#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int generate_c_code(char *fn, char *braincode) {
  char line[256];
  FILE *fp;
  char *p = braincode;
  char last_code;
  int num_of_last_code;
  int tabs_indented;
  int process;
  if (fp = fopen(fn, "w+")) {
    fputs("/*\n", fp);
    fputs("** Spoon -> Converter. Copyright 1998 VisionSoft. Written by "
          "S.Goodwin\n",
          fp);
    fputs("**\n", fp);
    fputs("**\n", fp);
    fputs("** This program has been converted, fairly literately from\n", fp);
    fputs("** from the original Spoon source. \n", fp);
    fputs("**\n", fp);
    fputs("** Version 1.00 Conversion\n", fp);
    fputs("** + Multiple '+', '-', '<' and '>' symbols have been joined\n", fp);
    fputs("**\n", fp);
    fputs("*/\n", fp);
    fputs("\n", fp);
    fputs("#include <stdio.h>\n", fp);
    fputs("\n", fp);
    fputs("int p;\n", fp);
    fputs("char a[5000];\n", fp);
    fputs("\n", fp);
    fputs("int main(int argc, char *argv[])\n", fp);
    fputs("{\n", fp);
    p = braincode;
    last_code = *p++;
    num_of_last_code = 1;
    tabs_indented = 1;
    do {
      process = 1;
      switch (*p) {
      case '+':
      case '-':
      case '>':
      case '<':
        if (last_code == *p) {
          num_of_last_code++;
          process = 0;
          break;
        }
      }
      if (process)
        switch (last_code) {
        case '+':
        case '-':
        case '<':
        case '>':
        case '[':
        case ']':
        case '.':
        case ',':
        case '#':
        case '\1':
          if (last_code == ']')
            if (tabs_indented-- <= 0)
              tabs_indented = 0;
          memset(line, '\t', tabs_indented);
          switch (last_code) {
          case '+':
            if (num_of_last_code == 1)
              strcpy(&line[tabs_indented], "a[p]++;");
            else
              sprintf(&line[tabs_indented], "a[p] += %d;", num_of_last_code);
            break;
          case '-':
            if (num_of_last_code == 1)
              strcpy(&line[tabs_indented], "a[p]--;");
            else
              sprintf(&line[tabs_indented], "a[p] -= %d;", num_of_last_code);
            break;
          case '>':
            if (num_of_last_code == 1)
              strcpy(&line[tabs_indented], "p++;");
            else
              sprintf(&line[tabs_indented], "p += %d;", num_of_last_code);
            break;
          case '<':
            if (num_of_last_code == 1)
              strcpy(&line[tabs_indented], "p--;");
            else
              sprintf(&line[tabs_indented], "p -= %d;", num_of_last_code);
            break;
          case '.':
            strcpy(&line[tabs_indented], "putchar(a[p]);  fflush(stdout);");
            break;
          case ',':
            strcpy(&line[tabs_indented], "a[p] = getchar();  fflush(stdout);");
            break;
          case '[':
            strcpy(&line[tabs_indented], "while(a[p]) {");
            tabs_indented++;
            break;
          case ']':
            strcpy(&line[tabs_indented], "}");
            break;
          case '\1':
            *(p + 1) = 0;
            break;
          case '#':
            strcpy(&line[tabs_indented], "printf(\"%2d %2d %2d %2d %2d %2d %2d "
                                         "%2d %2d %2d%\\n%*s%\\n\", "
                                         "*a,a[1],a[2],a[3],a[4],a[5],a[6],a[7]"
                                         ",a[8],a[9],3*p+2,\"^\");");
            break;
          }
          strcat(line, "\n");
          fputs(line, fp);
          num_of_last_code = 1;
          break;
        }
      last_code = *p;
      p++;
    } while (*p);
    fputs("return 0;\n\n", fp);
    fputs("}\n\n", fp);
    fclose(fp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<generate_c_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x114f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x128(%rbp)
cmp    $0x0,%rax
je     177b <generate_c_code+0x60b>
mov    -0x128(%rbp),%rsi
lea    0x112e(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x111f(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1154(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1141(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1132(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x115b(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1108(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x115a(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1163(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x10cf(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x117b(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x12d4(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1159(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x12ae(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1147(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x113c(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1275(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1125(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0x1134(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x130(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x130(%rbp)
mov    (%rax),%al
mov    %al,-0x131(%rbp)
movl   $0x1,-0x138(%rbp)
movl   $0x1,-0x13c(%rbp)
movl   $0x1,-0x140(%rbp)
mov    -0x130(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x144(%rbp)
sub    $0x2b,%eax
je     13b8 <generate_c_code+0x248>
jmp    137c <generate_c_code+0x20c>
mov    -0x144(%rbp),%eax
sub    $0x2d,%eax
je     13b8 <generate_c_code+0x248>
jmp    1390 <generate_c_code+0x220>
mov    -0x144(%rbp),%eax
sub    $0x3c,%eax
je     13b8 <generate_c_code+0x248>
jmp    13a4 <generate_c_code+0x234>
mov    -0x144(%rbp),%eax
sub    $0x3e,%eax
jne    13f4 <generate_c_code+0x284>
jmp    13b8 <generate_c_code+0x248>
movsbl -0x131(%rbp),%eax
mov    -0x130(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    13ef <generate_c_code+0x27f>
mov    -0x138(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x138(%rbp)
movl   $0x0,-0x140(%rbp)
jmp    13f4 <generate_c_code+0x284>
jmp    13f4 <generate_c_code+0x284>
cmpl   $0x0,-0x140(%rbp)
je     170c <generate_c_code+0x59c>
movsbl -0x131(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x150(%rbp)
sub    $0x5c,%eax
ja     1707 <generate_c_code+0x597>
mov    -0x150(%rbp),%rax
lea    0xbd5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x131(%rbp),%eax
cmp    $0x5d,%eax
jne    146d <generate_c_code+0x2fd>
mov    -0x13c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x13c(%rbp)
cmp    $0x0,%eax
jg     1468 <generate_c_code+0x2f8>
movl   $0x0,-0x13c(%rbp)
jmp    146d <generate_c_code+0x2fd>
mov    -0x13c(%rbp),%edx
lea    -0x120(%rbp),%rdi
mov    $0x9,%esi
call   1060 <memset@plt>
movsbl -0x131(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x158(%rbp)
sub    $0x5c,%eax
ja     16d7 <generate_c_code+0x567>
mov    -0x158(%rbp),%rax
lea    0xcc6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x1,-0x138(%rbp)
jne    14e6 <generate_c_code+0x376>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xf6e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1509 <generate_c_code+0x399>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
mov    -0x138(%rbp),%edx
lea    0xf4e(%rip),%rsi
call   1090 <sprintf@plt>
jmp    16d7 <generate_c_code+0x567>
cmpl   $0x1,-0x138(%rbp)
jne    153d <generate_c_code+0x3cd>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xf2b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1560 <generate_c_code+0x3f0>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
mov    -0x138(%rbp),%edx
lea    0xf0b(%rip),%rsi
call   1090 <sprintf@plt>
jmp    16d7 <generate_c_code+0x567>
cmpl   $0x1,-0x138(%rbp)
jne    1594 <generate_c_code+0x424>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xee8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15b7 <generate_c_code+0x447>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
mov    -0x138(%rbp),%edx
lea    0xec5(%rip),%rsi
call   1090 <sprintf@plt>
jmp    16d7 <generate_c_code+0x567>
cmpl   $0x1,-0x138(%rbp)
jne    15eb <generate_c_code+0x47b>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xe9f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    160e <generate_c_code+0x49e>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
mov    -0x138(%rbp),%edx
lea    0xe7c(%rip),%rsi
call   1090 <sprintf@plt>
jmp    16d7 <generate_c_code+0x567>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xe63(%rip),%rsi
call   1030 <strcpy@plt>
jmp    16d7 <generate_c_code+0x567>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xe61(%rip),%rsi
call   1030 <strcpy@plt>
jmp    16d7 <generate_c_code+0x567>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xe62(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x13c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13c(%rbp)
jmp    16d7 <generate_c_code+0x567>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xe3f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    16d7 <generate_c_code+0x567>
mov    -0x130(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    16d7 <generate_c_code+0x567>
movslq -0x13c(%rbp),%rax
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    0xe0f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1080 <strcat@plt>
lea    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   1050 <fputs@plt>
movl   $0x1,-0x138(%rbp)
jmp    170c <generate_c_code+0x59c>
mov    -0x130(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x131(%rbp)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
mov    -0x130(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1354 <generate_c_code+0x1e4>
mov    -0x128(%rbp),%rsi
lea    0xe0d(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rsi
lea    0xe06(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x128(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1782 <generate_c_code+0x612>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_c_code>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
lea    0x113d(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1588 <generate_c_code+0x3f8>
mov    %rax,%r14
lea    0x1128(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10b0 <fwrite@plt>
lea    0x1113(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x1142(%rip),%rbp
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x1115(%rip),%rdi
mov    $0x3b,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x1138(%rip),%rdi
mov    $0x24,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x112f(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x1132(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x1142(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1070 <fputc@plt>
lea    0x1120(%rip),%rdi
mov    $0x13,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1070 <fputc@plt>
lea    0x110e(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x10fd(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1070 <fputc@plt>
lea    0x10e6(%rip),%rdi
mov    $0x21,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0x10ef(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    0x1(%rbx),%cl
add    $0x2,%rbx
mov    $0x1,%r13d
mov    %rsp,%r15
mov    $0x1,%eax
jmp    13a3 <generate_c_code+0x213>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
je     1547 <generate_c_code+0x3b7>
movsbl -0x2(%rbx),%edx
movsbl %cl,%esi
cmp    $0x3e,%esi
ja     13c3 <generate_c_code+0x233>
movabs $0x5000280000000000,%rdi
bt     %rsi,%rdi
jae    13c3 <generate_c_code+0x233>
cmp    %cl,%dl
je     1390 <generate_c_code+0x200>
lea    -0x1(%rdx),%r12d
cmp    $0x5c,%r12d
ja     1394 <generate_c_code+0x204>
lea    0xc2c(%rip),%rsi
movslq (%rsi,%r12,4),%rcx
add    %rsi,%rcx
jmp    *%rcx
lea    -0x1(%rax),%ebp
test   %eax,%eax
mov    $0x0,%ecx
cmovle %ecx,%ebp
cmp    $0x5d,%dl
cmovne %eax,%ebp
mov    %r15,%rdi
mov    $0x9,%esi
mov    %ebp,%edx
call   1060 <memset@plt>
cmp    $0x5c,%r12d
ja     1520 <generate_c_code+0x390>
lea    0xd64(%rip),%rcx
movslq (%rcx,%r12,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,(%rbx)
jmp    1520 <generate_c_code+0x390>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
lea    0x10b2(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
cmp    $0x1,%r13d
jne    14e7 <generate_c_code+0x357>
lea    0xffe(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
lea    0x104f(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
cmp    $0x1,%r13d
jne    14f0 <generate_c_code+0x360>
lea    0xfe2(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
lea    0x1002(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
cmp    $0x1,%r13d
jne    14f9 <generate_c_code+0x369>
lea    0xfde(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
cmp    $0x1,%r13d
jne    1502 <generate_c_code+0x372>
lea    0xfba(%rip),%rsi
jmp    14e0 <generate_c_code+0x350>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
lea    0x1009(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x1,%ebp
jmp    1520 <generate_c_code+0x390>
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
lea    0xfff(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1520 <generate_c_code+0x390>
lea    0xf64(%rip),%rsi
jmp    1509 <generate_c_code+0x379>
lea    0xf6f(%rip),%rsi
jmp    1509 <generate_c_code+0x379>
lea    0xf85(%rip),%rsi
jmp    1509 <generate_c_code+0x379>
lea    0xf6e(%rip),%rsi
mov    %r13d,%edx
call   10a0 <sprintf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
lea    0x1038(%rip),%rsi
call   1090 <strcat@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <fputs@plt>
mov    $0x1,%r13d
mov    %ebp,%eax
jmp    1394 <generate_c_code+0x204>
lea    0x100a(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
lea    0xffd(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    $0x1,%eax
jmp    158a <generate_c_code+0x3fa>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
@.str.1 = [4 x i8] c"/*\0A\00"
@.str.2 = [72 x i8] c"** Spoon -> Converter. Copyright 1998 VisionSoft. Written by S.Goodwin\0A\00"
@.str.3 = [4 x i8] c"**\0A\00"
@.str.4 = [60 x i8] c"** This program has been converted, fairly literately from\0A\00"
@.str.5 = [37 x i8] c"** from the original Spoon source. \0A\00"
@.str.6 = [28 x i8] c"** Version 1.00 Conversion\0A\00"
@.str.7 = [62 x i8] c"** + Multiple '+', '-', '<' and '>' symbols have been joined\0A\00"
@.str.8 = [4 x i8] c"*/\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.11 = [8 x i8] c"int p;\0A\00"
@.str.12 = [15 x i8] c"char a[5000];\0A\00"
@.str.13 = [34 x i8] c"int main(int argc, char *argv[])\0A\00"
@.str.14 = [3 x i8] c"{\0A\00"
@.str.15 = [8 x i8] c"a[p]++;\00"
@.str.16 = [12 x i8] c"a[p] += %d;\00"
@.str.17 = [8 x i8] c"a[p]--;\00"
@.str.18 = [12 x i8] c"a[p] -= %d;\00"
@.str.19 = [5 x i8] c"p++;\00"
@.str.20 = [9 x i8] c"p += %d;\00"
@.str.21 = [5 x i8] c"p--;\00"
@.str.22 = [9 x i8] c"p -= %d;\00"
@.str.23 = [32 x i8] c"putchar(a[p]); fflush(stdout);\00"
@.str.24 = [35 x i8] c"a[p] = getchar(); fflush(stdout);\00"
@.str.25 = [14 x i8] c"while(a[p]) {\00"
@.str.26 = [2 x i8] c"}\00"
@.str.27 = [119 x i8] c"printf(\22%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d%\\n%*s%\\n\22, *a,a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],3*p+2,\22^\22);\00"
@.str.28 = [12 x i8] c"return 0;\0A\0A\00"
@.str.29 = [4 x i8] c"}\0A\0A\00"
define i32 @generate_c_code(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [256 x i8]
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%13 = load i8*, i8** %5
store i8* %13, i8** %8
%14 = load i8*, i8** %4
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %7
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %210
17: ; preds = %2
%18 = load i32*, i32** %7
%19 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = load i32*, i32** %7
%21 = call i32 @fputs(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0), i32* %20)
%22 = load i32*, i32** %7
%23 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %22)
%24 = load i32*, i32** %7
%25 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %24)
%26 = load i32*, i32** %7
%27 = call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0), i32* %26)
%28 = load i32*, i32** %7
%29 = call i32 @fputs(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32* %28)
%30 = load i32*, i32** %7
%31 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %30)
%32 = load i32*, i32** %7
%33 = call i32 @fputs(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32* %32)
%34 = load i32*, i32** %7
%35 = call i32 @fputs(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0), i32* %34)
%36 = load i32*, i32** %7
%37 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %36)
%38 = load i32*, i32** %7
%39 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32* %38)
%40 = load i32*, i32** %7
%41 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32* %40)
%42 = load i32*, i32** %7
%43 = call i32 @fputs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32* %42)
%44 = load i32*, i32** %7
%45 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32* %44)
%46 = load i32*, i32** %7
%47 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i32* %46)
%48 = load i32*, i32** %7
%49 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32* %48)
%50 = load i32*, i32** %7
%51 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32* %50)
%52 = load i32*, i32** %7
%53 = call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32* %52)
%54 = load i32*, i32** %7
%55 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %54)
%56 = load i8*, i8** %5
store i8* %56, i8** %8
%57 = load i8*, i8** %8
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %8
%59 = load i8, i8* %57
store i8 %59, i8* %9
store i32 1, i32* %10
store i32 1, i32* %11
br label %60
60: ; preds = %199, %17
store i32 1, i32* %12
%61 = load i8*, i8** %8
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
switch i32 %63, label %75 [
i32 43, label %64
i32 45, label %64
i32 62, label %64
i32 60, label %64
]
64: ; preds = %60, %60, %60, %60
%65 = load i8, i8* %9
%66 = sext i8 %65 to i32
%67 = load i8*, i8** %8
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %66, %69
br i1 %70, label %71, label %74
71: ; preds = %64
%72 = load i32, i32* %10
%73 = add nsw i32 %72, 1
store i32 %73, i32* %10
store i32 0, i32* %12
br label %75
74: ; preds = %64
br label %75
75: ; preds = %74, %60, %71
%76 = load i32, i32* %12
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %194
78: ; preds = %75
%79 = load i8, i8* %9
%80 = sext i8 %79 to i32
switch i32 %80, label %193 [
i32 43, label %81
i32 45, label %81
i32 60, label %81
i32 62, label %81
i32 91, label %81
i32 93, label %81
i32 46, label %81
i32 44, label %81
i32 35, label %81
i32 1, label %81
]
81: ; preds = %78, %78, %78, %78, %78, %78, %78, %78, %78, %78
%82 = load i8, i8* %9
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 93
br i1 %84, label %85, label %91
85: ; preds = %81
%86 = load i32, i32* %11
%87 = add nsw i32 %86, -1
store i32 %87, i32* %11
%88 = icmp sle i32 %86, 0
br i1 %88, label %89, label %90
89: ; preds = %85
store i32 0, i32* %11
br label %90
90: ; preds = %89, %85
br label %91
91: ; preds = %90, %81
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%93 = load i32, i32* %11
%94 = call i32 @memset(i8* %92, i8 signext 9, i32 %93)
%95 = load i8, i8* %9
%96 = sext i8 %95 to i32
switch i32 %96, label %187 [
i32 43, label %97
i32 45, label %112
i32 62, label %127
i32 60, label %142
i32 46, label %157
i32 44, label %162
i32 91, label %167
i32 93, label %174
i32 1, label %179
i32 35, label %182
]
97: ; preds = %91
%98 = load i32, i32* %10
%99 = icmp eq i32 %98, 1
br i1 %99, label %100, label %105
100: ; preds = %97
%101 = load i32, i32* %11
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %102
%104 = call i32 @strcpy(i8* %103, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
br label %111
105: ; preds = %97
%106 = load i32, i32* %11
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %107
%109 = load i32, i32* %10
%110 = call i32 @sprintf(i8* %108, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i32 %109)
br label %111
111: ; preds = %105, %100
br label %187
112: ; preds = %91
%113 = load i32, i32* %10
%114 = icmp eq i32 %113, 1
br i1 %114, label %115, label %120
115: ; preds = %112
%116 = load i32, i32* %11
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %117
%119 = call i32 @strcpy(i8* %118, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %126
120: ; preds = %112
%121 = load i32, i32* %11
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %122
%124 = load i32, i32* %10
%125 = call i32 @sprintf(i8* %123, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), i32 %124)
br label %126
126: ; preds = %120, %115
br label %187
127: ; preds = %91
%128 = load i32, i32* %10
%129 = icmp eq i32 %128, 1
br i1 %129, label %130, label %135
130: ; preds = %127
%131 = load i32, i32* %11
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %132
%134 = call i32 @strcpy(i8* %133, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
br label %141
135: ; preds = %127
%136 = load i32, i32* %11
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %137
%139 = load i32, i32* %10
%140 = call i32 @sprintf(i8* %138, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), i32 %139)
br label %141
141: ; preds = %135, %130
br label %187
142: ; preds = %91
%143 = load i32, i32* %10
%144 = icmp eq i32 %143, 1
br i1 %144, label %145, label %150
145: ; preds = %142
%146 = load i32, i32* %11
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %147
%149 = call i32 @strcpy(i8* %148, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %156
150: ; preds = %142
%151 = load i32, i32* %11
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %152
%154 = load i32, i32* %10
%155 = call i32 @sprintf(i8* %153, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0), i32 %154)
br label %156
156: ; preds = %150, %145
br label %187
157: ; preds = %91
%158 = load i32, i32* %11
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %159
%161 = call i32 @strcpy(i8* %160, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0))
br label %187
162: ; preds = %91
%163 = load i32, i32* %11
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %164
%166 = call i32 @strcpy(i8* %165, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %187
167: ; preds = %91
%168 = load i32, i32* %11
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %169
%171 = call i32 @strcpy(i8* %170, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0))
%172 = load i32, i32* %11
%173 = add nsw i32 %172, 1
store i32 %173, i32* %11
br label %187
174: ; preds = %91
%175 = load i32, i32* %11
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %176
%178 = call i32 @strcpy(i8* %177, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0))
br label %187
179: ; preds = %91
%180 = load i8*, i8** %8
%181 = getelementptr inbounds i8, i8* %180, i64 1
store i8 0, i8* %181
br label %187
182: ; preds = %91
%183 = load i32, i32* %11
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %184
%186 = call i32 @strcpy(i8* %185, i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str.27, i64 0, i64 0))
br label %187
187: ; preds = %91, %182, %179, %174, %167, %162, %157, %156, %141, %126, %111
%188 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%189 = call i32 @strcat(i8* %188, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%190 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%191 = load i32*, i32** %7
%192 = call i32 @fputs(i8* %190, i32* %191)
store i32 1, i32* %10
br label %193
193: ; preds = %78, %187
br label %194
194: ; preds = %193, %75
%195 = load i8*, i8** %8
%196 = load i8, i8* %195
store i8 %196, i8* %9
%197 = load i8*, i8** %8
%198 = getelementptr inbounds i8, i8* %197, i32 1
store i8* %198, i8** %8
br label %199
199: ; preds = %194
%200 = load i8*, i8** %8
%201 = load i8, i8* %200
%202 = icmp ne i8 %201, 0
br i1 %202, label %60, label %203
203: ; preds = %199
%204 = load i32*, i32** %7
%205 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i32* %204)
%206 = load i32*, i32** %7
%207 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32* %206)
%208 = load i32*, i32** %7
%209 = call i32 @fclose(i32* %208)
store i32 1, i32* %3
br label %211
210: ; preds = %2
store i32 0, i32* %3
br label %211
211: ; preds = %210, %203
%212 = load i32, i32* %3
ret i32 %212
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@.str.1 = [4 x i8] c"/*\0A\00"
@.str.2 = [72 x i8] c"** Spoon -> Converter. Copyright 1998 VisionSoft. Written by S.Goodwin\0A\00"
@.str.3 = [4 x i8] c"**\0A\00"
@.str.4 = [60 x i8] c"** This program has been converted, fairly literately from\0A\00"
@.str.5 = [37 x i8] c"** from the original Spoon source. \0A\00"
@.str.6 = [28 x i8] c"** Version 1.00 Conversion\0A\00"
@.str.7 = [62 x i8] c"** + Multiple '+', '-', '<' and '>' symbols have been joined\0A\00"
@.str.8 = [4 x i8] c"*/\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.11 = [8 x i8] c"int p;\0A\00"
@.str.12 = [15 x i8] c"char a[5000];\0A\00"
@.str.13 = [34 x i8] c"int main(int argc, char *argv[])\0A\00"
@.str.14 = [3 x i8] c"{\0A\00"
@.str.15 = [8 x i8] c"a[p]++;\00"
@.str.16 = [12 x i8] c"a[p] += %d;\00"
@.str.17 = [8 x i8] c"a[p]--;\00"
@.str.18 = [12 x i8] c"a[p] -= %d;\00"
@.str.19 = [5 x i8] c"p++;\00"
@.str.20 = [9 x i8] c"p += %d;\00"
@.str.21 = [5 x i8] c"p--;\00"
@.str.22 = [9 x i8] c"p -= %d;\00"
@.str.23 = [32 x i8] c"putchar(a[p]); fflush(stdout);\00"
@.str.24 = [35 x i8] c"a[p] = getchar(); fflush(stdout);\00"
@.str.25 = [14 x i8] c"while(a[p]) {\00"
@.str.26 = [2 x i8] c"}\00"
@.str.27 = [119 x i8] c"printf(\22%2d %2d %2d %2d %2d %2d %2d %2d %2d %2d%\\n%*s%\\n\22, *a,a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],3*p+2,\22^\22);\00"
@.str.28 = [12 x i8] c"return 0;\0A\0A\00"
@.str.29 = [4 x i8] c"}\0A\0A\00"
define i32 @generate_c_code(i8* nocapture %0, i8* nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %118, label %7
7: ; preds = %2
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %5)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0), i64 71, i64 1, i32* %5)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3, i64 1, i32* %5)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3, i64 1, i32* %5)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0), i64 59, i64 1, i32* %5)
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i64 36, i64 1, i32* %5)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3, i64 1, i32* %5)
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i64 27, i64 1, i32* %5)
%16 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0), i64 61, i64 1, i32* %5)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3, i64 1, i32* %5)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i64 3, i64 1, i32* %5)
%19 = tail call i32 @fputc(i32 10, i32* %5)
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i64 19, i64 1, i32* %5)
%21 = tail call i32 @fputc(i32 10, i32* %5)
%22 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i64 7, i64 1, i32* %5)
%23 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i64 14, i64 1, i32* %5)
%24 = tail call i32 @fputc(i32 10, i32* %5)
%25 = tail call i64 @fwrite(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i64 33, i64 1, i32* %5)
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i64 2, i64 1, i32* %5)
%27 = getelementptr inbounds i8, i8* %1, i64 1
%28 = load i8, i8* %27
br label %29
29: ; preds = %108, %7
%30 = phi i8 [ %28, %7 ], [ %112, %108 ]
%31 = phi i8* [ %27, %7 ], [ %111, %108 ]
%32 = phi i8* [ %1, %7 ], [ %31, %108 ]
%33 = phi i32 [ 1, %7 ], [ %109, %108 ]
%34 = phi i32 [ 1, %7 ], [ %110, %108 ]
%35 = load i8, i8* %32
%36 = sext i8 %30 to i32
switch i32 %36, label %40 [
i32 43, label %37
i32 45, label %37
i32 62, label %37
i32 60, label %37
]
37: ; preds = %29, %29, %29, %29
%38 = icmp eq i8 %35, %30
%39 = add nsw i32 %33, 1
br i1 %38, label %108, label %40
40: ; preds = %29, %37
%41 = sext i8 %35 to i32
switch i32 %41, label %108 [
i32 43, label %42
i32 45, label %42
i32 60, label %42
i32 62, label %42
i32 91, label %42
i32 93, label %42
i32 46, label %42
i32 44, label %42
i32 35, label %42
i32 1, label %42
]
42: ; preds = %40, %40, %40, %40, %40, %40, %40, %40, %40, %40
%43 = icmp eq i8 %35, 93
%44 = add nsw i32 %34, -1
%45 = icmp sgt i32 %34, 0
%46 = select i1 %45, i32 %44, i32 0
%47 = select i1 %43, i32 %46, i32 %34
%48 = call i32 @memset(i8* %4, i8 signext 9, i32 %47)
switch i32 %41, label %104 [
i32 43, label %49
i32 45, label %57
i32 62, label %65
i32 60, label %73
i32 46, label %81
i32 44, label %85
i32 91, label %89
i32 93, label %94
i32 1, label %98
i32 35, label %100
]
49: ; preds = %42
%50 = icmp eq i32 %33, 1
%51 = sext i32 %47 to i64
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %51
br i1 %50, label %53, label %55
53: ; preds = %49
%54 = call i32 @strcpy(i8* %52, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
br label %104
55: ; preds = %49
%56 = call i32 @sprintf(i8* %52, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), i32 %33)
br label %104
57: ; preds = %42
%58 = icmp eq i32 %33, 1
%59 = sext i32 %47 to i64
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %59
br i1 %58, label %61, label %63
61: ; preds = %57
%62 = call i32 @strcpy(i8* %60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %104
63: ; preds = %57
%64 = call i32 @sprintf(i8* %60, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), i32 %33)
br label %104
65: ; preds = %42
%66 = icmp eq i32 %33, 1
%67 = sext i32 %47 to i64
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %67
br i1 %66, label %69, label %71
69: ; preds = %65
%70 = call i32 @strcpy(i8* %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
br label %104
71: ; preds = %65
%72 = call i32 @sprintf(i8* %68, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0), i32 %33)
br label %104
73: ; preds = %42
%74 = icmp eq i32 %33, 1
%75 = sext i32 %47 to i64
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %75
br i1 %74, label %77, label %79
77: ; preds = %73
%78 = call i32 @strcpy(i8* %76, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %104
79: ; preds = %73
%80 = call i32 @sprintf(i8* %76, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0), i32 %33)
br label %104
81: ; preds = %42
%82 = sext i32 %47 to i64
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %82
%84 = call i32 @strcpy(i8* %83, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.23, i64 0, i64 0))
br label %104
85: ; preds = %42
%86 = sext i32 %47 to i64
%87 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %86
%88 = call i32 @strcpy(i8* %87, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i64 0, i64 0))
br label %104
89: ; preds = %42
%90 = sext i32 %47 to i64
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %90
%92 = call i32 @strcpy(i8* %91, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.25, i64 0, i64 0))
%93 = add nsw i32 %47, 1
br label %104
94: ; preds = %42
%95 = sext i32 %47 to i64
%96 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %95
%97 = call i32 @strcpy(i8* %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0))
br label %104
98: ; preds = %42
%99 = getelementptr inbounds i8, i8* %31, i64 1
store i8 0, i8* %99
br label %104
100: ; preds = %42
%101 = sext i32 %47 to i64
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %101
%103 = call i32 @strcpy(i8* %102, i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str.27, i64 0, i64 0))
br label %104
104: ; preds = %77, %79, %69, %71, %61, %63, %53, %55, %42, %100, %98, %94, %89, %85, %81
%105 = phi i32 [ %47, %42 ], [ %47, %100 ], [ %47, %98 ], [ %47, %94 ], [ %93, %89 ], [ %47, %85 ], [ %47, %81 ], [ %47, %77 ], [ %47, %79 ], [ %47, %69 ], [ %47, %71 ], [ %47, %61 ], [ %47, %63 ], [ %47, %53 ], [ %47, %55 ]
%106 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%107 = call i32 @fputs(i8* %4, i32* %5)
br label %108
108: ; preds = %104, %40, %37
%109 = phi i32 [ %33, %40 ], [ 1, %104 ], [ %39, %37 ]
%110 = phi i32 [ %34, %40 ], [ %105, %104 ], [ %34, %37 ]
%111 = getelementptr inbounds i8, i8* %31, i64 1
%112 = load i8, i8* %111
%113 = icmp eq i8 %112, 0
br i1 %113, label %114, label %29
114: ; preds = %108
%115 = call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i64 11, i64 1, i32* %5)
%116 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i64 3, i64 1, i32* %5)
%117 = call i32 @fclose(i32* %5)
br label %118
118: ; preds = %2, %114
%119 = phi i32 [ 1, %114 ], [ 0, %2 ]
ret i32 %119
}