#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_FREE();
int /*<<< orphan*/ SPC_INIT();
int /*<<< orphan*/ SPC_STATIS(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  char *filename = NULL;
  SPC_INIT();
  if (argc != 2) {
    printf("Input filename!\n");
    return -1;
  }
  filename = argv[1];
  SPC_STATIS(filename);
  SPC_FREE();
  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)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <SPC_INIT@plt>
cmpl   $0x2,-0x8(%rbp)
je     1187 <main+0x47>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11aa <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <SPC_STATIS@plt>
mov    $0x0,%al
call   1060 <SPC_FREE@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <SPC_INIT@plt>
cmp    $0x2,%ebp
jne    1169 <main+0x29>
mov    0x8(%r14),%rdi
call   1040 <SPC_STATIS@plt>
xor    %eax,%eax
call   1060 <SPC_FREE@plt>
jmp    117a <main+0x3a>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Input filename!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = call i32 (...) @SPC_INIT()
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %19
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 @SPC_STATIS(i8* %16)
%18 = call i32 (...) @SPC_FREE()
store i32 0, i32* %3
br label %19
19: ; preds = %12, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [16 x i8] c"Input filename!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @SPC_INIT()
%4 = icmp eq i32 %0, 2
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @SPC_STATIS(i8* %9)
%11 = tail call i32 (...) @SPC_FREE()
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ -1, %5 ], [ 0, %7 ]
ret i32 %13
}