#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 /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int getopt(int, char **, char *);
int /*<<< orphan*/ printusage();
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  const char *outfile, *cssName = "myCSS", *infile;
  extern char *optarg;
  extern int optind;
  int c;
  FILE *f, *fin;
  long i, sizeIn, sizeOut, offs, inComment = 0;
  int append = 0;
  char ch;
  while ((c = getopt(argc, argv, "?ao:n:")) != -1) {
    switch (c) {
    case 'a':
      append = 1;
      break;
    case 'o':
      outfile = optarg;
      break;
    case 'n':
      cssName = optarg;
      break;
    case '?':
    case 'h':
    default:
      printusage();
      exit(1);
    }
  }
  if (optind == argc) {
    printusage();
    exit(1);
  }
  infile = argv[optind];
  if (outfile == NULL) {
    printusage();
    exit(1);
  }
  if ((fin = fopen(infile, "r")) == NULL) {
    fprintf(stderr, "%s: %s\n", infile, strerror(errno));
    exit(1);
  }
  if ((f = fopen(outfile, append ? "a" : "w")) == NULL) {
    fprintf(stderr, "%s: %s\n", outfile, strerror(errno));
    fclose(fin);
    exit(1);
  }
  fseek(fin, 0, SEEK_END);
  sizeIn = ftell(fin);
  fseek(fin, 0, SEEK_SET);
  fprintf(f, "/* File generated by agar bundlecss */\n");
  fprintf(f, "const char *%s_Data = \n\t\"", cssName);
  for (i = 0, offs = 0, sizeOut = 0; i < sizeIn; i++) {
    fread(&ch, 1, 1, fin);
    if (offs == 0 && ch == '#') {
      inComment = 1;
    } else if (ch == '\n') {
      if (!inComment && offs > 0) {
        fputs("\\n\"\n\t\"", f);
        sizeOut++;
      }
      offs = 0;
      inComment = 0;
      continue;
    }
    if (inComment || (ch == '\t' && offs == 0)) {
      offs++;
      continue;
    }
    if (ch == '"') {
      fputs("\\\"", f);
      sizeOut += 2;
    } else {
      fputc(ch, f);
      sizeOut++;
    }
    offs++;
  }
  fprintf(f, "\";\n\n");
  fprintf(f, "AG_StaticCSS %s = {\n", cssName);
  fprintf(f, "\t\"%s\",\n", cssName);
  fprintf(f, "\t%ld,\n", sizeOut);
  fprintf(f, "\t&%s_Data,\n", cssName);
  fprintf(f, "\tNULL\n};\n");
  fclose(f);
  fclose(fin);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee4(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdx
call   10c0 <getopt@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0xffffffff,%eax
je     1288 <main+0xc8>
mov    -0x2c(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x30,%eax
ja     1272 <main+0xb2>
mov    -0x78(%rbp),%rax
lea    0xdce(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x6c(%rbp)
jmp    1283 <main+0xc3>
mov    0x2d8a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1283 <main+0xc3>
mov    0x2d77(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1283 <main+0xc3>
jmp    1272 <main+0xb2>
mov    $0x0,%al
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    11f3 <main+0x33>
mov    0x2d29(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    12ab <main+0xeb>
mov    $0x0,%al
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2d02(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12dd <main+0x11d>
mov    $0x0,%al
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x28(%rbp),%rdi
lea    0xde9(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1348 <main+0x188>
mov    0x2cce(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x88(%rbp),%rdi
mov    -0x80(%rbp),%rdx
mov    %rax,%rcx
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x6c(%rbp),%ecx
lea    0xd87(%rip),%rsi
lea    0xd7e(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    13d3 <main+0x213>
mov    0x2c52(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    0x2c2e(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x98(%rbp),%rdi
mov    -0x90(%rbp),%rdx
mov    %rax,%rcx
lea    0xd1a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x40(%rbp),%rdi
mov    0x2c0a(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x40(%rbp),%rdi
call   1090 <ftell@plt>
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x2bc1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x38(%rbp),%rdi
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xcde(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x58(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x50(%rbp),%rax
jge    1582 <main+0x3c2>
mov    -0x40(%rbp),%rcx
lea    -0x6d(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmpq   $0x0,-0x60(%rbp)
jne    148f <main+0x2cf>
movsbl -0x6d(%rbp),%eax
cmp    $0x23,%eax
jne    148f <main+0x2cf>
movq   $0x1,-0x68(%rbp)
jmp    14e8 <main+0x328>
movsbl -0x6d(%rbp),%eax
cmp    $0xa,%eax
jne    14e3 <main+0x323>
cmpq   $0x0,-0x68(%rbp)
jne    14ce <main+0x30e>
cmpq   $0x0,-0x60(%rbp)
jle    14ce <main+0x30e>
mov    -0x38(%rbp),%rsi
lea    0xc64(%rip),%rdi
call   1060 <fputs@plt>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
jmp    1571 <main+0x3b1>
jmp    14e8 <main+0x328>
cmpq   $0x0,-0x68(%rbp)
jne    150b <main+0x34b>
movsbl -0x6d(%rbp),%eax
cmp    $0x9,%eax
jne    151c <main+0x35c>
cmpq   $0x0,-0x60(%rbp)
jne    151c <main+0x35c>
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    1571 <main+0x3b1>
movsbl -0x6d(%rbp),%eax
cmp    $0x22,%eax
jne    154a <main+0x38a>
mov    -0x38(%rbp),%rsi
lea    0xbf4(%rip),%rdi
call   1060 <fputs@plt>
mov    -0x58(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x58(%rbp)
jmp    1565 <main+0x3a5>
mov    -0x6d(%rbp),%al
mov    -0x38(%rbp),%rsi
movsbl %al,%edi
call   1070 <fputc@plt>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1448 <main+0x288>
mov    -0x38(%rbp),%rdi
lea    0xb9e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xb8d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xb8c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x58(%rbp),%rdx
lea    0xb7e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xb6f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xb69(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%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,%r14
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xe24(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe1e(%rip),%r15
mov    0x2de9(%rip),%r13
mov    %ebp,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ecx,%ebp
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   10b0 <getopt@plt>
mov    $0x1,%ecx
cmp    $0x61,%eax
je     1200 <main+0x40>
cmp    $0xffffffff,%eax
je     124b <main+0x8b>
cmp    $0x6e,%eax
je     1240 <main+0x80>
cmp    $0x6f,%eax
jne    14ae <main+0x2ee>
mov    0x0(%r13),%r12
jmp    11ef <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13),%rax
mov    %rax,0x10(%rsp)
jmp    11ef <main+0x2f>
mov    0x2d66(%rip),%rax
movslq (%rax),%rax
cmp    %ebx,%eax
je     14ae <main+0x2ee>
test   %r12,%r12
je     14ae <main+0x2ee>
mov    (%r14,%rax,8),%rbx
lea    0xd9c(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     14bf <main+0x2ff>
mov    %rax,%r13
test   %ebp,%ebp
lea    0xd8b(%rip),%rax
lea    0xd82(%rip),%rsi
cmove  %rax,%rsi
mov    %r12,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     14f8 <main+0x338>
mov    %rax,%r15
mov    0x2d34(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
mov    %r13,%rdi
call   1080 <ftell@plt>
mov    %rax,%rbx
mov    0x2cee(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
lea    0xd36(%rip),%rdi
mov    $0x27,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
lea    0xd45(%rip),%rsi
mov    %r15,%rdi
mov    0x10(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rbx,%rbx
jle    13fd <main+0x23d>
xor    %r12d,%r12d
lea    0x7(%rsp),%rbp
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
jmp    1349 <main+0x189>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rcx
test   %r12,%r12
je     13ac <main+0x1ec>
add    $0x1,%r14
mov    %rcx,%r12
add    $0xffffffffffffffff,%rbx
je     1404 <main+0x244>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1030 <fread@plt>
movzbl 0x7(%rsp),%eax
test   %r14,%r14
jne    1371 <main+0x1b1>
mov    $0x1,%ecx
cmp    $0x23,%al
je     1338 <main+0x178>
cmp    $0xa,%al
jne    1330 <main+0x170>
test   %r12,%r12
jne    139e <main+0x1de>
test   %r14,%r14
jle    139e <main+0x1de>
mov    $0x6,%esi
mov    $0x1,%edx
lea    0xccd(%rip),%rdi
mov    %r15,%rcx
call   10d0 <fwrite@plt>
addq   $0x1,0x8(%rsp)
xor    %r14d,%r14d
xor    %r12d,%r12d
add    $0xffffffffffffffff,%rbx
jne    1349 <main+0x189>
jmp    1404 <main+0x244>
cmp    $0x9,%al
jne    13bc <main+0x1fc>
test   %r14,%r14
jne    13bc <main+0x1fc>
xor    %ecx,%ecx
jmp    1338 <main+0x178>
cmp    $0x22,%al
jne    13e1 <main+0x221>
mov    $0x2,%r12d
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc8d(%rip),%rdi
mov    %r15,%rcx
call   10d0 <fwrite@plt>
jmp    13f2 <main+0x232>
movsbl %al,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    $0x1,%r12d
add    %r12,0x8(%rsp)
add    $0x1,%r14
jmp    13a1 <main+0x1e1>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
lea    0xc5c(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
lea    0xc48(%rip),%rsi
mov    %r15,%rdi
mov    0x10(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xc44(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xc38(%rip),%rsi
mov    %r15,%rdi
mov    0x8(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xc29(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xc21(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10d0 <fwrite@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r13,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1050 <printusage@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2b0a(%rip),%rax
movslq (%rax),%rbp
mov    0x2af8(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xb31(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2ad1(%rip),%rax
movslq (%rax),%rbx
mov    0x2abf(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xaf8(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13,%rdi
call   1040 <fclose@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"myCSS\00"
@.str.1 = [7 x i8] c"?ao:n:\00"
@optarg = external global i8*
@optind = external global i32
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [2 x i8] c"w\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.6 = [40 x i8] c"/* File generated by agar bundlecss */\0A\00"
@.str.7 = [26 x i8] c"const char *%s_Data = \0A\09\22\00"
@.str.8 = [7 x i8] c"\\n\22\0A\09\22\00"
@.str.9 = [3 x i8] c"\\\22\00"
@.str.10 = [5 x i8] c"\22;\0A\0A\00"
@.str.11 = [21 x i8] c"AG_StaticCSS %s = {\0A\00"
@.str.12 = [8 x i8] c"\09\22%s\22,\0A\00"
@.str.13 = [7 x i8] c"\09%ld,\0A\00"
@.str.14 = [12 x i8] c"\09&%s_Data,\0A\00"
@.str.15 = [10 x i8] c"\09NULL\0A};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i32
%18 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %7
store i64 0, i64* %16
store i32 0, i32* %17
br label %19
19: ; preds = %35, %2
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @getopt(i32 %20, i8** %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 %22, i32* %9
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %36
24: ; preds = %19
%25 = load i32, i32* %9
switch i32 %25, label %32 [
i32 97, label %26
i32 111, label %27
i32 110, label %29
i32 63, label %31
i32 104, label %31
]
26: ; preds = %24
store i32 1, i32* %17
br label %35
27: ; preds = %24
%28 = load i8*, i8** @optarg
store i8* %28, i8** %6
br label %35
29: ; preds = %24
%30 = load i8*, i8** @optarg
store i8* %30, i8** %7
br label %35
31: ; preds = %24, %24
br label %32
32: ; preds = %24, %31
%33 = call i32 (...) @printusage()
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %29, %27, %26
br label %19
36: ; preds = %19
%37 = load i32, i32* @optind
%38 = load i32, i32* %4
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = call i32 (...) @printusage()
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %36
%44 = load i8**, i8*** %5
%45 = load i32, i32* @optind
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
store i8* %48, i8** %8
%49 = load i8*, i8** %6
%50 = icmp eq i8* %49, null
br i1 %50, label %51, label %54
51: ; preds = %43
%52 = call i32 (...) @printusage()
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %43
%55 = load i8*, i8** %8
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %56, i32** %11
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %67
58: ; preds = %54
%59 = load i32, i32* @stderr
%60 = sext i32 %59 to i64
%61 = inttoptr i64 %60 to i32*
%62 = load i8*, i8** %8
%63 = load i32, i32* @errno
%64 = call i8* @strerror(i32 %63)
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %62, i8* %64)
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %54
%68 = load i8*, i8** %6
%69 = load i32, i32* %17
%70 = icmp ne i32 %69, 0
%71 = zext i1 %70 to i64
%72 = select i1 %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
%73 = call i32* @fopen(i8* %68, i8* %72)
store i32* %73, i32** %10
%74 = icmp eq i32* %73, null
br i1 %74, label %75, label %86
75: ; preds = %67
%76 = load i32, i32* @stderr
%77 = sext i32 %76 to i64
%78 = inttoptr i64 %77 to i32*
%79 = load i8*, i8** %6
%80 = load i32, i32* @errno
%81 = call i8* @strerror(i32 %80)
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %79, i8* %81)
%83 = load i32*, i32** %11
%84 = call i32 @fclose(i32* %83)
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %67
%87 = load i32*, i32** %11
%88 = load i32, i32* @SEEK_END
%89 = call i32 @fseek(i32* %87, i32 0, i32 %88)
%90 = load i32*, i32** %11
%91 = call i64 @ftell(i32* %90)
store i64 %91, i64* %13
%92 = load i32*, i32** %11
%93 = load i32, i32* @SEEK_SET
%94 = call i32 @fseek(i32* %92, i32 0, i32 %93)
%95 = load i32*, i32** %10
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
%97 = load i32*, i32** %10
%98 = load i8*, i8** %7
%99 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %98)
store i64 0, i64* %12
store i64 0, i64* %15
store i64 0, i64* %14
br label %100
100: ; preds = %162, %86
%101 = load i64, i64* %12
%102 = load i64, i64* %13
%103 = icmp slt i64 %101, %102
br i1 %103, label %104, label %165
104: ; preds = %100
%105 = load i32*, i32** %11
%106 = call i32 @fread(i8* %18, i32 1, i32 1, i32* %105)
%107 = load i64, i64* %15
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %114
109: ; preds = %104
%110 = load i8, i8* %18
%111 = sext i8 %110 to i32
%112 = icmp eq i32 %111, 35
br i1 %112, label %113, label %114
113: ; preds = %109
store i64 1, i64* %16
br label %131
114: ; preds = %109, %104
%115 = load i8, i8* %18
%116 = sext i8 %115 to i32
%117 = icmp eq i32 %116, 10
br i1 %117, label %118, label %130
118: ; preds = %114
%119 = load i64, i64* %16
%120 = icmp ne i64 %119, 0
br i1 %120, label %129, label %121
121: ; preds = %118
%122 = load i64, i64* %15
%123 = icmp sgt i64 %122, 0
br i1 %123, label %124, label %129
124: ; preds = %121
%125 = load i32*, i32** %10
%126 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32* %125)
%127 = load i64, i64* %14
%128 = add nsw i64 %127, 1
store i64 %128, i64* %14
br label %129
129: ; preds = %124, %121, %118
store i64 0, i64* %15
store i64 0, i64* %16
br label %162
130: ; preds = %114
br label %131
131: ; preds = %130, %113
%132 = load i64, i64* %16
%133 = icmp ne i64 %132, 0
br i1 %133, label %141, label %134
134: ; preds = %131
%135 = load i8, i8* %18
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 9
br i1 %137, label %138, label %144
138: ; preds = %134
%139 = load i64, i64* %15
%140 = icmp eq i64 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %138, %131
%142 = load i64, i64* %15
%143 = add nsw i64 %142, 1
store i64 %143, i64* %15
br label %162
144: ; preds = %138, %134
%145 = load i8, i8* %18
%146 = sext i8 %145 to i32
%147 = icmp eq i32 %146, 34
br i1 %147, label %148, label %153
148: ; preds = %144
%149 = load i32*, i32** %10
%150 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %149)
%151 = load i64, i64* %14
%152 = add nsw i64 %151, 2
store i64 %152, i64* %14
br label %159
153: ; preds = %144
%154 = load i8, i8* %18
%155 = load i32*, i32** %10
%156 = call i32 @fputc(i8 signext %154, i32* %155)
%157 = load i64, i64* %14
%158 = add nsw i64 %157, 1
store i64 %158, i64* %14
br label %159
159: ; preds = %153, %148
%160 = load i64, i64* %15
%161 = add nsw i64 %160, 1
store i64 %161, i64* %15
br label %162
162: ; preds = %159, %141, %129
%163 = load i64, i64* %12
%164 = add nsw i64 %163, 1
store i64 %164, i64* %12
br label %100
165: ; preds = %100
%166 = load i32*, i32** %10
%167 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%168 = load i32*, i32** %10
%169 = load i8*, i8** %7
%170 = call i32 (i32*, i8*, ...) @fprintf(i32* %168, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %169)
%171 = load i32*, i32** %10
%172 = load i8*, i8** %7
%173 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %172)
%174 = load i32*, i32** %10
%175 = load i64, i64* %14
%176 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i64 %175)
%177 = load i32*, i32** %10
%178 = load i8*, i8** %7
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %177, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8* %178)
%180 = load i32*, i32** %10
%181 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%182 = load i32*, i32** %10
%183 = call i32 @fclose(i32* %182)
%184 = load i32*, i32** %11
%185 = call i32 @fclose(i32* %184)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"myCSS\00"
@.str.1 = [7 x i8] c"?ao:n:\00"
@optarg = external global i8*
@optind = external global i32
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [2 x i8] c"w\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.6 = [40 x i8] c"/* File generated by agar bundlecss */\0A\00"
@.str.7 = [26 x i8] c"const char *%s_Data = \0A\09\22\00"
@.str.8 = [7 x i8] c"\\n\22\0A\09\22\00"
@.str.9 = [3 x i8] c"\\\22\00"
@.str.10 = [5 x i8] c"\22;\0A\0A\00"
@.str.11 = [21 x i8] c"AG_StaticCSS %s = {\0A\00"
@.str.12 = [8 x i8] c"\09\22%s\22,\0A\00"
@.str.13 = [7 x i8] c"\09%ld,\0A\00"
@.str.14 = [12 x i8] c"\09&%s_Data,\0A\00"
@.str.15 = [10 x i8] c"\09NULL\0A};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8
br label %4
4: ; preds = %16, %2
%5 = phi i8* [ %17, %16 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %2 ]
%6 = phi i8* [ %9, %16 ], [ undef, %2 ]
%7 = phi i32 [ %12, %16 ], [ 0, %2 ]
br label %8
8: ; preds = %4, %14
%9 = phi i8* [ %6, %4 ], [ %15, %14 ]
%10 = phi i32 [ %7, %4 ], [ %12, %14 ]
br label %11
11: ; preds = %8, %11
%12 = phi i32 [ 1, %11 ], [ %10, %8 ]
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
switch i32 %13, label %18 [
i32 -1, label %21
i32 97, label %11
i32 111, label %14
i32 110, label %16
]
14: ; preds = %11
%15 = load i8*, i8** @optarg
br label %8
16: ; preds = %11
%17 = load i8*, i8** @optarg
br label %4
18: ; preds = %11
%19 = tail call i32 (...) @printusage()
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %11
%22 = load i32, i32* @optind
%23 = icmp eq i32 %22, %0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = tail call i32 (...) @printusage()
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %21
%28 = sext i32 %22 to i64
%29 = getelementptr inbounds i8*, i8** %1, i64 %28
%30 = load i8*, i8** %29
%31 = icmp eq i8* %9, null
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = tail call i32 (...) @printusage()
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %27
%36 = tail call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i32*
%42 = load i32, i32* @errno
%43 = tail call i8* @strerror(i32 %42)
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %30, i8* %43)
%45 = tail call i32 @exit(i32 1)
unreachable
46: ; preds = %35
%47 = icmp eq i32 %12, 0
%48 = select i1 %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0)
%49 = tail call i32* @fopen(i8* %9, i8* %48)
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %60
51: ; preds = %46
%52 = load i32, i32* @stderr
%53 = sext i32 %52 to i64
%54 = inttoptr i64 %53 to i32*
%55 = load i32, i32* @errno
%56 = tail call i8* @strerror(i32 %55)
%57 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %9, i8* %56)
%58 = tail call i32 @fclose(i32* %36)
%59 = tail call i32 @exit(i32 1)
unreachable
60: ; preds = %46
%61 = load i32, i32* @SEEK_END
%62 = tail call i32 @fseek(i32* %36, i32 0, i32 %61)
%63 = tail call i64 @ftell(i32* %36)
%64 = load i32, i32* @SEEK_SET
%65 = tail call i32 @fseek(i32* %36, i32 0, i32 %64)
%66 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i64 39, i64 1, i32* %49)
%67 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %5)
%68 = icmp sgt i64 %63, 0
br i1 %68, label %69, label %111
69: ; preds = %60, %105
%70 = phi i64 [ %108, %105 ], [ 0, %60 ]
%71 = phi i64 [ %107, %105 ], [ 0, %60 ]
%72 = phi i64 [ %106, %105 ], [ 0, %60 ]
%73 = phi i64 [ %109, %105 ], [ 0, %60 ]
%74 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %36)
%75 = icmp eq i64 %71, 0
%76 = load i8, i8* %3
%77 = icmp eq i8 %76, 35
%78 = select i1 %75, i1 %77, i1 false
br i1 %78, label %92, label %79
79: ; preds = %69
%80 = icmp eq i8 %76, 10
%81 = icmp eq i64 %70, 0
br i1 %80, label %82, label %88
82: ; preds = %79
%83 = icmp sgt i64 %71, 0
%84 = select i1 %81, i1 %83, i1 false
br i1 %84, label %85, label %105
85: ; preds = %82
%86 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i64 6, i64 1, i32* %49)
%87 = add nsw i64 %72, 1
br label %105
88: ; preds = %79
br i1 %81, label %89, label %92
89: ; preds = %88
%90 = icmp eq i8 %76, 9
%91 = select i1 %90, i1 %75, i1 false
br i1 %91, label %92, label %95
92: ; preds = %69, %89, %88
%93 = phi i64 [ 0, %89 ], [ %70, %88 ], [ 1, %69 ]
%94 = add nsw i64 %71, 1
br label %105
95: ; preds = %89
%96 = icmp eq i8 %76, 34
br i1 %96, label %97, label %99
97: ; preds = %95
%98 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 2, i64 1, i32* %49)
br label %101
99: ; preds = %95
%100 = tail call i32 @fputc(i8 signext %76, i32* %49)
br label %101
101: ; preds = %99, %97
%102 = phi i64 [ 1, %99 ], [ 2, %97 ]
%103 = add nsw i64 %72, %102
%104 = add nsw i64 %71, 1
br label %105
105: ; preds = %82, %85, %101, %92
%106 = phi i64 [ %72, %92 ], [ %103, %101 ], [ %87, %85 ], [ %72, %82 ]
%107 = phi i64 [ %94, %92 ], [ %104, %101 ], [ 0, %85 ], [ 0, %82 ]
%108 = phi i64 [ %93, %92 ], [ 0, %101 ], [ 0, %85 ], [ 0, %82 ]
%109 = add nuw nsw i64 %73, 1
%110 = icmp eq i64 %109, %63
br i1 %110, label %111, label %69
111: ; preds = %105, %60
%112 = phi i64 [ 0, %60 ], [ %106, %105 ]
%113 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 4, i64 1, i32* %49)
%114 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i8* %5)
%115 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), i8* %5)
%116 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i64 %112)
%117 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8* %5)
%118 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i64 9, i64 1, i32* %49)
%119 = tail call i32 @fclose(i32* %49)
%120 = tail call i32 @fclose(i32* %36)
ret i32 0
}