#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 PATH_MAX;
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ generate_code(int /*<<< orphan*/ *, char *, int, int);
int /*<<< orphan*/ show_error();
int /*<<< orphan*/ show_usage();
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  char *input = NULL;
  char *name = NULL;
  int i = 1;
  int zero_end = 0;
  int static_variable = 0;
  char res_name[61] = {0};
  FILE *fi = 0;
  for (; i < argc; ++i) {
    if (*(argv[i]) != '-') {
      if (i != argc - 1) {
        show_error();
        return -1;
      }
      input = argv[i];
    } else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
      show_usage();
      return 0;
    } else if (strcmp(argv[i], "--zero") == 0 || strcmp(argv[i], "-z") == 0) {
      zero_end = 1;
    } else if (strcmp(argv[i], "--static") == 0 || strcmp(argv[i], "-s") == 0) {
      static_variable = 1;
    } else if (strcmp(argv[i], "--name") == 0 || strcmp(argv[i], "-n") == 0) {
      if (i >= argc - 2 || *(argv[i + 1]) == '-') {
        show_error();
        return -1;
      }
      name = argv[i + 1];
      ++i;
    }
  }
  if (input == NULL) {
    show_error();
    return -1;
  }
  if (strlen(input) > PATH_MAX - 5) {
    fprintf(stderr, "Generate failed: pathname too lang.\n");
    return -1;
  }
  if (name == NULL) {
    strcpy(res_name, "data");
  } else {
    if (strlen(name) > 60) {
      fprintf(stderr, "Generate failed: resource name too lang.\n");
      return -1;
    }
    strcpy(res_name, name);
  }
  fi = fopen(input, "rb");
  if (fi == NULL) {
    fprintf(stderr, "Open input file failed: errno: %d.\n", errno);
    return -1;
  }
  generate_code(fi, res_name, zero_end, static_variable);
  fclose(fi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x3d,%edx
call   1060 <memset@plt>
movq   $0x0,-0x78(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1414 <main+0x274>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1253 <main+0xb3>
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     123e <main+0x9e>
mov    $0x0,%al
call   10a0 <show_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1542 <main+0x3a2>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
jmp    1401 <main+0x261>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1297 <main+0xf7>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd7f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12aa <main+0x10a>
mov    $0x0,%al
call   10b0 <show_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1542 <main+0x3a2>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd4d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12ee <main+0x14e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd32(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12fa <main+0x15a>
movl   $0x1,-0x28(%rbp)
jmp    13f7 <main+0x257>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd07(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     133e <main+0x19e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcee(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    134a <main+0x1aa>
movl   $0x1,-0x2c(%rbp)
jmp    13f2 <main+0x252>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcc3(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     138e <main+0x1ee>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xca8(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13ed <main+0x24d>
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    13bc <main+0x21c>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    13cf <main+0x22f>
mov    $0x0,%al
call   10a0 <show_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1542 <main+0x3a2>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13f2 <main+0x252>
jmp    13f7 <main+0x257>
jmp    13fc <main+0x25c>
jmp    1401 <main+0x261>
jmp    1406 <main+0x266>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f6 <main+0x56>
cmpq   $0x0,-0x18(%rbp)
jne    1432 <main+0x292>
mov    $0x0,%al
call   10a0 <show_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1542 <main+0x3a2>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    0x2bae(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x5,%ecx
cmp    %ecx,%eax
jle    1472 <main+0x2d2>
mov    0x2b82(%rip),%rax
mov    (%rax),%edi
lea    0xbcb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1542 <main+0x3a2>
cmpq   $0x0,-0x20(%rbp)
jne    1492 <main+0x2f2>
lea    -0x70(%rbp),%rdi
lea    0xbc7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    14d4 <main+0x334>
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x3c,%eax
jle    14c7 <main+0x327>
mov    0x2b2d(%rip),%rax
mov    (%rax),%edi
lea    0xba0(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1542 <main+0x3a2>
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xb9f(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    151f <main+0x37f>
mov    0x2ade(%rip),%rax
mov    (%rax),%edi
mov    0x2acd(%rip),%rax
mov    (%rax),%edx
lea    0xb75(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1542 <main+0x3a2>
mov    -0x78(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
call   1090 <generate_code@plt>
mov    -0x78(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x4d(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
cmp    $0x2,%edi
jl     1356 <main+0x1c6>
mov    %rsi,%rbp
mov    %edi,%r13d
lea    -0x1(%r13),%r14d
lea    -0x2(%r13),%eax
mov    %eax,0x14(%rsp)
mov    $0x1,%r12d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebx,%ebx
jmp    120c <main+0x7c>
mov    %rdi,%rbx
cmp    %r14d,%r12d
mov    %r14d,%r12d
jne    1356 <main+0x1c6>
add    $0x1,%r12d
cmp    %r13d,%r12d
jge    1327 <main+0x197>
movslq %r12d,%r15
mov    0x0(%rbp,%r15,8),%rdi
cmpb   $0x2d,(%rdi)
jne    11f0 <main+0x60>
lea    0xde0(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     131c <main+0x18c>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xdcd(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     131c <main+0x18c>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xdb6(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1300 <main+0x170>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xda3(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1300 <main+0x170>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd8c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     130d <main+0x17d>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd7f(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     130d <main+0x17d>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd6c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12d8 <main+0x148>
mov    0x0(%rbp,%r15,8),%rdi
lea    0xd5d(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11ff <main+0x6f>
cmp    0x14(%rsp),%r12d
jge    1356 <main+0x1c6>
mov    0x8(%rbp,%r15,8),%rcx
mov    %rcx,%rax
mov    %rcx,0x18(%rsp)
cmpb   $0x2d,(%rcx)
je     1356 <main+0x1c6>
add    $0x1,%r12d
jmp    11ff <main+0x6f>
nopw   0x0(%rax,%rax,1)
movl   $0x1,0x4(%rsp)
jmp    11ff <main+0x6f>
mov    $0x1,%eax
mov    %rax,0x8(%rsp)
jmp    11ff <main+0x6f>
xor    %ebx,%ebx
xor    %eax,%eax
call   10a0 <show_usage@plt>
jmp    1362 <main+0x1d2>
test   %rbx,%rbx
je     1356 <main+0x1c6>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    0x2cb5(%rip),%rcx
mov    (%rcx),%ecx
add    $0xfffffffb,%ecx
cmp    %ecx,%eax
jle    1373 <main+0x1e3>
mov    0x2c8d(%rip),%rax
mov    (%rax),%edi
lea    0xcd6(%rip),%rsi
jmp    139a <main+0x20a>
xor    %eax,%eax
call   1090 <show_error@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x18(%rsp),%rbp
test   %rbp,%rbp
je     13a3 <main+0x213>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    $0x3d,%eax
jl     13b1 <main+0x221>
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
lea    0xcba(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    135d <main+0x1cd>
lea    0xca5(%rip),%rsi
lea    0x20(%rsp),%rdi
jmp    13b9 <main+0x229>
lea    0x20(%rsp),%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
lea    0xcb9(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     13fa <main+0x26a>
mov    %rax,%rbx
lea    0x20(%rsp),%rsi
mov    %rax,%rdi
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%rcx
call   1080 <generate_code@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %ebx,%ebx
jmp    1362 <main+0x1d2>
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
mov    0x2bc6(%rip),%rax
mov    (%rax),%edx
lea    0xc6e(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    135d <main+0x1cd>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [7 x i8] c"--zero\00"
@.str.3 = [3 x i8] c"-z\00"
@.str.4 = [9 x i8] c"--static\00"
@.str.5 = [3 x i8] c"-s\00"
@.str.6 = [7 x i8] c"--name\00"
@.str.7 = [3 x i8] c"-n\00"
@PATH_MAX = global i32 0
@stderr = global i32 0
@.str.8 = [37 x i8] c"Generate failed: pathname too lang.\0A\00"
@.str.9 = [5 x i8] c"data\00"
@.str.10 = [42 x i8] c"Generate failed: resource name too lang.\0A\00"
@.str.11 = [3 x i8] c"rb\00"
@.str.12 = [36 x i8] c"Open input file failed: errno: %d.\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [61 x i8]
%12 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i32 1, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%13 = bitcast [61 x i8]* %11 to i8*
store i32* null, i32** %12
br label %14
14: ; preds = %139, %2
%15 = load i32, i32* %8
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %142
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 45
br i1 %26, label %27, label %40
27: ; preds = %18
%28 = load i32, i32* %8
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 1
%31 = icmp ne i32 %28, %30
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 (...) @show_error()
store i32 -1, i32* %3
br label %190
34: ; preds = %27
%35 = load i8**, i8*** %5
%36 = load i32, i32* %8
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
store i8* %39, i8** %6
br label %138
40: ; preds = %18
%41 = load i8**, i8*** %5
%42 = load i32, i32* %8
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %56, label %48
48: ; preds = %40
%49 = load i8**, i8*** %5
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %48, %40
%57 = call i32 (...) @show_usage()
store i32 0, i32* %3
br label %190
58: ; preds = %48
%59 = load i8**, i8*** %5
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %59, i64 %61
%63 = load i8*, i8** %62
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %74, label %66
66: ; preds = %58
%67 = load i8**, i8*** %5
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %75
74: ; preds = %66, %58
store i32 1, i32* %9
br label %136
75: ; preds = %66
%76 = load i8**, i8*** %5
%77 = load i32, i32* %8
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %76, i64 %78
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %91, label %83
83: ; preds = %75
%84 = load i8**, i8*** %5
%85 = load i32, i32* %8
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8*, i8** %84, i64 %86
%88 = load i8*, i8** %87
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %92
91: ; preds = %83, %75
store i32 1, i32* %10
br label %135
92: ; preds = %83
%93 = load i8**, i8*** %5
%94 = load i32, i32* %8
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i64 @strcmp(i8* %97, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%99 = icmp eq i64 %98, 0
br i1 %99, label %108, label %100
100: ; preds = %92
%101 = load i8**, i8*** %5
%102 = load i32, i32* %8
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8*, i8** %101, i64 %103
%105 = load i8*, i8** %104
%106 = call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %134
108: ; preds = %100, %92
%109 = load i32, i32* %8
%110 = load i32, i32* %4
%111 = sub nsw i32 %110, 2
%112 = icmp sge i32 %109, %111
br i1 %112, label %123, label %113
113: ; preds = %108
%114 = load i8**, i8*** %5
%115 = load i32, i32* %8
%116 = add nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8*, i8** %114, i64 %117
%119 = load i8*, i8** %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 45
br i1 %122, label %123, label %125
123: ; preds = %113, %108
%124 = call i32 (...) @show_error()
store i32 -1, i32* %3
br label %190
125: ; preds = %113
%126 = load i8**, i8*** %5
%127 = load i32, i32* %8
%128 = add nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8*, i8** %126, i64 %129
%131 = load i8*, i8** %130
store i8* %131, i8** %7
%132 = load i32, i32* %8
%133 = add nsw i32 %132, 1
store i32 %133, i32* %8
br label %134
134: ; preds = %125, %100
br label %135
135: ; preds = %134, %91
br label %136
136: ; preds = %135, %74
br label %137
137: ; preds = %136
br label %138
138: ; preds = %137, %34
br label %139
139: ; preds = %138
%140 = load i32, i32* %8
%141 = add nsw i32 %140, 1
store i32 %141, i32* %8
br label %14
142: ; preds = %14
%143 = load i8*, i8** %6
%144 = icmp eq i8* %143, null
br i1 %144, label %145, label %147
145: ; preds = %142
%146 = call i32 (...) @show_error()
store i32 -1, i32* %3
br label %190
147: ; preds = %142
%148 = load i8*, i8** %6
%149 = call i32 @strlen(i8* %148)
%150 = load i32, i32* @PATH_MAX
%151 = sub nsw i32 %150, 5
%152 = icmp sgt i32 %149, %151
br i1 %152, label %153, label %156
153: ; preds = %147
%154 = load i32, i32* @stderr
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
br label %190
156: ; preds = %147
%157 = load i8*, i8** %7
%158 = icmp eq i8* %157, null
br i1 %158, label %159, label %162
159: ; preds = %156
%160 = getelementptr inbounds [61 x i8], [61 x i8]* %11, i64 0, i64 0
%161 = call i32 @strcpy(i8* %160, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %173
162: ; preds = %156
%163 = load i8*, i8** %7
%164 = call i32 @strlen(i8* %163)
%165 = icmp sgt i32 %164, 60
br i1 %165, label %166, label %169
166: ; preds = %162
%167 = load i32, i32* @stderr
%168 = call i32 (i32, i8*, ...) @fprintf(i32 %167, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
store i32 -1, i32* %3
br label %190
169: ; preds = %162
%170 = getelementptr inbounds [61 x i8], [61 x i8]* %11, i64 0, i64 0
%171 = load i8*, i8** %7
%172 = call i32 @strcpy(i8* %170, i8* %171)
br label %173
173: ; preds = %169, %159
%174 = load i8*, i8** %6
%175 = call i32* @fopen(i8* %174, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
store i32* %175, i32** %12
%176 = load i32*, i32** %12
%177 = icmp eq i32* %176, null
br i1 %177, label %178, label %182
178: ; preds = %173
%179 = load i32, i32* @stderr
%180 = load i32, i32* @errno
%181 = call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %180)
store i32 -1, i32* %3
br label %190
182: ; preds = %173
%183 = load i32*, i32** %12
%184 = getelementptr inbounds [61 x i8], [61 x i8]* %11, i64 0, i64 0
%185 = load i32, i32* %9
%186 = load i32, i32* %10
%187 = call i32 @generate_code(i32* %183, i8* %184, i32 %185, i32 %186)
%188 = load i32*, i32** %12
%189 = call i32 @fclose(i32* %188)
store i32 0, i32* %3
br label %190
190: ; preds = %182, %178, %166, %153, %145, %123, %56, %32
%191 = load i32, i32* %3
ret i32 %191
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [7 x i8] c"--zero\00"
@.str.3 = [3 x i8] c"-z\00"
@.str.4 = [9 x i8] c"--static\00"
@.str.5 = [3 x i8] c"-s\00"
@.str.6 = [7 x i8] c"--name\00"
@.str.7 = [3 x i8] c"-n\00"
@PATH_MAX = global i32 0
@stderr = global i32 0
@.str.8 = [37 x i8] c"Generate failed: pathname too lang.\0A\00"
@.str.9 = [5 x i8] c"data\00"
@.str.10 = [42 x i8] c"Generate failed: resource name too lang.\0A\00"
@.str.11 = [3 x i8] c"rb\00"
@.str.12 = [36 x i8] c"Open input file failed: errno: %d.\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [61 x i8]
%4 = getelementptr inbounds [61 x i8], [61 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %78
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = add nsw i32 %0, -2
br label %9
9: ; preds = %6, %68
%10 = phi i32 [ 0, %6 ], [ %73, %68 ]
%11 = phi i32 [ 0, %6 ], [ %72, %68 ]
%12 = phi i32 [ 1, %6 ], [ %74, %68 ]
%13 = phi i8* [ null, %6 ], [ %70, %68 ]
%14 = phi i8* [ null, %6 ], [ %69, %68 ]
%15 = sext i32 %12 to i64
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 45
br i1 %19, label %24, label %20
20: ; preds = %9
%21 = icmp eq i32 %12, %7
br i1 %21, label %68, label %22
22: ; preds = %20
%23 = tail call i32 (...) @show_error()
br label %110
24: ; preds = %9
%25 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %24
%28 = load i8*, i8** %16
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27, %24
%32 = tail call i32 (...) @show_usage()
br label %110
33: ; preds = %27
%34 = load i8*, i8** %16
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %68, label %37
37: ; preds = %33
%38 = load i8*, i8** %16
%39 = tail call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %68, label %41
41: ; preds = %37
%42 = load i8*, i8** %16
%43 = tail call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %68, label %45
45: ; preds = %41
%46 = load i8*, i8** %16
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %68, label %49
49: ; preds = %45
%50 = load i8*, i8** %16
%51 = tail call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %57, label %53
53: ; preds = %49
%54 = load i8*, i8** %16
%55 = tail call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %68
57: ; preds = %53, %49
%58 = icmp slt i32 %12, %8
br i1 %58, label %59, label %66
59: ; preds = %57
%60 = add nsw i32 %12, 1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %1, i64 %61
%63 = load i8*, i8** %62
%64 = load i8, i8* %63
%65 = icmp eq i8 %64, 45
br i1 %65, label %66, label %68
66: ; preds = %59, %57
%67 = tail call i32 (...) @show_error()
br label %110
68: ; preds = %59, %41, %45, %33, %37, %20, %53
%69 = phi i8* [ %14, %53 ], [ %17, %20 ], [ %14, %37 ], [ %14, %33 ], [ %14, %45 ], [ %14, %41 ], [ %14, %59 ]
%70 = phi i8* [ %13, %53 ], [ %13, %20 ], [ %13, %37 ], [ %13, %33 ], [ %13, %45 ], [ %13, %41 ], [ %63, %59 ]
%71 = phi i32 [ %12, %53 ], [ %7, %20 ], [ %12, %37 ], [ %12, %33 ], [ %12, %45 ], [ %12, %41 ], [ %60, %59 ]
%72 = phi i32 [ %11, %53 ], [ %11, %20 ], [ 1, %37 ], [ 1, %33 ], [ %11, %45 ], [ %11, %41 ], [ %11, %59 ]
%73 = phi i32 [ %10, %53 ], [ %10, %20 ], [ %10, %37 ], [ %10, %33 ], [ 1, %45 ], [ 1, %41 ], [ %10, %59 ]
%74 = add nsw i32 %71, 1
%75 = icmp slt i32 %74, %0
br i1 %75, label %9, label %76
76: ; preds = %68
%77 = icmp eq i8* %69, null
br i1 %77, label %78, label %80
78: ; preds = %2, %76
%79 = tail call i32 (...) @show_error()
br label %110
80: ; preds = %76
%81 = tail call i32 @strlen(i8* %69)
%82 = load i32, i32* @PATH_MAX
%83 = add nsw i32 %82, -5
%84 = icmp sgt i32 %81, %83
br i1 %84, label %85, label %88
85: ; preds = %80
%86 = load i32, i32* @stderr
%87 = tail call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
br label %110
88: ; preds = %80
%89 = icmp eq i8* %70, null
br i1 %89, label %90, label %92
90: ; preds = %88
%91 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %100
92: ; preds = %88
%93 = tail call i32 @strlen(i8* %70)
%94 = icmp sgt i32 %93, 60
br i1 %94, label %95, label %98
95: ; preds = %92
%96 = load i32, i32* @stderr
%97 = tail call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
br label %110
98: ; preds = %92
%99 = call i32 @strcpy(i8* %4, i8* %70)
br label %100
100: ; preds = %98, %90
%101 = call i32* @fopen(i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%102 = icmp eq i32* %101, null
br i1 %102, label %103, label %107
103: ; preds = %100
%104 = load i32, i32* @stderr
%105 = load i32, i32* @errno
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %104, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %105)
br label %110
107: ; preds = %100
%108 = call i32 @generate_code(i32* %101, i8* %4, i32 %72, i32 %73)
%109 = call i32 @fclose(i32* %101)
br label %110
110: ; preds = %107, %103, %95, %85, %78, %66, %31, %22
%111 = phi i32 [ -1, %22 ], [ 0, %31 ], [ -1, %66 ], [ -1, %78 ], [ -1, %85 ], [ -1, %103 ], [ 0, %107 ], [ -1, %95 ]
ret i32 %111
}