#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 fun1(int);
int fun2(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("fun1(0x00000076) = %x, fun2(0x00000076) = %x\n", fun1(0x00000076),
         fun2(0x00000076));
  printf("fun1(0x87654321) = %x, fun2(0x87654321) = %x\n", fun1(0x87654321),
         fun2(0x87654321));
  printf("fun1(0x000000C9) = %x, fun2(0x000000C9) = %x\n", fun1(0x000000C9),
         fun2(0x000000C9));
  printf("fun1(0xEDCBA987) = %x, fun2(0xEDCBA987) = %x\n", fun1(0xEDCBA987),
         fun2(0xEDCBA987));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x76,%edi
call   1050 <fun1@plt>
mov    %eax,-0x14(%rbp)
mov    $0x76,%edi
call   1030 <fun2@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x87654321,%edi
call   1050 <fun1@plt>
mov    %eax,-0x10(%rbp)
mov    $0x87654321,%edi
call   1030 <fun2@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    $0xc9,%edi
call   1050 <fun1@plt>
mov    %eax,-0xc(%rbp)
mov    $0xc9,%edi
call   1030 <fun2@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0xedcba987,%edi
call   1050 <fun1@plt>
mov    %eax,-0x8(%rbp)
mov    $0xedcba987,%edi
call   1030 <fun2@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x76,%edi
call   1050 <fun1@plt>
mov    %eax,%ebx
mov    $0x76,%edi
call   1030 <fun2@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x87654321,%edi
call   1050 <fun1@plt>
mov    %eax,%ebx
mov    $0x87654321,%edi
call   1030 <fun2@plt>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xc9,%edi
call   1050 <fun1@plt>
mov    %eax,%ebx
mov    $0xc9,%edi
call   1030 <fun2@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0xedcba987,%edi
call   1050 <fun1@plt>
mov    %eax,%ebx
mov    $0xedcba987,%edi
call   1030 <fun2@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"fun1(0x00000076) = %x, fun2(0x00000076) = %x\0A\00"
@.str.1 = [46 x i8] c"fun1(0x87654321) = %x, fun2(0x87654321) = %x\0A\00"
@.str.2 = [46 x i8] c"fun1(0x000000C9) = %x, fun2(0x000000C9) = %x\0A\00"
@.str.3 = [46 x i8] c"fun1(0xEDCBA987) = %x, fun2(0xEDCBA987) = %x\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun1(i32 118)
%3 = call i32 @fun2(i32 118)
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 @fun1(i32 -2023406815)
%6 = call i32 @fun2(i32 -2023406815)
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @fun1(i32 201)
%9 = call i32 @fun2(i32 201)
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 @fun1(i32 -305419897)
%12 = call i32 @fun2(i32 -305419897)
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"fun1(0x00000076) = %x, fun2(0x00000076) = %x\0A\00"
@.str.1 = [46 x i8] c"fun1(0x87654321) = %x, fun2(0x87654321) = %x\0A\00"
@.str.2 = [46 x i8] c"fun1(0x000000C9) = %x, fun2(0x000000C9) = %x\0A\00"
@.str.3 = [46 x i8] c"fun1(0xEDCBA987) = %x, fun2(0xEDCBA987) = %x\0A\00"
define i32 @main() {
%1 = tail call i32 @fun1(i32 118)
%2 = tail call i32 @fun2(i32 118)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @fun1(i32 -2023406815)
%5 = tail call i32 @fun2(i32 -2023406815)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
%7 = tail call i32 @fun1(i32 201)
%8 = tail call i32 @fun2(i32 201)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = tail call i32 @fun1(i32 -305419897)
%11 = tail call i32 @fun2(i32 -305419897)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}