#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 dobra(int);
int /*<<< orphan*/ dobra2(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, b, c;
  a = 2;
  b = 3;
  c = 5;
  a = dobra(a);
  b = dobra(b);
  c = dobra(c);
  printf("depois da primeira dobra:\n a: %d, b: %d, c: %d", a, b, c);
  dobra2(&a, &b, &c);
  printf("depois da segunda dobra:\n a: %d, b: %d, c: %d", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dobra@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <dobra@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <dobra@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <dobra2@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    $0x2,%edi
call   1040 <dobra@plt>
mov    %eax,%ebx
mov    %eax,0x14(%rsp)
mov    $0x3,%edi
call   1040 <dobra@plt>
mov    %eax,%ebp
mov    %eax,0x10(%rsp)
mov    $0x5,%edi
call   1040 <dobra@plt>
mov    %eax,0xc(%rsp)
lea    0xe95(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <dobra2@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"depois da primeira dobra:\0A a: %d, b: %d, c: %d\00"
@.str.1 = [46 x i8] c"depois da segunda dobra:\0A a: %d, b: %d, c: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 2, i32* %1
store i32 3, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %1
%5 = call i32 @dobra(i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @dobra(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @dobra(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = call i32 @dobra2(i32* %1, i32* %2, i32* %3)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"depois da primeira dobra:\0A a: %d, b: %d, c: %d\00"
@.str.1 = [46 x i8] c"depois da segunda dobra:\0A a: %d, b: %d, c: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @dobra(i32 2)
store i32 %7, i32* %1
%8 = tail call i32 @dobra(i32 3)
store i32 %8, i32* %2
%9 = tail call i32 @dobra(i32 5)
store i32 %9, i32* %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = call i32 @dobra2(i32* %1, i32* %2, i32* %3)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret i32 0
}