#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 atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ trim(char *);
int /*<<< orphan*/ usage(char *);
int main_process(int argc, char **argv) {
  char in_file[256], out_file[256];
  int width = -1, height = -1;
  if (argc == 1) {
    printf("Enter input file name: ");
    gets(in_file);
    trim(in_file);
    printf("Enter output file name (<Enter> for auto generate): ");
    gets(out_file);
    trim(out_file);
    if (strlen(out_file) == 0) {
      strcpy(out_file, in_file);
      int len = strlen(out_file);
      while (out_file[--len] != '.')
        ;
      out_file[len + 1] = 'p';
      out_file[len + 2] = 'l';
      out_file[len + 3] = 'i';
      out_file[len + 4] = 's';
      out_file[len + 5] = 't';
      out_file[len + 6] = 0;
    }
    printf("Enter width, height (<Enter> for auto generate): ");
    char s[256];
    gets(s);
    sscanf(s, "%d%d", &width, &height);
  } else if (argc == 2) {
    strcpy(in_file, argv[1]);
    strcpy(out_file, argv[1]);
    int len = strlen(out_file);
    while (out_file[--len] != '.')
      ;
    out_file[len + 1] = 'p';
    out_file[len + 2] = 'l';
    out_file[len + 3] = 'i';
    out_file[len + 4] = 's';
    out_file[len + 5] = 't';
    out_file[len + 6] = 0;
    printf("Enter width, height (<Enter> for auto generate): ");
    char s[256];
    gets(s);
    sscanf(s, "%d%d", &width, &height);
  } else if (argc == 3) {
    strcpy(in_file, argv[1]);
    strcpy(out_file, argv[2]);
    printf("Enter width, height (<Enter> for auto generate): ");
    char s[256];
    gets(s);
    sscanf(s, "%d%d", &width, &height);
  } else if (argc == 5) {
    strcpy(in_file, argv[1]);
    strcpy(out_file, argv[2]);
    width = atoi(argv[3]);
    height = atoi(argv[4]);
  } else {
    usage(argv[0]);
    return 0;
  }
  printf("\nInput: %s\nOutput: %s\n", in_file, out_file);
  FILE *f_in, *f_out;
  f_in = fopen(in_file, "r");
  f_out = fopen(out_file, "w");
  if (!f_in || !f_out) {
    printf("\nERROR: Cannot open input/output file\n");
    return 10;
  }
  char s[256], frame_name[256];
  int img_x, img_y, img_width, img_height;
  fgets(s, 256, f_in);
  trim(s);
  fprintf(f_out, "%s\n", s);
  fgets(s, 256, f_in);
  fgets(s, 256, f_in);
  fprintf(f_out, "<!DOCTYPE plist PUBLIC \""
                 "-//Apple Computer//DTD PLIST 1.0//EN\" "
                 "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n");
  fprintf(f_out, "<plist version=\"1.0\">\n    <dict>\n");
  fprintf(f_out, "        <key>frames</key>\n        <dict>\n");
  fgets(s, 256, f_in);
  trim(s);
  while (strcmp(s, "</Asset>")) {
    sscanf(s + strlen("<Item><Key>"), "%s", frame_name);
    int len = strlen(frame_name);
    while (frame_name[--len] != '>')
      ;
    frame_name[len - strlen("</Key><Value>") + 1] = 0;
    sscanf(s + strlen("<Item></Key><Value><Key>") + strlen(frame_name),
           "%d%d%d%d", &img_x, &img_y, &img_width, &img_height);
    printf("INFO: Converting sprite frame %s\n", frame_name);
    fprintf(f_out, "            <key>%s</key>\n", frame_name);
    fprintf(f_out, "            <dict>\n");
    fprintf(f_out, "                <key>frame</key>\n");
    fprintf(f_out, "                <string>{{%d,%d},{%d,%d}}</string>\n",
            img_x, img_y, img_width, img_height);
    fprintf(f_out, "                <key>rotated</key>\n");
    fprintf(f_out, "                <false/>\n");
    fprintf(f_out, "            </dict>\n");
    fgets(s, 256, f_in);
    trim(s);
  }
  fprintf(f_out, "        </dict>\n");
  fprintf(f_out, "        <key>metadata</key>\n");
  fprintf(f_out, "        <dict>\n");
  fprintf(f_out, "            <key>format</key>\n");
  fprintf(f_out, "            <integer>2</integer>\n");
  if (width > 0 && height > 0) {
    fprintf(f_out, "            <key>size</key>\n");
    fprintf(f_out, "            <string>{%d,%d}</string>\n", width, height);
  } else if ((width > 0) ^ (height > 0)) {
    printf("WARNING: Only got one of width and height. Ignoring.\n");
  }
  fprintf(f_out, "        </dict>\n");
  fprintf(f_out, "    </dict>\n</plist>\n");
  fclose(f_in);
  fclose(f_out);
  printf("\nINFO: Successfully created your PLIST. Enjoy!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x780,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x214(%rbp)
ff ff ff
movl   $0xffffffff,-0x218(%rbp)
ff ff ff
cmpl   $0x1,-0x8(%rbp)
jne    1361 <main_process+0x191>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x110(%rbp),%rdi
call   10b0 <gets@plt>
lea    -0x110(%rbp),%rdi
call   1070 <trim@plt>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x210(%rbp),%rdi
call   10b0 <gets@plt>
lea    -0x210(%rbp),%rdi
call   1070 <trim@plt>
lea    -0x210(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%eax
jne    131f <main_process+0x14f>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x21c(%rbp)
mov    -0x21c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x21c(%rbp)
cltq
movsbl -0x210(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
je     12ad <main_process+0xdd>
jmp    1286 <main_process+0xb6>
mov    -0x21c(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x70,-0x210(%rbp,%rax,1)
70
mov    -0x21c(%rbp),%eax
add    $0x2,%eax
cltq
movb   $0x6c,-0x210(%rbp,%rax,1)
6c
mov    -0x21c(%rbp),%eax
add    $0x3,%eax
cltq
movb   $0x69,-0x210(%rbp,%rax,1)
69
mov    -0x21c(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x73,-0x210(%rbp,%rax,1)
73
mov    -0x21c(%rbp),%eax
add    $0x5,%eax
cltq
movb   $0x74,-0x210(%rbp,%rax,1)
74
mov    -0x21c(%rbp),%eax
add    $0x6,%eax
cltq
movb   $0x0,-0x210(%rbp,%rax,1)
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x320(%rbp),%rdi
call   10b0 <gets@plt>
lea    -0x320(%rbp),%rdi
lea    0xe7a(%rip),%rsi
lea    -0x214(%rbp),%rdx
lea    -0x218(%rbp),%rcx
mov    $0x0,%al
call   10c0 <sscanf@plt>
jmp    1578 <main_process+0x3a8>
cmpl   $0x2,-0x8(%rbp)
jne    1480 <main_process+0x2b0>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x324(%rbp)
mov    -0x324(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x324(%rbp)
cltq
movsbl -0x210(%rbp,%rax,1),%eax
ff
cmp    $0x2e,%eax
je     13cc <main_process+0x1fc>
jmp    13a5 <main_process+0x1d5>
mov    -0x324(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x70,-0x210(%rbp,%rax,1)
70
mov    -0x324(%rbp),%eax
add    $0x2,%eax
cltq
movb   $0x6c,-0x210(%rbp,%rax,1)
6c
mov    -0x324(%rbp),%eax
add    $0x3,%eax
cltq
movb   $0x69,-0x210(%rbp,%rax,1)
69
mov    -0x324(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x73,-0x210(%rbp,%rax,1)
73
mov    -0x324(%rbp),%eax
add    $0x5,%eax
cltq
movb   $0x74,-0x210(%rbp,%rax,1)
74
mov    -0x324(%rbp),%eax
add    $0x6,%eax
cltq
movb   $0x0,-0x210(%rbp,%rax,1)
lea    0xc08(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x430(%rbp),%rdi
call   10b0 <gets@plt>
lea    -0x430(%rbp),%rdi
lea    0xd5b(%rip),%rsi
lea    -0x214(%rbp),%rdx
lea    -0x218(%rbp),%rcx
mov    $0x0,%al
call   10c0 <sscanf@plt>
jmp    1573 <main_process+0x3a3>
cmpl   $0x3,-0x8(%rbp)
jne    14f4 <main_process+0x324>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
lea    0xb94(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x530(%rbp),%rdi
call   10b0 <gets@plt>
lea    -0x530(%rbp),%rdi
lea    0xce7(%rip),%rsi
lea    -0x214(%rbp),%rdx
lea    -0x218(%rbp),%rcx
mov    $0x0,%al
call   10c0 <sscanf@plt>
jmp    156e <main_process+0x39e>
cmpl   $0x5,-0x8(%rbp)
jne    1551 <main_process+0x381>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x214(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x218(%rbp)
jmp    1569 <main_process+0x399>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10d0 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a47 <main_process+0x877>
jmp    156e <main_process+0x39e>
jmp    1573 <main_process+0x3a3>
jmp    1578 <main_process+0x3a8>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xaf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xaf4(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x538(%rbp)
lea    -0x210(%rbp),%rdi
lea    0xadc(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x540(%rbp)
cmpq   $0x0,-0x538(%rbp)
je     15e4 <main_process+0x414>
cmpq   $0x0,-0x540(%rbp)
jne    15fe <main_process+0x42e>
lea    0xaaf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xa,-0x4(%rbp)
jmp    1a47 <main_process+0x877>
lea    -0x640(%rbp),%rdi
mov    -0x538(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
lea    -0x640(%rbp),%rdi
call   1070 <trim@plt>
mov    -0x540(%rbp),%rdi
lea    -0x640(%rbp),%rdx
lea    0xa5b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x640(%rbp),%rdi
mov    -0x538(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
lea    -0x640(%rbp),%rdi
mov    -0x538(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
mov    -0x540(%rbp),%rdi
lea    0xa45(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0xaa1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0xaae(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x640(%rbp),%rdi
mov    -0x538(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
lea    -0x640(%rbp),%rdi
call   1070 <trim@plt>
lea    -0x640(%rbp),%rdi
lea    0xa9f(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     18f5 <main_process+0x725>
lea    -0x640(%rbp),%rax
mov    %rax,-0x760(%rbp)
lea    0xa84(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x760(%rbp),%rdi
cltq
add    %rax,%rdi
lea    -0x740(%rbp),%rdx
lea    0xa71(%rip),%rsi
mov    $0x0,%al
call   10c0 <sscanf@plt>
lea    -0x740(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x754(%rbp)
mov    -0x754(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x754(%rbp)
cltq
movsbl -0x740(%rbp,%rax,1),%eax
ff
cmp    $0x3e,%eax
je     1762 <main_process+0x592>
jmp    173b <main_process+0x56b>
mov    -0x754(%rbp),%eax
mov    %eax,-0x774(%rbp)
lea    0xa21(%rip),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x774(%rbp),%eax
sub    %ecx,%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x740(%rbp,%rax,1)
lea    -0x640(%rbp),%rax
mov    %rax,-0x770(%rbp)
lea    0x9fe(%rip),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x770(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x768(%rbp)
lea    -0x740(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x768(%rbp),%rdi
cltq
add    %rax,%rdi
lea    0x9dd(%rip),%rsi
lea    -0x744(%rbp),%rdx
lea    -0x748(%rbp),%rcx
lea    -0x74c(%rbp),%r8
lea    -0x750(%rbp),%r9
mov    $0x0,%al
call   10c0 <sscanf@plt>
lea    -0x740(%rbp),%rsi
lea    0x9b5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x540(%rbp),%rdi
lea    -0x740(%rbp),%rdx
lea    0x9bb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9c1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9c0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
mov    -0x744(%rbp),%edx
mov    -0x748(%rbp),%ecx
mov    -0x74c(%rbp),%r8d
mov    -0x750(%rbp),%r9d
lea    0x9b3(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9d2(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9e1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9e6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
lea    -0x640(%rbp),%rdi
mov    -0x538(%rbp),%rdx
mov    $0x100,%esi
call   1080 <fgets@plt>
lea    -0x640(%rbp),%rdi
call   1070 <trim@plt>
jmp    16d1 <main_process+0x501>
mov    -0x540(%rbp),%rdi
lea    0x9ac(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9a8(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x841(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x99b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x9a5(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpl   $0x0,-0x214(%rbp)
jle    19b3 <main_process+0x7e3>
cmpl   $0x0,-0x218(%rbp)
jle    19b3 <main_process+0x7e3>
mov    -0x540(%rbp),%rdi
lea    0x998(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
mov    -0x214(%rbp),%edx
mov    -0x218(%rbp),%ecx
lea    0x994(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    19f0 <main_process+0x820>
cmpl   $0x0,-0x214(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x218(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     19eb <main_process+0x81b>
lea    0x97d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    19f0 <main_process+0x820>
mov    -0x540(%rbp),%rdi
lea    0x8b1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x540(%rbp),%rdi
lea    0x984(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x538(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x540(%rbp),%rdi
call   1040 <fclose@plt>
lea    0x974(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x780,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_process>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rsi,%rbx
movl   $0xffffffff,0xc(%rsp)
ff
movl   $0xffffffff,0x8(%rsp)
ff
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     147d <main_process+0x28d>
lea    0xdd9(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xddd(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x220(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <gets@plt>
mov    %rbx,%rdi
call   1080 <trim@plt>
lea    0xdcf(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <gets@plt>
mov    %rbx,%rdi
call   1080 <trim@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jne    1442 <main_process+0x252>
movabs $0xffffffff00000000,%r14
ff ff ff
lea    0x220(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
add    %rax,%rbx
add    $0xffffffffffffffff,%rbx
mov    %rax,%r8
shl    $0x20,%r8
movabs $0x600000000,%rax
add    %r8,%rax
movabs $0x500000000,%rcx
add    %r8,%rcx
movabs $0x400000000,%rdx
add    %r8,%rdx
movabs $0x300000000,%rsi
add    %r8,%rsi
movabs $0x200000000,%rdi
add    %r8,%rdi
movabs $0x100000000,%rbp
add    %r8,%rbp
nopl   0x0(%rax)
add    %r14,%rax
add    %r14,%rcx
add    %r14,%rdx
add    %r14,%rsi
add    %r14,%rdi
add    %r14,%rbp
cmpb   $0x2e,(%rbx)
lea    -0x1(%rbx),%rbx
jne    1310 <main_process+0x120>
jmp    13eb <main_process+0x1fb>
movabs $0xffffffff00000000,%r14
ff ff ff
mov    0x8(%rbx),%rsi
lea    0x220(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x8(%rbx),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
add    %rax,%rbx
add    $0xffffffffffffffff,%rbx
mov    %rax,%r8
shl    $0x20,%r8
movabs $0x600000000,%rax
add    %r8,%rax
movabs $0x500000000,%rcx
add    %r8,%rcx
movabs $0x400000000,%rdx
add    %r8,%rdx
movabs $0x300000000,%rsi
add    %r8,%rsi
movabs $0x200000000,%rdi
add    %r8,%rdi
movabs $0x100000000,%rbp
add    %r8,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %r14,%rax
add    %r14,%rcx
add    %r14,%rdx
add    %r14,%rsi
add    %r14,%rdi
add    %r14,%rbp
cmpb   $0x2e,(%rbx)
lea    -0x1(%rbx),%rbx
jne    13d0 <main_process+0x1e0>
sar    $0x20,%rbp
movb   $0x70,0x20(%rsp,%rbp,1)
sar    $0x20,%rdi
movb   $0x6c,0x20(%rsp,%rdi,1)
sar    $0x20,%rsi
movb   $0x69,0x20(%rsp,%rsi,1)
sar    $0x20,%rdx
movb   $0x73,0x20(%rsp,%rdx,1)
sar    $0x20,%rcx
movb   $0x74,0x20(%rsp,%rcx,1)
sar    $0x20,%rax
movb   $0x0,0x20(%rsp,%rax,1)
jmp    1442 <main_process+0x252>
mov    0x8(%rbx),%rsi
lea    0x220(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xc18(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x120(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <gets@plt>
lea    0xd47(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10d0 <sscanf@plt>
jmp    14c3 <main_process+0x2d3>
mov    (%rbx),%rdi
call   10e0 <usage@plt>
jmp    18f1 <main_process+0x701>
mov    0x8(%rbx),%rsi
lea    0x220(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x10(%rbx),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcpy@plt>
mov    0x18(%rbx),%rdi
call   1100 <atoi@plt>
mov    %eax,0xc(%rsp)
mov    0x20(%rbx),%rdi
call   1100 <atoi@plt>
mov    %eax,0x8(%rsp)
lea    0xbc9(%rip),%rdi
lea    0x220(%rsp),%rbx
lea    0x20(%rsp),%rbp
mov    %rbx,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbbf(%rip),%rsi
mov    %rbx,%rdi
call   10f0 <fopen@plt>
mov    %rax,%r14
lea    0xbaf(%rip),%rsi
mov    %rbp,%rdi
call   10f0 <fopen@plt>
test   %r14,%r14
je     1876 <main_process+0x686>
mov    %rax,%rbx
test   %rax,%rax
je     1876 <main_process+0x686>
lea    0x120(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %rbp,%rdi
call   1080 <trim@plt>
lea    0xb65(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
lea    0xb39(%rip),%rdi
mov    $0x70,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0xb91(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0xb9a(%rip),%rdi
mov    $0x29,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    %rbp,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %rbp,%rdi
call   1080 <trim@plt>
lea    0xb93(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     17b5 <main_process+0x5c5>
lea    0x320(%rsp),%r13
lea    0x120(%rsp),%r15
nopl   0x0(%rax)
lea    0xb6d(%rip),%rdi
call   1060 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
add    $0x120,%rdi
lea    0xb60(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10d0 <sscanf@plt>
mov    %r13,%rdi
call   1060 <strlen@plt>
cltq
lea    0x1(%rax),%r12d
lea    0x31f(%rsp),%rcx
add    %rcx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffff,%r12d
cmpb   $0x3e,(%rax)
lea    -0x1(%rax),%rax
jne    1650 <main_process+0x460>
lea    0xb1f(%rip),%rdi
call   1060 <strlen@plt>
sub    %eax,%r12d
movslq %r12d,%rax
movb   $0x0,0x320(%rsp,%rax,1)
lea    0xb13(%rip),%rdi
call   1060 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rbp
add    $0x120,%rbp
mov    %r13,%rdi
call   1060 <strlen@plt>
movslq %eax,%rdi
add    %rbp,%rdi
lea    0xb05(%rip),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
xor    %eax,%eax
call   10d0 <sscanf@plt>
lea    0xaec(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
lea    0xafa(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xafa(%rip),%rdi
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    $0x21,%esi
mov    $0x1,%edx
lea    0xaf5(%rip),%rdi
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
mov    %rbx,%rdi
lea    0xaf3(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0x23,%esi
mov    $0x1,%edx
lea    0xb0f(%rip),%rdi
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    $0x19,%esi
mov    $0x1,%edx
lea    0xb1a(%rip),%rdi
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xb1b(%rip),%rdi
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1090 <fgets@plt>
mov    %r15,%rdi
call   1080 <trim@plt>
mov    %r15,%rdi
lea    0x9c4(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1600 <main_process+0x410>
lea    0xae0(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0xad8(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0x96d(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0xac3(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0xac9(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
test   %eax,%eax
jle    1889 <main_process+0x699>
test   %ecx,%ecx
jle    1889 <main_process+0x699>
lea    0xac2(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xabe(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    18a3 <main_process+0x6b3>
lea    0xae7(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%eax
jmp    18f3 <main_process+0x703>
test   %ecx,%ecx
setg   %cl
test   %eax,%eax
setg   %al
cmp    %cl,%al
je     18a3 <main_process+0x6b3>
lea    0xb1b(%rip),%rdi
call   1040 <puts@plt>
lea    0x9f2(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
lea    0xa8b(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1110 <fwrite@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xa9e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter input file name: \00"
@.str.1 = [53 x i8] c"Enter output file name (<Enter> for auto generate): \00"
@.str.2 = [50 x i8] c"Enter width, height (<Enter> for auto generate): \00"
@.str.3 = [5 x i8] c"%d%d\00"
@.str.4 = [23 x i8] c"\0AInput: %s\0AOutput: %s\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [39 x i8] c"\0AERROR: Cannot open input/output file\0A\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@.str.9 = [113 x i8] c"<!DOCTYPE plist PUBLIC \22-//Apple Computer//DTD PLIST 1.0//EN\22 \22http://www.apple.com/DTDs/PropertyList-1.0.dtd\22>\0A\00"
@.str.10 = [34 x i8] c"<plist version=\221.0\22>\0A <dict>\0A\00"
@.str.11 = [42 x i8] c" <key>frames</key>\0A <dict>\0A\00"
@.str.12 = [9 x i8] c"</Asset>\00"
@.str.13 = [12 x i8] c"<Item><Key>\00"
@.str.14 = [3 x i8] c"%s\00"
@.str.15 = [14 x i8] c"</Key><Value>\00"
@.str.16 = [25 x i8] c"<Item></Key><Value><Key>\00"
@.str.17 = [9 x i8] c"%d%d%d%d\00"
@.str.18 = [34 x i8] c"INFO: Converting sprite frame %s\0A\00"
@.str.19 = [27 x i8] c" <key>%s</key>\0A\00"
@.str.20 = [20 x i8] c" <dict>\0A\00"
@.str.21 = [34 x i8] c" <key>frame</key>\0A\00"
@.str.22 = [52 x i8] c" <string>{{%d,%d},{%d,%d}}</string>\0A\00"
@.str.23 = [36 x i8] c" <key>rotated</key>\0A\00"
@.str.24 = [26 x i8] c" <false/>\0A\00"
@.str.25 = [21 x i8] c" </dict>\0A\00"
@.str.26 = [17 x i8] c" </dict>\0A\00"
@.str.27 = [29 x i8] c" <key>metadata</key>\0A\00"
@.str.28 = [16 x i8] c" <dict>\0A\00"
@.str.29 = [31 x i8] c" <key>format</key>\0A\00"
@.str.30 = [34 x i8] c" <integer>2</integer>\0A\00"
@.str.31 = [29 x i8] c" <key>size</key>\0A\00"
@.str.32 = [38 x i8] c" <string>{%d,%d}</string>\0A\00"
@.str.33 = [54 x i8] c"WARNING: Only got one of width and height. Ignoring.\0A\00"
@.str.34 = [22 x i8] c" </dict>\0A</plist>\0A\00"
@.str.35 = [48 x i8] c"\0AINFO: Successfully created your PLIST. Enjoy!\0A\00"
define i32 @main_process(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca [256 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [256 x i8]
%12 = alloca i32
%13 = alloca [256 x i8]
%14 = alloca [256 x i8]
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca [256 x i8]
%18 = alloca [256 x i8]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %8
store i32 -1, i32* %9
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %86
26: ; preds = %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%29 = call i32 @gets(i8* %28)
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%31 = call i32 @trim(i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%34 = call i32 @gets(i8* %33)
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%36 = call i32 @trim(i8* %35)
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%38 = call i32 @strlen(i8* %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %80
40: ; preds = %26
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%43 = call i32 @strcpy(i8* %41, i8* %42)
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%45 = call i32 @strlen(i8* %44)
store i32 %45, i32* %10
br label %46
46: ; preds = %54, %40
%47 = load i32, i32* %10
%48 = add nsw i32 %47, -1
store i32 %48, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 46
br i1 %53, label %54, label %55
54: ; preds = %46
br label %46
55: ; preds = %46
%56 = load i32, i32* %10
%57 = add nsw i32 %56, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %58
store i8 112, i8* %59
%60 = load i32, i32* %10
%61 = add nsw i32 %60, 2
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %62
store i8 108, i8* %63
%64 = load i32, i32* %10
%65 = add nsw i32 %64, 3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %66
store i8 105, i8* %67
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 4
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %70
store i8 115, i8* %71
%72 = load i32, i32* %10
%73 = add nsw i32 %72, 5
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %74
store i8 116, i8* %75
%76 = load i32, i32* %10
%77 = add nsw i32 %76, 6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %78
store i8 0, i8* %79
br label %80
80: ; preds = %55, %26
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%83 = call i32 @gets(i8* %82)
%84 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%85 = call i32 (i8*, i8*, ...) @sscanf(i8* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %8, i32* %9)
br label %190
86: ; preds = %2
%87 = load i32, i32* %4
%88 = icmp eq i32 %87, 2
br i1 %88, label %89, label %141
89: ; preds = %86
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 1
%93 = load i8*, i8** %92
%94 = call i32 @strcpy(i8* %90, i8* %93)
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%96 = load i8**, i8*** %5
%97 = getelementptr inbounds i8*, i8** %96, i64 1
%98 = load i8*, i8** %97
%99 = call i32 @strcpy(i8* %95, i8* %98)
%100 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%101 = call i32 @strlen(i8* %100)
store i32 %101, i32* %12
br label %102
102: ; preds = %110, %89
%103 = load i32, i32* %12
%104 = add nsw i32 %103, -1
store i32 %104, i32* %12
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %105
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp ne i32 %108, 46
br i1 %109, label %110, label %111
110: ; preds = %102
br label %102
111: ; preds = %102
%112 = load i32, i32* %12
%113 = add nsw i32 %112, 1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %114
store i8 112, i8* %115
%116 = load i32, i32* %12
%117 = add nsw i32 %116, 2
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %118
store i8 108, i8* %119
%120 = load i32, i32* %12
%121 = add nsw i32 %120, 3
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %122
store i8 105, i8* %123
%124 = load i32, i32* %12
%125 = add nsw i32 %124, 4
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %126
store i8 115, i8* %127
%128 = load i32, i32* %12
%129 = add nsw i32 %128, 5
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %130
store i8 116, i8* %131
%132 = load i32, i32* %12
%133 = add nsw i32 %132, 6
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %134
store i8 0, i8* %135
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%137 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%138 = call i32 @gets(i8* %137)
%139 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%140 = call i32 (i8*, i8*, ...) @sscanf(i8* %139, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %8, i32* %9)
br label %189
141: ; preds = %86
%142 = load i32, i32* %4
%143 = icmp eq i32 %142, 3
br i1 %143, label %144, label %160
144: ; preds = %141
%145 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%146 = load i8**, i8*** %5
%147 = getelementptr inbounds i8*, i8** %146, i64 1
%148 = load i8*, i8** %147
%149 = call i32 @strcpy(i8* %145, i8* %148)
%150 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%151 = load i8**, i8*** %5
%152 = getelementptr inbounds i8*, i8** %151, i64 2
%153 = load i8*, i8** %152
%154 = call i32 @strcpy(i8* %150, i8* %153)
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%156 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%157 = call i32 @gets(i8* %156)
%158 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%159 = call i32 (i8*, i8*, ...) @sscanf(i8* %158, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %8, i32* %9)
br label %188
160: ; preds = %141
%161 = load i32, i32* %4
%162 = icmp eq i32 %161, 5
br i1 %162, label %163, label %182
163: ; preds = %160
%164 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%165 = load i8**, i8*** %5
%166 = getelementptr inbounds i8*, i8** %165, i64 1
%167 = load i8*, i8** %166
%168 = call i32 @strcpy(i8* %164, i8* %167)
%169 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%170 = load i8**, i8*** %5
%171 = getelementptr inbounds i8*, i8** %170, i64 2
%172 = load i8*, i8** %171
%173 = call i32 @strcpy(i8* %169, i8* %172)
%174 = load i8**, i8*** %5
%175 = getelementptr inbounds i8*, i8** %174, i64 3
%176 = load i8*, i8** %175
%177 = call i32 @atoi(i8* %176)
store i32 %177, i32* %8
%178 = load i8**, i8*** %5
%179 = getelementptr inbounds i8*, i8** %178, i64 4
%180 = load i8*, i8** %179
%181 = call i32 @atoi(i8* %180)
store i32 %181, i32* %9
br label %187
182: ; preds = %160
%183 = load i8**, i8*** %5
%184 = getelementptr inbounds i8*, i8** %183, i64 0
%185 = load i8*, i8** %184
%186 = call i32 @usage(i8* %185)
store i32 0, i32* %3
br label %340
187: ; preds = %163
br label %188
188: ; preds = %187, %144
br label %189
189: ; preds = %188, %111
br label %190
190: ; preds = %189, %80
%191 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%192 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %191, i8* %192)
%194 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%195 = call i32* @fopen(i8* %194, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %195, i32** %15
%196 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%197 = call i32* @fopen(i8* %196, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %197, i32** %16
%198 = load i32*, i32** %15
%199 = icmp ne i32* %198, null
br i1 %199, label %200, label %203
200: ; preds = %190
%201 = load i32*, i32** %16
%202 = icmp ne i32* %201, null
br i1 %202, label %205, label %203
203: ; preds = %200, %190
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
store i32 10, i32* %3
br label %340
205: ; preds = %200
%206 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%207 = load i32*, i32** %15
%208 = call i32 @fgets(i8* %206, i32 256, i32* %207)
%209 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%210 = call i32 @trim(i8* %209)
%211 = load i32*, i32** %16
%212 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %211, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %212)
%214 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%215 = load i32*, i32** %15
%216 = call i32 @fgets(i8* %214, i32 256, i32* %215)
%217 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%218 = load i32*, i32** %15
%219 = call i32 @fgets(i8* %217, i32 256, i32* %218)
%220 = load i32*, i32** %16
%221 = call i32 (i32*, i8*, ...) @fprintf(i32* %220, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.9, i64 0, i64 0))
%222 = load i32*, i32** %16
%223 = call i32 (i32*, i8*, ...) @fprintf(i32* %222, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0))
%224 = load i32*, i32** %16
%225 = call i32 (i32*, i8*, ...) @fprintf(i32* %224, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%226 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%227 = load i32*, i32** %15
%228 = call i32 @fgets(i8* %226, i32 256, i32* %227)
%229 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%230 = call i32 @trim(i8* %229)
br label %231
231: ; preds = %253, %205
%232 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%233 = call i64 @strcmp(i8* %232, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%234 = icmp ne i64 %233, 0
br i1 %234, label %235, label %295
235: ; preds = %231
%236 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%237 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds i8, i8* %236, i64 %238
%240 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%241 = call i32 (i8*, i8*, ...) @sscanf(i8* %239, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* %240)
%242 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%243 = call i32 @strlen(i8* %242)
store i32 %243, i32* %23
br label %244
244: ; preds = %252, %235
%245 = load i32, i32* %23
%246 = add nsw i32 %245, -1
store i32 %246, i32* %23
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 %247
%249 = load i8, i8* %248
%250 = sext i8 %249 to i32
%251 = icmp ne i32 %250, 62
br i1 %251, label %252, label %253
252: ; preds = %244
br label %244
253: ; preds = %244
%254 = load i32, i32* %23
%255 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%256 = sub nsw i32 %254, %255
%257 = add nsw i32 %256, 1
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 %258
store i8 0, i8* %259
%260 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%261 = call i32 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds i8, i8* %260, i64 %262
%264 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%265 = call i32 @strlen(i8* %264)
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds i8, i8* %263, i64 %266
%268 = call i32 (i8*, i8*, ...) @sscanf(i8* %267, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32* %19, i32* %20, i32* %21, i32* %22)
%269 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0), i8* %269)
%271 = load i32*, i32** %16
%272 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%273 = call i32 (i32*, i8*, ...) @fprintf(i32* %271, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i8* %272)
%274 = load i32*, i32** %16
%275 = call i32 (i32*, i8*, ...) @fprintf(i32* %274, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0))
%276 = load i32*, i32** %16
%277 = call i32 (i32*, i8*, ...) @fprintf(i32* %276, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i64 0, i64 0))
%278 = load i32*, i32** %16
%279 = load i32, i32* %19
%280 = load i32, i32* %20
%281 = load i32, i32* %21
%282 = load i32, i32* %22
%283 = call i32 (i32*, i8*, ...) @fprintf(i32* %278, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.22, i64 0, i64 0), i32 %279, i32 %280, i32 %281, i32 %282)
%284 = load i32*, i32** %16
%285 = call i32 (i32*, i8*, ...) @fprintf(i32* %284, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.23, i64 0, i64 0))
%286 = load i32*, i32** %16
%287 = call i32 (i32*, i8*, ...) @fprintf(i32* %286, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0))
%288 = load i32*, i32** %16
%289 = call i32 (i32*, i8*, ...) @fprintf(i32* %288, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0))
%290 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%291 = load i32*, i32** %15
%292 = call i32 @fgets(i8* %290, i32 256, i32* %291)
%293 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%294 = call i32 @trim(i8* %293)
br label %231
295: ; preds = %231
%296 = load i32*, i32** %16
%297 = call i32 (i32*, i8*, ...) @fprintf(i32* %296, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0))
%298 = load i32*, i32** %16
%299 = call i32 (i32*, i8*, ...) @fprintf(i32* %298, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.27, i64 0, i64 0))
%300 = load i32*, i32** %16
%301 = call i32 (i32*, i8*, ...) @fprintf(i32* %300, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0))
%302 = load i32*, i32** %16
%303 = call i32 (i32*, i8*, ...) @fprintf(i32* %302, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.29, i64 0, i64 0))
%304 = load i32*, i32** %16
%305 = call i32 (i32*, i8*, ...) @fprintf(i32* %304, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.30, i64 0, i64 0))
%306 = load i32, i32* %8
%307 = icmp sgt i32 %306, 0
br i1 %307, label %308, label %318
308: ; preds = %295
%309 = load i32, i32* %9
%310 = icmp sgt i32 %309, 0
br i1 %310, label %311, label %318
311: ; preds = %308
%312 = load i32*, i32** %16
%313 = call i32 (i32*, i8*, ...) @fprintf(i32* %312, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.31, i64 0, i64 0))
%314 = load i32*, i32** %16
%315 = load i32, i32* %8
%316 = load i32, i32* %9
%317 = call i32 (i32*, i8*, ...) @fprintf(i32* %314, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.32, i64 0, i64 0), i32 %315, i32 %316)
br label %330
318: ; preds = %308, %295
%319 = load i32, i32* %8
%320 = icmp sgt i32 %319, 0
%321 = zext i1 %320 to i32
%322 = load i32, i32* %9
%323 = icmp sgt i32 %322, 0
%324 = zext i1 %323 to i32
%325 = xor i32 %321, %324
%326 = icmp ne i32 %325, 0
br i1 %326, label %327, label %329
327: ; preds = %318
%328 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.33, i64 0, i64 0))
br label %329
329: ; preds = %327, %318
br label %330
330: ; preds = %329, %311
%331 = load i32*, i32** %16
%332 = call i32 (i32*, i8*, ...) @fprintf(i32* %331, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0))
%333 = load i32*, i32** %16
%334 = call i32 (i32*, i8*, ...) @fprintf(i32* %333, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.34, i64 0, i64 0))
%335 = load i32*, i32** %15
%336 = call i32 @fclose(i32* %335)
%337 = load i32*, i32** %16
%338 = call i32 @fclose(i32* %337)
%339 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.35, i64 0, i64 0))
store i32 0, i32* %3
br label %340
340: ; preds = %330, %203, %182
%341 = load i32, i32* %3
ret i32 %341
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter input file name: \00"
@.str.1 = [53 x i8] c"Enter output file name (<Enter> for auto generate): \00"
@.str.2 = [50 x i8] c"Enter width, height (<Enter> for auto generate): \00"
@.str.3 = [5 x i8] c"%d%d\00"
@.str.4 = [23 x i8] c"\0AInput: %s\0AOutput: %s\0A\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [2 x i8] c"w\00"
@.str.8 = [4 x i8] c"%s\0A\00"
@.str.9 = [113 x i8] c"<!DOCTYPE plist PUBLIC \22-//Apple Computer//DTD PLIST 1.0//EN\22 \22http://www.apple.com/DTDs/PropertyList-1.0.dtd\22>\0A\00"
@.str.10 = [34 x i8] c"<plist version=\221.0\22>\0A <dict>\0A\00"
@.str.11 = [42 x i8] c" <key>frames</key>\0A <dict>\0A\00"
@.str.12 = [9 x i8] c"</Asset>\00"
@.str.13 = [12 x i8] c"<Item><Key>\00"
@.str.14 = [3 x i8] c"%s\00"
@.str.15 = [14 x i8] c"</Key><Value>\00"
@.str.16 = [25 x i8] c"<Item></Key><Value><Key>\00"
@.str.17 = [9 x i8] c"%d%d%d%d\00"
@.str.18 = [34 x i8] c"INFO: Converting sprite frame %s\0A\00"
@.str.19 = [27 x i8] c" <key>%s</key>\0A\00"
@.str.20 = [20 x i8] c" <dict>\0A\00"
@.str.21 = [34 x i8] c" <key>frame</key>\0A\00"
@.str.22 = [52 x i8] c" <string>{{%d,%d},{%d,%d}}</string>\0A\00"
@.str.23 = [36 x i8] c" <key>rotated</key>\0A\00"
@.str.24 = [26 x i8] c" <false/>\0A\00"
@.str.25 = [21 x i8] c" </dict>\0A\00"
@.str.26 = [17 x i8] c" </dict>\0A\00"
@.str.27 = [29 x i8] c" <key>metadata</key>\0A\00"
@.str.28 = [16 x i8] c" <dict>\0A\00"
@.str.29 = [31 x i8] c" <key>format</key>\0A\00"
@.str.30 = [34 x i8] c" <integer>2</integer>\0A\00"
@.str.31 = [29 x i8] c" <key>size</key>\0A\00"
@.str.32 = [38 x i8] c" <string>{%d,%d}</string>\0A\00"
@.str.34 = [22 x i8] c" </dict>\0A</plist>\0A\00"
@str = [38 x i8] c"\0AERROR: Cannot open input/output file\00"
@str.36 = [47 x i8] c"\0AINFO: Successfully created your PLIST. Enjoy!\00"
@str.37 = [53 x i8] c"WARNING: Only got one of width and height. Ignoring.\00"
define i32 @main_process(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%18 = bitcast i32* %5 to i8*
store i32 -1, i32* %5
%19 = bitcast i32* %6 to i8*
store i32 -1, i32* %6
switch i32 %0, label %134 [
i32 1, label %20
i32 2, label %68
i32 3, label %110
i32 5, label %121
]
20: ; preds = %2
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @gets(i8* %16)
%23 = call i32 @trim(i8* %16)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @gets(i8* %17)
%26 = call i32 @trim(i8* %17)
%27 = call i32 @strlen(i8* %17)
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %63
29: ; preds = %20
%30 = call i32 @strcpy(i8* %17, i8* %16)
%31 = call i32 @strlen(i8* %17)
%32 = sext i32 %31 to i64
br label %33
33: ; preds = %33, %29
%34 = phi i64 [ %35, %33 ], [ %32, %29 ]
%35 = add i64 %34, -1
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 46
br i1 %38, label %39, label %33
39: ; preds = %33
%40 = shl i64 %34, 32
%41 = ashr exact i64 %40, 32
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %41
store i8 112, i8* %42
%43 = shl i64 %34, 32
%44 = add i64 %43, 4294967296
%45 = ashr exact i64 %44, 32
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %45
store i8 108, i8* %46
%47 = shl i64 %34, 32
%48 = add i64 %47, 8589934592
%49 = ashr exact i64 %48, 32
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %49
store i8 105, i8* %50
%51 = shl i64 %34, 32
%52 = add i64 %51, 12884901888
%53 = ashr exact i64 %52, 32
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %53
store i8 115, i8* %54
%55 = shl i64 %34, 32
%56 = add i64 %55, 17179869184
%57 = ashr exact i64 %56, 32
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %57
store i8 116, i8* %58
%59 = shl i64 %34, 32
%60 = add i64 %59, 21474836480
%61 = ashr exact i64 %60, 32
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %61
store i8 0, i8* %62
br label %63
63: ; preds = %39, %20
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%65 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%66 = call i32 @gets(i8* %65)
%67 = call i32 (i8*, i8*, ...) @sscanf(i8* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %6)
br label %137
68: ; preds = %2
%69 = getelementptr inbounds i8*, i8** %1, i64 1
%70 = load i8*, i8** %69
%71 = call i32 @strcpy(i8* %16, i8* %70)
%72 = load i8*, i8** %69
%73 = call i32 @strcpy(i8* %17, i8* %72)
%74 = call i32 @strlen(i8* %17)
%75 = sext i32 %74 to i64
br label %76
76: ; preds = %76, %68
%77 = phi i64 [ %78, %76 ], [ %75, %68 ]
%78 = add i64 %77, -1
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %78
%80 = load i8, i8* %79
%81 = icmp eq i8 %80, 46
br i1 %81, label %82, label %76
82: ; preds = %76
%83 = shl i64 %77, 32
%84 = ashr exact i64 %83, 32
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %84
store i8 112, i8* %85
%86 = shl i64 %77, 32
%87 = add i64 %86, 4294967296
%88 = ashr exact i64 %87, 32
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %88
store i8 108, i8* %89
%90 = shl i64 %77, 32
%91 = add i64 %90, 8589934592
%92 = ashr exact i64 %91, 32
%93 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %92
store i8 105, i8* %93
%94 = shl i64 %77, 32
%95 = add i64 %94, 12884901888
%96 = ashr exact i64 %95, 32
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %96
store i8 115, i8* %97
%98 = shl i64 %77, 32
%99 = add i64 %98, 17179869184
%100 = ashr exact i64 %99, 32
%101 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %100
store i8 116, i8* %101
%102 = shl i64 %77, 32
%103 = add i64 %102, 21474836480
%104 = ashr exact i64 %103, 32
%105 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %104
store i8 0, i8* %105
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%108 = call i32 @gets(i8* %107)
%109 = call i32 (i8*, i8*, ...) @sscanf(i8* %107, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %6)
br label %137
110: ; preds = %2
%111 = getelementptr inbounds i8*, i8** %1, i64 1
%112 = load i8*, i8** %111
%113 = call i32 @strcpy(i8* %16, i8* %112)
%114 = getelementptr inbounds i8*, i8** %1, i64 2
%115 = load i8*, i8** %114
%116 = call i32 @strcpy(i8* %17, i8* %115)
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%119 = call i32 @gets(i8* %118)
%120 = call i32 (i8*, i8*, ...) @sscanf(i8* %118, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %6)
br label %137
121: ; preds = %2
%122 = getelementptr inbounds i8*, i8** %1, i64 1
%123 = load i8*, i8** %122
%124 = call i32 @strcpy(i8* %16, i8* %123)
%125 = getelementptr inbounds i8*, i8** %1, i64 2
%126 = load i8*, i8** %125
%127 = call i32 @strcpy(i8* %17, i8* %126)
%128 = getelementptr inbounds i8*, i8** %1, i64 3
%129 = load i8*, i8** %128
%130 = call i32 @atoi(i8* %129)
store i32 %130, i32* %5
%131 = getelementptr inbounds i8*, i8** %1, i64 4
%132 = load i8*, i8** %131
%133 = call i32 @atoi(i8* %132)
store i32 %133, i32* %6
br label %137
134: ; preds = %2
%135 = load i8*, i8** %1
%136 = tail call i32 @usage(i8* %135)
br label %233
137: ; preds = %82, %121, %110, %63
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %16, i8* %17)
%139 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%140 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%141 = icmp ne i32* %139, null
%142 = icmp ne i32* %140, null
%143 = and i1 %141, %142
br i1 %143, label %146, label %144
144: ; preds = %137
%145 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %233
146: ; preds = %137
%147 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%148 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%149 = bitcast i32* %12 to i8*
%150 = bitcast i32* %13 to i8*
%151 = bitcast i32* %14 to i8*
%152 = bitcast i32* %15 to i8*
%153 = call i32 @fgets(i8* %147, i32 256, i32* %139)
%154 = call i32 @trim(i8* %147)
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %147)
%156 = call i32 @fgets(i8* %147, i32 256, i32* %139)
%157 = call i32 @fgets(i8* %147, i32 256, i32* %139)
%158 = call i64 @fwrite(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.9, i64 0, i64 0), i64 112, i64 1, i32* %140)
%159 = call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i64 33, i64 1, i32* %140)
%160 = call i64 @fwrite(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0), i64 41, i64 1, i32* %140)
%161 = call i32 @fgets(i8* %147, i32 256, i32* %139)
%162 = call i32 @trim(i8* %147)
%163 = call i64 @strcmp(i8* %147, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%164 = icmp eq i64 %163, 0
br i1 %164, label %207, label %165
165: ; preds = %146, %178
%166 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 %167
%169 = call i32 (i8*, i8*, ...) @sscanf(i8* %168, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* %148)
%170 = call i32 @strlen(i8* %148)
%171 = sext i32 %170 to i64
br label %172
172: ; preds = %172, %165
%173 = phi i64 [ %174, %172 ], [ %171, %165 ]
%174 = add i64 %173, -1
%175 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %174
%176 = load i8, i8* %175
%177 = icmp eq i8 %176, 62
br i1 %177, label %178, label %172
178: ; preds = %172
%179 = trunc i64 %173 to i32
%180 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
%181 = sub i32 %179, %180
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %182
store i8 0, i8* %183
%184 = call i32 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 %185
%187 = call i32 @strlen(i8* %148)
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds i8, i8* %186, i64 %188
%190 = call i32 (i8*, i8*, ...) @sscanf(i8* %189, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32* %12, i32* %13, i32* %14, i32* %15)
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0), i8* %148)
%192 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0), i8* %148)
%193 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i64 19, i64 1, i32* %140)
%194 = call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.21, i64 0, i64 0), i64 33, i64 1, i32* %140)
%195 = load i32, i32* %12
%196 = load i32, i32* %13
%197 = load i32, i32* %14
%198 = load i32, i32* %15
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.22, i64 0, i64 0), i32 %195, i32 %196, i32 %197, i32 %198)
%200 = call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.23, i64 0, i64 0), i64 35, i64 1, i32* %140)
%201 = call i64 @fwrite(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0), i64 25, i64 1, i32* %140)
%202 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0), i64 20, i64 1, i32* %140)
%203 = call i32 @fgets(i8* %147, i32 256, i32* %139)
%204 = call i32 @trim(i8* %147)
%205 = call i64 @strcmp(i8* %147, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%206 = icmp eq i64 %205, 0
br i1 %206, label %207, label %165
207: ; preds = %178, %146
%208 = call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0), i64 16, i64 1, i32* %140)
%209 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.27, i64 0, i64 0), i64 28, i64 1, i32* %140)
%210 = call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0), i64 15, i64 1, i32* %140)
%211 = call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.29, i64 0, i64 0), i64 30, i64 1, i32* %140)
%212 = call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.30, i64 0, i64 0), i64 33, i64 1, i32* %140)
%213 = load i32, i32* %5
%214 = icmp sgt i32 %213, 0
%215 = load i32, i32* %6
%216 = icmp sgt i32 %215, 0
%217 = select i1 %214, i1 %216, i1 false
br i1 %217, label %218, label %223
218: ; preds = %207
%219 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.31, i64 0, i64 0), i64 28, i64 1, i32* %140)
%220 = load i32, i32* %5
%221 = load i32, i32* %6
%222 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.32, i64 0, i64 0), i32 %220, i32 %221)
br label %227
223: ; preds = %207
%224 = xor i1 %214, %216
br i1 %224, label %225, label %227
225: ; preds = %223
%226 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.37, i64 0, i64 0))
br label %227
227: ; preds = %223, %225, %218
%228 = call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0), i64 16, i64 1, i32* %140)
%229 = call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.34, i64 0, i64 0), i64 21, i64 1, i32* %140)
%230 = call i32 @fclose(i32* %139)
%231 = call i32 @fclose(i32* %140)
%232 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.36, i64 0, i64 0))
br label %233
233: ; preds = %144, %227, %134
%234 = phi i32 [ 0, %134 ], [ 0, %227 ], [ 10, %144 ]
ret i32 %234
}