#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 add(int, int);
int main(int argc, char *argv[]) {
  int i;
  int sum[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int array1[10] = {48, 56, 77, 33, 33, 11, 226, 544, 78, 90};
  int array2[10] = {85, 99, 66, 0x199, 393, 11, 1, 2, 3, 4};
  for (i = 0; i < 10; i++) {
    sum[i] = add(array1[i], array2[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x70(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11c7 <main+0x97>
movslq -0x14(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%edi
movslq -0x14(%rbp),%rax
mov    -0xa0(%rbp,%rax,4),%esi
call   1030 <add@plt>
mov    %eax,%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118d <main+0x5d>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x30,%edi
mov    $0x55,%esi
call   1030 <add@plt>
mov    $0x38,%edi
mov    $0x63,%esi
call   1030 <add@plt>
mov    $0x4d,%edi
mov    $0x42,%esi
call   1030 <add@plt>
mov    $0x21,%edi
mov    $0x199,%esi
call   1030 <add@plt>
mov    $0x21,%edi
mov    $0x189,%esi
call   1030 <add@plt>
mov    $0xb,%edi
mov    $0xb,%esi
call   1030 <add@plt>
mov    $0xe2,%edi
mov    $0x1,%esi
call   1030 <add@plt>
mov    $0x220,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    $0x4e,%edi
mov    $0x3,%esi
call   1030 <add@plt>
mov    $0x5a,%edi
mov    $0x4,%esi
call   1030 <add@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.array1 = [10 x i32] [i32 48, i32 56, i32 77, i32 33, i32 33, i32 11, i32 226, i32 544, i32 78, i32 90]
@__const.main.array2 = [10 x i32] [i32 85, i32 99, i32 66, i32 409, i32 393, i32 11, i32 1, i32 2, i32 3, i32 4]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i32]
%8 = alloca [10 x i32]
%9 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [10 x i32]* %7 to i8*
%11 = bitcast [10 x i32]* %8 to i8*
%12 = bitcast [10 x i32]* %9 to i8*
store i32 0, i32* %6
br label %13
13: ; preds = %29, %2
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %9, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = call i32 @add(i32 %20, i32 %24)
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %27
store i32 %25, i32* %28
br label %29
29: ; preds = %16
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %13
32: ; preds = %13
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 48, i32 85)
%4 = tail call i32 @add(i32 56, i32 99)
%5 = tail call i32 @add(i32 77, i32 66)
%6 = tail call i32 @add(i32 33, i32 409)
%7 = tail call i32 @add(i32 33, i32 393)
%8 = tail call i32 @add(i32 11, i32 11)
%9 = tail call i32 @add(i32 226, i32 1)
%10 = tail call i32 @add(i32 544, i32 2)
%11 = tail call i32 @add(i32 78, i32 3)
%12 = tail call i32 @add(i32 90, i32 4)
ret i32 0
}