#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[6];
  int i, soma = 0;
  A[0] = 1;
  A[1] = 0;
  A[2] = 5;
  A[3] = -2;
  A[4] = -5;
  A[5] = 7;
  soma = A[0] + A[1] + A[5];
  printf("soma: %d\n", soma);
  A[4] = 100;
  for (i = 0; i < 6; i++)
    printf("%d\n", A[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x5,-0x18(%rbp)
movl   $0xfffffffe,-0x14(%rbp)
movl   $0xfffffffb,-0x10(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x64,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    11a5 <main+0x95>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <main+0x69>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"soma: %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 -2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 100)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret i32 0
}