#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 /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ isdigit(char);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ stat(char *, struct stat *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strerror(int /*<<< orphan*/);
int strlen(char *);
char *strrchr(char *, char);
char toupper(char);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <file.png>\n", argv[0]);
    fprintf(stderr, "  Convert 'file.png' file to C table 'file_png.h'.\n");
    return 1;
  }
  for (argc--; argc > 0; argc--) {
    FILE *in;
    FILE *out;
    char variable[1024], header_fn[1024], output_fn[1024], *suffix, *prefix;
    int i;
    int bytes_per_row = 16;
    char row[1024], byte[1024];
    struct stat st;
    long total_bytes;
    in = fopen(argv[argc], "rb");
    if (!in)
      continue;
    stat(argv[argc], &st);
    total_bytes = (long)st.st_size;
    strcpy(output_fn, argv[argc]);
    suffix = strrchr(output_fn, '.');
    if (suffix)
      *suffix = '_';
    strcat(output_fn, ".h");
    prefix = strrchr(output_fn, '/');
    if (!prefix)
      prefix = output_fn;
    else
      prefix++;
    out = fopen(prefix, "w");
    if (!out) {
      fclose(in);
      fprintf(stderr, "error: unable to write to %s: %s\n", prefix,
              strerror(errno));
      continue;
    }
    strcpy(header_fn, prefix);
    for (i = 0; i < strlen(header_fn); i++) {
      if (i == 0 && isdigit(header_fn[i])) {
        int k;
        for (k = strlen(header_fn); k >= 0; k--) {
          header_fn[k + 1] = header_fn[k];
        }
        header_fn[0] = '_';
      }
      if (header_fn[i] == '.')
        header_fn[i] = '_';
      else
        header_fn[i] = toupper(header_fn[i]);
    }
    strcpy(variable, prefix);
    suffix = strrchr(variable, '.');
    if (suffix)
      *suffix = 0;
    if (isdigit(variable[0])) {
      int k;
      for (k = strlen(variable); k >= 0; k--) {
        variable[k + 1] = variable[k];
      }
      variable[0] = '_';
    }
    fprintf(out,
            "#ifndef %s\n"
            "#define %s\n"
            "\n"
            "static unsigned char %s[] =\n{\n",
            header_fn, header_fn, variable);
    fprintf(out, "\t0x%02x, 0x%02x, 0x%02x, 0x%02x,\n",
            (int)(total_bytes >> 24) & 0xff, (int)(total_bytes >> 16) & 0xff,
            (int)(total_bytes >> 8) & 0xff, (int)(total_bytes & 0xff));
    while (total_bytes > 0) {
      sprintf(row, "\t");
      for (i = 0; i < bytes_per_row && total_bytes > 0; i++) {
        if (i == 0)
          sprintf(byte, "0x%02x", fgetc(in));
        else
          sprintf(byte, ", 0x%02x", fgetc(in));
        strcat(row, byte);
        total_bytes--;
      }
      if (total_bytes > 0)
        sprintf(byte, ",\n");
      else
        sprintf(byte, "\n");
      fprintf(out, "%s%s", row, byte);
    }
    fprintf(out, "};\n\n#endif\n");
    fclose(out);
    fclose(in);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1236 <main+0x66>
mov    0x2de6(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdf5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    0x2dc7(%rip),%rax
mov    (%rax),%rdi
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17d7 <main+0x607>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    17d7 <main+0x607>
movl   $0x10,-0xc38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde4(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    127f <main+0xaf>
jmp    17c9 <main+0x5f9>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x1448(%rbp),%rsi
call   10b0 <stat@plt>
mov    -0x1448(%rbp),%rax
mov    %rax,-0x1450(%rbp)
lea    -0xc20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy@plt>
lea    -0xc20(%rbp),%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc28(%rbp)
cmpq   $0x0,-0xc28(%rbp)
je     12ed <main+0x11d>
mov    -0xc28(%rbp),%rax
movb   $0x5f,(%rax)
lea    -0xc20(%rbp),%rdi
lea    0xd52(%rip),%rsi
call   10d0 <strcat@plt>
lea    -0xc20(%rbp),%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc30(%rbp)
cmpq   $0x0,-0xc30(%rbp)
jne    1339 <main+0x169>
lea    -0xc20(%rbp),%rax
mov    %rax,-0xc30(%rbp)
jmp    134b <main+0x17b>
mov    -0xc30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc30(%rbp)
mov    -0xc30(%rbp),%rdi
lea    0xcf7(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13c7 <main+0x1f7>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    0x2c63(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x1468(%rbp)
mov    -0xc30(%rbp),%rax
mov    %rax,-0x1460(%rbp)
mov    0x2c3c(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x1468(%rbp),%rdi
mov    -0x1460(%rbp),%rdx
mov    %rax,%rcx
lea    0xc97(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17c9 <main+0x5f9>
lea    -0x820(%rbp),%rdi
mov    -0xc30(%rbp),%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0xc34(%rbp)
mov    -0xc34(%rbp),%eax
mov    %eax,-0x146c(%rbp)
lea    -0x820(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x146c(%rbp),%eax
cmp    %ecx,%eax
jge    14fa <main+0x32a>
cmpl   $0x0,-0xc34(%rbp)
jne    1491 <main+0x2c1>
movslq -0xc34(%rbp),%rax
movsbl -0x820(%rbp,%rax,1),%edi
ff
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1491 <main+0x2c1>
lea    -0x820(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x1454(%rbp)
cmpl   $0x0,-0x1454(%rbp)
jl     148a <main+0x2ba>
movslq -0x1454(%rbp),%rax
mov    -0x820(%rbp,%rax,1),%cl
mov    -0x1454(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x820(%rbp,%rax,1)
mov    -0x1454(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1454(%rbp)
jmp    1449 <main+0x279>
movb   $0x5f,-0x820(%rbp)
movslq -0xc34(%rbp),%rax
movsbl -0x820(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
jne    14bd <main+0x2ed>
movslq -0xc34(%rbp),%rax
movb   $0x5f,-0x820(%rbp,%rax,1)
5f
jmp    14e1 <main+0x311>
movslq -0xc34(%rbp),%rax
movsbl -0x820(%rbp,%rax,1),%edi
ff
call   1050 <toupper@plt>
mov    %al,%cl
movslq -0xc34(%rbp),%rax
mov    %cl,-0x820(%rbp,%rax,1)
jmp    14e6 <main+0x316>
mov    -0xc34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc34(%rbp)
jmp    13e4 <main+0x214>
lea    -0x420(%rbp),%rdi
mov    -0xc30(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x420(%rbp),%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
mov    %rax,-0xc28(%rbp)
cmpq   $0x0,-0xc28(%rbp)
je     153d <main+0x36d>
mov    -0xc28(%rbp),%rax
movb   $0x0,(%rax)
movsbl -0x420(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     15ad <main+0x3dd>
lea    -0x420(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x1458(%rbp)
cmpl   $0x0,-0x1458(%rbp)
jl     15a6 <main+0x3d6>
movslq -0x1458(%rbp),%rax
mov    -0x420(%rbp,%rax,1),%cl
mov    -0x1458(%rbp),%eax
add    $0x1,%eax
cltq
mov    %cl,-0x420(%rbp,%rax,1)
mov    -0x1458(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1458(%rbp)
jmp    1565 <main+0x395>
movb   $0x5f,-0x420(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x820(%rbp),%rdx
lea    -0x820(%rbp),%rcx
lea    -0x420(%rbp),%r8
lea    0xaa7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x1450(%rbp),%rax
sar    $0x18,%rax
mov    %eax,%edx
and    $0xff,%edx
mov    -0x1450(%rbp),%rax
sar    $0x10,%rax
mov    %eax,%ecx
and    $0xff,%ecx
mov    -0x1450(%rbp),%rax
sar    $0x8,%rax
mov    %eax,%r8d
and    $0xff,%r8d
mov    -0x1450(%rbp),%rax
and    $0xff,%rax
mov    %eax,%r9d
lea    0xa80(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpq   $0x0,-0x1450(%rbp)
jle    17a5 <main+0x5d5>
lea    -0x1040(%rbp),%rdi
lea    0xa7f(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
movl   $0x0,-0xc34(%rbp)
mov    -0xc34(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc38(%rbp),%ecx
mov    %al,-0x146d(%rbp)
jge    1689 <main+0x4b9>
cmpq   $0x0,-0x1450(%rbp)
setg   %al
mov    %al,-0x146d(%rbp)
mov    -0x146d(%rbp),%al
test   $0x1,%al
jne    169c <main+0x4cc>
jmp    1743 <main+0x573>
cmpl   $0x0,-0xc34(%rbp)
jne    16dc <main+0x50c>
lea    -0x1440(%rbp),%rax
mov    %rax,-0x1478(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <fgetc@plt>
mov    -0x1478(%rbp),%rdi
mov    %eax,%edx
lea    0xa00(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
jmp    170a <main+0x53a>
lea    -0x1440(%rbp),%rax
mov    %rax,-0x1480(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <fgetc@plt>
mov    -0x1480(%rbp),%rdi
mov    %eax,%edx
lea    0x9cb(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
lea    -0x1040(%rbp),%rdi
lea    -0x1440(%rbp),%rsi
call   10d0 <strcat@plt>
mov    -0x1450(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x1450(%rbp)
mov    -0xc34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc34(%rbp)
jmp    165e <main+0x48e>
cmpq   $0x0,-0x1450(%rbp)
jle    176b <main+0x59b>
lea    -0x1440(%rbp),%rdi
lea    0x96a(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
jmp    1780 <main+0x5b0>
lea    -0x1440(%rbp),%rdi
lea    0x951(%rip),%rsi
mov    $0x0,%al
call   10e0 <sprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x1040(%rbp),%rdx
lea    -0x1440(%rbp),%rcx
lea    0x93e(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    1631 <main+0x461>
mov    -0x20(%rbp),%rdi
lea    0x92c(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    123f <main+0x6f>
mov    -0x4(%rbp),%eax
add    $0x1480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1438,%rsp
cmp    $0x2,%edi
jge    1234 <main+0x54>
mov    0x2de3(%rip),%rbx
mov    (%rbx),%rdi
mov    (%rsi),%rdx
lea    0xdf6(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%rbx),%rcx
lea    0xdfb(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
mov    $0x1,%eax
jmp    169e <main+0x4be>
mov    %edi,%eax
lea    0x30(%rsp),%r13
lea    0x830(%rsp),%r14
mov    %rsi,0x10(%rsp)
jmp    1297 <main+0xb7>
nopw   0x0(%rax,%rax,1)
mov    $0xb,%esi
mov    $0x1,%edx
lea    0xe79(%rip),%rdi
mov    0x8(%rsp),%rbx
mov    %rbx,%rcx
call   10f0 <fwrite@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    0x18(%rsp),%r15
cmp    $0x2,%r15
mov    0x10(%rsp),%rsi
mov    0x20(%rsp),%rax
jle    169c <main+0x4bc>
mov    %rax,%r15
add    $0xffffffffffffffff,%rax
mov    %rax,0x20(%rsp)
mov    %eax,%ebx
mov    (%rsi,%rbx,8),%rdi
lea    0xd9a(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1283 <main+0xa3>
mov    %rax,%r12
mov    0x10(%rsp),%rbp
mov    0x0(%rbp,%rbx,8),%rdi
lea    0x28(%rsp),%rsi
call   10b0 <stat@plt>
mov    0x28(%rsp),%rax
mov    %rax,(%rsp)
mov    0x0(%rbp,%rbx,8),%rsi
lea    0x1030(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
test   %rax,%rax
je     1304 <main+0x124>
movb   $0x5f,(%rax)
lea    0x1030(%rsp),%rbx
mov    %rbx,%rdi
lea    0xd37(%rip),%rsi
call   10d0 <strcat@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1080 <strrchr@plt>
lea    0x1(%rax),%rbp
test   %rax,%rax
cmove  %rbx,%rbp
mov    %rbp,%rdi
lea    0xd13(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1660 <main+0x480>
mov    %r15,0x18(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
jle    1430 <main+0x250>
xor    %r15d,%r15d
jmp    139c <main+0x1bc>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %al,0x30(%rsp,%r15,1)
add    $0x1,%r15
mov    %r13,%rdi
call   1070 <strlen@plt>
cltq
cmp    %rax,%r15
jge    1430 <main+0x250>
test   %r15,%r15
jne    1407 <main+0x227>
movsbl 0x30(%rsp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1407 <main+0x227>
mov    %r13,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
js     1402 <main+0x222>
mov    %eax,%ecx
lea    0x1(%rax),%edx
and    $0x3,%rdx
je     13e3 <main+0x203>
nopw   0x0(%rax,%rax,1)
movzbl 0x30(%rsp,%rcx,1),%ebx
mov    %bl,0x31(%rsp,%rcx,1)
add    $0xffffffffffffffff,%rcx
add    $0xffffffffffffffff,%rdx
jne    13d0 <main+0x1f0>
cmp    $0x3,%eax
jb     1402 <main+0x222>
nopl   0x0(%rax,%rax,1)
mov    0x2d(%rsp,%rcx,1),%eax
mov    %eax,0x2e(%rsp,%rcx,1)
add    $0xfffffffffffffffc,%rcx
cmp    $0xffffffffffffffff,%rcx
jne    13f0 <main+0x210>
movb   $0x5f,0x30(%rsp)
mov    0x30(%rsp,%r15,1),%cl
mov    $0x5f,%al
cmp    $0x2e,%cl
je     1380 <main+0x1a0>
movsbl %cl,%edi
call   1050 <toupper@plt>
jmp    1380 <main+0x1a0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1080 <strrchr@plt>
test   %rax,%rax
je     1458 <main+0x278>
movb   $0x0,(%rax)
movsbl 0x430(%rsp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
lea    0xc30(%rsp),%r15
mov    (%rsp),%rbx
je     14f0 <main+0x310>
lea    0x430(%rsp),%rdi
call   1070 <strlen@plt>
test   %eax,%eax
js     14e8 <main+0x308>
mov    %eax,%ecx
lea    0x1(%rax),%edx
and    $0x3,%rdx
je     14b9 <main+0x2d9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x430(%rsp,%rcx,1),%ebx
mov    %bl,0x431(%rsp,%rcx,1)
add    $0xffffffffffffffff,%rcx
add    $0xffffffffffffffff,%rdx
jne    14a0 <main+0x2c0>
cmp    $0x3,%eax
mov    (%rsp),%rbx
jb     14e8 <main+0x308>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x42d(%rsp,%rcx,1),%eax
mov    %eax,0x42e(%rsp,%rcx,1)
add    $0xfffffffffffffffc,%rcx
cmp    $0xffffffffffffffff,%rcx
jne    14d0 <main+0x2f0>
movb   $0x5f,0x430(%rsp)
5f
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
lea    0xb75(%rip),%rsi
mov    %r13,%rdx
mov    %r13,%rcx
lea    0x430(%rsp),%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %ebx,%edx
shr    $0x18,%edx
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%ecx
movzbl %bh,%eax
movzbl %bl,%r9d
mov    %rbp,%rdi
lea    0xb78(%rip),%rsi
mov    %eax,%r8d
xor    %eax,%eax
call   10a0 <fprintf@plt>
test   %rbx,%rbx
jg     1596 <main+0x3b6>
jmp    1250 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%ebp
xor    %r15d,%r15d
movw   $0xa,0x830(%rsp)
mov    0x8(%rsp),%rdi
lea    0xb67(%rip),%rsi
lea    0xc30(%rsp),%rbx
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
cmp    $0x1,%rbp
mov    %r15,%rax
mov    %rbx,%r15
mov    %rax,%rbx
jle    1250 <main+0x70>
movw   $0x9,0xc30(%rsp)
mov    %r12,%rdi
call   1090 <fgetc@plt>
mov    %r14,%rdi
lea    0xb1c(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10d0 <strcat@plt>
cmp    $0x1,%rbx
je     1550 <main+0x370>
mov    %rbx,(%rsp)
lea    -0x2(%rbx),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%r13
add    $0x1,%rbx
mov    %r12,%rdi
call   1090 <fgetc@plt>
mov    %r14,%rdi
lea    0xad3(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10e0 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10d0 <strcat@plt>
cmp    $0xe,%ebx
ja     1617 <main+0x437>
cmp    %r13,%rbp
jne    15e0 <main+0x400>
mov    (%rsp),%rax
sub    %rbx,%rax
lea    -0x1(%rax),%r15
cmp    %r13,%rbp
je     1650 <main+0x470>
mov    %rax,%rbp
movb   $0x0,0x832(%rsp)
movw   $0xa2c,0x830(%rsp)
lea    0x30(%rsp),%r13
jmp    1562 <main+0x382>
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rbp
lea    0x30(%rsp),%r13
jmp    1558 <main+0x378>
nopl   (%rax)
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    0x2971(%rip),%rax
mov    (%rax),%rbx
mov    0x295f(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    %rbx,%rdi
lea    0x9c8(%rip),%rsi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1283 <main+0xa3>
xor    %eax,%eax
add    $0x1438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@stderr = global i32* null
@.str = [22 x i8] c"Usage: %s <file.png>\0A\00"
@.str.1 = [52 x i8] c" Convert 'file.png' file to C table 'file_png.h'.\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [3 x i8] c".h\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [34 x i8] c"error: unable to write to %s: %s\0A\00"
@errno = global i32 0
@.str.6 = [54 x i8] c"#ifndef %s\0A#define %s\0A\0Astatic unsigned char %s[] =\0A{\0A\00"
@.str.7 = [34 x i8] c"\090x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\00"
@.str.8 = [2 x i8] c"\09\00"
@.str.9 = [7 x i8] c"0x%02x\00"
@.str.10 = [9 x i8] c", 0x%02x\00"
@.str.11 = [3 x i8] c",\0A\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [5 x i8] c"%s%s\00"
@.str.14 = [12 x i8] c"};\0A\0A#endif\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 [1024 x i8]
%9 = alloca [1024 x i8]
%10 = alloca [1024 x i8]
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca [1024 x i8]
%16 = alloca [1024 x i8]
%17 = alloca %struct.stat
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 2
br i1 %22, label %23, label %31
23: ; preds = %2
%24 = load i32*, i32** @stderr
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = load i32*, i32** @stderr
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %276
31: ; preds = %2
%32 = load i32, i32* %4
%33 = add nsw i32 %32, -1
store i32 %33, i32* %4
br label %34
34: ; preds = %273, %31
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %276
37: ; preds = %34
store i32 16, i32* %14
%38 = load i8**, i8*** %5
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i32* @fopen(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %43, i32** %6
%44 = load i32*, i32** %6
%45 = icmp ne i32* %44, null
br i1 %45, label %47, label %46
46: ; preds = %37
br label %273
47: ; preds = %37
%48 = load i8**, i8*** %5
%49 = load i32, i32* %4
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %48, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @stat(i8* %52, %struct.stat* %17)
%54 = getelementptr inbounds %struct.stat, %struct.stat* %17, i32 0, i32 0
%55 = load i64, i64* %54
store i64 %55, i64* %18
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%57 = load i8**, i8*** %5
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8*, i8** %57, i64 %59
%61 = load i8*, i8** %60
%62 = call i32 @strcpy(i8* %56, i8* %61)
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%64 = call i8* @strrchr(i8* %63, i8 signext 46)
store i8* %64, i8** %11
%65 = load i8*, i8** %11
%66 = icmp ne i8* %65, null
br i1 %66, label %67, label %69
67: ; preds = %47
%68 = load i8*, i8** %11
store i8 95, i8* %68
br label %69
69: ; preds = %67, %47
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%71 = call i32 @strcat(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%73 = call i8* @strrchr(i8* %72, i8 signext 47)
store i8* %73, i8** %12
%74 = load i8*, i8** %12
%75 = icmp ne i8* %74, null
br i1 %75, label %78, label %76
76: ; preds = %69
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
store i8* %77, i8** %12
br label %81
78: ; preds = %69
%79 = load i8*, i8** %12
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %12
br label %81
81: ; preds = %78, %76
%82 = load i8*, i8** %12
%83 = call i32* @fopen(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %83, i32** %7
%84 = load i32*, i32** %7
%85 = icmp ne i32* %84, null
br i1 %85, label %94, label %86
86: ; preds = %81
%87 = load i32*, i32** %6
%88 = call i32 @fclose(i32* %87)
%89 = load i32*, i32** @stderr
%90 = load i8*, i8** %12
%91 = load i32, i32* @errno
%92 = call i8* @strerror(i32 %91)
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %90, i8* %92)
br label %273
94: ; preds = %81
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%96 = load i8*, i8** %12
%97 = call i32 @strcpy(i8* %95, i8* %96)
store i32 0, i32* %13
br label %98
98: ; preds = %154, %94
%99 = load i32, i32* %13
%100 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%101 = call i32 @strlen(i8* %100)
%102 = icmp slt i32 %99, %101
br i1 %102, label %103, label %157
103: ; preds = %98
%104 = load i32, i32* %13
%105 = icmp eq i32 %104, 0
br i1 %105, label %106, label %133
106: ; preds = %103
%107 = load i32, i32* %13
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %108
%110 = load i8, i8* %109
%111 = call i64 @isdigit(i8 signext %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %133
113: ; preds = %106
%114 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%115 = call i32 @strlen(i8* %114)
store i32 %115, i32* %19
br label %116
116: ; preds = %128, %113
%117 = load i32, i32* %19
%118 = icmp sge i32 %117, 0
br i1 %118, label %119, label %131
119: ; preds = %116
%120 = load i32, i32* %19
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %121
%123 = load i8, i8* %122
%124 = load i32, i32* %19
%125 = add nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %126
store i8 %123, i8* %127
br label %128
128: ; preds = %119
%129 = load i32, i32* %19
%130 = add nsw i32 %129, -1
store i32 %130, i32* %19
br label %116
131: ; preds = %116
%132 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
store i8 95, i8* %132
br label %133
133: ; preds = %131, %106, %103
%134 = load i32, i32* %13
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %135
%137 = load i8, i8* %136
%138 = sext i8 %137 to i32
%139 = icmp eq i32 %138, 46
br i1 %139, label %140, label %144
140: ; preds = %133
%141 = load i32, i32* %13
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %142
store i8 95, i8* %143
br label %153
144: ; preds = %133
%145 = load i32, i32* %13
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %146
%148 = load i8, i8* %147
%149 = call signext i8 @toupper(i8 signext %148)
%150 = load i32, i32* %13
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 %151
store i8 %149, i8* %152
br label %153
153: ; preds = %144, %140
br label %154
154: ; preds = %153
%155 = load i32, i32* %13
%156 = add nsw i32 %155, 1
store i32 %156, i32* %13
br label %98
157: ; preds = %98
%158 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%159 = load i8*, i8** %12
%160 = call i32 @strcpy(i8* %158, i8* %159)
%161 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%162 = call i8* @strrchr(i8* %161, i8 signext 46)
store i8* %162, i8** %11
%163 = load i8*, i8** %11
%164 = icmp ne i8* %163, null
br i1 %164, label %165, label %167
165: ; preds = %157
%166 = load i8*, i8** %11
store i8 0, i8* %166
br label %167
167: ; preds = %165, %157
%168 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%169 = load i8, i8* %168
%170 = call i64 @isdigit(i8 signext %169)
%171 = icmp ne i64 %170, 0
br i1 %171, label %172, label %192
172: ; preds = %167
%173 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%174 = call i32 @strlen(i8* %173)
store i32 %174, i32* %20
br label %175
175: ; preds = %187, %172
%176 = load i32, i32* %20
%177 = icmp sge i32 %176, 0
br i1 %177, label %178, label %190
178: ; preds = %175
%179 = load i32, i32* %20
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %180
%182 = load i8, i8* %181
%183 = load i32, i32* %20
%184 = add nsw i32 %183, 1
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 %185
store i8 %182, i8* %186
br label %187
187: ; preds = %178
%188 = load i32, i32* %20
%189 = add nsw i32 %188, -1
store i32 %189, i32* %20
br label %175
190: ; preds = %175
%191 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
store i8 95, i8* %191
br label %192
192: ; preds = %190, %167
%193 = load i32*, i32** %7
%194 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%195 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%196 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%197 = call i32 (i32*, i8*, ...) @fprintf(i32* %193, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* %194, i8* %195, i8* %196)
%198 = load i32*, i32** %7
%199 = load i64, i64* %18
%200 = ashr i64 %199, 24
%201 = trunc i64 %200 to i32
%202 = and i32 %201, 255
%203 = load i64, i64* %18
%204 = ashr i64 %203, 16
%205 = trunc i64 %204 to i32
%206 = and i32 %205, 255
%207 = load i64, i64* %18
%208 = ashr i64 %207, 8
%209 = trunc i64 %208 to i32
%210 = and i32 %209, 255
%211 = load i64, i64* %18
%212 = and i64 %211, 255
%213 = trunc i64 %212 to i32
%214 = call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %202, i32 %206, i32 %210, i32 %213)
br label %215
215: ; preds = %261, %192
%216 = load i64, i64* %18
%217 = icmp sgt i64 %216, 0
br i1 %217, label %218, label %266
218: ; preds = %215
%219 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%220 = call i32 (i8*, i8*, ...) @sprintf(i8* %219, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %13
br label %221
221: ; preds = %249, %218
%222 = load i32, i32* %13
%223 = load i32, i32* %14
%224 = icmp slt i32 %222, %223
br i1 %224, label %225, label %228
225: ; preds = %221
%226 = load i64, i64* %18
%227 = icmp sgt i64 %226, 0
br label %228
228: ; preds = %225, %221
%229 = phi i1 [ false, %221 ], [ %227, %225 ]
br i1 %229, label %230, label %252
230: ; preds = %228
%231 = load i32, i32* %13
%232 = icmp eq i32 %231, 0
br i1 %232, label %233, label %238
233: ; preds = %230
%234 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%235 = load i32*, i32** %6
%236 = call i32 @fgetc(i32* %235)
%237 = call i32 (i8*, i8*, ...) @sprintf(i8* %234, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %236)
br label %243
238: ; preds = %230
%239 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%240 = load i32*, i32** %6
%241 = call i32 @fgetc(i32* %240)
%242 = call i32 (i8*, i8*, ...) @sprintf(i8* %239, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %241)
br label %243
243: ; preds = %238, %233
%244 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%245 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%246 = call i32 @strcat(i8* %244, i8* %245)
%247 = load i64, i64* %18
%248 = add nsw i64 %247, -1
store i64 %248, i64* %18
br label %249
249: ; preds = %243
%250 = load i32, i32* %13
%251 = add nsw i32 %250, 1
store i32 %251, i32* %13
br label %221
252: ; preds = %228
%253 = load i64, i64* %18
%254 = icmp sgt i64 %253, 0
br i1 %254, label %255, label %258
255: ; preds = %252
%256 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%257 = call i32 (i8*, i8*, ...) @sprintf(i8* %256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %261
258: ; preds = %252
%259 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%260 = call i32 (i8*, i8*, ...) @sprintf(i8* %259, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %261
261: ; preds = %258, %255
%262 = load i32*, i32** %7
%263 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%264 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%265 = call i32 (i32*, i8*, ...) @fprintf(i32* %262, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* %263, i8* %264)
br label %215
266: ; preds = %215
%267 = load i32*, i32** %7
%268 = call i32 (i32*, i8*, ...) @fprintf(i32* %267, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0))
%269 = load i32*, i32** %7
%270 = call i32 @fclose(i32* %269)
%271 = load i32*, i32** %6
%272 = call i32 @fclose(i32* %271)
br label %273
273: ; preds = %266, %86, %46
%274 = load i32, i32* %4
%275 = add nsw i32 %274, -1
store i32 %275, i32* %4
br label %34
276: ; preds = %23, %34
%277 = load i32, i32* %3
ret i32 %277
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@stderr = global i32* null
@.str = [22 x i8] c"Usage: %s <file.png>\0A\00"
@.str.1 = [52 x i8] c" Convert 'file.png' file to C table 'file_png.h'.\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [3 x i8] c".h\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [34 x i8] c"error: unable to write to %s: %s\0A\00"
@errno = global i32 0
@.str.6 = [54 x i8] c"#ifndef %s\0A#define %s\0A\0Astatic unsigned char %s[] =\0A{\0A\00"
@.str.7 = [34 x i8] c"\090x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\00"
@.str.9 = [7 x i8] c"0x%02x\00"
@.str.10 = [9 x i8] c", 0x%02x\00"
@.str.11 = [3 x i8] c",\0A\00"
@.str.13 = [5 x i8] c"%s%s\00"
@.str.14 = [12 x i8] c"};\0A\0A#endif\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca %struct.stat
%9 = icmp slt i32 %0, 2
br i1 %9, label %21, label %10
10: ; preds = %2
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%16 = bitcast %struct.stat* %8 to i8*
%17 = getelementptr inbounds %struct.stat, %struct.stat* %8, i64 0, i32 0
%18 = bitcast [1024 x i8]* %6 to i16*
%19 = bitcast [1024 x i8]* %7 to i16*
%20 = zext i32 %0 to i64
br label %27
21: ; preds = %2
%22 = load i32*, i32** @stderr
%23 = load i8*, i8** %1
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = load i32*, i32** @stderr
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i64 51, i64 1, i32* %25)
br label %219
27: ; preds = %10, %217
%28 = phi i64 [ %20, %10 ], [ %29, %217 ]
%29 = add nsw i64 %28, -1
%30 = and i64 %29, 4294967295
%31 = getelementptr inbounds i8*, i8** %1, i64 %30
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %217, label %35
35: ; preds = %27
%36 = load i8*, i8** %31
%37 = call i32 @stat(i8* %36, %struct.stat* %8)
%38 = load i64, i64* %17
%39 = load i8*, i8** %31
%40 = call i32 @strcpy(i8* %13, i8* %39)
%41 = call i8* @strrchr(i8* %13, i8 signext 46)
%42 = icmp eq i8* %41, null
br i1 %42, label %44, label %43
43: ; preds = %35
store i8 95, i8* %41
br label %44
44: ; preds = %43, %35
%45 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%46 = call i8* @strrchr(i8* %13, i8 signext 47)
%47 = icmp eq i8* %46, null
%48 = getelementptr inbounds i8, i8* %46, i64 1
%49 = select i1 %47, i8* %13, i8* %48
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %58
52: ; preds = %44
%53 = call i32 @fclose(i32* %33)
%54 = load i32*, i32** @stderr
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %49, i8* %56)
br label %217
58: ; preds = %44
%59 = call i32 @strcpy(i8* %12, i8* %49)
%60 = call i32 @strlen(i8* %12)
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %123
62: ; preds = %58, %117
%63 = phi i64 [ %119, %117 ], [ 0, %58 ]
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %111
65: ; preds = %62
%66 = load i8, i8* %12
%67 = call i64 @isdigit(i8 signext %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %111, label %69
69: ; preds = %65
%70 = call i32 @strlen(i8* %12)
%71 = icmp sgt i32 %70, -1
br i1 %71, label %72, label %110
72: ; preds = %69
%73 = zext i32 %70 to i64
%74 = add nuw nsw i64 %73, 1
%75 = and i64 %74, 3
%76 = icmp eq i64 %75, 0
br i1 %76, label %87, label %77
77: ; preds = %72, %77
%78 = phi i64 [ %84, %77 ], [ %73, %72 ]
%79 = phi i64 [ %85, %77 ], [ 0, %72 ]
%80 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %78
%81 = load i8, i8* %80
%82 = add nuw nsw i64 %78, 1
%83 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %82
store i8 %81, i8* %83
%84 = add nsw i64 %78, -1
%85 = add i64 %79, 1
%86 = icmp eq i64 %85, %75
br i1 %86, label %87, label %77
87: ; preds = %77, %72
%88 = phi i64 [ %73, %72 ], [ %84, %77 ]
%89 = icmp ult i32 %70, 3
br i1 %89, label %110, label %90
90: ; preds = %87, %90
%91 = phi i64 [ %108, %90 ], [ %88, %87 ]
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %91
%93 = load i8, i8* %92
%94 = add nuw nsw i64 %91, 1
%95 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %94
store i8 %93, i8* %95
%96 = add nsw i64 %91, -1
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %96
%98 = load i8, i8* %97
%99 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %91
store i8 %98, i8* %99
%100 = add nsw i64 %91, -2
%101 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %96
store i8 %102, i8* %103
%104 = add nsw i64 %91, -3
%105 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %104
%106 = load i8, i8* %105
%107 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %100
store i8 %106, i8* %107
%108 = add nsw i64 %91, -4
%109 = icmp eq i64 %104, 0
br i1 %109, label %110, label %90
110: ; preds = %87, %90, %69
store i8 95, i8* %12
br label %111
111: ; preds = %110, %65, %62
%112 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %63
%113 = load i8, i8* %112
%114 = icmp eq i8 %113, 46
br i1 %114, label %117, label %115
115: ; preds = %111
%116 = call signext i8 @toupper(i8 signext %113)
br label %117
117: ; preds = %111, %115
%118 = phi i8 [ %116, %115 ], [ 95, %111 ]
store i8 %118, i8* %112
%119 = add nuw nsw i64 %63, 1
%120 = call i32 @strlen(i8* %12)
%121 = sext i32 %120 to i64
%122 = icmp slt i64 %119, %121
br i1 %122, label %62, label %123
123: ; preds = %117, %58
%124 = call i32 @strcpy(i8* %11, i8* %49)
%125 = call i8* @strrchr(i8* %11, i8 signext 46)
%126 = icmp eq i8* %125, null
br i1 %126, label %128, label %127
127: ; preds = %123
store i8 0, i8* %125
br label %128
128: ; preds = %127, %123
%129 = load i8, i8* %11
%130 = call i64 @isdigit(i8 signext %129)
%131 = icmp eq i64 %130, 0
br i1 %131, label %174, label %132
132: ; preds = %128
%133 = call i32 @strlen(i8* %11)
%134 = icmp sgt i32 %133, -1
br i1 %134, label %135, label %173
135: ; preds = %132
%136 = zext i32 %133 to i64
%137 = add nuw nsw i64 %136, 1
%138 = and i64 %137, 3
%139 = icmp eq i64 %138, 0
br i1 %139, label %150, label %140
140: ; preds = %135, %140
%141 = phi i64 [ %147, %140 ], [ %136, %135 ]
%142 = phi i64 [ %148, %140 ], [ 0, %135 ]
%143 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %141
%144 = load i8, i8* %143
%145 = add nuw nsw i64 %141, 1
%146 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %145
store i8 %144, i8* %146
%147 = add nsw i64 %141, -1
%148 = add i64 %142, 1
%149 = icmp eq i64 %148, %138
br i1 %149, label %150, label %140
150: ; preds = %140, %135
%151 = phi i64 [ %136, %135 ], [ %147, %140 ]
%152 = icmp ult i32 %133, 3
br i1 %152, label %173, label %153
153: ; preds = %150, %153
%154 = phi i64 [ %171, %153 ], [ %151, %150 ]
%155 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %154
%156 = load i8, i8* %155
%157 = add nuw nsw i64 %154, 1
%158 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %157
store i8 %156, i8* %158
%159 = add nsw i64 %154, -1
%160 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %159
%161 = load i8, i8* %160
%162 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %154
store i8 %161, i8* %162
%163 = add nsw i64 %154, -2
%164 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %163
%165 = load i8, i8* %164
%166 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %159
store i8 %165, i8* %166
%167 = add nsw i64 %154, -3
%168 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %167
%169 = load i8, i8* %168
%170 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 %163
store i8 %169, i8* %170
%171 = add nsw i64 %154, -4
%172 = icmp eq i64 %167, 0
br i1 %172, label %173, label %153
173: ; preds = %150, %153, %132
store i8 95, i8* %11
br label %174
174: ; preds = %173, %128
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* %12, i8* %12, i8* %11)
%176 = trunc i64 %38 to i32
%177 = lshr i32 %176, 24
%178 = lshr i32 %176, 16
%179 = and i32 %178, 255
%180 = lshr i32 %176, 8
%181 = and i32 %180, 255
%182 = and i32 %176, 255
%183 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %177, i32 %179, i32 %181, i32 %182)
%184 = icmp sgt i64 %38, 0
br i1 %184, label %185, label %213
185: ; preds = %174, %208
%186 = phi i64 [ %210, %208 ], [ %38, %174 ]
store i16 9, i16* %18
%187 = call i32 @fgetc(i32* %33)
%188 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %187)
%189 = call i32 @strcat(i8* %14, i8* %15)
%190 = add nsw i64 %186, -1
%191 = icmp eq i64 %190, 0
br i1 %191, label %205, label %192
192: ; preds = %185, %192
%193 = phi i64 [ %198, %192 ], [ %190, %185 ]
%194 = phi i32 [ %199, %192 ], [ 1, %185 ]
%195 = call i32 @fgetc(i32* %33)
%196 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %195)
%197 = call i32 @strcat(i8* %14, i8* %15)
%198 = add nsw i64 %193, -1
%199 = add nuw nsw i32 %194, 1
%200 = icmp ult i32 %194, 15
%201 = icmp ne i64 %198, 0
%202 = select i1 %200, i1 %201, i1 false
br i1 %202, label %192, label %203
203: ; preds = %192
br i1 %201, label %204, label %205
204: ; preds = %203
br label %208
205: ; preds = %185, %203
%206 = phi i64 [ %193, %203 ], [ 1, %185 ]
%207 = phi i64 [ %198, %203 ], [ 0, %185 ]
store i16 10, i16* %19
br label %208
208: ; preds = %205, %204
%209 = phi i64 [ %206, %205 ], [ %193, %204 ]
%210 = phi i64 [ %207, %205 ], [ %198, %204 ]
%211 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* %14, i8* %15)
%212 = icmp sgt i64 %209, 1
br i1 %212, label %185, label %213
213: ; preds = %208, %174
%214 = call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i64 11, i64 1, i32* %50)
%215 = call i32 @fclose(i32* %50)
%216 = call i32 @fclose(i32* %33)
br label %217
217: ; preds = %27, %213, %52
%218 = icmp sgt i64 %28, 2
br i1 %218, label %27, label %219
219: ; preds = %217, %21
%220 = phi i32 [ 1, %21 ], [ 0, %217 ]
ret i32 %220
}