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.

464 lines
14 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 @sum(i32* %arg.a0, i32* %arg.a1, i32* %arg.a2, i32* %arg.a3, i32* %arg.a4, i32* %arg.a5, i32* %arg.a6, i32* %arg.a7, i32* %arg.a8, i32* %arg.a9, i32* %arg.a10, i32* %arg.a11, i32* %arg.a12, i32* %arg.a13, i32* %arg.a14, i32* %arg.a15, i32* %arg.a16, i32* %arg.a17, i32* %arg.a18) {
entry:
%t0 = getelementptr inbounds i32, i32* %arg.a0, i32 0
%t1 = load i32, i32* %t0
%t2 = getelementptr inbounds i32, i32* %arg.a1, i32 2
%t3 = load i32, i32* %t2
%t4 = add i32 %t1, %t3
%t5 = getelementptr inbounds i32, i32* %arg.a2, i32 1
%t6 = load i32, i32* %t5
%t7 = add i32 %t4, %t6
%t8 = getelementptr inbounds i32, i32* %arg.a3, i32 10
%t9 = load i32, i32* %t8
%t10 = add i32 %t7, %t9
%t11 = getelementptr inbounds i32, i32* %arg.a4, i32 6
%t12 = load i32, i32* %t11
%t13 = add i32 %t10, %t12
%t14 = getelementptr inbounds i32, i32* %arg.a5, i32 57
%t15 = load i32, i32* %t14
%t16 = add i32 %t13, %t15
%t17 = getelementptr inbounds i32, i32* %arg.a6, i32 14
%t18 = load i32, i32* %t17
%t19 = add i32 %t16, %t18
%t20 = getelementptr inbounds i32, i32* %arg.a7, i32 241
%t21 = load i32, i32* %t20
%t22 = add i32 %t19, %t21
%t23 = getelementptr inbounds i32, i32* %arg.a8, i32 56
%t24 = load i32, i32* %t23
%t25 = add i32 %t22, %t24
%t26 = getelementptr inbounds i32, i32* %arg.a9, i32 201
%t27 = load i32, i32* %t26
%t28 = add i32 %t25, %t27
%t29 = getelementptr inbounds i32, i32* %arg.a10, i32 499
%t30 = load i32, i32* %t29
%t31 = add i32 %t28, %t30
%t32 = getelementptr inbounds i32, i32* %arg.a11, i32 806
%t33 = load i32, i32* %t32
%t34 = add i32 %t31, %t33
%t35 = getelementptr inbounds i32, i32* %arg.a12, i32 6600
%t36 = load i32, i32* %t35
%t37 = add i32 %t34, %t36
%t38 = getelementptr inbounds i32, i32* %arg.a13, i32 127
%t39 = load i32, i32* %t38
%t40 = add i32 %t37, %t39
%t41 = getelementptr inbounds i32, i32* %arg.a14, i32 31
%t42 = load i32, i32* %t41
%t43 = add i32 %t40, %t42
%t44 = getelementptr inbounds i32, i32* %arg.a15, i32 61668
%t45 = load i32, i32* %t44
%t46 = add i32 %t43, %t45
%t47 = getelementptr inbounds i32, i32* %arg.a16, i32 3989
%t48 = load i32, i32* %t47
%t49 = add i32 %t46, %t48
%t50 = getelementptr inbounds i32, i32* %arg.a17, i32 207091
%t51 = load i32, i32* %t50
%t52 = add i32 %t49, %t51
%t53 = getelementptr inbounds i32, i32* %arg.a18, i32 70400
%t54 = load i32, i32* %t53
%t55 = add i32 %t52, %t54
ret i32 %t55
}
define i32 @main() {
entry:
%t56 = alloca i32, i32 524288
%t65 = alloca i32
%t66 = alloca i32
%t71 = alloca i32
%t76 = alloca i32
%t81 = alloca i32
%t86 = alloca i32
%t91 = alloca i32
%t96 = alloca i32
%t101 = alloca i32
%t106 = alloca i32
%t111 = alloca i32
%t116 = alloca i32
%t121 = alloca i32
%t126 = alloca i32
%t131 = alloca i32
%t136 = alloca i32
%t141 = alloca i32
%t146 = alloca i32
%t151 = alloca i32
%t156 = alloca i32
%t57 = alloca i32
store i32 0, i32* %t57
br label %zero.init.cond
zero.init.cond:
%t58 = load i32, i32* %t57
%t59 = icmp slt i32 %t58, 524288
br i1 %t59, label %zero.init.body, label %zero.init.end
zero.init.body:
%t60 = load i32, i32* %t57
%t61 = getelementptr inbounds i32, i32* %t56, i32 %t60
store i32 0, i32* %t61
%t63 = load i32, i32* %t57
%t62 = add i32 %t63, 1
store i32 %t62, i32* %t57
br label %zero.init.cond
zero.init.end:
%t64 = getelementptr inbounds i32, i32* %t56, i32 0
store i32 0, i32* %t64
store i32 0, i32* %t65
store i32 0, i32* %t66
br label %while.cond.1
while.cond.1:
%t67 = load i32, i32* %t66
%t68 = icmp slt i32 %t67, 2
%t69 = zext i1 %t68 to i32
%t70 = icmp ne i32 %t69, 0
br i1 %t70, label %while.body.2, label %while.end.3
while.body.2:
store i32 0, i32* %t71
br label %while.cond.4
while.end.3:
%t258 = getelementptr inbounds i32, i32* %t56, i32 0
%t259 = getelementptr inbounds i32, i32* %t56, i32 0
%t260 = getelementptr inbounds i32, i32* %t56, i32 0
%t261 = getelementptr inbounds i32, i32* %t56, i32 0
%t262 = getelementptr inbounds i32, i32* %t56, i32 0
%t263 = getelementptr inbounds i32, i32* %t56, i32 0
%t264 = getelementptr inbounds i32, i32* %t56, i32 0
%t265 = getelementptr inbounds i32, i32* %t56, i32 0
%t266 = getelementptr inbounds i32, i32* %t56, i32 0
%t267 = getelementptr inbounds i32, i32* %t56, i32 0
%t268 = getelementptr inbounds i32, i32* %t56, i32 0
%t269 = getelementptr inbounds i32, i32* %t56, i32 0
%t270 = getelementptr inbounds i32, i32* %t56, i32 0
%t271 = getelementptr inbounds i32, i32* %t56, i32 0
%t272 = getelementptr inbounds i32, i32* %t56, i32 0
%t273 = getelementptr inbounds i32, i32* %t56, i32 0
%t274 = getelementptr inbounds i32, i32* %t56, i32 0
%t275 = getelementptr inbounds i32, i32* %t56, i32 0
%t276 = call i32 @sum(i32* %t258, i32* %t259, i32* %t260, i32* %t261, i32* %t262, i32* %t263, i32* %t264, i32* %t265, i32* %t266, i32* %t267, i32* %t268, i32* %t269, i32* %t270, i32* %t271, i32* %t272, i32* %t273, i32* %t274, i32* %t275, i32* %t56)
call void @putint(i32 %t276)
ret i32 0
while.cond.4:
%t72 = load i32, i32* %t71
%t73 = icmp slt i32 %t72, 2
%t74 = zext i1 %t73 to i32
%t75 = icmp ne i32 %t74, 0
br i1 %t75, label %while.body.5, label %while.end.6
while.body.5:
store i32 0, i32* %t76
br label %while.cond.7
while.end.6:
%t256 = load i32, i32* %t66
%t257 = add i32 %t256, 1
store i32 %t257, i32* %t66
br label %while.cond.1
while.cond.7:
%t77 = load i32, i32* %t76
%t78 = icmp slt i32 %t77, 2
%t79 = zext i1 %t78 to i32
%t80 = icmp ne i32 %t79, 0
br i1 %t80, label %while.body.8, label %while.end.9
while.body.8:
store i32 0, i32* %t81
br label %while.cond.10
while.end.9:
%t254 = load i32, i32* %t71
%t255 = add i32 %t254, 1
store i32 %t255, i32* %t71
br label %while.cond.4
while.cond.10:
%t82 = load i32, i32* %t81
%t83 = icmp slt i32 %t82, 2
%t84 = zext i1 %t83 to i32
%t85 = icmp ne i32 %t84, 0
br i1 %t85, label %while.body.11, label %while.end.12
while.body.11:
store i32 0, i32* %t86
br label %while.cond.13
while.end.12:
%t252 = load i32, i32* %t76
%t253 = add i32 %t252, 1
store i32 %t253, i32* %t76
br label %while.cond.7
while.cond.13:
%t87 = load i32, i32* %t86
%t88 = icmp slt i32 %t87, 2
%t89 = zext i1 %t88 to i32
%t90 = icmp ne i32 %t89, 0
br i1 %t90, label %while.body.14, label %while.end.15
while.body.14:
store i32 0, i32* %t91
br label %while.cond.16
while.end.15:
%t250 = load i32, i32* %t81
%t251 = add i32 %t250, 1
store i32 %t251, i32* %t81
br label %while.cond.10
while.cond.16:
%t92 = load i32, i32* %t91
%t93 = icmp slt i32 %t92, 2
%t94 = zext i1 %t93 to i32
%t95 = icmp ne i32 %t94, 0
br i1 %t95, label %while.body.17, label %while.end.18
while.body.17:
store i32 0, i32* %t96
br label %while.cond.19
while.end.18:
%t248 = load i32, i32* %t86
%t249 = add i32 %t248, 1
store i32 %t249, i32* %t86
br label %while.cond.13
while.cond.19:
%t97 = load i32, i32* %t96
%t98 = icmp slt i32 %t97, 2
%t99 = zext i1 %t98 to i32
%t100 = icmp ne i32 %t99, 0
br i1 %t100, label %while.body.20, label %while.end.21
while.body.20:
store i32 0, i32* %t101
br label %while.cond.22
while.end.21:
%t246 = load i32, i32* %t91
%t247 = add i32 %t246, 1
store i32 %t247, i32* %t91
br label %while.cond.16
while.cond.22:
%t102 = load i32, i32* %t101
%t103 = icmp slt i32 %t102, 2
%t104 = zext i1 %t103 to i32
%t105 = icmp ne i32 %t104, 0
br i1 %t105, label %while.body.23, label %while.end.24
while.body.23:
store i32 0, i32* %t106
br label %while.cond.25
while.end.24:
%t244 = load i32, i32* %t96
%t245 = add i32 %t244, 1
store i32 %t245, i32* %t96
br label %while.cond.19
while.cond.25:
%t107 = load i32, i32* %t106
%t108 = icmp slt i32 %t107, 2
%t109 = zext i1 %t108 to i32
%t110 = icmp ne i32 %t109, 0
br i1 %t110, label %while.body.26, label %while.end.27
while.body.26:
store i32 0, i32* %t111
br label %while.cond.28
while.end.27:
%t242 = load i32, i32* %t101
%t243 = add i32 %t242, 1
store i32 %t243, i32* %t101
br label %while.cond.22
while.cond.28:
%t112 = load i32, i32* %t111
%t113 = icmp slt i32 %t112, 2
%t114 = zext i1 %t113 to i32
%t115 = icmp ne i32 %t114, 0
br i1 %t115, label %while.body.29, label %while.end.30
while.body.29:
store i32 0, i32* %t116
br label %while.cond.31
while.end.30:
%t240 = load i32, i32* %t106
%t241 = add i32 %t240, 1
store i32 %t241, i32* %t106
br label %while.cond.25
while.cond.31:
%t117 = load i32, i32* %t116
%t118 = icmp slt i32 %t117, 2
%t119 = zext i1 %t118 to i32
%t120 = icmp ne i32 %t119, 0
br i1 %t120, label %while.body.32, label %while.end.33
while.body.32:
store i32 0, i32* %t121
br label %while.cond.34
while.end.33:
%t238 = load i32, i32* %t111
%t239 = add i32 %t238, 1
store i32 %t239, i32* %t111
br label %while.cond.28
while.cond.34:
%t122 = load i32, i32* %t121
%t123 = icmp slt i32 %t122, 2
%t124 = zext i1 %t123 to i32
%t125 = icmp ne i32 %t124, 0
br i1 %t125, label %while.body.35, label %while.end.36
while.body.35:
store i32 0, i32* %t126
br label %while.cond.37
while.end.36:
%t236 = load i32, i32* %t116
%t237 = add i32 %t236, 1
store i32 %t237, i32* %t116
br label %while.cond.31
while.cond.37:
%t127 = load i32, i32* %t126
%t128 = icmp slt i32 %t127, 2
%t129 = zext i1 %t128 to i32
%t130 = icmp ne i32 %t129, 0
br i1 %t130, label %while.body.38, label %while.end.39
while.body.38:
store i32 0, i32* %t131
br label %while.cond.40
while.end.39:
%t234 = load i32, i32* %t121
%t235 = add i32 %t234, 1
store i32 %t235, i32* %t121
br label %while.cond.34
while.cond.40:
%t132 = load i32, i32* %t131
%t133 = icmp slt i32 %t132, 2
%t134 = zext i1 %t133 to i32
%t135 = icmp ne i32 %t134, 0
br i1 %t135, label %while.body.41, label %while.end.42
while.body.41:
store i32 0, i32* %t136
br label %while.cond.43
while.end.42:
%t232 = load i32, i32* %t126
%t233 = add i32 %t232, 1
store i32 %t233, i32* %t126
br label %while.cond.37
while.cond.43:
%t137 = load i32, i32* %t136
%t138 = icmp slt i32 %t137, 2
%t139 = zext i1 %t138 to i32
%t140 = icmp ne i32 %t139, 0
br i1 %t140, label %while.body.44, label %while.end.45
while.body.44:
store i32 0, i32* %t141
br label %while.cond.46
while.end.45:
%t230 = load i32, i32* %t131
%t231 = add i32 %t230, 1
store i32 %t231, i32* %t131
br label %while.cond.40
while.cond.46:
%t142 = load i32, i32* %t141
%t143 = icmp slt i32 %t142, 2
%t144 = zext i1 %t143 to i32
%t145 = icmp ne i32 %t144, 0
br i1 %t145, label %while.body.47, label %while.end.48
while.body.47:
store i32 0, i32* %t146
br label %while.cond.49
while.end.48:
%t228 = load i32, i32* %t136
%t229 = add i32 %t228, 1
store i32 %t229, i32* %t136
br label %while.cond.43
while.cond.49:
%t147 = load i32, i32* %t146
%t148 = icmp slt i32 %t147, 2
%t149 = zext i1 %t148 to i32
%t150 = icmp ne i32 %t149, 0
br i1 %t150, label %while.body.50, label %while.end.51
while.body.50:
store i32 0, i32* %t151
br label %while.cond.52
while.end.51:
%t226 = load i32, i32* %t141
%t227 = add i32 %t226, 1
store i32 %t227, i32* %t141
br label %while.cond.46
while.cond.52:
%t152 = load i32, i32* %t151
%t153 = icmp slt i32 %t152, 2
%t154 = zext i1 %t153 to i32
%t155 = icmp ne i32 %t154, 0
br i1 %t155, label %while.body.53, label %while.end.54
while.body.53:
store i32 0, i32* %t156
br label %while.cond.55
while.end.54:
%t224 = load i32, i32* %t146
%t225 = add i32 %t224, 1
store i32 %t225, i32* %t146
br label %while.cond.49
while.cond.55:
%t157 = load i32, i32* %t156
%t158 = icmp slt i32 %t157, 2
%t159 = zext i1 %t158 to i32
%t160 = icmp ne i32 %t159, 0
br i1 %t160, label %while.body.56, label %while.end.57
while.body.56:
%t161 = load i32, i32* %t66
%t162 = load i32, i32* %t71
%t163 = load i32, i32* %t76
%t164 = load i32, i32* %t81
%t165 = load i32, i32* %t86
%t166 = load i32, i32* %t91
%t167 = load i32, i32* %t96
%t168 = load i32, i32* %t101
%t169 = load i32, i32* %t106
%t170 = load i32, i32* %t111
%t171 = load i32, i32* %t116
%t172 = load i32, i32* %t121
%t173 = load i32, i32* %t126
%t174 = load i32, i32* %t131
%t175 = load i32, i32* %t136
%t176 = load i32, i32* %t141
%t177 = load i32, i32* %t146
%t178 = load i32, i32* %t151
%t179 = load i32, i32* %t156
%t180 = mul i32 %t161, 262144
%t181 = mul i32 %t162, 131072
%t182 = add i32 %t180, %t181
%t183 = mul i32 %t163, 65536
%t184 = add i32 %t182, %t183
%t185 = mul i32 %t164, 32768
%t186 = add i32 %t184, %t185
%t187 = mul i32 %t165, 16384
%t188 = add i32 %t186, %t187
%t189 = mul i32 %t166, 8192
%t190 = add i32 %t188, %t189
%t191 = mul i32 %t167, 4096
%t192 = add i32 %t190, %t191
%t193 = mul i32 %t168, 2048
%t194 = add i32 %t192, %t193
%t195 = mul i32 %t169, 1024
%t196 = add i32 %t194, %t195
%t197 = mul i32 %t170, 512
%t198 = add i32 %t196, %t197
%t199 = mul i32 %t171, 256
%t200 = add i32 %t198, %t199
%t201 = mul i32 %t172, 128
%t202 = add i32 %t200, %t201
%t203 = mul i32 %t173, 64
%t204 = add i32 %t202, %t203
%t205 = mul i32 %t174, 32
%t206 = add i32 %t204, %t205
%t207 = mul i32 %t175, 16
%t208 = add i32 %t206, %t207
%t209 = mul i32 %t176, 8
%t210 = add i32 %t208, %t209
%t211 = mul i32 %t177, 4
%t212 = add i32 %t210, %t211
%t213 = mul i32 %t178, 2
%t214 = add i32 %t212, %t213
%t215 = add i32 %t214, %t179
%t216 = getelementptr inbounds i32, i32* %t56, i32 %t215
%t217 = load i32, i32* %t65
store i32 %t217, i32* %t216
%t218 = load i32, i32* %t65
%t219 = add i32 %t218, 1
store i32 %t219, i32* %t65
%t220 = load i32, i32* %t156
%t221 = add i32 %t220, 1
store i32 %t221, i32* %t156
br label %while.cond.55
while.end.57:
%t222 = load i32, i32* %t151
%t223 = add i32 %t222, 1
store i32 %t223, i32* %t151
br label %while.cond.52
}