#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int resta(int, int);
int suma(int, int);
int /*<<< orphan*/ suma_resta(int, int, int *, int *);
int main() {
  int o1 = 1, o2 = 2, v1, v2;
  printf("1+2 = %d\n", suma(o1, o2));
  printf("1-2 = %d\n", resta(o1, o2));
  suma_resta(o1, o2, &v1, &v2);
  printf("1+2 = %d\n", v1);
  printf("1-2 = %d\n", v2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <suma@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <resta@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <suma_resta@plt>
mov    -0x10(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <suma@plt>
lea    0xea6(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <resta@plt>
lea    0xe90(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <suma_resta@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"1+2 = %d\0A\00"
@.str.1 = [10 x i8] c"1-2 = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @suma(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @resta(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @suma_resta(i32 %14, i32 %15, i32* %4, i32* %5)
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %5
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [10 x i8] c"1+2 = %d\0A\00"
@.str.1 = [10 x i8] c"1-2 = %d\0A\00"
@EXIT_SUCCESS = global i32 0
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 1, i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @resta(i32 1, i32 2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @suma_resta(i32 1, i32 2, i32* %1, i32* %2)
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}