#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 */
scalar_t__ atoi(char *);
scalar_t__ convertHTMLcodes(char *, unsigned long);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ formatIPTC(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
unsigned long strlen(char *);
char *super_fgets(char *, int *, int /*<<< orphan*/ *);
scalar_t__ tokenizer(int /*<<< orphan*/, char *, int, char *, char *, char *,
                     char *, int /*<<< orphan*/, char *, int *, char *);
int main(int argc, char *argv[]) {
  unsigned int length;
  unsigned char *buffer;
  int i, mode;
  FILE *ifile = stdin, *ofile = stdout;
  char c, *usage = "usage: iptcutil -t | -b [-i file] [-o file] <input >output";
  if (argc < 2) {
    puts(usage);
    return 1;
  }
  mode = 0;
  length = -1;
  buffer = (unsigned char *)NULL;
  for (i = 1; i < argc; i++) {
    c = argv[i][0];
    if (c == '-' || c == '/') {
      c = argv[i][1];
      switch (c) {
      case 't':
        mode = 1;
        break;
      case 'b':
        mode = 0;
        break;
      case 'i':
        if (mode == 0)
          ifile = fopen(argv[++i], "rb");
        else
          ifile = fopen(argv[++i], "rt");
        if (ifile == (FILE *)NULL) {
          printf("Unable to open: %s\n", argv[i]);
          return 1;
        }
        break;
      case 'o':
        if (mode == 0)
          ofile = fopen(argv[++i], "wt");
        else
          ofile = fopen(argv[++i], "wb");
        if (ofile == (FILE *)NULL) {
          printf("Unable to open: %s\n", argv[i]);
          return 1;
        }
        break;
      default:
        printf("Unknown option: %s\n", argv[i]);
        return 1;
      }
    } else {
      puts(usage);
      return 1;
    }
  }
  if (mode == 0)
    formatIPTC(ifile, ofile);
  if (mode == 1) {
    char brkused, quoted, *line, *token, *newstr;
    int state, next;
    unsigned char recnum = 0, dataset = 0;
    int inputlen = 4096;
    line = (char *)malloc(inputlen);
    token = (char *)NULL;
    while ((line = super_fgets(line, &inputlen, ifile)) != NULL) {
      state = 0;
      next = 0;
      token = (char *)malloc(inputlen);
      newstr = (char *)malloc(inputlen);
      while (tokenizer(0, token, inputlen, line, "", "=", "\"", 0, &brkused,
                       &next, &quoted) == 0) {
        if (state == 0) {
          int state, next;
          char brkused, quoted;
          state = 0;
          next = 0;
          while (tokenizer(0, newstr, inputlen, token, "", "#", "", 0, &brkused,
                           &next, &quoted) == 0) {
            if (state == 0)
              dataset = (unsigned char)atoi(newstr);
            else if (state == 1)
              recnum = (unsigned char)atoi(newstr);
            state++;
          }
        } else if (state == 1) {
          int next;
          unsigned long len;
          char brkused, quoted;
          next = 0;
          len = strlen(token);
          while (tokenizer(0, newstr, inputlen, token, "", "&", "", 0, &brkused,
                           &next, &quoted) == 0) {
            if (brkused && next > 0) {
              char *s = &token[next - 1];
              len -= convertHTMLcodes(s, strlen(s));
            }
          }
          fputc(0x1c, ofile);
          fputc(dataset, ofile);
          fputc(recnum, ofile);
          if (len < 0x10000) {
            fputc((len >> 8) & 255, ofile);
            fputc(len & 255, ofile);
          } else {
            fputc(((len >> 24) & 255) | 0x80, ofile);
            fputc((len >> 16) & 255, ofile);
            fputc((len >> 8) & 255, ofile);
            fputc(len & 255, ofile);
          }
          next = 0;
          while (len--)
            fputc(token[next++], ofile);
        }
        state++;
      }
      free(token);
      token = (char *)NULL;
      free(newstr);
      newstr = (char *)NULL;
    }
    free(line);
    fclose(ifile);
    fclose(ofile);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xd8,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2df7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2dd9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
lea    0xe3f(%rip),%rax
mov    %rax,-0x50(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1230 <main+0x60>
mov    -0x50(%rbp),%rdi
call   1050 <puts@plt>
movl   $0x1,-0xc(%rbp)
jmp    1894 <main+0x6c4>
movl   $0x0,-0x30(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1445 <main+0x275>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%al
mov    %al,-0x41(%rbp)
movsbl -0x41(%rbp),%eax
cmp    $0x2d,%eax
je     1284 <main+0xb4>
movsbl -0x41(%rbp),%eax
cmp    $0x2f,%eax
jne    141d <main+0x24d>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x1(%rax),%al
mov    %al,-0x41(%rbp)
movsbl -0x41(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0xb0(%rbp)
sub    $0x12,%eax
ja     13f4 <main+0x224>
mov    -0xb0(%rbp),%rax
lea    0xd43(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x30(%rbp)
jmp    1418 <main+0x248>
movl   $0x0,-0x30(%rbp)
jmp    1418 <main+0x248>
cmpl   $0x0,-0x30(%rbp)
jne    1311 <main+0x141>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd84(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x38(%rbp)
jmp    1335 <main+0x165>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd5e(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1364 <main+0x194>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd3a(%rip),%rdi
call   1080 <printf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1894 <main+0x6c4>
jmp    1418 <main+0x248>
cmpl   $0x0,-0x30(%rbp)
jne    139c <main+0x1cc>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd13(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x40(%rbp)
jmp    13c0 <main+0x1f0>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xced(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    13ef <main+0x21f>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xcaf(%rip),%rdi
call   1080 <printf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1894 <main+0x6c4>
jmp    1418 <main+0x248>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xca0(%rip),%rdi
call   1080 <printf@plt>
movl   $0x1,-0xc(%rbp)
jmp    1894 <main+0x6c4>
jmp    1432 <main+0x262>
mov    -0x50(%rbp),%rdi
call   1050 <puts@plt>
movl   $0x1,-0xc(%rbp)
jmp    1894 <main+0x6c4>
jmp    1437 <main+0x267>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    124d <main+0x7d>
cmpl   $0x0,-0x30(%rbp)
jne    145c <main+0x28c>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <formatIPTC@plt>
cmpl   $0x1,-0x30(%rbp)
jne    188d <main+0x6bd>
movb   $0x0,-0x79(%rbp)
movb   $0x0,-0x7a(%rbp)
movl   $0x1000,-0x80(%rbp)
mov    -0x80(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    -0x80(%rbp),%rsi
call   10b0 <super_fgets@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
je     1872 <main+0x6a2>
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x80(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x80(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x68(%rbp),%rsi
mov    -0x80(%rbp),%edx
mov    -0x60(%rbp),%rcx
xor    %edi,%edi
lea    0xbbe(%rip),%r8
lea    0xbd2(%rip),%r9
lea    0xbcd(%rip),%rbx
lea    -0x51(%rbp),%r11
lea    -0x78(%rbp),%r10
lea    -0x52(%rbp),%rax
mov    %rbx,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   10a0 <tokenizer@plt>
cmp    $0x0,%rax
jne    184b <main+0x67b>
cmpl   $0x0,-0x74(%rbp)
jne    15f6 <main+0x426>
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x80(%rbp),%edx
mov    -0x68(%rbp),%rcx
xor    %edi,%edi
lea    0xb48(%rip),%rbx
lea    0xb60(%rip),%r9
lea    -0x89(%rbp),%r11
lea    -0x88(%rbp),%r10
lea    -0x8a(%rbp),%rax
mov    %rbx,%r8
mov    %rbx,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   10a0 <tokenizer@plt>
cmp    $0x0,%rax
jne    15f1 <main+0x421>
cmpl   $0x0,-0x84(%rbp)
jne    15bf <main+0x3ef>
mov    -0x70(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %al,-0x7a(%rbp)
jmp    15dd <main+0x40d>
cmpl   $0x1,-0x84(%rbp)
jne    15d8 <main+0x408>
mov    -0x70(%rbp),%rdi
call   10f0 <atoi@plt>
mov    %al,-0x79(%rbp)
jmp    15dd <main+0x40d>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1544 <main+0x374>
jmp    183d <main+0x66d>
cmpl   $0x1,-0x74(%rbp)
jne    1838 <main+0x668>
movl   $0x0,-0x90(%rbp)
mov    -0x68(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,-0x98(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x80(%rbp),%edx
mov    -0x68(%rbp),%rcx
xor    %edi,%edi
lea    0xa72(%rip),%rbx
lea    0xa8c(%rip),%r9
lea    -0x99(%rbp),%r11
lea    -0x90(%rbp),%r10
lea    -0x9a(%rbp),%rax
mov    %rbx,%r8
mov    %rbx,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   10a0 <tokenizer@plt>
cmp    $0x0,%rax
jne    16f0 <main+0x520>
movsbl -0x99(%rbp),%eax
cmp    $0x0,%eax
je     16eb <main+0x51b>
cmpl   $0x0,-0x90(%rbp)
jle    16eb <main+0x51b>
mov    -0x68(%rbp),%rax
mov    -0x90(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xa8(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xb8(%rbp),%rdi
mov    %rax,%rsi
call   10d0 <convertHTMLcodes@plt>
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x98(%rbp)
jmp    161a <main+0x44a>
mov    -0x40(%rbp),%rsi
mov    $0x1c,%edi
call   1090 <fputc@plt>
mov    -0x7a(%rbp),%al
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
mov    -0x79(%rbp),%al
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
cmpq   $0x10000,-0x98(%rbp)
jae    1768 <main+0x598>
mov    -0x98(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
mov    -0x98(%rbp),%rax
and    $0xff,%rax
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
jmp    17de <main+0x60e>
mov    -0x98(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
or     $0x80,%rax
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
mov    -0x98(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
mov    -0x98(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
mov    -0x98(%rbp),%rax
and    $0xff,%rax
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
movl   $0x0,-0x90(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x98(%rbp)
cmp    $0x0,%rax
je     1833 <main+0x663>
mov    -0x68(%rbp),%rax
mov    -0x90(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x90(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0x40(%rbp),%rsi
movsbl %al,%edi
call   1090 <fputc@plt>
jmp    17e8 <main+0x618>
jmp    1838 <main+0x668>
jmp    183d <main+0x66d>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    14ce <main+0x2fe>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x68(%rbp)
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x70(%rbp)
jmp    1489 <main+0x2b9>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xd8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x1,%edi
jg     1205 <main+0x35>
lea    0xe62(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2dd7(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x20(%rsp)
mov    0x2db8(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    $0x1,%r15d
lea    0xdc9(%rip),%r14
lea    0xe66(%rip),%r13
jmp    124f <main+0x7f>
xor    %eax,%eax
add    $0x1,%r15d
cmp    %ebp,%r15d
jge    12e1 <main+0x111>
mov    %eax,%r12d
movslq %r15d,%rcx
mov    (%rbx,%rcx,8),%rsi
movzbl (%rsi),%eax
and    $0xfd,%al
cmp    $0x2d,%al
jne    11e3 <main+0x13>
movsbl 0x1(%rsi),%edx
add    $0xffffff9e,%edx
cmp    $0x12,%edx
ja     16b9 <main+0x4e9>
mov    $0x1,%eax
movslq (%r14,%rdx,4),%rdx
add    %r14,%rdx
jmp    *%rdx
lea    0x1(%rcx),%r15d
test   %r12d,%r12d
mov    0x8(%rbx,%rcx,8),%rdi
lea    0xdf7(%rip),%rsi
lea    0xded(%rip),%rax
cmove  %rax,%rsi
call   10e0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
jne    12d9 <main+0x109>
jmp    1304 <main+0x134>
nop
lea    0x1(%rcx),%r15d
test   %r12d,%r12d
mov    0x8(%rbx,%rcx,8),%rdi
mov    %r13,%rsi
lea    0xddb(%rip),%rax
cmove  %rax,%rsi
call   10e0 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     1304 <main+0x134>
mov    %r12d,%eax
jmp    1242 <main+0x72>
cmp    $0x1,%eax
je     1317 <main+0x147>
xor    %ebx,%ebx
test   %eax,%eax
jne    11f4 <main+0x24>
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rsi
call   1040 <formatIPTC@plt>
jmp    11f4 <main+0x24>
movslq %r15d,%rax
mov    (%rbx,%rax,8),%rsi
lea    0xd7b(%rip),%rdi
jmp    16c0 <main+0x4f0>
movl   $0x1000,0xc(%rsp)
mov    $0x1000,%edi
call   10c0 <malloc@plt>
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
mov    0x20(%rsp),%rdx
call   10b0 <super_fgets@plt>
test   %rax,%rax
mov    0x18(%rsp),%rbp
je     1699 <main+0x4c9>
mov    %rax,%r14
xor    %eax,%eax
mov    %rax,0x38(%rsp)
lea    0xd46(%rip),%rbx
xor    %eax,%eax
mov    %rax,0x30(%rsp)
jmp    139e <main+0x1ce>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
mov    0x20(%rsp),%rdx
call   10b0 <super_fgets@plt>
mov    %rax,%r14
test   %rax,%rax
je     1699 <main+0x4c9>
movl   $0x0,0x2c(%rsp)
mov    0xc(%rsp),%edi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    0xc(%rsp),%edi
call   10c0 <malloc@plt>
mov    %rax,%r15
mov    0xc(%rsp),%edx
sub    $0x8,%rsp
xor    %edi,%edi
mov    %r12,%rsi
mov    %r14,%rcx
mov    %rbx,%r8
lea    0xce3(%rip),%r9
lea    0x1e(%rsp),%rax
push   %rax
lea    0x3c(%rsp),%rax
push   %rax
lea    0x2f(%rsp),%rax
push   %rax
push   $0x0
lea    0xcca(%rip),%rax
push   %rax
call   10a0 <tokenizer@plt>
add    $0x30,%rsp
test   %rax,%rax
jne    1370 <main+0x1a0>
xor    %r13d,%r13d
mov    %r14,0x40(%rsp)
jmp    1461 <main+0x291>
mov    0x40(%rsp),%r14
add    $0x1,%r13d
mov    0xc(%rsp),%edx
sub    $0x8,%rsp
xor    %edi,%edi
mov    %r12,%rsi
mov    %r14,%rcx
mov    %rbx,%r8
lea    0xc88(%rip),%r9
lea    0x1e(%rsp),%rax
push   %rax
lea    0x3c(%rsp),%rax
push   %rax
lea    0x2f(%rsp),%rax
push   %rax
push   $0x0
lea    0xc6f(%rip),%rax
push   %rax
call   10a0 <tokenizer@plt>
add    $0x30,%rsp
test   %rax,%rax
jne    1370 <main+0x1a0>
cmp    $0x1,%r13d
je     14c0 <main+0x2f0>
test   %r13d,%r13d
jne    1415 <main+0x245>
movl   $0x0,0x10(%rsp)
mov    0xc(%rsp),%edx
sub    $0x8,%rsp
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rcx
mov    %rbx,%r8
lea    0xc31(%rip),%r9
lea    0x13(%rsp),%rax
push   %rax
lea    0x20(%rsp),%rax
push   %rax
lea    0x22(%rsp),%rax
push   %rax
push   $0x0
push   %rbx
call   10a0 <tokenizer@plt>
add    $0x30,%rsp
test   %rax,%rax
je     1625 <main+0x455>
mov    0x18(%rsp),%rbp
jmp    1415 <main+0x245>
nop
movl   $0x0,0x10(%rsp)
mov    %r12,%rdi
call   1070 <strlen@plt>
mov    %rax,%r14
jmp    14e5 <main+0x315>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x18(%rsp),%rbp
mov    0xc(%rsp),%edx
sub    $0x8,%rsp
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rcx
mov    %rbx,%r8
lea    0xbc2(%rip),%r9
lea    0x13(%rsp),%rax
push   %rax
lea    0x20(%rsp),%rax
push   %rax
lea    0x22(%rsp),%rax
push   %rax
push   $0x0
push   %rbx
call   10a0 <tokenizer@plt>
add    $0x30,%rsp
test   %rax,%rax
jne    1550 <main+0x380>
cmpb   $0x0,0xa(%rsp)
je     14e5 <main+0x315>
mov    0x10(%rsp),%ebp
test   %ebp,%ebp
jle    14e0 <main+0x310>
add    $0xffffffff,%ebp
add    %r12,%rbp
mov    %rbp,%rdi
call   1070 <strlen@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
call   10d0 <convertHTMLcodes@plt>
sub    %rax,%r14
jmp    14e0 <main+0x310>
nop
mov    $0x1c,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
movsbl 0x38(%rsp),%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
movsbl 0x30(%rsp),%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
cmp    $0x10000,%r14
jae    15a7 <main+0x3d7>
mov    %r14d,%eax
shr    $0x8,%eax
movsbl %al,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
movsbl %r14b,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
test   %r14,%r14
jne    15e9 <main+0x419>
jmp    1410 <main+0x240>
mov    %r14,%rax
shr    $0x18,%rax
or     $0x80,%al
movsbl %al,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
mov    %r14d,%eax
shr    $0x10,%eax
movsbl %al,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
mov    %r14d,%eax
shr    $0x8,%eax
movsbl %al,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
movsbl %r14b,%edi
mov    %rbp,%rsi
call   1090 <fputc@plt>
movl   $0x1,0x10(%rsp)
movsbl (%r12),%edi
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rsi
call   1090 <fputc@plt>
add    $0xffffffffffffffff,%r14
je     1410 <main+0x240>
movslq 0x10(%rsp),%rax
lea    0x1(%rax),%ecx
mov    %ecx,0x10(%rsp)
movsbl (%r12,%rax,1),%edi
jmp    1600 <main+0x430>
xor    %ebp,%ebp
jmp    1681 <main+0x4b1>
nopl   0x0(%rax)
mov    %r15,%rdi
call   10f0 <atoi@plt>
mov    %rax,0x30(%rsp)
add    $0x1,%ebp
mov    0xc(%rsp),%edx
sub    $0x8,%rsp
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rcx
mov    %rbx,%r8
lea    0xa65(%rip),%r9
lea    0x13(%rsp),%rax
push   %rax
lea    0x20(%rsp),%rax
push   %rax
lea    0x22(%rsp),%rax
push   %rax
push   $0x0
push   %rbx
call   10a0 <tokenizer@plt>
add    $0x30,%rsp
test   %rax,%rax
jne    14b5 <main+0x2e5>
cmp    $0x1,%ebp
je     1630 <main+0x460>
test   %ebp,%ebp
jne    163d <main+0x46d>
mov    %r15,%rdi
call   10f0 <atoi@plt>
mov    %rax,0x38(%rsp)
jmp    163d <main+0x46d>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1060 <fclose@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
jmp    11f4 <main+0x24>
lea    0x9e7(%rip),%rdi
call   1080 <printf@plt>
jmp    11ef <main+0x1f>

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@.str = [59 x i8] c"usage: iptcutil -t | -b [-i file] [-o file] <input >output\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"rt\00"
@.str.3 = [20 x i8] c"Unable to open: %s\0A\00"
@.str.4 = [3 x i8] c"wt\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [20 x i8] c"Unknown option: %s\0A\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [2 x i8] c"=\00"
@.str.9 = [2 x i8] c"\22\00"
@.str.10 = [2 x i8] c"#\00"
@.str.11 = [2 x i8] c"&\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8
%13 = alloca i8*
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8
%22 = alloca i8
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8
%27 = alloca i8
%28 = alloca i32
%29 = alloca i64
%30 = alloca i8
%31 = alloca i8
%32 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%33 = load i32*, i32** @stdin
store i32* %33, i32** %10
%34 = load i32*, i32** @stdout
store i32* %34, i32** %11
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8** %13
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 2
br i1 %36, label %37, label %40
37: ; preds = %2
%38 = load i8*, i8** %13
%39 = call i32 @puts(i8* %38)
store i32 1, i32* %3
br label %320
40: ; preds = %2
store i32 0, i32* %9
store i32 -1, i32* %6
store i8* null, i8** %7
store i32 1, i32* %8
br label %41
41: ; preds = %144, %40
%42 = load i32, i32* %8
%43 = load i32, i32* %4
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %147
45: ; preds = %41
%46 = load i8**, i8*** %5
%47 = load i32, i32* %8
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = getelementptr inbounds i8, i8* %50, i64 0
%52 = load i8, i8* %51
store i8 %52, i8* %12
%53 = load i8, i8* %12
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 45
br i1 %55, label %60, label %56
56: ; preds = %45
%57 = load i8, i8* %12
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 47
br i1 %59, label %60, label %140
60: ; preds = %56, %45
%61 = load i8**, i8*** %5
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
%66 = getelementptr inbounds i8, i8* %65, i64 1
%67 = load i8, i8* %66
store i8 %67, i8* %12
%68 = load i8, i8* %12
%69 = sext i8 %68 to i32
switch i32 %69, label %132 [
i32 116, label %70
i32 98, label %71
i32 105, label %72
i32 111, label %102
]
70: ; preds = %60
store i32 1, i32* %9
br label %139
71: ; preds = %60
store i32 0, i32* %9
br label %139
72: ; preds = %60
%73 = load i32, i32* %9
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %83
75: ; preds = %72
%76 = load i8**, i8*** %5
%77 = load i32, i32* %8
%78 = add nsw i32 %77, 1
store i32 %78, i32* %8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8*, i8** %76, i64 %79
%81 = load i8*, i8** %80
%82 = call i32* @fopen(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %82, i32** %10
br label %91
83: ; preds = %72
%84 = load i8**, i8*** %5
%85 = load i32, i32* %8
%86 = add nsw i32 %85, 1
store i32 %86, i32* %8
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %84, i64 %87
%89 = load i8*, i8** %88
%90 = call i32* @fopen(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %90, i32** %10
br label %91
91: ; preds = %83, %75
%92 = load i32*, i32** %10
%93 = icmp eq i32* %92, null
br i1 %93, label %94, label %101
94: ; preds = %91
%95 = load i8**, i8*** %5
%96 = load i32, i32* %8
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8*, i8** %95, i64 %97
%99 = load i8*, i8** %98
%100 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %99)
store i32 1, i32* %3
br label %320
101: ; preds = %91
br label %139
102: ; preds = %60
%103 = load i32, i32* %9
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %113
105: ; preds = %102
%106 = load i8**, i8*** %5
%107 = load i32, i32* %8
%108 = add nsw i32 %107, 1
store i32 %108, i32* %8
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8*, i8** %106, i64 %109
%111 = load i8*, i8** %110
%112 = call i32* @fopen(i8* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %112, i32** %11
br label %121
113: ; preds = %102
%114 = load i8**, i8*** %5
%115 = load i32, i32* %8
%116 = add nsw i32 %115, 1
store i32 %116, i32* %8
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8*, i8** %114, i64 %117
%119 = load i8*, i8** %118
%120 = call i32* @fopen(i8* %119, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %120, i32** %11
br label %121
121: ; preds = %113, %105
%122 = load i32*, i32** %11
%123 = icmp eq i32* %122, null
br i1 %123, label %124, label %131
124: ; preds = %121
%125 = load i8**, i8*** %5
%126 = load i32, i32* %8
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8*, i8** %125, i64 %127
%129 = load i8*, i8** %128
%130 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %129)
store i32 1, i32* %3
br label %320
131: ; preds = %121
br label %139
132: ; preds = %60
%133 = load i8**, i8*** %5
%134 = load i32, i32* %8
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8*, i8** %133, i64 %135
%137 = load i8*, i8** %136
%138 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %137)
store i32 1, i32* %3
br label %320
139: ; preds = %131, %101, %71, %70
br label %143
140: ; preds = %56
%141 = load i8*, i8** %13
%142 = call i32 @puts(i8* %141)
store i32 1, i32* %3
br label %320
143: ; preds = %139
br label %144
144: ; preds = %143
%145 = load i32, i32* %8
%146 = add nsw i32 %145, 1
store i32 %146, i32* %8
br label %41
147: ; preds = %41
%148 = load i32, i32* %9
%149 = icmp eq i32 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %147
%151 = load i32*, i32** %10
%152 = load i32*, i32** %11
%153 = call i32 @formatIPTC(i32* %151, i32* %152)
br label %154
154: ; preds = %150, %147
%155 = load i32, i32* %9
%156 = icmp eq i32 %155, 1
br i1 %156, label %157, label %319
157: ; preds = %154
store i8 0, i8* %21
store i8 0, i8* %22
store i32 4096, i32* %23
%158 = load i32, i32* %23
%159 = call i64 @malloc(i32 %158)
%160 = inttoptr i64 %159 to i8*
store i8* %160, i8** %16
store i8* null, i8** %17
br label %161
161: ; preds = %307, %157
%162 = load i8*, i8** %16
%163 = load i32*, i32** %10
%164 = call i8* @super_fgets(i8* %162, i32* %23, i32* %163)
store i8* %164, i8** %16
%165 = icmp ne i8* %164, null
br i1 %165, label %166, label %312
166: ; preds = %161
store i32 0, i32* %19
store i32 0, i32* %20
%167 = load i32, i32* %23
%168 = call i64 @malloc(i32 %167)
%169 = inttoptr i64 %168 to i8*
store i8* %169, i8** %17
%170 = load i32, i32* %23
%171 = call i64 @malloc(i32 %170)
%172 = inttoptr i64 %171 to i8*
store i8* %172, i8** %18
br label %173
173: ; preds = %304, %166
%174 = load i8*, i8** %17
%175 = load i32, i32* %23
%176 = load i8*, i8** %16
%177 = call i64 @tokenizer(i32 0, i8* %174, i32 %175, i8* %176, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* %14, i32* %20, i8* %15)
%178 = icmp eq i64 %177, 0
br i1 %178, label %179, label %307
179: ; preds = %173
%180 = load i32, i32* %19
%181 = icmp eq i32 %180, 0
br i1 %181, label %182, label %208
182: ; preds = %179
store i32 0, i32* %24
store i32 0, i32* %25
br label %183
183: ; preds = %204, %182
%184 = load i8*, i8** %18
%185 = load i32, i32* %23
%186 = load i8*, i8** %17
%187 = call i64 @tokenizer(i32 0, i8* %184, i32 %185, i8* %186, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* %26, i32* %25, i8* %27)
%188 = icmp eq i64 %187, 0
br i1 %188, label %189, label %207
189: ; preds = %183
%190 = load i32, i32* %24
%191 = icmp eq i32 %190, 0
br i1 %191, label %192, label %196
192: ; preds = %189
%193 = load i8*, i8** %18
%194 = call i64 @atoi(i8* %193)
%195 = trunc i64 %194 to i8
store i8 %195, i8* %22
br label %204
196: ; preds = %189
%197 = load i32, i32* %24
%198 = icmp eq i32 %197, 1
br i1 %198, label %199, label %203
199: ; preds = %196
%200 = load i8*, i8** %18
%201 = call i64 @atoi(i8* %200)
%202 = trunc i64 %201 to i8
store i8 %202, i8* %21
br label %203
203: ; preds = %199, %196
br label %204
204: ; preds = %203, %192
%205 = load i32, i32* %24
%206 = add nsw i32 %205, 1
store i32 %206, i32* %24
br label %183
207: ; preds = %183
br label %304
208: ; preds = %179
%209 = load i32, i32* %19
%210 = icmp eq i32 %209, 1
br i1 %210, label %211, label %303
211: ; preds = %208
store i32 0, i32* %28
%212 = load i8*, i8** %17
%213 = call i64 @strlen(i8* %212)
store i64 %213, i64* %29
br label %214
214: ; preds = %239, %211
%215 = load i8*, i8** %18
%216 = load i32, i32* %23
%217 = load i8*, i8** %17
%218 = call i64 @tokenizer(i32 0, i8* %215, i32 %216, i8* %217, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* %30, i32* %28, i8* %31)
%219 = icmp eq i64 %218, 0
br i1 %219, label %220, label %240
220: ; preds = %214
%221 = load i8, i8* %30
%222 = sext i8 %221 to i32
%223 = icmp ne i32 %222, 0
br i1 %223, label %224, label %239
224: ; preds = %220
%225 = load i32, i32* %28
%226 = icmp sgt i32 %225, 0
br i1 %226, label %227, label %239
227: ; preds = %224
%228 = load i8*, i8** %17
%229 = load i32, i32* %28
%230 = sub nsw i32 %229, 1
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i8, i8* %228, i64 %231
store i8* %232, i8** %32
%233 = load i8*, i8** %32
%234 = load i8*, i8** %32
%235 = call i64 @strlen(i8* %234)
%236 = call i64 @convertHTMLcodes(i8* %233, i64 %235)
%237 = load i64, i64* %29
%238 = sub i64 %237, %236
store i64 %238, i64* %29
br label %239
239: ; preds = %227, %224, %220
br label %214
240: ; preds = %214
%241 = load i32*, i32** %11
%242 = call i32 @fputc(i8 signext 28, i32* %241)
%243 = load i8, i8* %22
%244 = load i32*, i32** %11
%245 = call i32 @fputc(i8 signext %243, i32* %244)
%246 = load i8, i8* %21
%247 = load i32*, i32** %11
%248 = call i32 @fputc(i8 signext %246, i32* %247)
%249 = load i64, i64* %29
%250 = icmp ult i64 %249, 65536
br i1 %250, label %251, label %263
251: ; preds = %240
%252 = load i64, i64* %29
%253 = lshr i64 %252, 8
%254 = and i64 %253, 255
%255 = trunc i64 %254 to i8
%256 = load i32*, i32** %11
%257 = call i32 @fputc(i8 signext %255, i32* %256)
%258 = load i64, i64* %29
%259 = and i64 %258, 255
%260 = trunc i64 %259 to i8
%261 = load i32*, i32** %11
%262 = call i32 @fputc(i8 signext %260, i32* %261)
br label %288
263: ; preds = %240
%264 = load i64, i64* %29
%265 = lshr i64 %264, 24
%266 = and i64 %265, 255
%267 = or i64 %266, 128
%268 = trunc i64 %267 to i8
%269 = load i32*, i32** %11
%270 = call i32 @fputc(i8 signext %268, i32* %269)
%271 = load i64, i64* %29
%272 = lshr i64 %271, 16
%273 = and i64 %272, 255
%274 = trunc i64 %273 to i8
%275 = load i32*, i32** %11
%276 = call i32 @fputc(i8 signext %274, i32* %275)
%277 = load i64, i64* %29
%278 = lshr i64 %277, 8
%279 = and i64 %278, 255
%280 = trunc i64 %279 to i8
%281 = load i32*, i32** %11
%282 = call i32 @fputc(i8 signext %280, i32* %281)
%283 = load i64, i64* %29
%284 = and i64 %283, 255
%285 = trunc i64 %284 to i8
%286 = load i32*, i32** %11
%287 = call i32 @fputc(i8 signext %285, i32* %286)
br label %288
288: ; preds = %263, %251
store i32 0, i32* %28
br label %289
289: ; preds = %293, %288
%290 = load i64, i64* %29
%291 = add i64 %290, -1
store i64 %291, i64* %29
%292 = icmp ne i64 %290, 0
br i1 %292, label %293, label %302
293: ; preds = %289
%294 = load i8*, i8** %17
%295 = load i32, i32* %28
%296 = add nsw i32 %295, 1
store i32 %296, i32* %28
%297 = sext i32 %295 to i64
%298 = getelementptr inbounds i8, i8* %294, i64 %297
%299 = load i8, i8* %298
%300 = load i32*, i32** %11
%301 = call i32 @fputc(i8 signext %299, i32* %300)
br label %289
302: ; preds = %289
br label %303
303: ; preds = %302, %208
br label %304
304: ; preds = %303, %207
%305 = load i32, i32* %19
%306 = add nsw i32 %305, 1
store i32 %306, i32* %19
br label %173
307: ; preds = %173
%308 = load i8*, i8** %17
%309 = call i32 @free(i8* %308)
store i8* null, i8** %17
%310 = load i8*, i8** %18
%311 = call i32 @free(i8* %310)
store i8* null, i8** %18
br label %161
312: ; preds = %161
%313 = load i8*, i8** %16
%314 = call i32 @free(i8* %313)
%315 = load i32*, i32** %10
%316 = call i32 @fclose(i32* %315)
%317 = load i32*, i32** %11
%318 = call i32 @fclose(i32* %317)
br label %319
319: ; preds = %312, %154
store i32 0, i32* %3
br label %320
320: ; preds = %319, %140, %132, %124, %94, %37
%321 = load i32, i32* %3
ret i32 %321
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@.str = [59 x i8] c"usage: iptcutil -t | -b [-i file] [-o file] <input >output\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"rt\00"
@.str.3 = [20 x i8] c"Unable to open: %s\0A\00"
@.str.4 = [3 x i8] c"wt\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [20 x i8] c"Unknown option: %s\0A\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [2 x i8] c"=\00"
@.str.9 = [2 x i8] c"\22\00"
@.str.10 = [2 x i8] c"#\00"
@.str.11 = [2 x i8] c"&\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8
%13 = icmp slt i32 %0, 2
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %212
16: ; preds = %2
%17 = load i32*, i32** @stdin
%18 = load i32*, i32** @stdout
br label %19
19: ; preds = %16, %67
%20 = phi i32 [ %72, %67 ], [ 1, %16 ]
%21 = phi i32* [ %70, %67 ], [ %18, %16 ]
%22 = phi i32* [ %69, %67 ], [ %17, %16 ]
%23 = phi i32 [ %68, %67 ], [ 0, %16 ]
%24 = sext i32 %20 to i64
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = load i8, i8* %26
%28 = and i8 %27, -3
%29 = icmp eq i8 %28, 45
br i1 %29, label %30, label %65
30: ; preds = %19
%31 = getelementptr inbounds i8, i8* %26, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
switch i32 %33, label %63 [
i32 116, label %67
i32 98, label %34
i32 105, label %35
i32 111, label %49
]
34: ; preds = %30
br label %67
35: ; preds = %30
%36 = icmp eq i32 %23, 0
%37 = add nsw i32 %20, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %1, i64 %38
%40 = load i8*, i8** %39
%41 = select i1 %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%42 = tail call i32* @fopen(i8* %40, i8* %41)
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %67
44: ; preds = %35
%45 = sext i32 %37 to i64
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
%48 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %47)
br label %212
49: ; preds = %30
%50 = icmp eq i32 %23, 0
%51 = add nsw i32 %20, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %1, i64 %52
%54 = load i8*, i8** %53
%55 = select i1 %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%56 = tail call i32* @fopen(i8* %54, i8* %55)
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %67
58: ; preds = %49
%59 = sext i32 %51 to i64
%60 = getelementptr inbounds i8*, i8** %1, i64 %59
%61 = load i8*, i8** %60
%62 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %61)
br label %212
63: ; preds = %30
%64 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* %26)
br label %212
65: ; preds = %19
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
br label %212
67: ; preds = %30, %49, %35, %34
%68 = phi i32 [ %23, %49 ], [ %23, %35 ], [ 0, %34 ], [ 1, %30 ]
%69 = phi i32* [ %22, %49 ], [ %42, %35 ], [ %22, %34 ], [ %22, %30 ]
%70 = phi i32* [ %56, %49 ], [ %21, %35 ], [ %21, %34 ], [ %21, %30 ]
%71 = phi i32 [ %51, %49 ], [ %37, %35 ], [ %20, %34 ], [ %20, %30 ]
%72 = add nsw i32 %71, 1
%73 = icmp slt i32 %72, %0
br i1 %73, label %19, label %74
74: ; preds = %67
switch i32 %68, label %212 [
i32 0, label %75
i32 1, label %77
]
75: ; preds = %74
%76 = tail call i32 @formatIPTC(i32* %69, i32* %70)
br label %212
77: ; preds = %74
%78 = bitcast i32* %5 to i8*
%79 = bitcast i32* %6 to i8*
store i32 4096, i32* %6
%80 = tail call i64 @malloc(i32 4096)
%81 = inttoptr i64 %80 to i8*
%82 = call i8* @super_fgets(i8* %81, i32* %6, i32* %69)
%83 = icmp eq i8* %82, null
br i1 %83, label %208, label %84
84: ; preds = %77
%85 = bitcast i32* %10 to i8*
%86 = bitcast i32* %7 to i8*
br label %87
87: ; preds = %84, %201
%88 = phi i8* [ %82, %84 ], [ %206, %201 ]
%89 = phi i8 [ 0, %84 ], [ %203, %201 ]
%90 = phi i8 [ 0, %84 ], [ %202, %201 ]
store i32 0, i32* %5
%91 = load i32, i32* %6
%92 = call i64 @malloc(i32 %91)
%93 = inttoptr i64 %92 to i8*
%94 = load i32, i32* %6
%95 = call i64 @malloc(i32 %94)
%96 = inttoptr i64 %95 to i8*
%97 = load i32, i32* %6
%98 = call i64 @tokenizer(i32 0, i8* %93, i32 %97, i8* %88, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* %3, i32* %5, i8* %4)
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %201
100: ; preds = %87, %194
%101 = phi i8 [ %196, %194 ], [ %89, %87 ]
%102 = phi i8 [ %195, %194 ], [ %90, %87 ]
%103 = phi i32 [ %197, %194 ], [ 0, %87 ]
switch i32 %103, label %194 [
i32 0, label %104
i32 1, label %128
]
104: ; preds = %100
store i32 0, i32* %7
%105 = load i32, i32* %6
%106 = call i64 @tokenizer(i32 0, i8* %96, i32 %105, i8* %93, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* %8, i32* %7, i8* %9)
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %125
108: ; preds = %104, %118
%109 = phi i32 [ %121, %118 ], [ 0, %104 ]
%110 = phi i8 [ %120, %118 ], [ %101, %104 ]
%111 = phi i8 [ %119, %118 ], [ %102, %104 ]
switch i32 %109, label %118 [
i32 0, label %112
i32 1, label %115
]
112: ; preds = %108
%113 = call i64 @atoi(i8* %96)
%114 = trunc i64 %113 to i8
br label %118
115: ; preds = %108
%116 = call i64 @atoi(i8* %96)
%117 = trunc i64 %116 to i8
br label %118
118: ; preds = %108, %115, %112
%119 = phi i8 [ %111, %112 ], [ %117, %115 ], [ %111, %108 ]
%120 = phi i8 [ %114, %112 ], [ %110, %115 ], [ %110, %108 ]
%121 = add nuw nsw i32 %109, 1
%122 = load i32, i32* %6
%123 = call i64 @tokenizer(i32 0, i8* %96, i32 %122, i8* %93, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* %8, i32* %7, i8* %9)
%124 = icmp eq i64 %123, 0
br i1 %124, label %108, label %125
125: ; preds = %118, %104
%126 = phi i8 [ %102, %104 ], [ %119, %118 ]
%127 = phi i8 [ %101, %104 ], [ %120, %118 ]
br label %194
128: ; preds = %100
store i32 0, i32* %10
%129 = call i64 @strlen(i8* dereferenceable(1) %93)
%130 = load i32, i32* %6
%131 = call i64 @tokenizer(i32 0, i8* %96, i32 %130, i8* %93, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* %11, i32* %10, i8* %12)
%132 = icmp eq i64 %131, 0
br i1 %132, label %133, label %152
133: ; preds = %128, %147
%134 = phi i64 [ %148, %147 ], [ %129, %128 ]
%135 = load i8, i8* %11
%136 = icmp ne i8 %135, 0
%137 = load i32, i32* %10
%138 = icmp sgt i32 %137, 0
%139 = select i1 %136, i1 %138, i1 false
br i1 %139, label %140, label %147
140: ; preds = %133
%141 = add nsw i32 %137, -1
%142 = zext i32 %141 to i64
%143 = getelementptr inbounds i8, i8* %93, i64 %142
%144 = call i64 @strlen(i8* dereferenceable(1) %143)
%145 = call i64 @convertHTMLcodes(i8* %143, i64 %144)
%146 = sub i64 %134, %145
br label %147
147: ; preds = %140, %133
%148 = phi i64 [ %146, %140 ], [ %134, %133 ]
%149 = load i32, i32* %6
%150 = call i64 @tokenizer(i32 0, i8* %96, i32 %149, i8* %93, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i32 0, i8* %11, i32* %10, i8* %12)
%151 = icmp eq i64 %150, 0
br i1 %151, label %133, label %152
152: ; preds = %147, %128
%153 = phi i64 [ %129, %128 ], [ %148, %147 ]
%154 = call i32 @fputc(i8 signext 28, i32* %70)
%155 = call i32 @fputc(i8 signext %101, i32* %70)
%156 = call i32 @fputc(i8 signext %102, i32* %70)
%157 = icmp ult i64 %153, 65536
br i1 %157, label %171, label %158
158: ; preds = %152
%159 = lshr i64 %153, 24
%160 = trunc i64 %159 to i8
%161 = or i8 %160, -128
%162 = call i32 @fputc(i8 signext %161, i32* %70)
%163 = lshr i64 %153, 16
%164 = trunc i64 %163 to i8
%165 = call i32 @fputc(i8 signext %164, i32* %70)
%166 = lshr i64 %153, 8
%167 = trunc i64 %166 to i8
%168 = call i32 @fputc(i8 signext %167, i32* %70)
%169 = trunc i64 %153 to i8
%170 = call i32 @fputc(i8 signext %169, i32* %70)
br label %178
171: ; preds = %152
%172 = lshr i64 %153, 8
%173 = trunc i64 %172 to i8
%174 = call i32 @fputc(i8 signext %173, i32* %70)
%175 = trunc i64 %153 to i8
%176 = call i32 @fputc(i8 signext %175, i32* %70)
%177 = icmp eq i64 %153, 0
br i1 %177, label %193, label %178
178: ; preds = %158, %171
%179 = add i64 %153, -1
store i32 1, i32* %10
%180 = load i8, i8* %93
%181 = call i32 @fputc(i8 signext %180, i32* %70)
%182 = icmp eq i64 %179, 0
br i1 %182, label %193, label %183
183: ; preds = %178, %183
%184 = phi i64 [ %186, %183 ], [ %179, %178 ]
%185 = load i32, i32* %10
%186 = add i64 %184, -1
%187 = add nsw i32 %185, 1
store i32 %187, i32* %10
%188 = sext i32 %185 to i64
%189 = getelementptr inbounds i8, i8* %93, i64 %188
%190 = load i8, i8* %189
%191 = call i32 @fputc(i8 signext %190, i32* %70)
%192 = icmp eq i64 %186, 0
br i1 %192, label %193, label %183
193: ; preds = %183, %178, %171
br label %194
194: ; preds = %100, %193, %125
%195 = phi i8 [ %126, %125 ], [ %102, %193 ], [ %102, %100 ]
%196 = phi i8 [ %127, %125 ], [ %101, %193 ], [ %101, %100 ]
%197 = add nuw nsw i32 %103, 1
%198 = load i32, i32* %6
%199 = call i64 @tokenizer(i32 0, i8* %93, i32 %198, i8* %88, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 0, i8* %3, i32* %5, i8* %4)
%200 = icmp eq i64 %199, 0
br i1 %200, label %100, label %201
201: ; preds = %194, %87
%202 = phi i8 [ %90, %87 ], [ %195, %194 ]
%203 = phi i8 [ %89, %87 ], [ %196, %194 ]
%204 = call i32 @free(i8* %93)
%205 = call i32 @free(i8* %96)
%206 = call i8* @super_fgets(i8* %88, i32* %6, i32* %69)
%207 = icmp eq i8* %206, null
br i1 %207, label %208, label %87
208: ; preds = %201, %77
%209 = call i32 @free(i8* null)
%210 = call i32 @fclose(i32* %69)
%211 = call i32 @fclose(i32* %70)
br label %212
212: ; preds = %75, %208, %74, %65, %63, %58, %44, %14
%213 = phi i32 [ 1, %14 ], [ 1, %63 ], [ 1, %58 ], [ 1, %44 ], [ 1, %65 ], [ 0, %74 ], [ 0, %208 ], [ 0, %75 ]
ret i32 %213
}