#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*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ LispBegin();
int /*<<< orphan*/ LispDebug(int);
int /*<<< orphan*/ LispEnd();
int /*<<< orphan*/ LispExecute(char *);
int /*<<< orphan*/ LispMachine();
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  LispBegin();
  i = 1;
  if (argc > 1 && strcmp(argv[1], "-d") == 0) {
    LispDebug(1);
    ++i;
  }
  if (i < argc) {
    char buffer[2048];
    for (; i < argc; i++) {
      snprintf(buffer, sizeof(buffer),
               "(load \"%s\" :if-does-not-exist :error)", argv[i]);
      LispExecute(buffer);
    }
  } else
    LispMachine();
  LispEnd();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <LispBegin@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11d2 <main+0x62>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe50(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11d2 <main+0x62>
mov    $0x1,%edi
call   1090 <LispDebug@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1232 <main+0xc2>
jmp    11e3 <main+0x73>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122d <main+0xbd>
lea    -0x820(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    $0x800,%esi
lea    0xdf5(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x820(%rbp),%rdi
call   1080 <LispExecute@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e3 <main+0x73>
jmp    1239 <main+0xc9>
mov    $0x0,%al
call   1030 <LispMachine@plt>
mov    $0x0,%al
call   1070 <LispEnd@plt>
xor    %eax,%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <LispBegin@plt>
mov    $0x1,%ebx
cmp    $0x2,%ebp
jl     11aa <main+0x3a>
mov    0x8(%r15),%rdi
lea    0xe60(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11e7 <main+0x77>
cmp    %ebp,%ebx
jge    11fa <main+0x8a>
mov    %ebx,%ebx
mov    %ebp,%r12d
lea    0xe49(%rip),%r14
mov    %rsp,%rbp
nopl   (%rax)
mov    (%r15,%rbx,8),%rcx
mov    %rbp,%rdi
mov    $0x800,%esi
mov    %r14,%rdx
call   1050 <snprintf@plt>
mov    %rbp,%rdi
call   1080 <LispExecute@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11c0 <main+0x50>
jmp    1201 <main+0x91>
mov    $0x1,%edi
call   1090 <LispDebug@plt>
mov    $0x2,%ebx
cmp    %ebp,%ebx
jl     11ae <main+0x3e>
xor    %eax,%eax
call   1030 <LispMachine@plt>
xor    %eax,%eax
call   1070 <LispEnd@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
@.str.1 = [38 x i8] c"(load \22%s\22 :if-does-not-exist :error)\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2048 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @LispBegin()
store i32 1, i32* %6
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = call i32 @LispDebug(i32 1)
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %21
21: ; preds = %17, %11, %2
%22 = load i32, i32* %6
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %44
25: ; preds = %21
br label %26
26: ; preds = %40, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %43
30: ; preds = %26
%31 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%32 = load i8**, i8*** %5
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = call i32 @snprintf(i8* %31, i32 2048, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%39 = call i32 @LispExecute(i8* %38)
br label %40
40: ; preds = %30
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %26
43: ; preds = %26
br label %46
44: ; preds = %21
%45 = call i32 (...) @LispMachine()
br label %46
46: ; preds = %44, %43
%47 = call i32 (...) @LispEnd()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
@.str.1 = [38 x i8] c"(load \22%s\22 :if-does-not-exist :error)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2048 x i8]
%4 = tail call i32 (...) @LispBegin()
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @LispDebug(i32 1)
br label %13
13: ; preds = %11, %6, %2
%14 = phi i32 [ 2, %11 ], [ 1, %6 ], [ 1, %2 ]
%15 = icmp slt i32 %14, %0
br i1 %15, label %16, label %29
16: ; preds = %13
%17 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%18 = zext i32 %14 to i64
%19 = zext i32 %0 to i64
br label %20
20: ; preds = %16, %20
%21 = phi i64 [ %18, %16 ], [ %26, %20 ]
%22 = getelementptr inbounds i8*, i8** %1, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @snprintf(i8* %17, i32 2048, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = call i32 @LispExecute(i8* %17)
%26 = add nuw nsw i64 %21, 1
%27 = icmp eq i64 %26, %19
br i1 %27, label %28, label %20
28: ; preds = %20
br label %31
29: ; preds = %13
%30 = tail call i32 (...) @LispMachine()
br label %31
31: ; preds = %29, %28
%32 = call i32 (...) @LispEnd()
ret i32 0
}