#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 atoi(char *);
int /*<<< orphan*/ makeZombie();
int /*<<< orphan*/ pause();
int main(int argc, char **argv) {
  if (argc != 2) {
    return 1;
  }
  int limit = atoi(argv[1]);
  int i = 0;
  for (i; i < limit; i++) {
    makeZombie();
  }
  pause();
  return 0;
}


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     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <main+0x72>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1194 <main+0x64>
mov    $0x0,%al
call   1040 <makeZombie@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1173 <main+0x43>
mov    $0x0,%al
call   1030 <pause@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jne    1165 <main+0x35>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
jle    115c <main+0x2c>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <makeZombie@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x20>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <pause@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 %11
10: ; preds = %2
store i32 1, i32* %3
br label %28
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
store i32 0, i32* %7
%16 = load i32, i32* %7
br label %17
17: ; preds = %23, %11
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = call i32 (...) @makeZombie()
br label %23
23: ; preds = %21
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %17
26: ; preds = %17
%27 = call i32 (...) @pause()
store i32 0, i32* %3
br label %28
28: ; preds = %26, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4, %9
%10 = phi i32 [ %12, %9 ], [ 0, %4 ]
%11 = tail call i32 (...) @makeZombie()
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %7
br i1 %13, label %14, label %9
14: ; preds = %9, %4
%15 = tail call i32 (...) @pause()
br label %16
16: ; preds = %2, %14
%17 = phi i32 [ 0, %14 ], [ 1, %2 ]
ret i32 %17
}