#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int suma(int, int);
int main() {
  int x, y, z;
  fprintf(stdout, "Escribe dos numeros: ");
  fscanf(stdin, "%d%d", &x, &y);
  z = suma(x, y);
  fprintf(stdout, "La suma de los numeros es: %d\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <fscanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <suma@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rbx
mov    (%rbx),%edi
lea    0xebb(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <fscanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <suma@plt>
mov    (%rbx),%edi
lea    0xe9a(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"Escribe dos numeros: \00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [31 x i8] c"La suma de los numeros es: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @stdout
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdin
%8 = call i32 @fscanf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @suma(i32 %9, i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* @stdout
%13 = load i32, i32* %4
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"Escribe dos numeros: \00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [31 x i8] c"La suma de los numeros es: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdin
%8 = call i32 @fscanf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @suma(i32 %9, i32 %10)
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}