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.

249 lines
6.4 KiB

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
%t6 = alloca i32
%t11 = alloca i32
%t16 = alloca i32
%t21 = alloca i32
%t26 = alloca i32
%t31 = alloca i32
%t36 = alloca i32
%t41 = alloca i32
%t46 = alloca i32
%t51 = alloca i32
%t56 = alloca i32
%t61 = alloca i32
%t66 = alloca i32
%t71 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t1
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t1
%t3 = icmp slt i32 %t2, 1
%t4 = zext i1 %t3 to i32
%t5 = icmp ne i32 %t4, 0
br i1 %t5, label %while.body.2, label %while.end.3
while.body.2:
store i32 0, i32* %t6
br label %while.cond.4
while.end.3:
%t109 = load i32, i32* %t0
ret i32 %t109
while.cond.4:
%t7 = load i32, i32* %t6
%t8 = icmp slt i32 %t7, 1
%t9 = zext i1 %t8 to i32
%t10 = icmp ne i32 %t9, 0
br i1 %t10, label %while.body.5, label %while.end.6
while.body.5:
store i32 0, i32* %t11
br label %while.cond.7
while.end.6:
%t107 = load i32, i32* %t1
%t108 = add i32 %t107, 1
store i32 %t108, i32* %t1
br label %while.cond.1
while.cond.7:
%t12 = load i32, i32* %t11
%t13 = icmp slt i32 %t12, 2
%t14 = zext i1 %t13 to i32
%t15 = icmp ne i32 %t14, 0
br i1 %t15, label %while.body.8, label %while.end.9
while.body.8:
store i32 0, i32* %t16
br label %while.cond.10
while.end.9:
%t105 = load i32, i32* %t6
%t106 = add i32 %t105, 1
store i32 %t106, i32* %t6
br label %while.cond.4
while.cond.10:
%t17 = load i32, i32* %t16
%t18 = icmp slt i32 %t17, 3
%t19 = zext i1 %t18 to i32
%t20 = icmp ne i32 %t19, 0
br i1 %t20, label %while.body.11, label %while.end.12
while.body.11:
store i32 0, i32* %t21
br label %while.cond.13
while.end.12:
%t103 = load i32, i32* %t11
%t104 = add i32 %t103, 1
store i32 %t104, i32* %t11
br label %while.cond.7
while.cond.13:
%t22 = load i32, i32* %t21
%t23 = icmp slt i32 %t22, 5
%t24 = zext i1 %t23 to i32
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %while.body.14, label %while.end.15
while.body.14:
store i32 0, i32* %t26
br label %while.cond.16
while.end.15:
%t101 = load i32, i32* %t16
%t102 = add i32 %t101, 1
store i32 %t102, i32* %t16
br label %while.cond.10
while.cond.16:
%t27 = load i32, i32* %t26
%t28 = icmp slt i32 %t27, 4
%t29 = zext i1 %t28 to i32
%t30 = icmp ne i32 %t29, 0
br i1 %t30, label %while.body.17, label %while.end.18
while.body.17:
store i32 0, i32* %t31
br label %while.cond.19
while.end.18:
%t99 = load i32, i32* %t21
%t100 = add i32 %t99, 1
store i32 %t100, i32* %t21
br label %while.cond.13
while.cond.19:
%t32 = load i32, i32* %t31
%t33 = icmp slt i32 %t32, 6
%t34 = zext i1 %t33 to i32
%t35 = icmp ne i32 %t34, 0
br i1 %t35, label %while.body.20, label %while.end.21
while.body.20:
store i32 0, i32* %t36
br label %while.cond.22
while.end.21:
%t97 = load i32, i32* %t26
%t98 = add i32 %t97, 1
store i32 %t98, i32* %t26
br label %while.cond.16
while.cond.22:
%t37 = load i32, i32* %t36
%t38 = icmp slt i32 %t37, 5
%t39 = zext i1 %t38 to i32
%t40 = icmp ne i32 %t39, 0
br i1 %t40, label %while.body.23, label %while.end.24
while.body.23:
store i32 0, i32* %t41
br label %while.cond.25
while.end.24:
%t95 = load i32, i32* %t31
%t96 = add i32 %t95, 1
store i32 %t96, i32* %t31
br label %while.cond.19
while.cond.25:
%t42 = load i32, i32* %t41
%t43 = icmp slt i32 %t42, 5
%t44 = zext i1 %t43 to i32
%t45 = icmp ne i32 %t44, 0
br i1 %t45, label %while.body.26, label %while.end.27
while.body.26:
store i32 0, i32* %t46
br label %while.cond.28
while.end.27:
%t93 = load i32, i32* %t36
%t94 = add i32 %t93, 1
store i32 %t94, i32* %t36
br label %while.cond.22
while.cond.28:
%t47 = load i32, i32* %t46
%t48 = icmp slt i32 %t47, 3
%t49 = zext i1 %t48 to i32
%t50 = icmp ne i32 %t49, 0
br i1 %t50, label %while.body.29, label %while.end.30
while.body.29:
store i32 0, i32* %t51
br label %while.cond.31
while.end.30:
%t91 = load i32, i32* %t41
%t92 = add i32 %t91, 1
store i32 %t92, i32* %t41
br label %while.cond.25
while.cond.31:
%t52 = load i32, i32* %t51
%t53 = icmp slt i32 %t52, 2
%t54 = zext i1 %t53 to i32
%t55 = icmp ne i32 %t54, 0
br i1 %t55, label %while.body.32, label %while.end.33
while.body.32:
store i32 0, i32* %t56
br label %while.cond.34
while.end.33:
%t89 = load i32, i32* %t46
%t90 = add i32 %t89, 1
store i32 %t90, i32* %t46
br label %while.cond.28
while.cond.34:
%t57 = load i32, i32* %t56
%t58 = icmp slt i32 %t57, 5
%t59 = zext i1 %t58 to i32
%t60 = icmp ne i32 %t59, 0
br i1 %t60, label %while.body.35, label %while.end.36
while.body.35:
store i32 0, i32* %t61
br label %while.cond.37
while.end.36:
%t87 = load i32, i32* %t51
%t88 = add i32 %t87, 2
store i32 %t88, i32* %t51
br label %while.cond.31
while.cond.37:
%t62 = load i32, i32* %t61
%t63 = icmp slt i32 %t62, 5
%t64 = zext i1 %t63 to i32
%t65 = icmp ne i32 %t64, 0
br i1 %t65, label %while.body.38, label %while.end.39
while.body.38:
store i32 0, i32* %t66
br label %while.cond.40
while.end.39:
%t85 = load i32, i32* %t56
%t86 = add i32 %t85, 2
store i32 %t86, i32* %t56
br label %while.cond.34
while.cond.40:
%t67 = load i32, i32* %t66
%t68 = icmp slt i32 %t67, 3
%t69 = zext i1 %t68 to i32
%t70 = icmp ne i32 %t69, 0
br i1 %t70, label %while.body.41, label %while.end.42
while.body.41:
store i32 0, i32* %t71
br label %while.cond.43
while.end.42:
%t83 = load i32, i32* %t61
%t84 = add i32 %t83, 2
store i32 %t84, i32* %t61
br label %while.cond.37
while.cond.43:
%t72 = load i32, i32* %t71
%t73 = icmp slt i32 %t72, 6
%t74 = zext i1 %t73 to i32
%t75 = icmp ne i32 %t74, 0
br i1 %t75, label %while.body.44, label %while.end.45
while.body.44:
%t76 = load i32, i32* %t0
%t77 = add i32 %t76, 3
%t78 = srem i32 %t77, 999
store i32 %t78, i32* %t0
%t79 = load i32, i32* %t71
%t80 = add i32 %t79, 3
store i32 %t80, i32* %t71
br label %while.cond.43
while.end.45:
%t81 = load i32, i32* %t66
%t82 = add i32 %t81, 1
store i32 %t82, i32* %t66
br label %while.cond.40
}