#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*/ fact(int);
int /*<<< orphan*/ lee();
int /*<<< orphan*/ phint(int /*<<< orphan*/);
int /*<<< orphan*/ procnum();
int /*<<< orphan*/ uputs(int, char *);
int main(void) {
  uputs(0x00400000, "Hello world on processor ");
  phint(procnum());
  uputs(0x00400000, "\n");
  uputs(0x00400000, "Computing 7! recursively\n");
  phint(fact(7));
  uputs(0x00400000, "\n");
  uputs(0x00400000, "Solving a random maze using Lee algorithm\n");
  lee();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400000,%edi
lea    0xe95(%rip),%rsi
call   1030 <uputs@plt>
mov    $0x0,%al
call   1070 <procnum@plt>
mov    %eax,%edi
call   1050 <phint@plt>
mov    $0x400000,%edi
lea    0xed3(%rip),%rsi
call   1030 <uputs@plt>
mov    $0x400000,%edi
lea    0xe7f(%rip),%rsi
call   1030 <uputs@plt>
mov    $0x7,%edi
call   1060 <fact@plt>
mov    %eax,%edi
call   1050 <phint@plt>
mov    $0x400000,%edi
lea    0xea0(%rip),%rsi
call   1030 <uputs@plt>
mov    $0x400000,%edi
lea    0xe66(%rip),%rsi
call   1030 <uputs@plt>
mov    $0x0,%al
call   1040 <lee@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rsi
mov    $0x400000,%edi
call   1030 <uputs@plt>
xor    %eax,%eax
call   1070 <procnum@plt>
mov    %eax,%edi
call   1050 <phint@plt>
lea    0xee6(%rip),%rbx
mov    $0x400000,%edi
mov    %rbx,%rsi
call   1030 <uputs@plt>
lea    0xe8f(%rip),%rsi
mov    $0x400000,%edi
call   1030 <uputs@plt>
mov    $0x7,%edi
call   1060 <fact@plt>
mov    %eax,%edi
call   1050 <phint@plt>
mov    $0x400000,%edi
mov    %rbx,%rsi
call   1030 <uputs@plt>
lea    0xe7a(%rip),%rsi
mov    $0x400000,%edi
call   1030 <uputs@plt>
xor    %eax,%eax
call   1040 <lee@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello world on processor \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [26 x i8] c"Computing 7! recursively\0A\00"
@.str.3 = [43 x i8] c"Solving a random maze using Lee algorithm\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @procnum()
%4 = call i32 @phint(i32 %3)
%5 = call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @fact(i32 7)
%8 = call i32 @phint(i32 %7)
%9 = call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (...) @lee()
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Hello world on processor \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [26 x i8] c"Computing 7! recursively\0A\00"
@.str.3 = [43 x i8] c"Solving a random maze using Lee algorithm\0A\00"
define i32 @main() {
%1 = tail call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @procnum()
%3 = tail call i32 @phint(i32 %2)
%4 = tail call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @fact(i32 7)
%7 = tail call i32 @phint(i32 %6)
%8 = tail call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @uputs(i32 4194304, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 (...) @lee()
ret i32 0
}