#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *get_line(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
int main(int argc, char **argv) {
  FILE *in;
  FILE *out_c;
  FILE *out_h;
  if (argc != 4) {
    fprintf(stderr,
            "Syntax:\nnamedump <in-file> <public header> <private header>\n");
    return EXIT_FAILURE;
  }
  in = fopen(argv[1], "rb");
  if (!in) {
    fprintf(stderr, "Failed to open '%s' for reading\n", argv[1]);
    return EXIT_FAILURE;
  }
  out_h = fopen(argv[2], "wb");
  if (!out_h) {
    fprintf(stderr, "Failed to open '%s' for writing\n", argv[2]);
    return EXIT_FAILURE;
  }
  out_c = fopen(argv[3], "wb");
  if (!out_c) {
    fprintf(stderr, "Failed to open '%s' for writing\n", argv[3]);
    return EXIT_FAILURE;
  }
  fprintf(out_c, "char *PDF_NAMES[] =\n{\n\t\"\",\n");
  fprintf(out_h, "enum\n{\n\tPDF_OBJ_ENUM__DUMMY,\n");
  while (!feof(in)) {
    char *line = get_line(in);
    if (*line == 0)
      continue;
    fprintf(out_c, "\t\"%s\",\n", line);
    {
      char *l;
      for (l = line; *l; l++) {
        if (*l == '.' || *l == '-')
          *l = '_';
      }
    }
    fprintf(
        out_h,
        "#define PDF_NAME_%s  ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_%s)\n",
        line, line);
    fprintf(out_h, "\tPDF_OBJ_ENUM_NAME_%s,\n", line);
  }
  fprintf(
      out_h,
      "#define PDF_OBJ_NAME__LIMIT ((pdf_obj "
      "*)(intptr_t)PDF_OBJ_ENUM_NAME__LIMIT)\n\tPDF_OBJ_ENUM_NAME__LIMIT,\n");
  fprintf(out_h, "#define PDF_OBJ_FALSE ((pdf_obj "
                 "*)(intptr_t)PDF_OBJ_ENUM_BOOL_FALSE)\n\tPDF_OBJ_ENUM_BOOL_"
                 "FALSE = PDF_OBJ_ENUM_NAME__LIMIT,\n");
  fprintf(out_h,
          "#define PDF_OBJ_TRUE ((pdf_obj "
          "*)(intptr_t)PDF_OBJ_ENUM_BOOL_TRUE)\n\tPDF_OBJ_ENUM_BOOL_TRUE,\n");
  fprintf(out_h, "#define PDF_OBJ_NULL ((pdf_obj "
                 "*)(intptr_t)PDF_OBJ_ENUM_NULL)\n\tPDF_OBJ_ENUM_NULL,\n");
  fprintf(out_h,
          "#define PDF_OBJ__LIMIT ((pdf_obj "
          "*)(intptr_t)PDF_OBJ_ENUM__LIMIT)\n\tPDF_OBJ_ENUM__LIMIT\n};\n");
  fprintf(out_c, "};\n");
  fclose(out_c);
  fclose(out_h);
  fclose(in);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1199 <main+0x49>
mov    0x2e69(%rip),%rax
mov    (%rax),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1429 <main+0x2d9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe95(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11ed <main+0x9d>
mov    0x2e1d(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1429 <main+0x2d9>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe65(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1241 <main+0xf1>
mov    0x2dc9(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe3b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1429 <main+0x2d9>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe11(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1295 <main+0x145>
mov    0x2d75(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0xde7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1429 <main+0x2d9>
mov    -0x20(%rbp),%rdi
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12d7 <main+0x187>
jmp    1396 <main+0x246>
mov    -0x18(%rbp),%rdi
call   1030 <get_line@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    12f9 <main+0x1a9>
jmp    12b9 <main+0x169>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xdb7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     1361 <main+0x211>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1344 <main+0x1f4>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    134b <main+0x1fb>
mov    -0x38(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1350 <main+0x200>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1317 <main+0x1c7>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xd53(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    12b9 <main+0x169>
mov    -0x28(%rbp),%rdi
lea    0xd80(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdd6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe3f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xf10(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    0x2bac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x4,%edi
jne    12c4 <main+0x164>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0xebb(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     12e6 <main+0x186>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     12fd <main+0x19d>
mov    %rax,%r14
mov    0x18(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     130d <main+0x1ad>
mov    %rax,%r15
lea    0xeb3(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
lea    0xeb6(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
je     1341 <main+0x1e1>
lea    0xf0d(%rip),%rdi
mov    $0x67,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xf5c(%rip),%rdi
mov    $0x7a,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0xfbe(%rip),%rdi
mov    $0x5c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x1002(%rip),%rdi
mov    $0x52,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x103c(%rip),%rdi
mov    $0x5a,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
lea    0x107a(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1080 <fwrite@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x2d0e(%rip),%rax
jmp    1330 <main+0x1d0>
mov    0x2d15(%rip),%rax
mov    (%rax),%rcx
lea    0xd2b(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
call   1080 <fwrite@plt>
jmp    1329 <main+0x1c9>
mov    0x2cf3(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%rbp),%rdx
lea    0xd45(%rip),%rsi
jmp    1322 <main+0x1c2>
mov    0x2cdc(%rip),%rax
mov    (%rax),%rdi
mov    0x10(%rbp),%rdx
jmp    131b <main+0x1bb>
mov    0x2ccc(%rip),%rax
mov    (%rax),%rdi
mov    0x18(%rbp),%rdx
lea    0xd42(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2ca8(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd7f(%rip),%r13
lea    0xdba(%rip),%rbp
jmp    1370 <main+0x210>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    120d <main+0xad>
mov    %rbx,%rdi
call   1030 <get_line@plt>
cmpb   $0x0,(%rax)
je     1360 <main+0x200>
mov    %rax,%r12
mov    %r15,%rdi
lea    0xd35(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %r12,%rax
jmp    13a7 <main+0x247>
nopl   0x0(%rax)
movb   $0x5f,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x2d(%rcx),%edx
cmp    $0x2,%dl
jb     13a0 <main+0x240>
test   %cl,%cl
jne    13a3 <main+0x243>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1360 <main+0x200>

LLVM IR (-O0):
@stderr = global i32* null
@.str = [61 x i8] c"Syntax:\0Anamedump <in-file> <public header> <private header>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [33 x i8] c"Failed to open '%s' for reading\0A\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [33 x i8] c"Failed to open '%s' for writing\0A\00"
@.str.5 = [28 x i8] c"char *PDF_NAMES[] =\0A{\0A\09\22\22,\0A\00"
@.str.6 = [30 x i8] c"enum\0A{\0A\09PDF_OBJ_ENUM__DUMMY,\0A\00"
@.str.7 = [8 x i8] c"\09\22%s\22,\0A\00"
@.str.8 = [66 x i8] c"#define PDF_NAME_%s ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_%s)\0A\00"
@.str.9 = [24 x i8] c"\09PDF_OBJ_ENUM_NAME_%s,\0A\00"
@.str.10 = [104 x i8] c"#define PDF_OBJ_NAME__LIMIT ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME__LIMIT)\0A\09PDF_OBJ_ENUM_NAME__LIMIT,\0A\00"
@.str.11 = [123 x i8] c"#define PDF_OBJ_FALSE ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_BOOL_FALSE)\0A\09PDF_OBJ_ENUM_BOOL_FALSE = PDF_OBJ_ENUM_NAME__LIMIT,\0A\00"
@.str.12 = [93 x i8] c"#define PDF_OBJ_TRUE ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_BOOL_TRUE)\0A\09PDF_OBJ_ENUM_BOOL_TRUE,\0A\00"
@.str.13 = [83 x i8] c"#define PDF_OBJ_NULL ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NULL)\0A\09PDF_OBJ_ENUM_NULL,\0A\00"
@.str.14 = [91 x i8] c"#define PDF_OBJ__LIMIT ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM__LIMIT)\0A\09PDF_OBJ_ENUM__LIMIT\0A};\0A\00"
@.str.15 = [4 x i8] c"};\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32*, i32** @stderr
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %3
br label %130
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %6
%22 = load i32*, i32** %6
%23 = icmp ne i32* %22, null
br i1 %23, label %31, label %24
24: ; preds = %17
%25 = load i32*, i32** @stderr
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @EXIT_FAILURE
store i32 %30, i32* %3
br label %130
31: ; preds = %17
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %35, i32** %8
%36 = load i32*, i32** %8
%37 = icmp ne i32* %36, null
br i1 %37, label %45, label %38
38: ; preds = %31
%39 = load i32*, i32** @stderr
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = load i32, i32* @EXIT_FAILURE
store i32 %44, i32* %3
br label %130
45: ; preds = %31
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 3
%48 = load i8*, i8** %47
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %49, i32** %7
%50 = load i32*, i32** %7
%51 = icmp ne i32* %50, null
br i1 %51, label %59, label %52
52: ; preds = %45
%53 = load i32*, i32** @stderr
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 3
%56 = load i8*, i8** %55
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %56)
%58 = load i32, i32* @EXIT_FAILURE
store i32 %58, i32* %3
br label %130
59: ; preds = %45
%60 = load i32*, i32** %7
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%62 = load i32*, i32** %8
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
br label %64
64: ; preds = %102, %76, %59
%65 = load i32*, i32** %6
%66 = call i32 @feof(i32* %65)
%67 = icmp ne i32 %66, 0
%68 = xor i1 %67, true
br i1 %68, label %69, label %110
69: ; preds = %64
%70 = load i32*, i32** %6
%71 = call i8* @get_line(i32* %70)
store i8* %71, i8** %9
%72 = load i8*, i8** %9
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %69
br label %64
77: ; preds = %69
%78 = load i32*, i32** %7
%79 = load i8*, i8** %9
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %79)
%81 = load i8*, i8** %9
store i8* %81, i8** %10
br label %82
82: ; preds = %99, %77
%83 = load i8*, i8** %10
%84 = load i8, i8* %83
%85 = icmp ne i8 %84, 0
br i1 %85, label %86, label %102
86: ; preds = %82
%87 = load i8*, i8** %10
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 46
br i1 %90, label %96, label %91
91: ; preds = %86
%92 = load i8*, i8** %10
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 45
br i1 %95, label %96, label %98
96: ; preds = %91, %86
%97 = load i8*, i8** %10
store i8 95, i8* %97
br label %98
98: ; preds = %96, %91
br label %99
99: ; preds = %98
%100 = load i8*, i8** %10
%101 = getelementptr inbounds i8, i8* %100, i32 1
store i8* %101, i8** %10
br label %82
102: ; preds = %82
%103 = load i32*, i32** %8
%104 = load i8*, i8** %9
%105 = load i8*, i8** %9
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %103, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0), i8* %104, i8* %105)
%107 = load i32*, i32** %8
%108 = load i8*, i8** %9
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i8* %108)
br label %64
110: ; preds = %64
%111 = load i32*, i32** %8
%112 = call i32 (i32*, i8*, ...) @fprintf(i32* %111, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.10, i64 0, i64 0))
%113 = load i32*, i32** %8
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %113, i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str.11, i64 0, i64 0))
%115 = load i32*, i32** %8
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.12, i64 0, i64 0))
%117 = load i32*, i32** %8
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %117, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.13, i64 0, i64 0))
%119 = load i32*, i32** %8
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %119, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.14, i64 0, i64 0))
%121 = load i32*, i32** %7
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%123 = load i32*, i32** %7
%124 = call i32 @fclose(i32* %123)
%125 = load i32*, i32** %8
%126 = call i32 @fclose(i32* %125)
%127 = load i32*, i32** %6
%128 = call i32 @fclose(i32* %127)
%129 = load i32, i32* @EXIT_SUCCESS
store i32 %129, i32* %3
br label %130
130: ; preds = %110, %52, %38, %24, %13
%131 = load i32, i32* %3
ret i32 %131
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [61 x i8] c"Syntax:\0Anamedump <in-file> <public header> <private header>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [33 x i8] c"Failed to open '%s' for reading\0A\00"
@.str.3 = [3 x i8] c"wb\00"
@.str.4 = [33 x i8] c"Failed to open '%s' for writing\0A\00"
@.str.5 = [28 x i8] c"char *PDF_NAMES[] =\0A{\0A\09\22\22,\0A\00"
@.str.6 = [30 x i8] c"enum\0A{\0A\09PDF_OBJ_ENUM__DUMMY,\0A\00"
@.str.7 = [8 x i8] c"\09\22%s\22,\0A\00"
@.str.8 = [66 x i8] c"#define PDF_NAME_%s ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME_%s)\0A\00"
@.str.9 = [24 x i8] c"\09PDF_OBJ_ENUM_NAME_%s,\0A\00"
@.str.10 = [104 x i8] c"#define PDF_OBJ_NAME__LIMIT ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NAME__LIMIT)\0A\09PDF_OBJ_ENUM_NAME__LIMIT,\0A\00"
@.str.11 = [123 x i8] c"#define PDF_OBJ_FALSE ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_BOOL_FALSE)\0A\09PDF_OBJ_ENUM_BOOL_FALSE = PDF_OBJ_ENUM_NAME__LIMIT,\0A\00"
@.str.12 = [93 x i8] c"#define PDF_OBJ_TRUE ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_BOOL_TRUE)\0A\09PDF_OBJ_ENUM_BOOL_TRUE,\0A\00"
@.str.13 = [83 x i8] c"#define PDF_OBJ_NULL ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM_NULL)\0A\09PDF_OBJ_ENUM_NULL,\0A\00"
@.str.14 = [91 x i8] c"#define PDF_OBJ__LIMIT ((pdf_obj *)(intptr_t)PDF_OBJ_ENUM__LIMIT)\0A\09PDF_OBJ_ENUM__LIMIT\0A};\0A\00"
@.str.15 = [4 x i8] c"};\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32*, i32** @stderr
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 60, i64 1, i32* %5)
br label %67
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i32*, i32** @stderr
%14 = load i8*, i8** %8
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %67
16: ; preds = %7
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i32*, i32** @stderr
%23 = load i8*, i8** %17
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %23)
br label %67
25: ; preds = %16
%26 = getelementptr inbounds i8*, i8** %1, i64 3
%27 = load i8*, i8** %26
%28 = tail call i32* @fopen(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %34
30: ; preds = %25
%31 = load i32*, i32** @stderr
%32 = load i8*, i8** %26
%33 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %32)
br label %67
34: ; preds = %25
%35 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i64 27, i64 1, i32* %28)
%36 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i64 29, i64 1, i32* %19)
%37 = tail call i32 @feof(i32* %10)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %57
39: ; preds = %34, %54
%40 = tail call i8* @get_line(i32* %10)
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 0
br i1 %42, label %54, label %43
43: ; preds = %39
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %40)
br label %45
45: ; preds = %49, %43
%46 = phi i8* [ %40, %43 ], [ %50, %49 ]
%47 = load i8, i8* %46
switch i8 %47, label %49 [
i8 0, label %51
i8 46, label %48
i8 45, label %48
]
48: ; preds = %45, %45
store i8 95, i8* %46
br label %49
49: ; preds = %45, %48
%50 = getelementptr inbounds i8, i8* %46, i64 1
br label %45
51: ; preds = %45
%52 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0), i8* %40, i8* %40)
%53 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i8* %40)
br label %54
54: ; preds = %39, %51
%55 = tail call i32 @feof(i32* %10)
%56 = icmp eq i32 %55, 0
br i1 %56, label %39, label %57
57: ; preds = %54, %34
%58 = tail call i64 @fwrite(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.10, i64 0, i64 0), i64 103, i64 1, i32* %19)
%59 = tail call i64 @fwrite(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str.11, i64 0, i64 0), i64 122, i64 1, i32* %19)
%60 = tail call i64 @fwrite(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.12, i64 0, i64 0), i64 92, i64 1, i32* %19)
%61 = tail call i64 @fwrite(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.13, i64 0, i64 0), i64 82, i64 1, i32* %19)
%62 = tail call i64 @fwrite(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.14, i64 0, i64 0), i64 90, i64 1, i32* %19)
%63 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i64 3, i64 1, i32* %28)
%64 = tail call i32 @fclose(i32* %28)
%65 = tail call i32 @fclose(i32* %19)
%66 = tail call i32 @fclose(i32* %10)
br label %67
67: ; preds = %57, %30, %21, %12, %4
%68 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %57 ], [ @EXIT_FAILURE, %30 ], [ @EXIT_FAILURE, %21 ], [ @EXIT_FAILURE, %12 ]
%69 = load i32, i32* %68
ret i32 %69
}