#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int i, j;
  int array[9] = {88, 112, 6467, 325, 878, 3, 77, 8, 99};
  for (i = 0; i < 9; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
  int mat1[2][2] = {{2, 5}, {2, 2}};
  int mat2[2][2] = {{1, 2}, {0, 1}};
  int result[2][2] = {{(mat1[0][0] * mat2[0][0] + mat1[0][1] * mat2[1][0]),
                       (mat1[0][0] * mat2[0][1] + mat1[0][1] * mat2[1][1])},
                      {(mat1[1][0] * mat2[0][0] + mat1[1][1] * mat2[1][0]),
                       (mat1[1][0] * mat2[0][1] + mat1[1][1] * mat2[1][1])}};
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
      printf("%d ", result[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jge    1172 <main+0x52>
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <main+0x24>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xea9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    -0x3c(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x60(%rbp)
mov    -0x40(%rbp),%eax
imul   -0x4c(%rbp),%eax
mov    -0x3c(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    -0x38(%rbp),%eax
imul   -0x4c(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1268 <main+0x148>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    124c <main+0x12c>
movslq -0x4(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1210 <main+0xf0>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ff <main+0xdf>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x58,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x70,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1943,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x145,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x36e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__const.main.array = [9 x i32] [i32 88, i32 112, i32 6467, i32 325, i32 878, i32 3, i32 77, i32 8, i32 99]
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
@__const.main.mat1 = [2 x [2 x i32]] [[2 x i32] [i32 2, i32 5], [2 x i32] [i32 2, i32 2]]
@__const.main.mat2 = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 0, i32 1]]
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i32]
%4 = alloca [2 x [2 x i32]]
%5 = alloca [2 x [2 x i32]]
%6 = alloca [2 x [2 x i32]]
%7 = bitcast [9 x i32]* %3 to i8*
store i32 0, i32* %1
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 9
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i32, i32* %1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %8
20: ; preds = %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = bitcast [2 x [2 x i32]]* %4 to i8*
%23 = bitcast [2 x [2 x i32]]* %5 to i8*
%24 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 0
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %24, i64 0, i64 0
%26 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 0
%28 = load i32, i32* %27
%29 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 0
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %29, i64 0, i64 0
%31 = load i32, i32* %30
%32 = mul nsw i32 %28, %31
%33 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %33, i64 0, i64 1
%35 = load i32, i32* %34
%36 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 1
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %36, i64 0, i64 0
%38 = load i32, i32* %37
%39 = mul nsw i32 %35, %38
%40 = add nsw i32 %32, %39
store i32 %40, i32* %25
%41 = getelementptr inbounds i32, i32* %25, i64 1
%42 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %42, i64 0, i64 0
%44 = load i32, i32* %43
%45 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 0
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %45, i64 0, i64 1
%47 = load i32, i32* %46
%48 = mul nsw i32 %44, %47
%49 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %49, i64 0, i64 1
%51 = load i32, i32* %50
%52 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 1
%53 = getelementptr inbounds [2 x i32], [2 x i32]* %52, i64 0, i64 1
%54 = load i32, i32* %53
%55 = mul nsw i32 %51, %54
%56 = add nsw i32 %48, %55
store i32 %56, i32* %41
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %24, i64 1
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %57, i64 0, i64 0
%59 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %59, i64 0, i64 0
%61 = load i32, i32* %60
%62 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 0
%63 = getelementptr inbounds [2 x i32], [2 x i32]* %62, i64 0, i64 0
%64 = load i32, i32* %63
%65 = mul nsw i32 %61, %64
%66 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1
%67 = getelementptr inbounds [2 x i32], [2 x i32]* %66, i64 0, i64 1
%68 = load i32, i32* %67
%69 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 1
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 0, i64 0
%71 = load i32, i32* %70
%72 = mul nsw i32 %68, %71
%73 = add nsw i32 %65, %72
store i32 %73, i32* %58
%74 = getelementptr inbounds i32, i32* %58, i64 1
%75 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %75, i64 0, i64 0
%77 = load i32, i32* %76
%78 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 0
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %78, i64 0, i64 1
%80 = load i32, i32* %79
%81 = mul nsw i32 %77, %80
%82 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %82, i64 0, i64 1
%84 = load i32, i32* %83
%85 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %5, i64 0, i64 1
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %85, i64 0, i64 1
%87 = load i32, i32* %86
%88 = mul nsw i32 %84, %87
%89 = add nsw i32 %81, %88
store i32 %89, i32* %74
store i32 0, i32* %1
br label %90
90: ; preds = %111, %20
%91 = load i32, i32* %1
%92 = icmp slt i32 %91, 2
br i1 %92, label %93, label %114
93: ; preds = %90
store i32 0, i32* %2
br label %94
94: ; preds = %106, %93
%95 = load i32, i32* %2
%96 = icmp slt i32 %95, 2
br i1 %96, label %97, label %109
97: ; preds = %94
%98 = load i32, i32* %1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %6, i64 0, i64 %99
%101 = load i32, i32* %2
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [2 x i32], [2 x i32]* %100, i64 0, i64 %102
%104 = load i32, i32* %103
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %104)
br label %106
106: ; preds = %97
%107 = load i32, i32* %2
%108 = add nsw i32 %107, 1
store i32 %108, i32* %2
br label %94
109: ; preds = %94
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %111
111: ; preds = %109
%112 = load i32, i32* %1
%113 = add nsw i32 %112, 1
store i32 %113, i32* %1
br label %90
114: ; preds = %90
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 88)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 112)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6467)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 325)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 878)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 77)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 99)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%16 = tail call i32 @putchar(i32 10)
ret void
}