#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*/ atoi(char *);
int factorial(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ marker1();
int /*<<< orphan*/ marker2(int);
int /*<<< orphan*/ marker3(char *, char *);
int /*<<< orphan*/ marker4(long);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv, char **envp) {
  if (argc == 12345) {
    fprintf(stderr, "usage:  factorial <number>\n");
    return 1;
  }
  printf("%d\n", factorial(atoi("6")));
  marker1();
  marker2(43);
  marker3("stack", "trace");
  marker4(177601976L);
  (void)malloc(1);
  argc = (argc == 12345);
  return argc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x3039,-0x8(%rbp)
jne    11d8 <main+0x48>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1249 <main+0xb9>
lea    0xe41(%rip),%rdi
call   10b0 <atoi@plt>
mov    %eax,%edi
call   1050 <factorial@plt>
mov    %eax,%esi
lea    0xe28(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1080 <marker1@plt>
mov    $0x2b,%edi
call   1030 <marker2@plt>
lea    0xe11(%rip),%rdi
lea    0xe10(%rip),%rsi
call   1090 <marker3@plt>
mov    $0xa95fdb8,%edi
call   1040 <marker4@plt>
mov    $0x1,%edi
call   10a0 <malloc@plt>
cmpl   $0x3039,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3039,%edi
jne    11a5 <main+0x25>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%ebx
jmp    11f7 <main+0x77>
mov    $0x6,%edi
call   1050 <factorial@plt>
lea    0xe66(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <marker1@plt>
mov    $0x2b,%edi
call   1030 <marker2@plt>
lea    0xe49(%rip),%rdi
lea    0xe48(%rip),%rsi
call   1090 <marker3@plt>
mov    $0xa95fdb8,%edi
call   1040 <marker4@plt>
mov    $0x1,%edi
call   10a0 <malloc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"usage: factorial <number>\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [2 x i8] c"6\00"
@.str.3 = [6 x i8] c"stack\00"
@.str.4 = [6 x i8] c"trace\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 12345
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
br label %26
13: ; preds = %3
%14 = call i32 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @factorial(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 (...) @marker1()
%18 = call i32 @marker2(i32 43)
%19 = call i32 @marker3(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @marker4(i64 177601976)
%21 = call i32 @malloc(i32 1)
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 12345
%24 = zext i1 %23 to i32
store i32 %24, i32* %5
%25 = load i32, i32* %5
store i32 %25, i32* %4
br label %26
26: ; preds = %13, %10
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage: factorial <number>\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"stack\00"
@.str.4 = [6 x i8] c"trace\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = icmp eq i32 %0, 12345
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %3
%9 = tail call i32 @factorial(i32 6)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = tail call i32 (...) @marker1()
%12 = tail call i32 @marker2(i32 43)
%13 = tail call i32 @marker3(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @marker4(i64 177601976)
%15 = tail call i32 @malloc(i32 1)
br label %16
16: ; preds = %8, %5
%17 = phi i32 [ 1, %5 ], [ 0, %8 ]
ret i32 %17
}