#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*/ extract_all();
int /*<<< orphan*/ ms_close();
int /*<<< orphan*/ ms_open(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc == 2) {
    ms_open(argv[1]);
    extract_all();
    ms_close();
  } else
    printf("Explode by Stefan Jokisch\n"
           "(for use with Magnetic Scrolls Collection and Wonderland)\n"
           "\n"
           "Usage: %s RDF-file\n",
           argv[0]);
  return 0;
}


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)
jne    1180 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <ms_open@plt>
mov    $0x0,%al
call   1030 <extract_all@plt>
mov    $0x0,%al
call   1060 <ms_close@plt>
jmp    1193 <main+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    115f <main+0x1f>
mov    0x8(%rsi),%rdi
call   1050 <ms_open@plt>
xor    %eax,%eax
call   1030 <extract_all@plt>
xor    %eax,%eax
call   1060 <ms_close@plt>
jmp    116e <main+0x2e>
mov    (%rsi),%rsi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [105 x i8] c"Explode by Stefan Jokisch\0A(for use with Magnetic Scrolls Collection and Wonderland)\0A\0AUsage: %s RDF-file\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 eq i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @ms_open(i8* %11)
%13 = call i32 (...) @extract_all()
%14 = call i32 (...) @ms_close()
br label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %15, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [105 x i8] c"Explode by Stefan Jokisch\0A(for use with Magnetic Scrolls Collection and Wonderland)\0A\0AUsage: %s RDF-file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ms_open(i8* %6)
%8 = tail call i32 (...) @extract_all()
%9 = tail call i32 (...) @ms_close()
br label %13
10: ; preds = %2
%11 = load i8*, i8** %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %4
ret i32 0
}