#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*/ mensaje();
int /*<<< orphan*/ printf(char *, ...);
int resta(int, int);
int /*<<< orphan*/ scanf(char *, int *);
int suma(int, int);
int /*<<< orphan*/ suma2();
int main() {
  int x, y, s, r;
  s = suma(50, 20);
  printf("La suma es %d\n", s);
  printf("ingrese el valor de X\n");
  scanf("%d", &x);
  printf("ingrese el valor de Y\n");
  scanf("%d", &y);
  printf("La resta es igual a %d\n", r);
  r = resta(x, y);
  suma2();
  mensaje();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x32,%edi
mov    $0x14,%esi
call   1050 <suma@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <resta@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <suma2@plt>
mov    $0x0,%al
call   1030 <mensaje@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x32,%edi
mov    $0x14,%esi
call   1060 <suma@plt>
lea    0xe75(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
lea    0xe68(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe3e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1080 <resta@plt>
xor    %eax,%eax
call   1090 <suma2@plt>
xor    %eax,%eax
call   1030 <mensaje@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"La suma es %d\0A\00"
@.str.1 = [23 x i8] c"ingrese el valor de X\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [23 x i8] c"ingrese el valor de Y\0A\00"
@.str.4 = [24 x i8] c"La resta es igual a %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @suma(i32 50, i32 20)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @resta(i32 %14, i32 %15)
store i32 %16, i32* %4
%17 = call i32 (...) @suma2()
%18 = call i32 (...) @mensaje()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"La suma es %d\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.4 = [24 x i8] c"La resta es igual a %d\0A\00"
@str = [22 x i8] c"ingrese el valor de X\00"
@str.5 = [22 x i8] c"ingrese el valor de Y\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @suma(i32 50, i32 20)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 undef)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @resta(i32 %12, i32 %13)
%15 = call i32 (...) @suma2()
%16 = call i32 (...) @mensaje()
ret i32 0
}