#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 printSoma(int a[], int b[], int size) {
  if (size > 0) {
    printf("\n[");
    printf("%d", a[0] + b[0]);
    for (int i = 1; i < size; i++)
      printf(", %d", a[i] + b[i]);
    printf("]\n");
  } else
    printf("\n[]\n");
}


x86 assembly (clang, -O0):
<printSoma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11ad <printSoma+0x9d>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
add    (%rax),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    119a <printSoma+0x8a>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
add    (%rax,%rcx,4),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115c <printSoma+0x4c>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bb <printSoma+0xab>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSoma>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    119e <printSoma+0x7e>
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r13
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14),%esi
add    0x0(%r13),%esi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%r15
cmp    $0x1,%ebp
je     11a5 <printSoma+0x85>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0xe8f(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,4),%esi
add    0x0(%r13,%rbx,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1180 <printSoma+0x60>
jmp    11a5 <printSoma+0x85>
lea    0xe63(%rip),%r15
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0A[\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c", %d\00"
@str = [4 x i8] c"\0A[]\00"
@str.5 = [2 x i8] c"]\00"
define void @printSoma(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %24
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = icmp eq i32 %2, 1
br i1 %11, label %24, label %12
12: ; preds = %5
%13 = zext i32 %2 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 1, %12 ], [ %22, %14 ]
%16 = getelementptr inbounds i32, i32* %0, i64 %15
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 %15
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %17
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i64 %15, 1
%23 = icmp eq i64 %22, %13
br i1 %23, label %24, label %14
24: ; preds = %14, %3, %5
%25 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), %14 ]
%26 = tail call i32 @puts(i8* dereferenceable(1) %25)
ret void
}