#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*/ printf(char *);
int /*<<< orphan*/ run(int);
int main(int argc, char **argv) {
  if (argc == 1) {
    printf("First arg is required \n");
    return 1;
  }
  int count = atoi(argv[1]);
  if (count <= 0 || count > 2000000000) {
    printf("Must be a positive number not exceeding 2 billion.\n");
    return 1;
  }
  run(count);
  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   $0x1,-0x8(%rbp)
jne    1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b6 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    118f <main+0x5f>
cmpl   $0x77359400,-0x14(%rbp)
jle    11a7 <main+0x77>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b6 <main+0x86>
mov    -0x14(%rbp),%edi
call   1030 <run@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    113f <main+0xf>
lea    0xef6(%rip),%rdi
jmp    115d <main+0x2d>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
lea    -0x77359401(%rax),%ecx
cmp    $0x88ca6bff,%ecx
ja     1169 <main+0x39>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    %eax,%edi
call   1040 <run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"First arg is required \0A\00"
@.str.1 = [52 x i8] c"Must be a positive number not exceeding 2 billion.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %26
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
%16 = load i32, i32* %6
%17 = icmp sle i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = icmp sgt i32 %19, 2000000000
br i1 %20, label %21, label %23
21: ; preds = %18, %11
%22 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %26
23: ; preds = %18
%24 = load i32, i32* %6
%25 = call i32 @run(i32 %24)
store i32 0, i32* %3
br label %26
26: ; preds = %23, %21, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@str = [51 x i8] c"Must be a positive number not exceeding 2 billion.\00"
@str.2 = [23 x i8] c"First arg is required \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
br label %16
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = add i32 %9, -2000000001
%11 = icmp ult i32 %10, -2000000000
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %16
14: ; preds = %6
%15 = tail call i32 @run(i32 %9)
br label %16
16: ; preds = %12, %14, %4
%17 = phi i32 [ 1, %4 ], [ 1, %12 ], [ 0, %14 ]
ret i32 %17
}