#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 *, int);
int main() {
  int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  int b[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  int len = 3;
  int c[9];
  char number[] = "%d ";
  char charactor[] = "%c";
  int i;
  int j;
  int m;
  for (i = 0; i < len; i += 1) {
    for (j = 0; j < len; j += 1) {
      c[i * len + j] = 0;
      for (m = 0; m < len; m += 1)
        c[i * len + j] += a[i * len + m] * b[m * len + j];
      printf(number, c[i * len + j]);
    }
    printf(charactor, 10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xede(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x3,-0x64(%rbp)
mov    0xeeb(%rip),%eax
mov    %eax,-0x94(%rbp)
mov    0xee2(%rip),%ax
mov    %ax,-0x97(%rbp)
mov    0xed7(%rip),%al
mov    %al,-0x95(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    12b0 <main+0x190>
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    128b <main+0x16b>
mov    -0x9c(%rbp),%eax
imul   -0x64(%rbp),%eax
add    -0xa0(%rbp),%eax
cltq
movl   $0x0,-0x90(%rbp,%rax,4)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1252 <main+0x132>
mov    -0x9c(%rbp),%eax
imul   -0x64(%rbp),%eax
add    -0xa4(%rbp),%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
mov    -0xa4(%rbp),%eax
imul   -0x64(%rbp),%eax
add    -0xa0(%rbp),%eax
cltq
imul   -0x60(%rbp,%rax,4),%ecx
mov    -0x9c(%rbp),%eax
imul   -0x64(%rbp),%eax
add    -0xa0(%rbp),%eax
cltq
add    -0x90(%rbp,%rax,4),%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    11e2 <main+0xc2>
lea    -0x94(%rbp),%rdi
mov    -0x9c(%rbp),%eax
imul   -0x64(%rbp),%eax
add    -0xa0(%rbp),%eax
cltq
mov    -0x90(%rbp,%rax,4),%esi
call   1030 <printf@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    11ac <main+0x8c>
lea    -0x97(%rbp),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1193 <main+0x73>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x206425,0x4(%rsp)
movb   $0x0,0x2(%rsp)
movw   $0x6325,(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x24,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x42,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x60,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x66,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x96,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.main.b = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.main.number = [4 x i8] c"%d \00"
@__const.main.charactor = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca [9 x i32]
%4 = alloca i32
%5 = alloca [9 x i32]
%6 = alloca [4 x i8]
%7 = alloca [3 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = bitcast [9 x i32]* %2 to i8*
%12 = bitcast [9 x i32]* %3 to i8*
store i32 3, i32* %4
%13 = bitcast [4 x i8]* %6 to i8*
%14 = bitcast [3 x i8]* %7 to i8*
store i32 0, i32* %8
br label %15
15: ; preds = %83, %0
%16 = load i32, i32* %8
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %86
19: ; preds = %15
store i32 0, i32* %9
br label %20
20: ; preds = %77, %19
%21 = load i32, i32* %9
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %80
24: ; preds = %20
%25 = load i32, i32* %8
%26 = load i32, i32* %4
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %9
%29 = add nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 %30
store i32 0, i32* %31
store i32 0, i32* %10
br label %32
32: ; preds = %63, %24
%33 = load i32, i32* %10
%34 = load i32, i32* %4
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %66
36: ; preds = %32
%37 = load i32, i32* %8
%38 = load i32, i32* %4
%39 = mul nsw i32 %37, %38
%40 = load i32, i32* %10
%41 = add nsw i32 %39, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = load i32, i32* %10
%46 = load i32, i32* %4
%47 = mul nsw i32 %45, %46
%48 = load i32, i32* %9
%49 = add nsw i32 %47, %48
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = mul nsw i32 %44, %52
%54 = load i32, i32* %8
%55 = load i32, i32* %4
%56 = mul nsw i32 %54, %55
%57 = load i32, i32* %9
%58 = add nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = add nsw i32 %61, %53
store i32 %62, i32* %60
br label %63
63: ; preds = %36
%64 = load i32, i32* %10
%65 = add nsw i32 %64, 1
store i32 %65, i32* %10
br label %32
66: ; preds = %32
%67 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%68 = load i32, i32* %8
%69 = load i32, i32* %4
%70 = mul nsw i32 %68, %69
%71 = load i32, i32* %9
%72 = add nsw i32 %70, %71
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = call i32 @printf(i8* %67, i32 %75)
br label %77
77: ; preds = %66
%78 = load i32, i32* %9
%79 = add nsw i32 %78, 1
store i32 %79, i32* %9
br label %20
80: ; preds = %20
%81 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%82 = call i32 @printf(i8* %81, i32 10)
br label %83
83: ; preds = %80
%84 = load i32, i32* %8
%85 = add nsw i32 %84, 1
store i32 %85, i32* %8
br label %15
86: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@__const.main.charactor = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = bitcast i32* %1 to i8*
store i32 2122789, i32* %1
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* %3, i32 30)
%6 = call i32 @printf(i8* %3, i32 36)
%7 = call i32 @printf(i8* %3, i32 42)
%8 = call i32 @printf(i8* %4, i32 10)
%9 = call i32 @printf(i8* %3, i32 66)
%10 = call i32 @printf(i8* %3, i32 81)
%11 = call i32 @printf(i8* %3, i32 96)
%12 = call i32 @printf(i8* %4, i32 10)
%13 = call i32 @printf(i8* %3, i32 102)
%14 = call i32 @printf(i8* %3, i32 126)
%15 = call i32 @printf(i8* %3, i32 150)
%16 = call i32 @printf(i8* %4, i32 10)
ret i32 0
}