#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *);
int sscanf(char const *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
int main(int argc, const char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Usage: %s numberOfPhis\n", argv[0]);
    return EXIT_FAILURE;
  }
  unsigned phis;
  if (sscanf(argv[1], "%u", &phis) != 1) {
    fprintf(stderr, "Cannot parse number of phis\n");
    return EXIT_FAILURE;
  }
  printf("int main(int argc, char *argv[])\n{\n");
  for (unsigned i = 0; i != phis; i++) {
    printf("\tif (argc) { }\n");
  }
  printf("\n\treturn 0;\n}\n");
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x4f>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1219 <main+0xe9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8a(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     11c8 <main+0x98>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1219 <main+0xe9>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1201 <main+0xd1>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11db <main+0xab>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1196 <main+0x66>
mov    0x8(%rsi),%rdi
lea    0xed5(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11b2 <main+0x82>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0x4(%rsp)
je     1181 <main+0x51>
xor    %ebp,%ebp
lea    0xefb(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jne    1170 <main+0x40>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e3c(%rip),%rax
jmp    11d0 <main+0xa0>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe57(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11c9 <main+0x99>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
lea    0xe59(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s numberOfPhis\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [29 x i8] c"Cannot parse number of phis\0A\00"
@.str.3 = [36 x i8] c"int main(int argc, char *argv[])\0A{\0A\00"
@.str.4 = [16 x i8] c"\09if (argc) { }\0A\00"
@.str.5 = [15 x i8] c"\0A\09return 0;\0A}\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %3
br label %41
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%22 = icmp ne i32 %21, 1
br i1 %22, label %23, label %27
23: ; preds = %17
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @EXIT_FAILURE
store i32 %26, i32* %3
br label %41
27: ; preds = %17
%28 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %7
br label %29
29: ; preds = %35, %27
%30 = load i32, i32* %7
%31 = load i32, i32* %6
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %38
33: ; preds = %29
%34 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %35
35: ; preds = %33
%36 = load i32, i32* %7
%37 = add i32 %36, 1
store i32 %37, i32* %7
br label %29
38: ; preds = %29
%39 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%40 = load i32, i32* @EXIT_SUCCESS
store i32 %40, i32* %3
br label %41
41: ; preds = %38, %23, %10
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s numberOfPhis\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [29 x i8] c"Cannot parse number of phis\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [35 x i8] c"int main(int argc, char *argv[])\0A{\00"
@str.6 = [14 x i8] c"\0A\09return 0;\0A}\00"
@str.7 = [15 x i8] c"\09if (argc) { }\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp eq i32 %0, 2
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
br label %34
10: ; preds = %2
%11 = bitcast i32* %3 to i8*
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%15 = icmp eq i32 %14, 1
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %31
19: ; preds = %10
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %25, %19
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
br label %31
25: ; preds = %19, %25
%26 = phi i32 [ %28, %25 ], [ 0, %19 ]
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.7, i64 0, i64 0))
%28 = add i32 %26, 1
%29 = load i32, i32* %3
%30 = icmp eq i32 %28, %29
br i1 %30, label %23, label %25
31: ; preds = %23, %16
%32 = phi i32* [ @EXIT_FAILURE, %16 ], [ @EXIT_SUCCESS, %23 ]
%33 = load i32, i32* %32
br label %34
34: ; preds = %31, %5
%35 = phi i32 [ %9, %5 ], [ %33, %31 ]
ret i32 %35
}