#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*/ p1();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Expecting at least one argument. Please try again\n");
  } else if (argc == 2) {
    if (atoi(argv[1]) == 1) {
      p1();
    } else {
      printf("Incorrect argument supplied.\n");
    }
  } else {
    printf("Expecting only one argument\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1161 <main+0x31>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x7f>
cmpl   $0x2,-0x8(%rbp)
jne    119e <main+0x6e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
cmp    $0x1,%eax
jne    118d <main+0x5d>
mov    $0x0,%al
call   1040 <p1@plt>
jmp    1199 <main+0x69>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11aa <main+0x7a>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x7f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113f <main+0xf>
lea    0xefc(%rip),%rdi
jmp    116b <main+0x3b>
cmp    $0x2,%edi
jne    115b <main+0x2b>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
cmp    $0x1,%eax
jne    1164 <main+0x34>
xor    %eax,%eax
call   1040 <p1@plt>
jmp    1170 <main+0x40>
lea    0xe9e(%rip),%rdi
jmp    116b <main+0x3b>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Expecting at least one argument. Please try again\0A\00"
@.str.1 = [30 x i8] c"Incorrect argument supplied.\0A\00"
@.str.2 = [29 x i8] c"Expecting only one argument\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %27
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @p1()
br label %23
21: ; preds = %13
%22 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %26
24: ; preds = %10
%25 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %23
br label %27
27: ; preds = %26, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@str = [28 x i8] c"Expecting only one argument\00"
@str.3 = [29 x i8] c"Incorrect argument supplied.\00"
@str.4 = [50 x i8] c"Expecting at least one argument. Please try again\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.4, i64 0, i64 0))
br label %19
6: ; preds = %2
%7 = icmp eq i32 %0, 2
br i1 %7, label %8, label %17
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 (...) @p1()
br label %19
15: ; preds = %8
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
br label %19
17: ; preds = %6
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %4
ret i32 0
}