#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 f1(int /*<<< orphan*/);
int f2(int);
int f3(int);
int f4(int);
int f5(int *);
int f6(int *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int a, b;
  a = f1(0);
  b = f2(1);
  printf("a=%d, b=%d\n", a, b);
  a = f3(a);
  b = f4(a);
  printf("a=%d, b=%d\n", a, b);
  a = f5(&a);
  b = f6(&a);
  printf("a=%d, b=%d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1070 <f1@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f2@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe64(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1060 <f3@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1090 <f4@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe3c(%rip),%rdi
call   1050 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1080 <f5@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <f6@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe12(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1070 <f1@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1030 <f2@plt>
lea    0xe73(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
mov    %ebp,%edi
call   1060 <f3@plt>
mov    %eax,%ebp
mov    %eax,0x4(%rsp)
mov    %eax,%edi
call   1090 <f4@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
lea    0x4(%rsp),%rbp
mov    %rbp,%rdi
call   1080 <f5@plt>
mov    %eax,0x4(%rsp)
mov    %rbp,%rdi
call   1040 <f6@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @f1(i32 0)
store i32 %3, i32* %1
%4 = call i32 @f2(i32 1)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @f3(i32 %8)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = call i32 @f4(i32 %10)
store i32 %11, i32* %2
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = call i32 @f5(i32* %1)
store i32 %15, i32* %1
%16 = call i32 @f6(i32* %1)
store i32 %16, i32* %2
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @f1(i32 0)
%4 = tail call i32 @f2(i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = tail call i32 @f3(i32 %3)
store i32 %6, i32* %1
%7 = tail call i32 @f4(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @f5(i32* %1)
store i32 %9, i32* %1
%10 = call i32 @f6(i32* %1)
%11 = load i32, i32* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
ret i32 0
}