int main() {
  int i, j, k, l;
  int temp = 0;
  int N1 = 3 * 3;
  int N2 = 3 * 3;
  int N3 = 3 * 3;
  char mat1[9] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
  char mat2[9] = {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x17};
  unsigned long mat3[9];
  for (j = 0; j < 3; j++) {
    for (k = 0; k < 3; k++) {
      for (l = 0; l < 3; l++) {
        temp = temp + (mat1[l + j * 3]) * (mat2[k + l * 3]);
      }
      mat3[k + j * 3] = temp;
      temp = 0;
    }
  }
  for (i = 0; i < N3; i++) {
    printf("0x%x\t", mat3[i]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x9,-0x1c(%rbp)
movl   $0x9,-0x20(%rbp)
movl   $0x9,-0x24(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x2d(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x25(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x36(%rbp)
mov    0xeae(%rip),%al
mov    %al,-0x2e(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1210 <main+0x100>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    11fd <main+0xed>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11d4 <main+0xc4>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   $0x3,-0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsbl -0x2d(%rbp,%rcx,1),%ecx
mov    -0x10(%rbp),%edx
imul   $0x3,-0x14(%rbp),%esi
add    %esi,%edx
movslq %edx,%rdx
movsbl -0x36(%rbp,%rdx,1),%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <main+0x7f>
movslq -0x18(%rbp),%rcx
mov    -0x10(%rbp),%eax
imul   $0x3,-0xc(%rbp),%edx
add    %edx,%eax
cltq
mov    %rcx,-0x80(%rbp,%rax,8)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117e <main+0x6e>
jmp    1202 <main+0xf2>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x5d>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1256 <main+0x146>
movslq -0x8(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rsi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1217 <main+0x107>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x3f,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x42,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x43,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xea,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xf6,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xfd,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x195,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1aa,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1b7,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\09\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 63)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 66)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 67)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 234)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 246)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 253)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 405)
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 426)
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 439)
%18 = tail call i32 @putchar(i32 10)
ret i32 0
}