#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*/ getPrimes(unsigned int);
int /*<<< orphan*/ printf(char *, char *, ...);
int main(int argc, char **argv) {
  int natNum = 0;
  if (argc == 2) {
    natNum = atoi(argv[1]);
    if (natNum >= 2)
      getPrimes((unsigned)natNum);
    else
      printf("%s: 'natural_number' must be at least %d\n", argv[0], 2);
  } else
    printf("Usage: %s natural_number\n", argv[0]);
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    119d <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jl     117e <main+0x4e>
mov    -0x14(%rbp),%edi
call   1050 <getPrimes@plt>
jmp    1198 <main+0x68>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe74(%rip),%rdi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0x82>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1150 <main+0x20>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
cmp    $0x2,%eax
jl     1163 <main+0x33>
mov    %eax,%edi
call   1050 <getPrimes@plt>
jmp    1179 <main+0x49>
mov    (%rbx),%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1179 <main+0x49>
mov    (%rbx),%rsi
lea    0xe93(%rip),%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"%s: 'natural_number' must be at least %d\0A\00"
@.str.1 = [26 x i8] c"Usage: %s natural_number\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
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %25
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp sge i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = load i32, i32* %6
%18 = call i32 @getPrimes(i32 %17)
br label %24
19: ; preds = %9
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %22, i32 2)
br label %24
24: ; preds = %19, %16
br label %30
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %25, %24
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"%s: 'natural_number' must be at least %d\0A\00"
@.str.1 = [26 x i8] c"Usage: %s natural_number\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %14
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, 1
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @getPrimes(i32 %7)
br label %17
11: ; preds = %4
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %12, i32 2)
br label %17
14: ; preds = %2
%15 = load i8*, i8** %1
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %9, %11, %14
ret i32 0
}