#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 /*<<< orphan*/ SPC_FETCH(char *, int);
int atol(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int flag = 0;
  char *path = NULL;
  if ((argc < 2) || (argc > 3)) {
    printf("Input file`s path! and flag\n");
    return -1;
  }
  path = argv[1];
  if (3 == argc) {
    flag = atol(argv[2]);
  }
  SPC_FETCH(path, flag);
  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)
movq   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1169 <main+0x39>
cmpl   $0x3,-0x8(%rbp)
jle    1181 <main+0x51>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11be <main+0x8e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    11ab <main+0x7b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <SPC_FETCH@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    -0x4(%rdi),%eax
cmp    $0xfffffffd,%eax
ja     114f <main+0x1f>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
jmp    1172 <main+0x42>
mov    0x8(%rsi),%r14
xor    %ebx,%ebx
mov    $0x0,%eax
cmp    $0x3,%edi
jne    1168 <main+0x38>
mov    0x10(%rsi),%rdi
call   1050 <atol@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <SPC_FETCH@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Input file`s path! and flag\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %10, %2
%14 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %30
15: ; preds = %10
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %7
%19 = load i32, i32* %4
%20 = icmp eq i32 3, %19
br i1 %20, label %21, label %26
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atol(i8* %24)
store i32 %25, i32* %6
br label %26
26: ; preds = %21, %15
%27 = load i8*, i8** %7
%28 = load i32, i32* %6
%29 = call i32 @SPC_FETCH(i8* %27, i32 %28)
store i32 0, i32* %3
br label %30
30: ; preds = %26, %13
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@str = [28 x i8] c"Input file`s path! and flag\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -4
%4 = icmp ult i32 %3, -2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %18
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i32 %0, 3
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atol(i8* %13)
br label %15
15: ; preds = %11, %7
%16 = phi i32 [ %14, %11 ], [ 0, %7 ]
%17 = tail call i32 @SPC_FETCH(i8* %9, i32 %16)
br label %18
18: ; preds = %15, %5
%19 = phi i32 [ -1, %5 ], [ 0, %15 ]
ret i32 %19
}