#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 */
long long atoll(char *);
int /*<<< orphan*/ print_primes(long long);
int /*<<< orphan*/ print_usage();
int main(int argc, char **argv) {
  long long n;
  if (argc != 2) {
    print_usage();
    return 0;
  }
  n = atoll(argv[1]);
  if (n < 2) {
    print_usage();
    return 1;
  }
  print_primes(n);
  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     1163 <main+0x33>
mov    $0x0,%al
call   1050 <print_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a2 <main+0x72>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jge    1192 <main+0x62>
mov    $0x0,%al
call   1050 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <main+0x72>
mov    -0x18(%rbp),%rdi
call   1030 <print_primes@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1153 <main+0x23>
mov    0x8(%rsi),%rdi
call   1040 <atoll@plt>
cmp    $0x1,%rax
jg     115e <main+0x2e>
xor    %eax,%eax
call   1050 <print_usage@plt>
mov    $0x1,%ebx
jmp    1168 <main+0x38>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <print_usage@plt>
jmp    1168 <main+0x38>
mov    %rax,%rdi
call   1030 <print_primes@plt>
xor    %ebx,%ebx
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 i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @print_usage()
store i32 0, i32* %3
br label %23
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @atoll(i8* %14)
store i64 %15, i64* %6
%16 = load i64, i64* %6
%17 = icmp slt i64 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 (...) @print_usage()
store i32 1, i32* %3
br label %23
20: ; preds = %11
%21 = load i64, i64* %6
%22 = call i32 @print_primes(i64 %21)
store i32 0, i32* %3
br label %23
23: ; preds = %20, %18, %9
%24 = load i32, i32* %3
ret i32 %24
}

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