#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 suma(int a[3][3], int b[3][3]) {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      printf("%d   ", a[i][j] + b[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    11a6 <suma+0x96>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    118a <suma+0x7a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
add    (%rax,%rcx,4),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1138 <suma+0x28>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <suma+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%esi
add    (%rdi),%esi
lea    0xeca(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%esi
add    0x4(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%esi
add    0x8(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%esi
add    0xc(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
add    0x10(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%esi
add    0x14(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%esi
add    0x18(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx),%esi
add    0x1c(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx),%esi
add    0x20(%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @suma([3 x i32]* %0, [3 x i32]* %1) {
%3 = alloca [3 x i32]*
%4 = alloca [3 x i32]*
%5 = alloca i32
%6 = alloca i32
store [3 x i32]* %0, [3 x i32]** %3
store [3 x i32]* %1, [3 x i32]** %4
store i32 0, i32* %5
br label %7
7: ; preds = %38, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %41
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %33, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %36
14: ; preds = %11
%15 = load [3 x i32]*, [3 x i32]** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %15, i64 %17
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = load [3 x i32]*, [3 x i32]** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %23, i64 %25
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %26, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = add nsw i32 %22, %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %14
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %11
36: ; preds = %11
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %36
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %7
41: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d \00"
define void @suma([3 x i32]* nocapture %0, [3 x i32]* nocapture %1) {
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, %10
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 2
%16 = load i32, i32* %15
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = tail call i32 @putchar(i32 10)
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 0
%23 = load i32, i32* %22
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 1, i64 0
%25 = load i32, i32* %24
%26 = add nsw i32 %25, %23
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%29 = load i32, i32* %28
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 1, i64 1
%31 = load i32, i32* %30
%32 = add nsw i32 %31, %29
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 2
%35 = load i32, i32* %34
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 1, i64 2
%37 = load i32, i32* %36
%38 = add nsw i32 %37, %35
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = tail call i32 @putchar(i32 10)
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 0
%42 = load i32, i32* %41
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 2, i64 0
%44 = load i32, i32* %43
%45 = add nsw i32 %44, %42
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 1
%48 = load i32, i32* %47
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 2, i64 1
%50 = load i32, i32* %49
%51 = add nsw i32 %50, %48
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 2
%54 = load i32, i32* %53
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 2, i64 2
%56 = load i32, i32* %55
%57 = add nsw i32 %56, %54
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %57)
%59 = tail call i32 @putchar(i32 10)
ret void
}