You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
6.6 KiB

@n = global i32 0
declare i32 @getint()
declare float @getfloat()
declare i32 @getarray(i32* %arg.a)
declare i32 @getfarray(float* %arg.a)
declare i32 @getch()
declare void @putint(i32 %arg.x)
declare void @putfloat(float %arg.x)
declare void @putarray(i32 %arg.n, i32* %arg.a)
declare void @putfarray(i32 %arg.n, float* %arg.a)
declare void @putch(i32 %arg.x)
declare void @starttime()
declare void @stoptime()
define i32 @main() {
entry:
%t0 = alloca i32
%t1 = alloca i32
%t2 = alloca i32
%t3 = alloca i32
%t4 = alloca i32
%t5 = alloca i32
%t6 = alloca i32
%t7 = alloca i32
%t8 = alloca i32
%t9 = alloca i32
%t10 = alloca i32
%t11 = alloca i32
%t12 = alloca i32
%t13 = alloca i32
%t14 = alloca i32
%t15 = alloca i32
%t16 = alloca i32
%t17 = alloca i32
%t18 = alloca i32
%t19 = alloca i32
%t20 = alloca i32
%t21 = alloca i32
%t22 = alloca i32
%t23 = alloca i32
%t24 = alloca i32
%t25 = alloca i32
%t26 = alloca i32
%t27 = alloca i32
%t28 = alloca i32
%t29 = alloca i32
%t30 = alloca i32
%t96 = alloca i32
%t157 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t1
store i32 0, i32* %t2
store i32 0, i32* %t3
store i32 0, i32* %t4
store i32 0, i32* %t5
store i32 0, i32* %t6
store i32 0, i32* %t7
store i32 0, i32* %t8
store i32 0, i32* %t9
store i32 0, i32* %t10
store i32 0, i32* %t11
store i32 0, i32* %t12
store i32 0, i32* %t13
store i32 0, i32* %t14
store i32 0, i32* %t15
store i32 0, i32* %t16
store i32 0, i32* %t17
store i32 0, i32* %t18
store i32 0, i32* %t19
store i32 0, i32* %t20
store i32 0, i32* %t21
store i32 0, i32* %t22
store i32 0, i32* %t23
store i32 0, i32* %t24
store i32 0, i32* %t25
store i32 0, i32* %t26
store i32 0, i32* %t27
store i32 0, i32* %t28
store i32 0, i32* %t29
store i32 0, i32* %t30
%t31 = call i32 @getint()
store i32 %t31, i32* %t30
br label %while.cond.1
while.cond.1:
%t32 = load i32, i32* %t30
%t33 = icmp eq i32 %t32, 5
%t34 = zext i1 %t33 to i32
%t35 = icmp ne i32 %t34, 0
br i1 %t35, label %while.body.2, label %while.end.3
while.body.2:
%t36 = load i32, i32* %t30
%t37 = add i32 %t36, 1
store i32 %t37, i32* %t30
br label %while.cond.1
while.end.3:
store i32 0, i32* %t0
%t38 = load i32, i32* %t0
%t39 = add i32 %t38, 1
store i32 %t39, i32* %t1
%t40 = load i32, i32* %t1
%t41 = add i32 %t40, 1
store i32 %t41, i32* %t2
%t42 = load i32, i32* %t2
%t43 = add i32 %t42, 1
store i32 %t43, i32* %t3
%t44 = load i32, i32* %t3
%t45 = add i32 %t44, 1
store i32 %t45, i32* %t4
%t46 = load i32, i32* %t4
%t47 = add i32 %t46, 1
store i32 %t47, i32* %t5
%t48 = load i32, i32* %t5
%t49 = add i32 %t48, 1
store i32 %t49, i32* %t6
%t50 = load i32, i32* %t6
%t51 = add i32 %t50, 1
store i32 %t51, i32* %t7
%t52 = load i32, i32* %t7
%t53 = add i32 %t52, 1
store i32 %t53, i32* %t8
%t54 = load i32, i32* %t8
%t55 = add i32 %t54, 1
store i32 %t55, i32* %t9
%t56 = load i32, i32* %t9
%t57 = add i32 %t56, 1
store i32 %t57, i32* %t10
%t58 = load i32, i32* %t10
%t59 = add i32 %t58, 1
store i32 %t59, i32* %t11
%t60 = load i32, i32* %t11
%t61 = add i32 %t60, 1
store i32 %t61, i32* %t12
%t62 = load i32, i32* %t12
%t63 = add i32 %t62, 1
store i32 %t63, i32* %t13
%t64 = load i32, i32* %t13
%t65 = add i32 %t64, 1
store i32 %t65, i32* %t14
%t66 = load i32, i32* %t14
%t67 = add i32 %t66, 1
store i32 %t67, i32* %t15
%t68 = load i32, i32* %t15
%t69 = add i32 %t68, 1
store i32 %t69, i32* %t16
%t70 = load i32, i32* %t16
%t71 = add i32 %t70, 1
store i32 %t71, i32* %t17
%t72 = load i32, i32* %t17
%t73 = add i32 %t72, 1
store i32 %t73, i32* %t18
%t74 = load i32, i32* %t18
%t75 = add i32 %t74, 1
store i32 %t75, i32* %t19
%t76 = load i32, i32* %t19
%t77 = add i32 %t76, 1
store i32 %t77, i32* %t20
%t78 = load i32, i32* %t20
%t79 = add i32 %t78, 1
store i32 %t79, i32* %t21
%t80 = load i32, i32* %t21
%t81 = add i32 %t80, 1
store i32 %t81, i32* %t22
%t82 = load i32, i32* %t22
%t83 = add i32 %t82, 1
store i32 %t83, i32* %t23
%t84 = load i32, i32* %t23
%t85 = add i32 %t84, 1
store i32 %t85, i32* %t24
%t86 = load i32, i32* %t24
%t87 = add i32 %t86, 1
store i32 %t87, i32* %t25
%t88 = load i32, i32* %t25
%t89 = add i32 %t88, 1
store i32 %t89, i32* %t26
%t90 = load i32, i32* %t26
%t91 = add i32 %t90, 1
store i32 %t91, i32* %t27
%t92 = load i32, i32* %t27
%t93 = add i32 %t92, 1
store i32 %t93, i32* %t28
%t94 = load i32, i32* %t28
%t95 = add i32 %t94, 1
store i32 %t95, i32* %t29
store i32 0, i32* %t96
%t97 = load i32, i32* %t0
call void @putint(i32 %t97)
%t99 = load i32, i32* %t1
call void @putint(i32 %t99)
%t101 = load i32, i32* %t2
call void @putint(i32 %t101)
%t103 = load i32, i32* %t3
call void @putint(i32 %t103)
%t105 = load i32, i32* %t4
call void @putint(i32 %t105)
%t107 = load i32, i32* %t5
call void @putint(i32 %t107)
%t109 = load i32, i32* %t6
call void @putint(i32 %t109)
%t111 = load i32, i32* %t7
call void @putint(i32 %t111)
%t113 = load i32, i32* %t8
call void @putint(i32 %t113)
%t115 = load i32, i32* %t9
call void @putint(i32 %t115)
%t117 = load i32, i32* %t10
call void @putint(i32 %t117)
%t119 = load i32, i32* %t11
call void @putint(i32 %t119)
%t121 = load i32, i32* %t12
call void @putint(i32 %t121)
%t123 = load i32, i32* %t13
call void @putint(i32 %t123)
%t125 = load i32, i32* %t14
call void @putint(i32 %t125)
%t127 = load i32, i32* %t15
call void @putint(i32 %t127)
%t129 = load i32, i32* %t16
call void @putint(i32 %t129)
%t131 = load i32, i32* %t17
call void @putint(i32 %t131)
%t133 = load i32, i32* %t18
call void @putint(i32 %t133)
%t135 = load i32, i32* %t19
call void @putint(i32 %t135)
%t137 = load i32, i32* %t20
call void @putint(i32 %t137)
%t139 = load i32, i32* %t21
call void @putint(i32 %t139)
%t141 = load i32, i32* %t22
call void @putint(i32 %t141)
%t143 = load i32, i32* %t23
call void @putint(i32 %t143)
%t145 = load i32, i32* %t24
call void @putint(i32 %t145)
%t147 = load i32, i32* %t25
call void @putint(i32 %t147)
%t149 = load i32, i32* %t26
call void @putint(i32 %t149)
%t151 = load i32, i32* %t27
call void @putint(i32 %t151)
%t153 = load i32, i32* %t28
call void @putint(i32 %t153)
%t155 = load i32, i32* %t29
call void @putint(i32 %t155)
store i32 0, i32* %t157
store i32 10, i32* %t157
%t158 = load i32, i32* %t157
call void @putch(i32 %t158)
%t160 = load i32, i32* %t30
call void @putint(i32 %t160)
%t162 = load i32, i32* %t157
call void @putch(i32 %t162)
%t164 = load i32, i32* %t25
ret i32 %t164
}