#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*/ add(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int a[10], b[10], c[10];
  for (int i = 0; i < 10; i++) {
    a[i] = -i;
    b[i] = i * i;
  }
  add(a, b, c);
  for (int i = 0; i < 10; i++) {
    printf("%d + %d = %d\n", a[i], b[i], c[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    1188 <main+0x68>
xor    %ecx,%ecx
sub    -0x94(%rbp),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x94(%rbp),%ecx
imul   -0x94(%rbp),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    113c <main+0x1c>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1030 <add@plt>
movl   $0x0,-0x98(%rbp)
cmpl   $0xa,-0x98(%rbp)
jge    11f7 <main+0xd7>
movslq -0x98(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
movslq -0x98(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
movslq -0x98(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
lea    0xe22(%rip),%rdi
call   1040 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    11a6 <main+0x86>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0xfffffff7fffffff8,%rax
ff ff ff
mov    %rax,0x50(%rsp)
movabs $0x5100000040,%rax
mov    %rax,0x20(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
lea    0x60(%rsp),%rdx
call   1030 <add@plt>
mov    0x30(%rsp),%esi
mov    (%rsp),%edx
mov    0x60(%rsp),%ecx
lea    0xea7(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    0x4(%rsp),%edx
mov    0x64(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x68(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x6c(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x40(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x70(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x44(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x74(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x48(%rsp),%esi
mov    0x18(%rsp),%edx
mov    0x78(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4c(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x7c(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x50(%rsp),%esi
mov    0x20(%rsp),%edx
mov    0x80(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x84(%rsp),%ecx
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

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

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