#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 */
struct stat {
  scalar_t__ st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ fstat(int /*<<< orphan*/, struct stat *);
char *generate_name(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  FILE *outfile;
  FILE *infile;
  char **argp;
  if (argc == 1) {
    printf("\x1B[31;1m%s: Arguments required!\x1B[37;0m\r\n", argv[0]);
    exit(1);
  }
  if (argc == 2 &&
      (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) {
    printf("\x1B[1m%s: make a header file containing files in strings\r\n",
           argv[0]);
    printf("Usage:\x1B[0m \x1B[32m%s \x1B[37;0m <\x1B[34moutfile\x1B[37m> "
           "<\x1B[34minfile\x1B[37m> [<\x1B[34minfile\x1B[37m>...]\r\n",
           argv[0]);
    printf("\r\n");
    printf("\t\x1B[34moutfile\x1B[37m\t\tThe file to output to. \x1B[31mDon't "
           "forget the extension!\x1B[37m\r\n");
    printf("\t\x1B[34minfile\x1B[37m...\tThe input files.\r\n");
    exit(0);
  }
  if (argc < 3) {
    printf("\x1B[31;1m%s: Too few arguments!\x1B[37;0m\r\n", argv[0]);
    exit(2);
  }
  outfile = fopen(argv[1], "w");
  if (outfile == NULL) {
    printf("\x1B[31;1m%s: Can't write to outfile (%s)!\x1B[37;0m\r\n", argv[0],
           argv[1]);
    exit(4);
  }
  printf("Writing to \"%s\".\r\n", argv[1]);
  fprintf(outfile, "/* Generated by %s. DO NOT EDIT */\r\n\r\n#pragma once\r\n",
          argv[0]);
  argp = &argv[1];
  while (*++argp != NULL) {
    int ch;
    unsigned int filesize, i;
    struct stat st;
    printf("Writing file \"%s\"\r\n", *argp);
    infile = fopen(*argp, "rb");
    if (infile == NULL) {
      printf("\x1B[31;1m%s: Can't read from infile (%s)!\x1B[37;0m\r\n",
             argv[0], *argp);
      exit(7);
    }
    if (fstat(fileno(infile), &st)) {
      printf("\x1B[31;1m%s: fstat failed (%s)!\x1B[37;0m\r\n", argv[0], *argp);
      return 8;
    }
    filesize = (unsigned)(st.st_size);
    fprintf(outfile, "uint8_t %s[%u] = {", generate_name(argv[0], *argp),
            filesize);
    for (i = 0; i < filesize; i++) {
      ch = fgetc(infile);
      if (ch == EOF) {
        printf("\x1B[31;1m%s: Error while reading \"%s\"!\x1B[37;0m\r\n",
               argv[0], *argp);
        return 9;
      }
      if (i)
        fprintf(outfile, ",");
      fprintf(outfile, "0x%02X", ch);
    }
    fprintf(outfile, "};\r\n");
    fclose(infile);
  }
  fprintf(outfile, "/* EOF */\r\n");
  fclose(outfile);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11df <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1280 <main+0xe0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe30(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1225 <main+0x85>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe15(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1280 <main+0xe0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf9f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
cmpl   $0x3,-0x8(%rbp)
jge    12a9 <main+0x109>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb1(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12f3 <main+0x153>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x4,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,0x8(%rax)
je     14dd <main+0x33d>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xe8d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13a5 <main+0x205>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x7,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1090 <fileno@plt>
mov    %eax,%edi
lea    -0x40(%rbp),%rsi
call   10c0 <fstat@plt>
cmp    $0x0,%rax
je     13eb <main+0x24b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x8,-0x4(%rbp)
jmp    14ff <main+0x35f>
mov    -0x40(%rbp),%rax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
call   1030 <generate_name@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rdx
mov    -0x30(%rbp),%ecx
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jae    14bd <main+0x31d>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2b9a(%rip),%rcx
cmp    (%rcx),%eax
jne    147e <main+0x2de>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x9,-0x4(%rbp)
jmp    14ff <main+0x35f>
cmpl   $0x0,-0x34(%rbp)
je     149a <main+0x2fa>
mov    -0x18(%rbp),%rdi
lea    0xe01(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xdee(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    142c <main+0x28c>
mov    -0x18(%rbp),%rdi
lea    0xdd5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
jmp    132e <main+0x18e>
mov    -0x18(%rbp),%rdi
lea    0xdba(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r15
cmp    $0x2,%edi
je     13ff <main+0x22f>
cmp    $0x1,%edi
je     1491 <main+0x2c1>
cmp    $0x2,%edi
jle    1476 <main+0x2a6>
mov    0x8(%r15),%rdi
lea    0xee7(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     14ac <main+0x2dc>
mov    %rax,%rbx
mov    0x8(%r15),%rsi
lea    0xefe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r15),%rdx
lea    0xf00(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x10(%r15),%rsi
test   %rsi,%rsi
je     13b9 <main+0x1e9>
lea    0x10(%r15),%r14
lea    0xf13(%rip),%rdi
lea    0xf20(%rip),%rbp
mov    %r15,0x8(%rsp)
jmp    12b5 <main+0xe5>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xf9f(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x8(%r14),%rsi
add    $0x8,%r14
test   %rsi,%rsi
mov    0x8(%rsp),%r15
lea    0xec1(%rip),%rdi
lea    0xece(%rip),%rbp
je     13b9 <main+0x1e9>
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r14),%rdi
mov    %rbp,%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     13e1 <main+0x211>
mov    %rax,%r13
mov    %rax,%rdi
call   10b0 <fileno@plt>
mov    %eax,%edi
lea    0x10(%rsp),%rsi
call   10f0 <fstat@plt>
test   %rax,%rax
jne    13ab <main+0x1db>
mov    0x10(%rsp),%ebp
mov    (%r15),%rdi
mov    (%r14),%rsi
call   1040 <generate_name@plt>
mov    %rbx,%rdi
lea    0xecf(%rip),%rsi
mov    %rax,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
test   %ebp,%ebp
je     1270 <main+0xa0>
xor    %r12d,%r12d
jmp    1351 <main+0x181>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
lea    0xedf(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
add    $0x1,%r12d
cmp    %r12d,%ebp
je     1270 <main+0xa0>
mov    %r13,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r15d
mov    0x2c85(%rip),%rax
cmp    (%rax),%r15d
je     137c <main+0x1ac>
test   %r12d,%r12d
je     1330 <main+0x160>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
jmp    1330 <main+0x160>
mov    $0x9,%ebx
lea    0xe63(%rip),%rdi
mov    0x8(%rsp),%r15
mov    (%r15),%rsi
mov    (%r14),%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x8,%ebx
lea    0xdfa(%rip),%rdi
jmp    138d <main+0x1bd>
lea    0xe65(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    (%r15),%rsi
mov    (%r14),%rdx
lea    0xd92(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x7,%edi
call   10d0 <exit@plt>
mov    0x8(%r15),%rdi
lea    0xc1e(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1429 <main+0x259>
mov    0x8(%r15),%rdi
lea    0xc0c(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1476 <main+0x2a6>
mov    (%r15),%rsi
lea    0xbff(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r15),%rsi
lea    0xc27(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
lea    0xdd3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe19(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    (%r15),%rsi
lea    0xc47(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    (%r15),%rsi
lea    0xb65(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    (%r15),%rsi
mov    0x8(%r15),%rdx
lea    0xc36(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x4,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [40 x i8] c"\1B[31;1m%s: Arguments required!\1B[37;0m\0D\0A\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [57 x i8] c"\1B[1m%s: make a header file containing files in strings\0D\0A\00"
@.str.4 = [92 x i8] c"Usage:\1B[0m \1B[32m%s \1B[37;0m <\1B[34moutfile\1B[37m> <\1B[34minfile\1B[37m> [<\1B[34minfile\1B[37m>...]\0D\0A\00"
@.str.5 = [3 x i8] c"\0D\0A\00"
@.str.6 = [83 x i8] c"\09\1B[34moutfile\1B[37m\09\09The file to output to. \1B[31mDon't forget the extension!\1B[37m\0D\0A\00"
@.str.7 = [40 x i8] c"\09\1B[34minfile\1B[37m...\09The input files.\0D\0A\00"
@.str.8 = [39 x i8] c"\1B[31;1m%s: Too few arguments!\1B[37;0m\0D\0A\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [49 x i8] c"\1B[31;1m%s: Can't write to outfile (%s)!\1B[37;0m\0D\0A\00"
@.str.11 = [19 x i8] c"Writing to \22%s\22.\0D\0A\00"
@.str.12 = [53 x i8] c"/* Generated by %s. DO NOT EDIT */\0D\0A\0D\0A#pragma once\0D\0A\00"
@.str.13 = [20 x i8] c"Writing file \22%s\22\0D\0A\00"
@.str.14 = [3 x i8] c"rb\00"
@.str.15 = [49 x i8] c"\1B[31;1m%s: Can't read from infile (%s)!\1B[37;0m\0D\0A\00"
@.str.16 = [39 x i8] c"\1B[31;1m%s: fstat failed (%s)!\1B[37;0m\0D\0A\00"
@.str.17 = [19 x i8] c"uint8_t %s[%u] = {\00"
@EOF = global i32 0
@.str.18 = [46 x i8] c"\1B[31;1m%s: Error while reading \22%s\22!\1B[37;0m\0D\0A\00"
@.str.19 = [2 x i8] c",\00"
@.str.20 = [7 x i8] c"0x%02X\00"
@.str.21 = [5 x i8] c"};\0D\0A\00"
@.str.22 = [12 x i8] c"/* EOF */\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %49
24: ; preds = %21
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %36, label %30
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %49
36: ; preds = %30, %24
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i8* %39)
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 0
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.4, i64 0, i64 0), i8* %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.6, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%48 = call i32 @exit(i32 0)
unreachable
49: ; preds = %30, %21
%50 = load i32, i32* %4
%51 = icmp slt i32 %50, 3
br i1 %51, label %52, label %58
52: ; preds = %49
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 0
%55 = load i8*, i8** %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %55)
%57 = call i32 @exit(i32 2)
unreachable
58: ; preds = %49
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 1
%61 = load i8*, i8** %60
%62 = call i32* @fopen(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %62, i32** %6
%63 = load i32*, i32** %6
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %74
65: ; preds = %58
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i64 0
%68 = load i8*, i8** %67
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %68, i8* %71)
%73 = call i32 @exit(i32 4)
unreachable
74: ; preds = %58
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %77)
%79 = load i32*, i32** %6
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0), i8* %82)
%84 = load i8**, i8*** %5
%85 = getelementptr inbounds i8*, i8** %84, i64 1
store i8** %85, i8*** %8
br label %86
86: ; preds = %163, %74
%87 = load i8**, i8*** %8
%88 = getelementptr inbounds i8*, i8** %87, i32 1
store i8** %88, i8*** %8
%89 = load i8*, i8** %88
%90 = icmp ne i8* %89, null
br i1 %90, label %91, label %168
91: ; preds = %86
%92 = load i8**, i8*** %8
%93 = load i8*, i8** %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %93)
%95 = load i8**, i8*** %8
%96 = load i8*, i8** %95
%97 = call i32* @fopen(i8* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
store i32* %97, i32** %7
%98 = load i32*, i32** %7
%99 = icmp eq i32* %98, null
br i1 %99, label %100, label %108
100: ; preds = %91
%101 = load i8**, i8*** %5
%102 = getelementptr inbounds i8*, i8** %101, i64 0
%103 = load i8*, i8** %102
%104 = load i8**, i8*** %8
%105 = load i8*, i8** %104
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0), i8* %103, i8* %105)
%107 = call i32 @exit(i32 7)
unreachable
108: ; preds = %91
%109 = load i32*, i32** %7
%110 = call i32 @fileno(i32* %109)
%111 = call i64 @fstat(i32 %110, %struct.stat* %12)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %120
113: ; preds = %108
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 0
%116 = load i8*, i8** %115
%117 = load i8**, i8*** %8
%118 = load i8*, i8** %117
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.16, i64 0, i64 0), i8* %116, i8* %118)
store i32 8, i32* %3
br label %174
120: ; preds = %108
%121 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%122 = load i64, i64* %121
%123 = trunc i64 %122 to i32
store i32 %123, i32* %10
%124 = load i32*, i32** %6
%125 = load i8**, i8*** %5
%126 = getelementptr inbounds i8*, i8** %125, i64 0
%127 = load i8*, i8** %126
%128 = load i8**, i8*** %8
%129 = load i8*, i8** %128
%130 = call i8* @generate_name(i8* %127, i8* %129)
%131 = load i32, i32* %10
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* %130, i32 %131)
store i32 0, i32* %11
br label %133
133: ; preds = %160, %120
%134 = load i32, i32* %11
%135 = load i32, i32* %10
%136 = icmp ult i32 %134, %135
br i1 %136, label %137, label %163
137: ; preds = %133
%138 = load i32*, i32** %7
%139 = call i32 @fgetc(i32* %138)
store i32 %139, i32* %9
%140 = load i32, i32* %9
%141 = load i32, i32* @EOF
%142 = icmp eq i32 %140, %141
br i1 %142, label %143, label %150
143: ; preds = %137
%144 = load i8**, i8*** %5
%145 = getelementptr inbounds i8*, i8** %144, i64 0
%146 = load i8*, i8** %145
%147 = load i8**, i8*** %8
%148 = load i8*, i8** %147
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0), i8* %146, i8* %148)
store i32 9, i32* %3
br label %174
150: ; preds = %137
%151 = load i32, i32* %11
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %156
153: ; preds = %150
%154 = load i32*, i32** %6
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %154, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
br label %156
156: ; preds = %153, %150
%157 = load i32*, i32** %6
%158 = load i32, i32* %9
%159 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32 %158)
br label %160
160: ; preds = %156
%161 = load i32, i32* %11
%162 = add i32 %161, 1
store i32 %162, i32* %11
br label %133
163: ; preds = %133
%164 = load i32*, i32** %6
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %164, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%166 = load i32*, i32** %7
%167 = call i32 @fclose(i32* %166)
br label %86
168: ; preds = %86
%169 = load i32*, i32** %6
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %169, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%171 = load i32*, i32** %6
%172 = call i32 @fclose(i32* %171)
%173 = call i32 @exit(i32 0)
unreachable
174: ; preds = %143, %113
%175 = load i32, i32* %3
ret i32 %175
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [40 x i8] c"\1B[31;1m%s: Arguments required!\1B[37;0m\0D\0A\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [57 x i8] c"\1B[1m%s: make a header file containing files in strings\0D\0A\00"
@.str.4 = [92 x i8] c"Usage:\1B[0m \1B[32m%s \1B[37;0m <\1B[34moutfile\1B[37m> <\1B[34minfile\1B[37m> [<\1B[34minfile\1B[37m>...]\0D\0A\00"
@.str.8 = [39 x i8] c"\1B[31;1m%s: Too few arguments!\1B[37;0m\0D\0A\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [49 x i8] c"\1B[31;1m%s: Can't write to outfile (%s)!\1B[37;0m\0D\0A\00"
@.str.11 = [19 x i8] c"Writing to \22%s\22.\0D\0A\00"
@.str.12 = [53 x i8] c"/* Generated by %s. DO NOT EDIT */\0D\0A\0D\0A#pragma once\0D\0A\00"
@.str.13 = [20 x i8] c"Writing file \22%s\22\0D\0A\00"
@.str.14 = [3 x i8] c"rb\00"
@.str.15 = [49 x i8] c"\1B[31;1m%s: Can't read from infile (%s)!\1B[37;0m\0D\0A\00"
@.str.16 = [39 x i8] c"\1B[31;1m%s: fstat failed (%s)!\1B[37;0m\0D\0A\00"
@.str.17 = [19 x i8] c"uint8_t %s[%u] = {\00"
@EOF = global i32 0
@.str.18 = [46 x i8] c"\1B[31;1m%s: Error while reading \22%s\22!\1B[37;0m\0D\0A\00"
@.str.20 = [7 x i8] c"0x%02X\00"
@.str.21 = [5 x i8] c"};\0D\0A\00"
@.str.22 = [12 x i8] c"/* EOF */\0D\0A\00"
@str = [2 x i8] c"\0D\00"
@str.23 = [82 x i8] c"\09\1B[34moutfile\1B[37m\09\09The file to output to. \1B[31mDon't forget the extension!\1B[37m\0D\00"
@str.24 = [39 x i8] c"\09\1B[34minfile\1B[37m...\09The input files.\0D\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
switch i32 %0, label %26 [
i32 1, label %4
i32 2, label %8
]
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = load i8*, i8** %9
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %13, %8
%18 = load i8*, i8** %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.23, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.24, i64 0, i64 0))
%25 = tail call i32 @exit(i32 0)
unreachable
26: ; preds = %2
%27 = icmp slt i32 %0, 3
br i1 %27, label %28, label %32
28: ; preds = %13, %26
%29 = load i8*, i8** %1
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %29)
%31 = tail call i32 @exit(i32 2)
unreachable
32: ; preds = %26
%33 = getelementptr inbounds i8*, i8** %1, i64 1
%34 = load i8*, i8** %33
%35 = tail call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %42
37: ; preds = %32
%38 = load i8*, i8** %1
%39 = load i8*, i8** %33
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.10, i64 0, i64 0), i8* %38, i8* %39)
%41 = tail call i32 @exit(i32 4)
unreachable
42: ; preds = %32
%43 = load i8*, i8** %33
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %43)
%45 = load i8*, i8** %1
%46 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0), i8* %45)
%47 = getelementptr inbounds i8*, i8** %1, i64 2
%48 = load i8*, i8** %47
%49 = icmp eq i8* %48, null
br i1 %49, label %96, label %50
50: ; preds = %42
%51 = bitcast %struct.stat* %3 to i8*
%52 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %53
53: ; preds = %50, %90
%54 = phi i8* [ %48, %50 ], [ %94, %90 ]
%55 = phi i8** [ %47, %50 ], [ %93, %90 ]
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i8* %54)
%57 = load i8*, i8** %55
%58 = tail call i32* @fopen(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %65
60: ; preds = %53
%61 = load i8*, i8** %1
%62 = load i8*, i8** %55
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.15, i64 0, i64 0), i8* %61, i8* %62)
%64 = tail call i32 @exit(i32 7)
unreachable
65: ; preds = %53
%66 = tail call i32 @fileno(i32* %58)
%67 = call i64 @fstat(i32 %66, %struct.stat* %3)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %100
69: ; preds = %65
%70 = load i64, i64* %52
%71 = trunc i64 %70 to i32
%72 = load i8*, i8** %1
%73 = load i8*, i8** %55
%74 = tail call i8* @generate_name(i8* %72, i8* %73)
%75 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.17, i64 0, i64 0), i8* %74, i32 %71)
%76 = icmp eq i32 %71, 0
br i1 %76, label %90, label %77
77: ; preds = %69, %86
%78 = phi i32 [ %88, %86 ], [ 0, %69 ]
%79 = tail call i32 @fgetc(i32* %58)
%80 = load i32, i32* @EOF
%81 = icmp eq i32 %79, %80
br i1 %81, label %100, label %82
82: ; preds = %77
%83 = icmp eq i32 %78, 0
br i1 %83, label %86, label %84
84: ; preds = %82
%85 = tail call i32 @fputc(i32 44, i32* %35)
br label %86
86: ; preds = %84, %82
%87 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32 %79)
%88 = add nuw i32 %78, 1
%89 = icmp eq i32 %88, %71
br i1 %89, label %90, label %77
90: ; preds = %86, %69
%91 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), i64 4, i64 1, i32* %35)
%92 = tail call i32 @fclose(i32* %58)
%93 = getelementptr inbounds i8*, i8** %55, i64 1
%94 = load i8*, i8** %93
%95 = icmp eq i8* %94, null
br i1 %95, label %96, label %53
96: ; preds = %90, %42
%97 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), i64 11, i64 1, i32* %35)
%98 = tail call i32 @fclose(i32* %35)
%99 = tail call i32 @exit(i32 0)
unreachable
100: ; preds = %65, %77
%101 = phi i8* [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0), %77 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.16, i64 0, i64 0), %65 ]
%102 = phi i32 [ 9, %77 ], [ 8, %65 ]
%103 = load i8*, i8** %1
%104 = load i8*, i8** %55
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %101, i8* %103, i8* %104)
ret i32 %102
}