#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int _interpret_(int /*<<< orphan*/ *);
int _start_();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ publish_masthead();
int /*<<< orphan*/ show_help();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  FILE *in;
  int a = 0;
  if (argc == 1) {
    a = _start_();
  } else if (argc > 1) {
    if (argv[1][0] == '-') {
      switch (argv[1][1]) {
      case 'v':
        publish_masthead();
      case 'h':
      default:
        show_help();
      }
    } else if (!strcmp(argv[1] + strlen(argv[1]) - 3, ".ci")) {
      in = fopen(argv[1], "r");
      if (in == NULL) {
        fprintf(stderr, "\nUnable to open script file.\n");
        exit(1);
      } else {
        a = _interpret_(in);
        fclose(in);
      }
    } else {
      show_help();
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11d6 <main+0x36>
mov    $0x0,%al
call   1060 <_start_@plt>
mov    %eax,-0x1c(%rbp)
jmp    12e7 <main+0x147>
cmpl   $0x1,-0x8(%rbp)
jle    12e2 <main+0x142>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    123a <main+0x9a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x20(%rbp)
sub    $0x68,%eax
je     1229 <main+0x89>
jmp    1211 <main+0x71>
mov    -0x20(%rbp),%eax
sub    $0x76,%eax
jne    122e <main+0x8e>
jmp    1222 <main+0x82>
mov    $0x0,%al
call   10a0 <publish_masthead@plt>
jmp    122e <main+0x8e>
mov    $0x0,%al
call   1090 <show_help@plt>
jmp    12dd <main+0x13d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
cltq
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xd99(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12d1 <main+0x131>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd80(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12b7 <main+0x117>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0xd5e(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%rdi
call   1050 <_interpret_@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
jmp    12d8 <main+0x138>
mov    $0x0,%al
call   1090 <show_help@plt>
jmp    12dd <main+0x13d>
jmp    12e2 <main+0x142>
jmp    12e7 <main+0x147>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
jne    11b4 <main+0x14>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <_start_@plt>
jle    11fa <main+0x5a>
mov    %rsi,%r14
mov    0x8(%rsi),%rbx
cmpb   $0x2d,(%rbx)
jne    11d1 <main+0x31>
cmpb   $0x76,0x1(%rbx)
jne    11f3 <main+0x53>
xor    %eax,%eax
call   10a0 <publish_masthead@plt>
jmp    11f3 <main+0x53>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xe16(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1201 <main+0x61>
xor    %eax,%eax
call   1090 <show_help@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x8(%r14),%rdi
lea    0xdf8(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     122f <main+0x8f>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <_interpret_@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
jmp    11fc <main+0x5c>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
lea    0xdc7(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c".ci\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"\0AUnable to open script file.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @_start_()
store i32 %11, i32* %7
br label %71
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %70
15: ; preds = %12
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 45
br i1 %22, label %23, label %36
23: ; preds = %15
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
switch i32 %29, label %33 [
i32 118, label %30
i32 104, label %32
]
30: ; preds = %23
%31 = call i32 (...) @publish_masthead()
br label %32
32: ; preds = %23, %30
br label %33
33: ; preds = %23, %32
%34 = call i32 (...) @show_help()
br label %35
35: ; preds = %33
br label %69
36: ; preds = %15
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 @strlen(i8* %42)
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %39, i64 %44
%46 = getelementptr inbounds i8, i8* %45, i64 -3
%47 = call i32 @strcmp(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %66, label %49
49: ; preds = %36
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 1
%52 = load i8*, i8** %51
%53 = call i32* @fopen(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %53, i32** %6
%54 = load i32*, i32** %6
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %60
56: ; preds = %49
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %49
%61 = load i32*, i32** %6
%62 = call i32 @_interpret_(i32* %61)
store i32 %62, i32* %7
%63 = load i32*, i32** %6
%64 = call i32 @fclose(i32* %63)
br label %65
65: ; preds = %60
br label %68
66: ; preds = %36
%67 = call i32 (...) @show_help()
br label %68
68: ; preds = %66, %65
br label %69
69: ; preds = %68, %35
br label %70
70: ; preds = %69, %12
br label %71
71: ; preds = %70, %10
%72 = load i32, i32* %7
ret i32 %72
}

LLVM IR (-O2):
@.str = [4 x i8] c".ci\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"\0AUnable to open script file.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @_start_()
br label %41
6: ; preds = %2
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %41
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 118
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 (...) @publish_masthead()
br label %19
19: ; preds = %13, %17
%20 = tail call i32 (...) @show_help()
br label %41
21: ; preds = %8
%22 = tail call i32 @strlen(i8* %10)
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %10, i64 %23
%25 = getelementptr inbounds i8, i8* %24, i64 -3
%26 = tail call i32 @strcmp(i8* %25, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %39
28: ; preds = %21
%29 = load i8*, i8** %9
%30 = tail call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load i32, i32* @stderr
%34 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%35 = tail call i32 @exit(i32 1)
unreachable
36: ; preds = %28
%37 = tail call i32 @_interpret_(i32* %30)
%38 = tail call i32 @fclose(i32* %30)
br label %41
39: ; preds = %21
%40 = tail call i32 (...) @show_help()
br label %41
41: ; preds = %6, %36, %39, %19, %4
%42 = phi i32 [ %5, %4 ], [ 0, %19 ], [ 0, %39 ], [ %37, %36 ], [ 0, %6 ]
ret i32 %42
}