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.

898 lines
27 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 @bubblesort(i32* %arg.arr) {
entry:
%t0 = alloca i32
%t1 = alloca i32
%t26 = alloca i32
store i32 0, i32* %t0
store i32 0, i32* %t1
store i32 0, i32* %t0
br label %while.cond.1
while.cond.1:
%t2 = load i32, i32* %t0
%t3 = load i32, i32* @n
%t4 = sub i32 %t3, 1
%t5 = icmp slt i32 %t2, %t4
%t6 = zext i1 %t5 to i32
%t7 = icmp ne i32 %t6, 0
br i1 %t7, label %while.body.2, label %while.end.3
while.body.2:
store i32 0, i32* %t1
br label %while.cond.4
while.end.3:
ret i32 0
while.cond.4:
%t8 = load i32, i32* %t1
%t9 = load i32, i32* @n
%t10 = load i32, i32* %t0
%t11 = sub i32 %t9, %t10
%t12 = sub i32 %t11, 1
%t13 = icmp slt i32 %t8, %t12
%t14 = zext i1 %t13 to i32
%t15 = icmp ne i32 %t14, 0
br i1 %t15, label %while.body.5, label %while.end.6
while.body.5:
%t16 = load i32, i32* %t1
%t17 = getelementptr inbounds i32, i32* %arg.arr, i32 %t16
%t18 = load i32, i32* %t17
%t19 = load i32, i32* %t1
%t20 = add i32 %t19, 1
%t21 = getelementptr inbounds i32, i32* %arg.arr, i32 %t20
%t22 = load i32, i32* %t21
%t23 = icmp sgt i32 %t18, %t22
%t24 = zext i1 %t23 to i32
%t25 = icmp ne i32 %t24, 0
br i1 %t25, label %if.then.7, label %if.end.8
while.end.6:
%t42 = load i32, i32* %t0
%t43 = add i32 %t42, 1
store i32 %t43, i32* %t0
br label %while.cond.1
if.then.7:
store i32 0, i32* %t26
%t27 = load i32, i32* %t1
%t28 = add i32 %t27, 1
%t29 = getelementptr inbounds i32, i32* %arg.arr, i32 %t28
%t30 = load i32, i32* %t29
store i32 %t30, i32* %t26
%t31 = load i32, i32* %t1
%t32 = add i32 %t31, 1
%t33 = getelementptr inbounds i32, i32* %arg.arr, i32 %t32
%t34 = load i32, i32* %t1
%t35 = getelementptr inbounds i32, i32* %arg.arr, i32 %t34
%t36 = load i32, i32* %t35
store i32 %t36, i32* %t33
%t37 = load i32, i32* %t1
%t38 = getelementptr inbounds i32, i32* %arg.arr, i32 %t37
%t39 = load i32, i32* %t26
store i32 %t39, i32* %t38
br label %if.end.8
if.end.8:
%t40 = load i32, i32* %t1
%t41 = add i32 %t40, 1
store i32 %t41, i32* %t1
br label %while.cond.4
}
define i32 @insertsort(i32* %arg.a) {
entry:
%t44 = alloca i32
%t50 = alloca i32
%t54 = alloca i32
store i32 0, i32* %t44
store i32 1, i32* %t44
br label %while.cond.9
while.cond.9:
%t45 = load i32, i32* %t44
%t46 = load i32, i32* @n
%t47 = icmp slt i32 %t45, %t46
%t48 = zext i1 %t47 to i32
%t49 = icmp ne i32 %t48, 0
br i1 %t49, label %while.body.10, label %while.end.11
while.body.10:
store i32 0, i32* %t50
%t51 = load i32, i32* %t44
%t52 = getelementptr inbounds i32, i32* %arg.a, i32 %t51
%t53 = load i32, i32* %t52
store i32 %t53, i32* %t50
store i32 0, i32* %t54
%t55 = load i32, i32* %t44
%t56 = sub i32 %t55, 1
store i32 %t56, i32* %t54
br label %while.cond.12
while.end.11:
ret i32 0
while.cond.12:
%t57 = load i32, i32* %t54
%t58 = icmp sgt i32 %t57, -1
%t59 = zext i1 %t58 to i32
%t60 = icmp ne i32 %t59, 0
br i1 %t60, label %land.rhs.15, label %while.end.14
while.body.13:
%t68 = load i32, i32* %t54
%t69 = add i32 %t68, 1
%t70 = getelementptr inbounds i32, i32* %arg.a, i32 %t69
%t71 = load i32, i32* %t54
%t72 = getelementptr inbounds i32, i32* %arg.a, i32 %t71
%t73 = load i32, i32* %t72
store i32 %t73, i32* %t70
%t74 = load i32, i32* %t54
%t75 = sub i32 %t74, 1
store i32 %t75, i32* %t54
br label %while.cond.12
while.end.14:
%t76 = load i32, i32* %t54
%t77 = add i32 %t76, 1
%t78 = getelementptr inbounds i32, i32* %arg.a, i32 %t77
%t79 = load i32, i32* %t50
store i32 %t79, i32* %t78
%t80 = load i32, i32* %t44
%t81 = add i32 %t80, 1
store i32 %t81, i32* %t44
br label %while.cond.9
land.rhs.15:
%t61 = load i32, i32* %t50
%t62 = load i32, i32* %t54
%t63 = getelementptr inbounds i32, i32* %arg.a, i32 %t62
%t64 = load i32, i32* %t63
%t65 = icmp slt i32 %t61, %t64
%t66 = zext i1 %t65 to i32
%t67 = icmp ne i32 %t66, 0
br i1 %t67, label %while.body.13, label %while.end.14
}
define i32 @QuickSort(i32* %arg.arr, i32 %arg.low, i32 %arg.high) {
entry:
%t89 = alloca i32
%t91 = alloca i32
%t93 = alloca i32
%t158 = alloca i32
%t82 = alloca i32
store i32 %arg.low, i32* %t82
%t83 = alloca i32
store i32 %arg.high, i32* %t83
%t84 = load i32, i32* %t82
%t85 = load i32, i32* %t83
%t86 = icmp slt i32 %t84, %t85
%t87 = zext i1 %t86 to i32
%t88 = icmp ne i32 %t87, 0
br i1 %t88, label %if.then.16, label %if.end.17
if.then.16:
store i32 0, i32* %t89
%t90 = load i32, i32* %t82
store i32 %t90, i32* %t89
store i32 0, i32* %t91
%t92 = load i32, i32* %t83
store i32 %t92, i32* %t91
store i32 0, i32* %t93
%t94 = load i32, i32* %t82
%t95 = getelementptr inbounds i32, i32* %arg.arr, i32 %t94
%t96 = load i32, i32* %t95
store i32 %t96, i32* %t93
br label %while.cond.18
if.end.17:
ret i32 0
while.cond.18:
%t97 = load i32, i32* %t89
%t98 = load i32, i32* %t91
%t99 = icmp slt i32 %t97, %t98
%t100 = zext i1 %t99 to i32
%t101 = icmp ne i32 %t100, 0
br i1 %t101, label %while.body.19, label %while.end.20
while.body.19:
br label %while.cond.21
while.end.20:
%t155 = load i32, i32* %t89
%t156 = getelementptr inbounds i32, i32* %arg.arr, i32 %t155
%t157 = load i32, i32* %t93
store i32 %t157, i32* %t156
store i32 0, i32* %t158
%t159 = load i32, i32* %t89
%t160 = sub i32 %t159, 1
store i32 %t160, i32* %t158
%t161 = load i32, i32* %t82
%t162 = load i32, i32* %t158
%t163 = call i32 @QuickSort(i32* %arg.arr, i32 %t161, i32 %t162)
store i32 %t163, i32* %t158
%t164 = load i32, i32* %t89
%t165 = add i32 %t164, 1
store i32 %t165, i32* %t158
%t166 = load i32, i32* %t158
%t167 = load i32, i32* %t83
%t168 = call i32 @QuickSort(i32* %arg.arr, i32 %t166, i32 %t167)
store i32 %t168, i32* %t158
br label %if.end.17
while.cond.21:
%t102 = load i32, i32* %t89
%t103 = load i32, i32* %t91
%t104 = icmp slt i32 %t102, %t103
%t105 = zext i1 %t104 to i32
%t106 = icmp ne i32 %t105, 0
br i1 %t106, label %land.rhs.24, label %while.end.23
while.body.22:
%t115 = load i32, i32* %t91
%t116 = sub i32 %t115, 1
store i32 %t116, i32* %t91
br label %while.cond.21
while.end.23:
%t117 = load i32, i32* %t89
%t118 = load i32, i32* %t91
%t119 = icmp slt i32 %t117, %t118
%t120 = zext i1 %t119 to i32
%t121 = icmp ne i32 %t120, 0
br i1 %t121, label %if.then.25, label %if.end.26
land.rhs.24:
%t107 = load i32, i32* %t91
%t108 = getelementptr inbounds i32, i32* %arg.arr, i32 %t107
%t109 = load i32, i32* %t108
%t110 = load i32, i32* %t93
%t111 = sub i32 %t110, 1
%t112 = icmp sgt i32 %t109, %t111
%t113 = zext i1 %t112 to i32
%t114 = icmp ne i32 %t113, 0
br i1 %t114, label %while.body.22, label %while.end.23
if.then.25:
%t122 = load i32, i32* %t89
%t123 = getelementptr inbounds i32, i32* %arg.arr, i32 %t122
%t124 = load i32, i32* %t91
%t125 = getelementptr inbounds i32, i32* %arg.arr, i32 %t124
%t126 = load i32, i32* %t125
store i32 %t126, i32* %t123
%t127 = load i32, i32* %t89
%t128 = add i32 %t127, 1
store i32 %t128, i32* %t89
br label %if.end.26
if.end.26:
br label %while.cond.27
while.cond.27:
%t129 = load i32, i32* %t89
%t130 = load i32, i32* %t91
%t131 = icmp slt i32 %t129, %t130
%t132 = zext i1 %t131 to i32
%t133 = icmp ne i32 %t132, 0
br i1 %t133, label %land.rhs.30, label %while.end.29
while.body.28:
%t141 = load i32, i32* %t89
%t142 = add i32 %t141, 1
store i32 %t142, i32* %t89
br label %while.cond.27
while.end.29:
%t143 = load i32, i32* %t89
%t144 = load i32, i32* %t91
%t145 = icmp slt i32 %t143, %t144
%t146 = zext i1 %t145 to i32
%t147 = icmp ne i32 %t146, 0
br i1 %t147, label %if.then.31, label %if.end.32
land.rhs.30:
%t134 = load i32, i32* %t89
%t135 = getelementptr inbounds i32, i32* %arg.arr, i32 %t134
%t136 = load i32, i32* %t135
%t137 = load i32, i32* %t93
%t138 = icmp slt i32 %t136, %t137
%t139 = zext i1 %t138 to i32
%t140 = icmp ne i32 %t139, 0
br i1 %t140, label %while.body.28, label %while.end.29
if.then.31:
%t148 = load i32, i32* %t91
%t149 = getelementptr inbounds i32, i32* %arg.arr, i32 %t148
%t150 = load i32, i32* %t89
%t151 = getelementptr inbounds i32, i32* %arg.arr, i32 %t150
%t152 = load i32, i32* %t151
store i32 %t152, i32* %t149
%t153 = load i32, i32* %t91
%t154 = sub i32 %t153, 1
store i32 %t154, i32* %t91
br label %if.end.32
if.end.32:
br label %while.cond.18
}
define i32 @getMid(i32* %arg.arr) {
entry:
%t169 = alloca i32
store i32 0, i32* %t169
%t170 = load i32, i32* @n
%t171 = srem i32 %t170, 2
%t172 = icmp eq i32 %t171, 0
%t173 = zext i1 %t172 to i32
%t174 = icmp ne i32 %t173, 0
br i1 %t174, label %if.then.33, label %if.else.34
if.then.33:
%t175 = load i32, i32* @n
%t176 = sdiv i32 %t175, 2
store i32 %t176, i32* %t169
%t177 = load i32, i32* %t169
%t178 = getelementptr inbounds i32, i32* %arg.arr, i32 %t177
%t179 = load i32, i32* %t178
%t180 = load i32, i32* %t169
%t181 = sub i32 %t180, 1
%t182 = getelementptr inbounds i32, i32* %arg.arr, i32 %t181
%t183 = load i32, i32* %t182
%t184 = add i32 %t179, %t183
%t185 = sdiv i32 %t184, 2
ret i32 %t185
if.else.34:
%t186 = load i32, i32* @n
%t187 = sdiv i32 %t186, 2
store i32 %t187, i32* %t169
%t188 = load i32, i32* %t169
%t189 = getelementptr inbounds i32, i32* %arg.arr, i32 %t188
%t190 = load i32, i32* %t189
ret i32 %t190
if.end.35:
ret i32 0
}
define i32 @getMost(i32* %arg.arr) {
entry:
%t191 = alloca i32, i32 1000
%t192 = alloca i32
%t201 = alloca i32
%t202 = alloca i32
%t208 = alloca i32
store i32 0, i32* %t192
store i32 0, i32* %t192
br label %while.cond.36
while.cond.36:
%t193 = load i32, i32* %t192
%t194 = icmp slt i32 %t193, 1000
%t195 = zext i1 %t194 to i32
%t196 = icmp ne i32 %t195, 0
br i1 %t196, label %while.body.37, label %while.end.38
while.body.37:
%t197 = load i32, i32* %t192
%t198 = getelementptr inbounds i32, i32* %t191, i32 %t197
store i32 0, i32* %t198
%t199 = load i32, i32* %t192
%t200 = add i32 %t199, 1
store i32 %t200, i32* %t192
br label %while.cond.36
while.end.38:
store i32 0, i32* %t192
store i32 0, i32* %t201
store i32 0, i32* %t202
store i32 0, i32* %t201
br label %while.cond.39
while.cond.39:
%t203 = load i32, i32* %t192
%t204 = load i32, i32* @n
%t205 = icmp slt i32 %t203, %t204
%t206 = zext i1 %t205 to i32
%t207 = icmp ne i32 %t206, 0
br i1 %t207, label %while.body.40, label %while.end.41
while.body.40:
store i32 0, i32* %t208
%t209 = load i32, i32* %t192
%t210 = getelementptr inbounds i32, i32* %arg.arr, i32 %t209
%t211 = load i32, i32* %t210
store i32 %t211, i32* %t208
%t212 = load i32, i32* %t208
%t213 = getelementptr inbounds i32, i32* %t191, i32 %t212
%t214 = load i32, i32* %t208
%t215 = getelementptr inbounds i32, i32* %t191, i32 %t214
%t216 = load i32, i32* %t215
%t217 = add i32 %t216, 1
store i32 %t217, i32* %t213
%t218 = load i32, i32* %t208
%t219 = getelementptr inbounds i32, i32* %t191, i32 %t218
%t220 = load i32, i32* %t219
%t221 = load i32, i32* %t201
%t222 = icmp sgt i32 %t220, %t221
%t223 = zext i1 %t222 to i32
%t224 = icmp ne i32 %t223, 0
br i1 %t224, label %if.then.42, label %if.end.43
while.end.41:
%t231 = load i32, i32* %t202
ret i32 %t231
if.then.42:
%t225 = load i32, i32* %t208
%t226 = getelementptr inbounds i32, i32* %t191, i32 %t225
%t227 = load i32, i32* %t226
store i32 %t227, i32* %t201
%t228 = load i32, i32* %t208
store i32 %t228, i32* %t202
br label %if.end.43
if.end.43:
%t229 = load i32, i32* %t192
%t230 = add i32 %t229, 1
store i32 %t230, i32* %t192
br label %while.cond.39
}
define i32 @revert(i32* %arg.arr) {
entry:
%t232 = alloca i32
%t233 = alloca i32
%t234 = alloca i32
store i32 0, i32* %t232
store i32 0, i32* %t233
store i32 0, i32* %t234
store i32 0, i32* %t233
store i32 0, i32* %t234
br label %while.cond.44
while.cond.44:
%t235 = load i32, i32* %t233
%t236 = load i32, i32* %t234
%t237 = icmp slt i32 %t235, %t236
%t238 = zext i1 %t237 to i32
%t239 = icmp ne i32 %t238, 0
br i1 %t239, label %while.body.45, label %while.end.46
while.body.45:
%t240 = load i32, i32* %t233
%t241 = getelementptr inbounds i32, i32* %arg.arr, i32 %t240
%t242 = load i32, i32* %t241
store i32 %t242, i32* %t232
%t243 = load i32, i32* %t233
%t244 = getelementptr inbounds i32, i32* %arg.arr, i32 %t243
%t245 = load i32, i32* %t234
%t246 = getelementptr inbounds i32, i32* %arg.arr, i32 %t245
%t247 = load i32, i32* %t246
store i32 %t247, i32* %t244
%t248 = load i32, i32* %t234
%t249 = getelementptr inbounds i32, i32* %arg.arr, i32 %t248
%t250 = load i32, i32* %t232
store i32 %t250, i32* %t249
%t251 = load i32, i32* %t233
%t252 = add i32 %t251, 1
store i32 %t252, i32* %t233
%t253 = load i32, i32* %t234
%t254 = sub i32 %t253, 1
store i32 %t254, i32* %t234
br label %while.cond.44
while.end.46:
ret i32 0
}
define i32 @arrCopy(i32* %arg.src, i32* %arg.target) {
entry:
%t255 = alloca i32
store i32 0, i32* %t255
store i32 0, i32* %t255
br label %while.cond.47
while.cond.47:
%t256 = load i32, i32* %t255
%t257 = load i32, i32* @n
%t258 = icmp slt i32 %t256, %t257
%t259 = zext i1 %t258 to i32
%t260 = icmp ne i32 %t259, 0
br i1 %t260, label %while.body.48, label %while.end.49
while.body.48:
%t261 = load i32, i32* %t255
%t262 = getelementptr inbounds i32, i32* %arg.target, i32 %t261
%t263 = load i32, i32* %t255
%t264 = getelementptr inbounds i32, i32* %arg.src, i32 %t263
%t265 = load i32, i32* %t264
store i32 %t265, i32* %t262
%t266 = load i32, i32* %t255
%t267 = add i32 %t266, 1
store i32 %t267, i32* %t255
br label %while.cond.47
while.end.49:
ret i32 0
}
define i32 @calSum(i32* %arg.arr, i32 %arg.stride) {
entry:
%t269 = alloca i32
%t270 = alloca i32
%t268 = alloca i32
store i32 %arg.stride, i32* %t268
store i32 0, i32* %t269
store i32 0, i32* %t269
store i32 0, i32* %t270
store i32 0, i32* %t270
br label %while.cond.50
while.cond.50:
%t271 = load i32, i32* %t270
%t272 = load i32, i32* @n
%t273 = icmp slt i32 %t271, %t272
%t274 = zext i1 %t273 to i32
%t275 = icmp ne i32 %t274, 0
br i1 %t275, label %while.body.51, label %while.end.52
while.body.51:
%t276 = load i32, i32* %t269
%t277 = load i32, i32* %t270
%t278 = getelementptr inbounds i32, i32* %arg.arr, i32 %t277
%t279 = load i32, i32* %t278
%t280 = add i32 %t276, %t279
store i32 %t280, i32* %t269
%t281 = load i32, i32* %t270
%t282 = load i32, i32* %t268
%t283 = srem i32 %t281, %t282
%t284 = load i32, i32* %t268
%t285 = sub i32 %t284, 1
%t286 = icmp ne i32 %t283, %t285
%t287 = zext i1 %t286 to i32
%t288 = icmp ne i32 %t287, 0
br i1 %t288, label %if.then.53, label %if.else.54
while.end.52:
ret i32 0
if.then.53:
%t289 = load i32, i32* %t270
%t290 = getelementptr inbounds i32, i32* %arg.arr, i32 %t289
store i32 0, i32* %t290
br label %if.end.55
if.else.54:
%t291 = load i32, i32* %t270
%t292 = getelementptr inbounds i32, i32* %arg.arr, i32 %t291
%t293 = load i32, i32* %t269
store i32 %t293, i32* %t292
store i32 0, i32* %t269
br label %if.end.55
if.end.55:
%t294 = load i32, i32* %t270
%t295 = add i32 %t294, 1
store i32 %t295, i32* %t270
br label %while.cond.50
}
define i32 @avgPooling(i32* %arg.arr, i32 %arg.stride) {
entry:
%t297 = alloca i32
%t298 = alloca i32
%t299 = alloca i32
%t296 = alloca i32
store i32 %arg.stride, i32* %t296
store i32 0, i32* %t297
store i32 0, i32* %t298
store i32 0, i32* %t298
store i32 0, i32* %t297
store i32 0, i32* %t299
br label %while.cond.56
while.cond.56:
%t300 = load i32, i32* %t298
%t301 = load i32, i32* @n
%t302 = icmp slt i32 %t300, %t301
%t303 = zext i1 %t302 to i32
%t304 = icmp ne i32 %t303, 0
br i1 %t304, label %while.body.57, label %while.end.58
while.body.57:
%t305 = load i32, i32* %t298
%t306 = load i32, i32* %t296
%t307 = sub i32 %t306, 1
%t308 = icmp slt i32 %t305, %t307
%t309 = zext i1 %t308 to i32
%t310 = icmp ne i32 %t309, 0
br i1 %t310, label %if.then.59, label %if.else.60
while.end.58:
%t351 = load i32, i32* @n
%t352 = load i32, i32* %t296
%t353 = sub i32 %t351, %t352
%t354 = add i32 %t353, 1
store i32 %t354, i32* %t298
br label %while.cond.65
if.then.59:
%t311 = load i32, i32* %t297
%t312 = load i32, i32* %t298
%t313 = getelementptr inbounds i32, i32* %arg.arr, i32 %t312
%t314 = load i32, i32* %t313
%t315 = add i32 %t311, %t314
store i32 %t315, i32* %t297
br label %if.end.61
if.else.60:
%t316 = load i32, i32* %t298
%t317 = load i32, i32* %t296
%t318 = sub i32 %t317, 1
%t319 = icmp eq i32 %t316, %t318
%t320 = zext i1 %t319 to i32
%t321 = icmp ne i32 %t320, 0
br i1 %t321, label %if.then.62, label %if.else.63
if.end.61:
%t349 = load i32, i32* %t298
%t350 = add i32 %t349, 1
store i32 %t350, i32* %t298
br label %while.cond.56
if.then.62:
%t322 = getelementptr inbounds i32, i32* %arg.arr, i32 0
%t323 = load i32, i32* %t322
store i32 %t323, i32* %t299
%t324 = getelementptr inbounds i32, i32* %arg.arr, i32 0
%t325 = load i32, i32* %t297
%t326 = load i32, i32* %t296
%t327 = sdiv i32 %t325, %t326
store i32 %t327, i32* %t324
br label %if.end.64
if.else.63:
%t328 = load i32, i32* %t297
%t329 = load i32, i32* %t298
%t330 = getelementptr inbounds i32, i32* %arg.arr, i32 %t329
%t331 = load i32, i32* %t330
%t332 = add i32 %t328, %t331
%t333 = load i32, i32* %t299
%t334 = sub i32 %t332, %t333
store i32 %t334, i32* %t297
%t335 = load i32, i32* %t298
%t336 = load i32, i32* %t296
%t337 = sub i32 %t335, %t336
%t338 = add i32 %t337, 1
%t339 = getelementptr inbounds i32, i32* %arg.arr, i32 %t338
%t340 = load i32, i32* %t339
store i32 %t340, i32* %t299
%t341 = load i32, i32* %t298
%t342 = load i32, i32* %t296
%t343 = sub i32 %t341, %t342
%t344 = add i32 %t343, 1
%t345 = getelementptr inbounds i32, i32* %arg.arr, i32 %t344
%t346 = load i32, i32* %t297
%t347 = load i32, i32* %t296
%t348 = sdiv i32 %t346, %t347
store i32 %t348, i32* %t345
br label %if.end.64
if.end.64:
br label %if.end.61
while.cond.65:
%t355 = load i32, i32* %t298
%t356 = load i32, i32* @n
%t357 = icmp slt i32 %t355, %t356
%t358 = zext i1 %t357 to i32
%t359 = icmp ne i32 %t358, 0
br i1 %t359, label %while.body.66, label %while.end.67
while.body.66:
%t360 = load i32, i32* %t298
%t361 = getelementptr inbounds i32, i32* %arg.arr, i32 %t360
store i32 0, i32* %t361
%t362 = load i32, i32* %t298
%t363 = add i32 %t362, 1
store i32 %t363, i32* %t298
br label %while.cond.65
while.end.67:
ret i32 0
}
define i32 @main() {
entry:
%t364 = alloca i32, i32 32
%t365 = alloca i32, i32 32
%t398 = alloca i32
%t401 = alloca i32
store i32 32, i32* @n
%t366 = getelementptr inbounds i32, i32* %t364, i32 0
store i32 7, i32* %t366
%t367 = getelementptr inbounds i32, i32* %t364, i32 1
store i32 23, i32* %t367
%t368 = getelementptr inbounds i32, i32* %t364, i32 2
store i32 89, i32* %t368
%t369 = getelementptr inbounds i32, i32* %t364, i32 3
store i32 26, i32* %t369
%t370 = getelementptr inbounds i32, i32* %t364, i32 4
store i32 282, i32* %t370
%t371 = getelementptr inbounds i32, i32* %t364, i32 5
store i32 254, i32* %t371
%t372 = getelementptr inbounds i32, i32* %t364, i32 6
store i32 27, i32* %t372
%t373 = getelementptr inbounds i32, i32* %t364, i32 7
store i32 5, i32* %t373
%t374 = getelementptr inbounds i32, i32* %t364, i32 8
store i32 83, i32* %t374
%t375 = getelementptr inbounds i32, i32* %t364, i32 9
store i32 273, i32* %t375
%t376 = getelementptr inbounds i32, i32* %t364, i32 10
store i32 574, i32* %t376
%t377 = getelementptr inbounds i32, i32* %t364, i32 11
store i32 905, i32* %t377
%t378 = getelementptr inbounds i32, i32* %t364, i32 12
store i32 354, i32* %t378
%t379 = getelementptr inbounds i32, i32* %t364, i32 13
store i32 657, i32* %t379
%t380 = getelementptr inbounds i32, i32* %t364, i32 14
store i32 935, i32* %t380
%t381 = getelementptr inbounds i32, i32* %t364, i32 15
store i32 264, i32* %t381
%t382 = getelementptr inbounds i32, i32* %t364, i32 16
store i32 639, i32* %t382
%t383 = getelementptr inbounds i32, i32* %t364, i32 17
store i32 459, i32* %t383
%t384 = getelementptr inbounds i32, i32* %t364, i32 18
store i32 29, i32* %t384
%t385 = getelementptr inbounds i32, i32* %t364, i32 19
store i32 68, i32* %t385
%t386 = getelementptr inbounds i32, i32* %t364, i32 20
store i32 929, i32* %t386
%t387 = getelementptr inbounds i32, i32* %t364, i32 21
store i32 756, i32* %t387
%t388 = getelementptr inbounds i32, i32* %t364, i32 22
store i32 452, i32* %t388
%t389 = getelementptr inbounds i32, i32* %t364, i32 23
store i32 279, i32* %t389
%t390 = getelementptr inbounds i32, i32* %t364, i32 24
store i32 58, i32* %t390
%t391 = getelementptr inbounds i32, i32* %t364, i32 25
store i32 87, i32* %t391
%t392 = getelementptr inbounds i32, i32* %t364, i32 26
store i32 96, i32* %t392
%t393 = getelementptr inbounds i32, i32* %t364, i32 27
store i32 36, i32* %t393
%t394 = getelementptr inbounds i32, i32* %t364, i32 28
store i32 39, i32* %t394
%t395 = getelementptr inbounds i32, i32* %t364, i32 29
store i32 28, i32* %t395
%t396 = getelementptr inbounds i32, i32* %t364, i32 30
store i32 1, i32* %t396
%t397 = getelementptr inbounds i32, i32* %t364, i32 31
store i32 290, i32* %t397
store i32 0, i32* %t398
%t399 = call i32 @arrCopy(i32* %t364, i32* %t365)
store i32 %t399, i32* %t398
%t400 = call i32 @revert(i32* %t365)
store i32 %t400, i32* %t398
store i32 0, i32* %t401
store i32 0, i32* %t401
br label %while.cond.68
while.cond.68:
%t402 = load i32, i32* %t401
%t403 = icmp slt i32 %t402, 32
%t404 = zext i1 %t403 to i32
%t405 = icmp ne i32 %t404, 0
br i1 %t405, label %while.body.69, label %while.end.70
while.body.69:
%t406 = load i32, i32* %t401
%t407 = getelementptr inbounds i32, i32* %t365, i32 %t406
%t408 = load i32, i32* %t407
store i32 %t408, i32* %t398
%t409 = load i32, i32* %t398
call void @putint(i32 %t409)
%t411 = load i32, i32* %t401
%t412 = add i32 %t411, 1
store i32 %t412, i32* %t401
br label %while.cond.68
while.end.70:
%t413 = call i32 @bubblesort(i32* %t365)
store i32 %t413, i32* %t398
store i32 0, i32* %t401
br label %while.cond.71
while.cond.71:
%t414 = load i32, i32* %t401
%t415 = icmp slt i32 %t414, 32
%t416 = zext i1 %t415 to i32
%t417 = icmp ne i32 %t416, 0
br i1 %t417, label %while.body.72, label %while.end.73
while.body.72:
%t418 = load i32, i32* %t401
%t419 = getelementptr inbounds i32, i32* %t365, i32 %t418
%t420 = load i32, i32* %t419
store i32 %t420, i32* %t398
%t421 = load i32, i32* %t398
call void @putint(i32 %t421)
%t423 = load i32, i32* %t401
%t424 = add i32 %t423, 1
store i32 %t424, i32* %t401
br label %while.cond.71
while.end.73:
%t425 = call i32 @getMid(i32* %t365)
store i32 %t425, i32* %t398
%t426 = load i32, i32* %t398
call void @putint(i32 %t426)
%t428 = call i32 @getMost(i32* %t365)
store i32 %t428, i32* %t398
%t429 = load i32, i32* %t398
call void @putint(i32 %t429)
%t431 = call i32 @arrCopy(i32* %t364, i32* %t365)
store i32 %t431, i32* %t398
%t432 = call i32 @bubblesort(i32* %t365)
store i32 %t432, i32* %t398
store i32 0, i32* %t401
br label %while.cond.74
while.cond.74:
%t433 = load i32, i32* %t401
%t434 = icmp slt i32 %t433, 32
%t435 = zext i1 %t434 to i32
%t436 = icmp ne i32 %t435, 0
br i1 %t436, label %while.body.75, label %while.end.76
while.body.75:
%t437 = load i32, i32* %t401
%t438 = getelementptr inbounds i32, i32* %t365, i32 %t437
%t439 = load i32, i32* %t438
store i32 %t439, i32* %t398
%t440 = load i32, i32* %t398
call void @putint(i32 %t440)
%t442 = load i32, i32* %t401
%t443 = add i32 %t442, 1
store i32 %t443, i32* %t401
br label %while.cond.74
while.end.76:
%t444 = call i32 @arrCopy(i32* %t364, i32* %t365)
store i32 %t444, i32* %t398
%t445 = call i32 @insertsort(i32* %t365)
store i32 %t445, i32* %t398
store i32 0, i32* %t401
br label %while.cond.77
while.cond.77:
%t446 = load i32, i32* %t401
%t447 = icmp slt i32 %t446, 32
%t448 = zext i1 %t447 to i32
%t449 = icmp ne i32 %t448, 0
br i1 %t449, label %while.body.78, label %while.end.79
while.body.78:
%t450 = load i32, i32* %t401
%t451 = getelementptr inbounds i32, i32* %t365, i32 %t450
%t452 = load i32, i32* %t451
store i32 %t452, i32* %t398
%t453 = load i32, i32* %t398
call void @putint(i32 %t453)
%t455 = load i32, i32* %t401
%t456 = add i32 %t455, 1
store i32 %t456, i32* %t401
br label %while.cond.77
while.end.79:
%t457 = call i32 @arrCopy(i32* %t364, i32* %t365)
store i32 %t457, i32* %t398
store i32 0, i32* %t401
store i32 31, i32* %t398
%t458 = load i32, i32* %t401
%t459 = load i32, i32* %t398
%t460 = call i32 @QuickSort(i32* %t365, i32 %t458, i32 %t459)
store i32 %t460, i32* %t398
br label %while.cond.80
while.cond.80:
%t461 = load i32, i32* %t401
%t462 = icmp slt i32 %t461, 32
%t463 = zext i1 %t462 to i32
%t464 = icmp ne i32 %t463, 0
br i1 %t464, label %while.body.81, label %while.end.82
while.body.81:
%t465 = load i32, i32* %t401
%t466 = getelementptr inbounds i32, i32* %t365, i32 %t465
%t467 = load i32, i32* %t466
store i32 %t467, i32* %t398
%t468 = load i32, i32* %t398
call void @putint(i32 %t468)
%t470 = load i32, i32* %t401
%t471 = add i32 %t470, 1
store i32 %t471, i32* %t401
br label %while.cond.80
while.end.82:
%t472 = call i32 @arrCopy(i32* %t364, i32* %t365)
store i32 %t472, i32* %t398
%t473 = call i32 @calSum(i32* %t365, i32 4)
store i32 %t473, i32* %t398
store i32 0, i32* %t401
br label %while.cond.83
while.cond.83:
%t474 = load i32, i32* %t401
%t475 = icmp slt i32 %t474, 32
%t476 = zext i1 %t475 to i32
%t477 = icmp ne i32 %t476, 0
br i1 %t477, label %while.body.84, label %while.end.85
while.body.84:
%t478 = load i32, i32* %t401
%t479 = getelementptr inbounds i32, i32* %t365, i32 %t478
%t480 = load i32, i32* %t479
store i32 %t480, i32* %t398
%t481 = load i32, i32* %t398
call void @putint(i32 %t481)
%t483 = load i32, i32* %t401
%t484 = add i32 %t483, 1
store i32 %t484, i32* %t401
br label %while.cond.83
while.end.85:
%t485 = call i32 @arrCopy(i32* %t364, i32* %t365)
store i32 %t485, i32* %t398
%t486 = call i32 @avgPooling(i32* %t365, i32 3)
store i32 %t486, i32* %t398
store i32 0, i32* %t401
br label %while.cond.86
while.cond.86:
%t487 = load i32, i32* %t401
%t488 = icmp slt i32 %t487, 32
%t489 = zext i1 %t488 to i32
%t490 = icmp ne i32 %t489, 0
br i1 %t490, label %while.body.87, label %while.end.88
while.body.87:
%t491 = load i32, i32* %t401
%t492 = getelementptr inbounds i32, i32* %t365, i32 %t491
%t493 = load i32, i32* %t492
store i32 %t493, i32* %t398
%t494 = load i32, i32* %t398
call void @putint(i32 %t494)
%t496 = load i32, i32* %t401
%t497 = add i32 %t496, 1
store i32 %t497, i32* %t401
br label %while.cond.86
while.end.88:
ret i32 0
}