#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 vector_a[32] = {1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11,
                      12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
                      23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
  int vector_b[32] = {32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22,
                      21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11,
                      10, 9,  8,  7,  6,  5,  4,  3,  2,  1};
  int i = 0;
  int resultado = 0;
  while (i < 32) {
    resultado += vector_a[i] + vector_b[i];
    i++;
  }
  printf("El resultado de sumar los dos vectores es: %d", resultado);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0xf28(%rip),%rsi
mov    $0x80,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x114(%rbp)
movl   $0x0,-0x118(%rbp)
cmpl   $0x20,-0x114(%rbp)
jge    11bf <main+0x9f>
movslq -0x114(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
movslq -0x114(%rbp),%rcx
add    -0x110(%rbp,%rcx,4),%eax
add    -0x118(%rbp),%eax
mov    %eax,-0x118(%rbp)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    1176 <main+0x56>
mov    -0x118(%rbp),%esi
lea    0xf34(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x420,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [46 x i8] c"El resultado de sumar los dos vectores es: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 1056)
ret i32 0
}