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.

117 lines
4.2 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, i32 8
%t9 = alloca i32, i32 8
%t18 = alloca i32, i32 8
%t27 = alloca i32, i32 8
%t36 = alloca i32, i32 8
%t1 = getelementptr inbounds i32, i32* %t0, i32 0
store i32 0, i32* %t1
%t2 = getelementptr inbounds i32, i32* %t0, i32 1
store i32 0, i32* %t2
%t3 = getelementptr inbounds i32, i32* %t0, i32 2
store i32 0, i32* %t3
%t4 = getelementptr inbounds i32, i32* %t0, i32 3
store i32 0, i32* %t4
%t5 = getelementptr inbounds i32, i32* %t0, i32 4
store i32 0, i32* %t5
%t6 = getelementptr inbounds i32, i32* %t0, i32 5
store i32 0, i32* %t6
%t7 = getelementptr inbounds i32, i32* %t0, i32 6
store i32 0, i32* %t7
%t8 = getelementptr inbounds i32, i32* %t0, i32 7
store i32 0, i32* %t8
%t10 = getelementptr inbounds i32, i32* %t9, i32 0
store i32 1, i32* %t10
%t11 = getelementptr inbounds i32, i32* %t9, i32 1
store i32 2, i32* %t11
%t12 = getelementptr inbounds i32, i32* %t9, i32 2
store i32 3, i32* %t12
%t13 = getelementptr inbounds i32, i32* %t9, i32 3
store i32 4, i32* %t13
%t14 = getelementptr inbounds i32, i32* %t9, i32 4
store i32 5, i32* %t14
%t15 = getelementptr inbounds i32, i32* %t9, i32 5
store i32 6, i32* %t15
%t16 = getelementptr inbounds i32, i32* %t9, i32 6
store i32 7, i32* %t16
%t17 = getelementptr inbounds i32, i32* %t9, i32 7
store i32 8, i32* %t17
%t19 = getelementptr inbounds i32, i32* %t18, i32 0
store i32 1, i32* %t19
%t20 = getelementptr inbounds i32, i32* %t18, i32 1
store i32 2, i32* %t20
%t21 = getelementptr inbounds i32, i32* %t18, i32 2
store i32 3, i32* %t21
%t22 = getelementptr inbounds i32, i32* %t18, i32 3
store i32 4, i32* %t22
%t23 = getelementptr inbounds i32, i32* %t18, i32 4
store i32 5, i32* %t23
%t24 = getelementptr inbounds i32, i32* %t18, i32 5
store i32 6, i32* %t24
%t25 = getelementptr inbounds i32, i32* %t18, i32 6
store i32 7, i32* %t25
%t26 = getelementptr inbounds i32, i32* %t18, i32 7
store i32 8, i32* %t26
%t28 = getelementptr inbounds i32, i32* %t27, i32 0
store i32 1, i32* %t28
%t29 = getelementptr inbounds i32, i32* %t27, i32 1
store i32 2, i32* %t29
%t30 = getelementptr inbounds i32, i32* %t27, i32 2
store i32 3, i32* %t30
%t31 = getelementptr inbounds i32, i32* %t27, i32 3
store i32 0, i32* %t31
%t32 = getelementptr inbounds i32, i32* %t27, i32 4
store i32 5, i32* %t32
%t33 = getelementptr inbounds i32, i32* %t27, i32 5
store i32 0, i32* %t33
%t34 = getelementptr inbounds i32, i32* %t27, i32 6
store i32 7, i32* %t34
%t35 = getelementptr inbounds i32, i32* %t27, i32 7
store i32 8, i32* %t35
%t37 = getelementptr inbounds i32, i32* %t36, i32 0
%t38 = getelementptr inbounds i32, i32* %t27, i32 5
%t39 = load i32, i32* %t38
store i32 %t39, i32* %t37
%t40 = getelementptr inbounds i32, i32* %t36, i32 1
%t41 = getelementptr inbounds i32, i32* %t18, i32 5
%t42 = load i32, i32* %t41
store i32 %t42, i32* %t40
%t43 = getelementptr inbounds i32, i32* %t36, i32 2
store i32 3, i32* %t43
%t44 = getelementptr inbounds i32, i32* %t36, i32 3
store i32 4, i32* %t44
%t45 = getelementptr inbounds i32, i32* %t36, i32 4
store i32 5, i32* %t45
%t46 = getelementptr inbounds i32, i32* %t36, i32 5
store i32 6, i32* %t46
%t47 = getelementptr inbounds i32, i32* %t36, i32 6
store i32 7, i32* %t47
%t48 = getelementptr inbounds i32, i32* %t36, i32 7
store i32 8, i32* %t48
%t49 = getelementptr inbounds i32, i32* %t36, i32 7
%t50 = load i32, i32* %t49
%t51 = getelementptr inbounds i32, i32* %t36, i32 0
%t52 = load i32, i32* %t51
%t53 = add i32 %t50, %t52
%t54 = getelementptr inbounds i32, i32* %t36, i32 1
%t55 = load i32, i32* %t54
%t56 = add i32 %t53, %t55
%t57 = getelementptr inbounds i32, i32* %t0, i32 4
%t58 = load i32, i32* %t57
%t59 = add i32 %t56, %t58
ret i32 %t59
}