#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 EOF;
size_t clamp(short);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
scalar_t__ isChar(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  printf("icontainer2icns, (C) 2005/2007 by Thomas Lübking\n\n");
  if (argc < 2) {
    printf("\nusage: icontainer2icns foo.icontainer\n\n");
    return -1;
  } else if (argc > 2) {
    printf("\nusage: icontainer2icns foo.icontainer\nif your icontainer file "
           "contains spaces etc.,\nuse a system valid form (i.e. use \"my "
           "foo.icontainer\" or my\\ foo.icontainer)\n\n");
    return -1;
  }
  char buffer[118];
  FILE *icontainer = NULL;
  FILE *icns = NULL;
  short i = 0;
  int c;
  char name[256];
  if ((icontainer = fopen(argv[1], "r")) == NULL) {
    printf("error while opening file %s\n", argv[1]);
    return -1;
  }
  rewind(icontainer);
  while ((c = getc(icontainer)) != EOF) {
    if (c != 'i') {
      buffer[i] = (char)(c & 0xff);
      i = clamp(++i);
      if (icns)
        fputc(buffer[i], icns);
    } else {
      if ((c = getc(icontainer)) == 'c') {
        if ((c = getc(icontainer)) == 'n') {
          if ((c = getc(icontainer)) == 's') {
            if (icns)
              fclose(icns);
            short j;
            short k = 0;
            if (buffer[clamp(i - 1)] == ']') {
              j = clamp(i - 7);
              for (k = 0; k < 6; j = clamp(++j)) {
                name[k++] = buffer[j];
              }
              name[k++] = '-';
            }
            j = clamp(i + 1);
            while (!isChar(buffer[j]) && j != i)
              j = clamp(++j);
            while (isChar(buffer[j]) && j != i) {
              name[k++] = buffer[j];
              j = clamp(++j);
            }
            name[k++] = '.';
            name[k++] = 'i';
            name[k++] = 'c';
            name[k++] = 'n';
            name[k++] = 's';
            name[k] = '\0';
            if ((icns = fopen(name, "w")) == NULL) {
              printf("error while opening icns file %s\n", name);
              return -1;
            }
            rewind(icns);
            fputc('i', icns);
            fputc('c', icns);
            fputc('n', icns);
            fputc('s', icns);
            for (i = 0; i < 117; ++i)
              buffer[i] = (char)(getc(icontainer) & 0xff);
          } else {
            ungetc(c, icontainer);
            ungetc('n', icontainer);
            ungetc('c', icontainer);
            buffer[i] = 'i';
            i = clamp(++i);
            if (icns)
              fputc(buffer[i], icns);
          }
        } else {
          ungetc(c, icontainer);
          ungetc('c', icontainer);
          buffer[i] = 'i';
          i = clamp(++i);
          if (icns)
            fputc(buffer[i], icns);
        }
      } else {
        ungetc(c, icontainer);
        buffer[i] = 'i';
        i = clamp(++i);
        if (icns)
          fputc(buffer[i], icns);
      }
    }
  }
  fclose(icontainer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    11db <main+0x4b>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18ed <main+0x75d>
cmpl   $0x2,-0x8(%rbp)
jle    11ff <main+0x6f>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18ed <main+0x75d>
jmp    1204 <main+0x74>
movq   $0x0,-0x98(%rbp)
movq   $0x0,-0xa0(%rbp)
movw   $0x0,-0xa2(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xecf(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
jne    126a <main+0xda>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18ed <main+0x75d>
mov    -0x98(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x98(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0xa8(%rbp)
mov    0x2d59(%rip),%rcx
cmp    (%rcx),%eax
je     18da <main+0x74a>
cmpl   $0x69,-0xa8(%rbp)
je     1312 <main+0x182>
mov    -0xa8(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
movswq -0xa2(%rbp),%rax
ff
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0xa2(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     130d <main+0x17d>
movswq -0xa2(%rbp),%rax
ff
mov    -0x90(%rbp,%rax,1),%al
mov    -0xa0(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    18d5 <main+0x745>
mov    -0x98(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0xa8(%rbp)
cmp    $0x63,%eax
jne    185c <main+0x6cc>
mov    -0x98(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0xa8(%rbp)
cmp    $0x6e,%eax
jne    17d2 <main+0x642>
mov    -0x98(%rbp),%rdi
call   10b0 <getc@plt>
mov    %eax,-0xa8(%rbp)
cmp    $0x73,%eax
jne    1737 <main+0x5a7>
cmpq   $0x0,-0xa0(%rbp)
je     137d <main+0x1ed>
mov    -0xa0(%rbp),%rdi
call   1050 <fclose@plt>
movw   $0x0,-0x1b4(%rbp)
movswl -0xa2(%rbp),%eax
sub    $0x1,%eax
movswl %ax,%edi
call   1040 <clamp@plt>
movsbl -0x90(%rbp,%rax,1),%eax
ff
cmp    $0x5d,%eax
jne    1451 <main+0x2c1>
movswl -0xa2(%rbp),%eax
sub    $0x7,%eax
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0x1b2(%rbp)
movw   $0x0,-0x1b4(%rbp)
movswl -0x1b4(%rbp),%eax
cmp    $0x6,%eax
jge    1430 <main+0x2a0>
movswq -0x1b2(%rbp),%rax
ff
mov    -0x90(%rbp,%rax,1),%cl
mov    -0x1b4(%rbp),%ax
mov    %ax,%dx
add    $0x1,%dx
mov    %dx,-0x1b4(%rbp)
movswq %ax,%rax
mov    %cl,-0x1b0(%rbp,%rax,1)
mov    -0x1b2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1b2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0x1b2(%rbp)
jmp    13cb <main+0x23b>
mov    -0x1b4(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1b4(%rbp)
movswq %ax,%rax
movb   $0x2d,-0x1b0(%rbp,%rax,1)
2d
movswl -0xa2(%rbp),%eax
add    $0x1,%eax
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0x1b2(%rbp)
movswq -0x1b2(%rbp),%rax
ff
movsbl -0x90(%rbp,%rax,1),%edi
ff
call   1030 <isChar@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1b5(%rbp)
jne    14ad <main+0x31d>
movswl -0x1b2(%rbp),%eax
movswl -0xa2(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x1b5(%rbp)
mov    -0x1b5(%rbp),%al
test   $0x1,%al
jne    14c0 <main+0x330>
jmp    14e6 <main+0x356>
mov    -0x1b2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1b2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0x1b2(%rbp)
jmp    146a <main+0x2da>
jmp    14eb <main+0x35b>
movswq -0x1b2(%rbp),%rax
ff
movsbl -0x90(%rbp,%rax,1),%edi
ff
call   1030 <isChar@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1b6(%rbp)
je     152e <main+0x39e>
movswl -0x1b2(%rbp),%eax
movswl -0xa2(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x1b6(%rbp)
mov    -0x1b6(%rbp),%al
test   $0x1,%al
jne    1541 <main+0x3b1>
jmp    1596 <main+0x406>
movswq -0x1b2(%rbp),%rax
ff
mov    -0x90(%rbp,%rax,1),%cl
mov    -0x1b4(%rbp),%ax
mov    %ax,%dx
add    $0x1,%dx
mov    %dx,-0x1b4(%rbp)
movswq %ax,%rax
mov    %cl,-0x1b0(%rbp,%rax,1)
mov    -0x1b2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1b2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0x1b2(%rbp)
jmp    14eb <main+0x35b>
mov    -0x1b4(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1b4(%rbp)
movswq %ax,%rax
movb   $0x2e,-0x1b0(%rbp,%rax,1)
2e
mov    -0x1b4(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1b4(%rbp)
movswq %ax,%rax
movb   $0x69,-0x1b0(%rbp,%rax,1)
69
mov    -0x1b4(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1b4(%rbp)
movswq %ax,%rax
movb   $0x63,-0x1b0(%rbp,%rax,1)
63
mov    -0x1b4(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1b4(%rbp)
movswq %ax,%rax
movb   $0x6e,-0x1b0(%rbp,%rax,1)
6e
mov    -0x1b4(%rbp),%ax
mov    %ax,%cx
add    $0x1,%cx
mov    %cx,-0x1b4(%rbp)
movswq %ax,%rax
movb   $0x73,-0x1b0(%rbp,%rax,1)
73
movswq -0x1b4(%rbp),%rax
ff
movb   $0x0,-0x1b0(%rbp,%rax,1)
lea    -0x1b0(%rbp),%rdi
lea    0xac7(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0xa0(%rbp)
cmp    $0x0,%rax
jne    1690 <main+0x500>
lea    -0x1b0(%rbp),%rsi
lea    0xaa5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    18ed <main+0x75d>
mov    -0xa0(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0xa0(%rbp),%rsi
mov    $0x69,%edi
call   1080 <fputc@plt>
mov    -0xa0(%rbp),%rsi
mov    $0x63,%edi
call   1080 <fputc@plt>
mov    -0xa0(%rbp),%rsi
mov    $0x6e,%edi
call   1080 <fputc@plt>
mov    -0xa0(%rbp),%rsi
mov    $0x73,%edi
call   1080 <fputc@plt>
movw   $0x0,-0xa2(%rbp)
movswl -0xa2(%rbp),%eax
cmp    $0x75,%eax
jge    1732 <main+0x5a2>
mov    -0x98(%rbp),%rdi
call   10b0 <getc@plt>
and    $0xff,%eax
mov    %al,%cl
movswq -0xa2(%rbp),%rax
ff
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
jmp    16e9 <main+0x559>
jmp    17cd <main+0x63d>
mov    -0xa8(%rbp),%edi
mov    -0x98(%rbp),%rsi
call   1090 <ungetc@plt>
mov    -0x98(%rbp),%rsi
mov    $0x6e,%edi
call   1090 <ungetc@plt>
mov    -0x98(%rbp),%rsi
mov    $0x63,%edi
call   1090 <ungetc@plt>
movswq -0xa2(%rbp),%rax
ff
movb   $0x69,-0x90(%rbp,%rax,1)
69
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0xa2(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     17c8 <main+0x638>
movswq -0xa2(%rbp),%rax
ff
mov    -0x90(%rbp,%rax,1),%al
mov    -0xa0(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    17cd <main+0x63d>
jmp    1857 <main+0x6c7>
mov    -0xa8(%rbp),%edi
mov    -0x98(%rbp),%rsi
call   1090 <ungetc@plt>
mov    -0x98(%rbp),%rsi
mov    $0x63,%edi
call   1090 <ungetc@plt>
movswq -0xa2(%rbp),%rax
ff
movb   $0x69,-0x90(%rbp,%rax,1)
69
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0xa2(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     1852 <main+0x6c2>
movswq -0xa2(%rbp),%rax
ff
mov    -0x90(%rbp,%rax,1),%al
mov    -0xa0(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    1857 <main+0x6c7>
jmp    18d0 <main+0x740>
mov    -0xa8(%rbp),%edi
mov    -0x98(%rbp),%rsi
call   1090 <ungetc@plt>
movswq -0xa2(%rbp),%rax
ff
movb   $0x69,-0x90(%rbp,%rax,1)
69
mov    -0xa2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa2(%rbp)
movswl %ax,%edi
call   1040 <clamp@plt>
mov    %ax,-0xa2(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     18cb <main+0x73b>
movswq -0xa2(%rbp),%rax
ff
mov    -0x90(%rbp,%rax,1),%al
mov    -0xa0(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
jmp    18d0 <main+0x740>
jmp    18d5 <main+0x745>
jmp    1276 <main+0xe6>
mov    -0x98(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x1,%ebp
jg     11d0 <main+0x30>
lea    0xf4b(%rip),%rdi
jmp    121c <main+0x7c>
cmp    $0x2,%ebp
jne    1215 <main+0x75>
mov    0x8(%rbx),%rdi
lea    0xe20(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1238 <main+0x98>
mov    %rax,%r12
mov    %rax,%rdi
call   1080 <rewind@plt>
mov    %r12,%rdi
call   10c0 <getc@plt>
mov    0x2de4(%rip),%r14
cmp    (%r14),%eax
jne    124c <main+0xac>
mov    %r12,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
jmp    1226 <main+0x86>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rbx),%rsi
lea    0xdbf(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1221 <main+0x81>
xor    %r15d,%r15d
xor    %r13d,%r13d
jmp    127d <main+0xdd>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movswq %r15w,%rax
movsbl (%rsp,%rax,1),%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
mov    %r12,%rdi
call   10c0 <getc@plt>
cmp    (%r14),%eax
je     1209 <main+0x69>
cmp    $0x69,%eax
jne    1390 <main+0x1f0>
mov    %r12,%rdi
call   10c0 <getc@plt>
cmp    $0x63,%eax
jne    13a0 <main+0x200>
mov    %r12,%rdi
call   10c0 <getc@plt>
cmp    $0x6e,%eax
jne    13a4 <main+0x204>
mov    %r12,%rdi
call   10c0 <getc@plt>
cmp    $0x73,%eax
jne    13a8 <main+0x208>
test   %r13,%r13
je     12c6 <main+0x126>
mov    %r13,%rdi
call   1060 <fclose@plt>
lea    -0x1(%r15),%eax
movswl %ax,%edi
call   1050 <clamp@plt>
cmpb   $0x5d,(%rsp,%rax,1)
jne    13f4 <main+0x254>
lea    -0x7(%r15),%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movswq %ax,%rcx
mov    (%rsp,%rcx,1),%cl
mov    %cl,0x80(%rsp)
add    $0x1,%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movswq %ax,%rcx
mov    (%rsp,%rcx,1),%cl
mov    %cl,0x81(%rsp)
add    $0x1,%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movswq %ax,%rcx
mov    (%rsp,%rcx,1),%cl
mov    %cl,0x82(%rsp)
add    $0x1,%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movswq %ax,%rcx
mov    (%rsp,%rcx,1),%cl
mov    %cl,0x83(%rsp)
add    $0x1,%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movswq %ax,%rcx
mov    (%rsp,%rcx,1),%cl
mov    %cl,0x84(%rsp)
add    $0x1,%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movswq %ax,%rcx
mov    (%rsp,%rcx,1),%cl
mov    %cl,0x85(%rsp)
add    $0x1,%eax
movswl %ax,%edi
call   1050 <clamp@plt>
movb   $0x2d,0x86(%rsp)
2d
mov    $0x7,%bp
jmp    13f6 <main+0x256>
nopl   0x0(%rax)
movswq %r15w,%rcx
mov    %al,(%rsp,%rcx,1)
jmp    13d4 <main+0x234>
nopl   0x0(%rax)
mov    %eax,%edi
jmp    13c4 <main+0x224>
mov    %eax,%edi
jmp    13b7 <main+0x217>
mov    %eax,%edi
mov    %r12,%rsi
call   10a0 <ungetc@plt>
mov    $0x6e,%edi
mov    %r12,%rsi
call   10a0 <ungetc@plt>
mov    $0x63,%edi
mov    %r12,%rsi
call   10a0 <ungetc@plt>
movswq %r15w,%rax
movb   $0x69,(%rsp,%rax,1)
lea    0x1(%r15),%eax
movswl %ax,%edi
call   1050 <clamp@plt>
mov    %rax,%r15
test   %r13,%r13
jne    1260 <main+0xc0>
xor    %r13d,%r13d
jmp    1270 <main+0xd0>
xor    %ebp,%ebp
lea    0x1(%r15),%eax
movswl %ax,%edi
nopl   (%rax)
call   1050 <clamp@plt>
mov    %rax,%rbx
movswq %bx,%rax
movzbl (%rsp,%rax,1),%r13d
movsbl %r13b,%edi
call   1040 <isChar@plt>
test   %rax,%rax
jne    1456 <main+0x2b6>
cmp    %bx,%r15w
je     1456 <main+0x2b6>
add    $0x1,%ebx
movswl %bx,%edi
jmp    1400 <main+0x260>
nopl   (%rax)
movswq %bp,%rax
add    $0x1,%ebp
mov    %r13b,0x80(%rsp,%rax,1)
add    $0x1,%ebx
movswl %bx,%edi
call   1050 <clamp@plt>
mov    %rax,%rbx
movswq %bx,%rax
movzbl (%rsp,%rax,1),%r13d
movsbl %r13b,%edi
call   1040 <isChar@plt>
test   %rax,%rax
je     146a <main+0x2ca>
cmp    %bx,%r15w
jne    1430 <main+0x290>
lea    0x1(%rbp),%eax
movswq %bp,%rcx
movb   $0x2e,0x80(%rsp,%rcx,1)
2e
movswq %ax,%rax
movl   $0x736e6369,0x80(%rsp,%rax,1)
69 63 6e 73
lea    0x5(%rbp),%eax
movswq %ax,%rax
movb   $0x0,0x80(%rsp,%rax,1)
lea    0x80(%rsp),%rdi
lea    0xb79(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     151f <main+0x37f>
mov    %rax,%r13
mov    %rax,%rdi
call   1080 <rewind@plt>
mov    $0x69,%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
mov    $0x63,%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
mov    $0x6e,%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
mov    $0x73,%edi
mov    %r13,%rsi
call   1090 <fputc@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   10c0 <getc@plt>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x75,%rbx
jne    1500 <main+0x360>
mov    $0x75,%r15w
jmp    1270 <main+0xd0>
lea    0xafb(%rip),%rdi
lea    0x80(%rsp),%rsi
jmp    1243 <main+0xa3>

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

LLVM IR (-O2):
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [29 x i8] c"error while opening file %s\0A\00"
@EOF = global i32 0
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [34 x i8] c"error while opening icns file %s\0A\00"
@str = [51 x i8] c"icontainer2icns, (C) 2005/2007 by Thomas L\C3\BCbking\0A\00"
@str.7 = [163 x i8] c"\0Ausage: icontainer2icns foo.icontainer\0Aif your icontainer file contains spaces etc.,\0Ause a system valid form (i.e. use \22my foo.icontainer\22 or my\\ foo.icontainer)\0A\00"
@str.8 = [40 x i8] c"\0Ausage: icontainer2icns foo.icontainer\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [118 x i8]
%4 = alloca [256 x i8]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%6 = icmp slt i32 %0, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.8, i64 0, i64 0))
br label %246
9: ; preds = %2
%10 = icmp eq i32 %0, 2
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([163 x i8], [163 x i8]* @str.7, i64 0, i64 0))
br label %246
13: ; preds = %9
%14 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = load i8*, i8** %16
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %21)
br label %244
23: ; preds = %13
%24 = tail call i32 @rewind(i32* %18)
%25 = tail call i32 @getc(i32* %18)
%26 = load i32, i32* @EOF
%27 = icmp eq i32 %25, %26
br i1 %27, label %242, label %28
28: ; preds = %23
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 1
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 2
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 3
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 4
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 5
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 6
br label %35
35: ; preds = %28, %236
%36 = phi i32 [ %239, %236 ], [ %25, %28 ]
%37 = phi i16 [ %238, %236 ], [ 0, %28 ]
%38 = phi i32* [ %237, %236 ], [ null, %28 ]
%39 = icmp eq i32 %36, 105
br i1 %39, label %48, label %40
40: ; preds = %35
%41 = trunc i32 %36 to i8
%42 = sext i16 %37 to i64
%43 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %42
store i8 %41, i8* %43
%44 = add i16 %37, 1
%45 = tail call i64 @clamp(i16 signext %44)
%46 = trunc i64 %45 to i16
%47 = icmp eq i32* %38, null
br i1 %47, label %236, label %228
48: ; preds = %35
%49 = tail call i32 @getc(i32* %18)
%50 = icmp eq i32 %49, 99
br i1 %50, label %51, label %220
51: ; preds = %48
%52 = tail call i32 @getc(i32* %18)
%53 = icmp eq i32 %52, 110
br i1 %53, label %54, label %211
54: ; preds = %51
%55 = tail call i32 @getc(i32* %18)
%56 = icmp eq i32 %55, 115
br i1 %56, label %57, label %201
57: ; preds = %54
%58 = icmp eq i32* %38, null
br i1 %58, label %61, label %59
59: ; preds = %57
%60 = tail call i32 @fclose(i32* %38)
br label %61
61: ; preds = %59, %57
%62 = add i16 %37, -1
%63 = tail call i64 @clamp(i16 signext %62)
%64 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 93
br i1 %66, label %67, label %112
67: ; preds = %61
%68 = add i16 %37, -7
%69 = tail call i64 @clamp(i16 signext %68)
%70 = trunc i64 %69 to i16
%71 = shl i64 %69, 48
%72 = ashr exact i64 %71, 48
%73 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %72
%74 = load i8, i8* %73
store i8 %74, i8* %15
%75 = add i16 %70, 1
%76 = tail call i64 @clamp(i16 signext %75)
%77 = trunc i64 %76 to i16
%78 = shl i64 %76, 48
%79 = ashr exact i64 %78, 48
%80 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %79
%81 = load i8, i8* %80
store i8 %81, i8* %29
%82 = add i16 %77, 1
%83 = tail call i64 @clamp(i16 signext %82)
%84 = trunc i64 %83 to i16
%85 = shl i64 %83, 48
%86 = ashr exact i64 %85, 48
%87 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %86
%88 = load i8, i8* %87
store i8 %88, i8* %30
%89 = add i16 %84, 1
%90 = tail call i64 @clamp(i16 signext %89)
%91 = trunc i64 %90 to i16
%92 = shl i64 %90, 48
%93 = ashr exact i64 %92, 48
%94 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %93
%95 = load i8, i8* %94
store i8 %95, i8* %31
%96 = add i16 %91, 1
%97 = tail call i64 @clamp(i16 signext %96)
%98 = trunc i64 %97 to i16
%99 = shl i64 %97, 48
%100 = ashr exact i64 %99, 48
%101 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %100
%102 = load i8, i8* %101
store i8 %102, i8* %32
%103 = add i16 %98, 1
%104 = tail call i64 @clamp(i16 signext %103)
%105 = trunc i64 %104 to i16
%106 = shl i64 %104, 48
%107 = ashr exact i64 %106, 48
%108 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %107
%109 = load i8, i8* %108
store i8 %109, i8* %33
%110 = add i16 %105, 1
%111 = tail call i64 @clamp(i16 signext %110)
store i8 45, i8* %34
br label %112
112: ; preds = %67, %61
%113 = phi i16 [ 7, %67 ], [ 0, %61 ]
%114 = add i16 %37, 1
%115 = tail call i64 @clamp(i16 signext %114)
%116 = trunc i64 %115 to i16
%117 = shl i64 %115, 48
%118 = ashr exact i64 %117, 48
%119 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = tail call i64 @isChar(i8 signext %120)
%122 = icmp eq i64 %121, 0
%123 = icmp ne i16 %37, %116
%124 = select i1 %122, i1 %123, i1 false
br i1 %124, label %134, label %127
125: ; preds = %134
%126 = trunc i64 %137 to i16
br label %127
127: ; preds = %125, %112
%128 = phi i16 [ %116, %112 ], [ %126, %125 ]
%129 = phi i8 [ %120, %112 ], [ %142, %125 ]
%130 = tail call i64 @isChar(i8 signext %129)
%131 = icmp ne i64 %130, 0
%132 = icmp ne i16 %37, %128
%133 = select i1 %131, i1 %132, i1 false
br i1 %133, label %147, label %165
134: ; preds = %112, %134
%135 = phi i16 [ %138, %134 ], [ %116, %112 ]
%136 = add i16 %135, 1
%137 = tail call i64 @clamp(i16 signext %136)
%138 = trunc i64 %137 to i16
%139 = shl i64 %137, 48
%140 = ashr exact i64 %139, 48
%141 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %140
%142 = load i8, i8* %141
%143 = tail call i64 @isChar(i8 signext %142)
%144 = icmp eq i64 %143, 0
%145 = icmp ne i16 %37, %138
%146 = select i1 %144, i1 %145, i1 false
br i1 %146, label %134, label %125
147: ; preds = %127, %147
%148 = phi i8 [ %160, %147 ], [ %129, %127 ]
%149 = phi i16 [ %151, %147 ], [ %113, %127 ]
%150 = phi i16 [ %156, %147 ], [ %128, %127 ]
%151 = add i16 %149, 1
%152 = sext i16 %149 to i64
%153 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %152
store i8 %148, i8* %153
%154 = add i16 %150, 1
%155 = tail call i64 @clamp(i16 signext %154)
%156 = trunc i64 %155 to i16
%157 = shl i64 %155, 48
%158 = ashr exact i64 %157, 48
%159 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %158
%160 = load i8, i8* %159
%161 = tail call i64 @isChar(i8 signext %160)
%162 = icmp ne i64 %161, 0
%163 = icmp ne i16 %37, %156
%164 = select i1 %162, i1 %163, i1 false
br i1 %164, label %147, label %165
165: ; preds = %147, %127
%166 = phi i16 [ %113, %127 ], [ %151, %147 ]
%167 = add i16 %166, 1
%168 = sext i16 %166 to i64
%169 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %168
store i8 46, i8* %169
%170 = add i16 %166, 2
%171 = sext i16 %167 to i64
%172 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %171
store i8 105, i8* %172
%173 = add i16 %166, 3
%174 = sext i16 %170 to i64
%175 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %174
store i8 99, i8* %175
%176 = add i16 %166, 4
%177 = sext i16 %173 to i64
%178 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %177
store i8 110, i8* %178
%179 = add i16 %166, 5
%180 = sext i16 %176 to i64
%181 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %180
store i8 115, i8* %181
%182 = sext i16 %179 to i64
%183 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 %182
store i8 0, i8* %183
%184 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%185 = icmp eq i32* %184, null
br i1 %185, label %186, label %188
186: ; preds = %165
%187 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i8* %15)
br label %244
188: ; preds = %165
%189 = tail call i32 @rewind(i32* %184)
%190 = tail call i32 @fputc(i8 signext 105, i32* %184)
%191 = tail call i32 @fputc(i8 signext 99, i32* %184)
%192 = tail call i32 @fputc(i8 signext 110, i32* %184)
%193 = tail call i32 @fputc(i8 signext 115, i32* %184)
br label %194
194: ; preds = %188, %194
%195 = phi i64 [ 0, %188 ], [ %199, %194 ]
%196 = tail call i32 @getc(i32* %18)
%197 = trunc i32 %196 to i8
%198 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %195
store i8 %197, i8* %198
%199 = add nuw nsw i64 %195, 1
%200 = icmp eq i64 %199, 117
br i1 %200, label %236, label %194
201: ; preds = %54
%202 = tail call i32 @ungetc(i32 %55, i32* %18)
%203 = tail call i32 @ungetc(i32 110, i32* %18)
%204 = tail call i32 @ungetc(i32 99, i32* %18)
%205 = sext i16 %37 to i64
%206 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %205
store i8 105, i8* %206
%207 = add i16 %37, 1
%208 = tail call i64 @clamp(i16 signext %207)
%209 = trunc i64 %208 to i16
%210 = icmp eq i32* %38, null
br i1 %210, label %236, label %228
211: ; preds = %51
%212 = tail call i32 @ungetc(i32 %52, i32* %18)
%213 = tail call i32 @ungetc(i32 99, i32* %18)
%214 = sext i16 %37 to i64
%215 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %214
store i8 105, i8* %215
%216 = add i16 %37, 1
%217 = tail call i64 @clamp(i16 signext %216)
%218 = trunc i64 %217 to i16
%219 = icmp eq i32* %38, null
br i1 %219, label %236, label %228
220: ; preds = %48
%221 = tail call i32 @ungetc(i32 %49, i32* %18)
%222 = sext i16 %37 to i64
%223 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %222
store i8 105, i8* %223
%224 = add i16 %37, 1
%225 = tail call i64 @clamp(i16 signext %224)
%226 = trunc i64 %225 to i16
%227 = icmp eq i32* %38, null
br i1 %227, label %236, label %228
228: ; preds = %220, %211, %201, %40
%229 = phi i64 [ %45, %40 ], [ %208, %201 ], [ %217, %211 ], [ %225, %220 ]
%230 = phi i16 [ %46, %40 ], [ %209, %201 ], [ %218, %211 ], [ %226, %220 ]
%231 = shl i64 %229, 48
%232 = ashr exact i64 %231, 48
%233 = getelementptr inbounds [118 x i8], [118 x i8]* %3, i64 0, i64 %232
%234 = load i8, i8* %233
%235 = tail call i32 @fputc(i8 signext %234, i32* %38)
br label %236
236: ; preds = %194, %228, %211, %201, %220, %40
%237 = phi i32* [ null, %40 ], [ null, %201 ], [ null, %211 ], [ null, %220 ], [ %38, %228 ], [ %184, %194 ]
%238 = phi i16 [ %46, %40 ], [ %209, %201 ], [ %218, %211 ], [ %226, %220 ], [ %230, %228 ], [ 117, %194 ]
%239 = tail call i32 @getc(i32* %18)
%240 = load i32, i32* @EOF
%241 = icmp eq i32 %239, %240
br i1 %241, label %242, label %35
242: ; preds = %236, %23
%243 = tail call i32 @fclose(i32* %18)
br label %244
244: ; preds = %186, %242, %20
%245 = phi i32 [ -1, %20 ], [ 0, %242 ], [ -1, %186 ]
br label %246
246: ; preds = %244, %11, %7
%247 = phi i32 [ -1, %7 ], [ -1, %11 ], [ %245, %244 ]
ret i32 %247
}