#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*/ dump(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ emit(char *, int);
int /*<<< orphan*/ fdump(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  printf("/* code automatically generated by bin2c -- DO NOT EDIT */\n");
  printf("{\n");
  if (argc < 2) {
    dump(stdin, 0);
    emit("=stdin", 0);
  } else {
    int i;
    printf(
        "/* #include'ing this file in a C program is equivalent to calling\n");
    for (i = 1; i < argc; i++)
      printf("  lua_dofile(L,\"%s\");\n", argv[i]);
    printf("*/\n");
    for (i = 1; i < argc; i++)
      fdump(argv[i], i);
    for (i = 1; i < argc; i++)
      emit(argv[i], i);
  }
  printf("}\n");
  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)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    119f <main+0x5f>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <dump@plt>
lea    0xeac(%rip),%rdi
xor    %esi,%esi
call   1060 <emit@plt>
jmp    1265 <main+0x125>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e8 <main+0xa8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b4 <main+0x74>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122b <main+0xeb>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
call   1030 <fdump@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11fd <main+0xbd>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1260 <main+0x120>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
call   1060 <emit@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1232 <main+0xf2>
jmp    1265 <main+0x125>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%r14d
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%r14d
jg     119f <main+0x4f>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1060 <dump@plt>
lea    0xe6d(%rip),%rdi
xor    %esi,%esi
call   1070 <emit@plt>
jmp    1224 <main+0xd4>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    %r14d,%ebx
mov    $0x1,%ebp
lea    0xe4d(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbp,8),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11c0 <main+0x70>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%r14d
jl     1224 <main+0xd4>
mov    $0x1,%ebp
xchg   %ax,%ax
mov    (%r15,%rbp,8),%rdi
mov    %ebp,%esi
call   1040 <fdump@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11f0 <main+0xa0>
cmp    $0x2,%r14d
jl     1224 <main+0xd4>
mov    $0x1,%ebp
nop
mov    (%r15,%rbp,8),%rdi
mov    %ebp,%esi
call   1070 <emit@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1210 <main+0xc0>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [60 x i8] c"/* code automatically generated by bin2c -- DO NOT EDIT */\0A\00"
@.str.1 = [3 x i8] c"{\0A\00"
@stdin = global i32 0
@.str.2 = [7 x i8] c"=stdin\00"
@.str.3 = [67 x i8] c"/* #include'ing this file in a C program is equivalent to calling\0A\00"
@.str.4 = [23 x i8] c" lua_dofile(L,\22%s\22);\0A\00"
@.str.5 = [4 x i8] c"*/\0A\00"
@.str.6 = [3 x i8] c"}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stdin
%13 = call i32 @dump(i32 %12, i32 0)
%14 = call i32 @emit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %65
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %6
br label %17
17: ; preds = %28, %15
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %31
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %21
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %17
31: ; preds = %17
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %6
br label %33
33: ; preds = %45, %31
%34 = load i32, i32* %6
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %48
37: ; preds = %33
%38 = load i8**, i8*** %5
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = load i32, i32* %6
%44 = call i32 @fdump(i8* %42, i32 %43)
br label %45
45: ; preds = %37
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %33
48: ; preds = %33
store i32 1, i32* %6
br label %49
49: ; preds = %61, %48
%50 = load i32, i32* %6
%51 = load i32, i32* %4
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %64
53: ; preds = %49
%54 = load i8**, i8*** %5
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8*, i8** %54, i64 %56
%58 = load i8*, i8** %57
%59 = load i32, i32* %6
%60 = call i32 @emit(i8* %58, i32 %59)
br label %61
61: ; preds = %53
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %49
64: ; preds = %49
br label %65
65: ; preds = %64, %11
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.2 = [7 x i8] c"=stdin\00"
@.str.4 = [23 x i8] c" lua_dofile(L,\22%s\22);\0A\00"
@str = [59 x i8] c"/* code automatically generated by bin2c -- DO NOT EDIT */\00"
@str.7 = [2 x i8] c"{\00"
@str.8 = [66 x i8] c"/* #include'ing this file in a C program is equivalent to calling\00"
@str.9 = [3 x i8] c"*/\00"
@str.10 = [2 x i8] c"}\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stdin
%8 = tail call i32 @dump(i32 %7, i32 0)
%9 = tail call i32 @emit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 0)
br label %44
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.8, i64 0, i64 0))
%12 = zext i32 %0 to i64
br label %13
13: ; preds = %10, %13
%14 = phi i64 [ 1, %10 ], [ %18, %13 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %12
br i1 %19, label %20, label %13
20: ; preds = %13
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.9, i64 0, i64 0))
%22 = icmp sgt i32 %0, 1
br i1 %22, label %23, label %44
23: ; preds = %20
%24 = zext i32 %0 to i64
br label %28
25: ; preds = %28
br i1 %22, label %26, label %44
26: ; preds = %25
%27 = zext i32 %0 to i64
br label %36
28: ; preds = %23, %28
%29 = phi i64 [ 1, %23 ], [ %34, %28 ]
%30 = getelementptr inbounds i8*, i8** %1, i64 %29
%31 = load i8*, i8** %30
%32 = trunc i64 %29 to i32
%33 = tail call i32 @fdump(i8* %31, i32 %32)
%34 = add nuw nsw i64 %29, 1
%35 = icmp eq i64 %34, %24
br i1 %35, label %25, label %28
36: ; preds = %26, %36
%37 = phi i64 [ 1, %26 ], [ %42, %36 ]
%38 = getelementptr inbounds i8*, i8** %1, i64 %37
%39 = load i8*, i8** %38
%40 = trunc i64 %37 to i32
%41 = tail call i32 @emit(i8* %39, i32 %40)
%42 = add nuw nsw i64 %37, 1
%43 = icmp eq i64 %42, %27
br i1 %43, label %44, label %36
44: ; preds = %36, %20, %25, %6
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}