#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, double,
                           double, double, double, int);
int /*<<< orphan*/ printHeader(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *, double *,
                          double *, double *, double *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  FILE *fp;
  FILE *output_fp = NULL;
  char buf[1024];
  int table[20000];
  int id, parent, root;
  double x, y, z, diam;
  int i, j, hit;
  int node;
  char filename_template[] = "%sCell_BN_1056_node%d_part%d.swc";
  char filename[1024];
  char dirname[1024] = "./split_swc/";
  char cell_name[] = "Cell_BN_1056[0].dend[%d]";
  char scanf_template[] = "%s%s%s%s%s%s\n";
  char scanf_template1[] = "%d : SWC(";
  char scanf_template2[] = ") : ";
  char scanf_template3[] = " %lf %lf %lf %lf ";
  char scanf_format[1024];
  int comp_counter = 0;
  int comp_counter_node[128];
  int part_node[128];
  for (i = 0; i < 128; i++) {
    comp_counter_node[i] = 0;
    part_node[i] = 0;
  }
  sprintf(scanf_format, scanf_template, scanf_template1, cell_name,
          scanf_template2, cell_name, scanf_template3, cell_name);
  printf("%s\n", cell_name);
  if (argc == 1) {
    printf("USEAGE : \n");
    return (-1);
  } else if (argc == 3) {
    strcpy(argv[2], dirname);
  }
  fp = fopen(argv[1], "r");
  while (1) {
    if (fgets(buf, 1024, fp) == NULL) {
      break;
    }
    sscanf(buf, scanf_format, &node, &root, &id, &x, &y, &z, &diam, &parent);
    if (parent == -1) {
      sprintf(filename, filename_template, dirname, node, part_node[node]);
      if (output_fp != NULL) {
        fclose(output_fp);
      }
      output_fp = fopen(filename, "w");
      printHeader(output_fp);
      for (i = 0; i < 20000; i++) {
        table[i] = -1;
      }
      fprintf(output_fp, "%d %d %f %f %f %f %d\n", 1, node, x, y, z, diam, -1);
      table[1] = root;
      printf("node = %d, root = %d\n", node, root);
      part_node[node]++;
      i = 1;
    } else {
      j = 1;
      hit = 0;
      while (table[j] != -1) {
        if (table[j] == parent) {
          hit = 1;
          break;
        }
        j++;
      }
      if (hit == 0) {
        printf("error i=%d j=%d\n", i, j);
        break;
      }
      fprintf(output_fp, "%d %d %f %f %f %f %d\n", i, node, x, y, z, diam, j);
      table[i] = id;
      comp_counter++;
      comp_counter_node[node]++;
    }
    i++;
  }
  fclose(output_fp);
  fclose(fp);
  printf("Total Compartments : %d\n", comp_counter);
  for (i = 0; i < 128; i++) {
    if (comp_counter_node[i] != 0) {
      printf(" NODE%d : %d comp\n", i, comp_counter_node[i]);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x14d98,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x13d20(%rbp),%rdi
lea    0xe30(%rip),%rsi
mov    $0x21,%edx
call   1080 <memcpy@plt>
lea    -0x14520(%rbp),%rdi
lea    0xe88(%rip),%rsi
mov    $0x400,%edx
call   1080 <memcpy@plt>
mov    0xe37(%rip),%rax
mov    %rax,-0x14540(%rbp)
mov    0xe31(%rip),%rax
mov    %rax,-0x14538(%rbp)
mov    0xe2b(%rip),%rax
mov    %rax,-0x14530(%rbp)
mov    0xe26(%rip),%al
mov    %al,-0x14528(%rbp)
mov    0x1241(%rip),%rax
mov    %rax,-0x1454e(%rbp)
mov    0x123c(%rip),%eax
mov    %eax,-0x14546(%rbp)
mov    0x1233(%rip),%ax
mov    %ax,-0x14542(%rbp)
mov    0x1227(%rip),%rax
mov    %rax,-0x14558(%rbp)
mov    0x1221(%rip),%ax
mov    %ax,-0x14550(%rbp)
mov    0x1216(%rip),%eax
mov    %eax,-0x1455d(%rbp)
mov    0x120e(%rip),%al
mov    %al,-0x14559(%rbp)
mov    0xdc5(%rip),%rax
mov    %rax,-0x14570(%rbp)
mov    0xdbf(%rip),%rax
mov    %rax,-0x14568(%rbp)
mov    0xdb9(%rip),%ax
mov    %ax,-0x14560(%rbp)
movl   $0x0,-0x14974(%rbp)
movl   $0x0,-0x13ce4(%rbp)
cmpl   $0x80,-0x13ce4(%rbp)
jge    130a <main+0x16a>
movslq -0x13ce4(%rbp),%rax
movl   $0x0,-0x14b80(%rbp,%rax,4)
movslq -0x13ce4(%rbp),%rax
movl   $0x0,-0x14d80(%rbp,%rax,4)
mov    -0x13ce4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13ce4(%rbp)
jmp    12c2 <main+0x122>
lea    -0x14970(%rbp),%rdi
lea    -0x1454e(%rbp),%rsi
lea    -0x14558(%rbp),%rdx
lea    -0x14540(%rbp),%rcx
lea    -0x1455d(%rbp),%r8
lea    -0x14540(%rbp),%r9
lea    -0x14570(%rbp),%r10
lea    -0x14540(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x14540(%rbp),%rsi
lea    0x111a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    138b <main+0x1eb>
lea    0x1115(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0xc(%rbp)
jmp    1743 <main+0x5a3>
cmpl   $0x3,-0x10(%rbp)
jne    13a9 <main+0x209>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x14520(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    13ae <main+0x20e>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x10db(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x400,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    13ea <main+0x24a>
jmp    16ac <main+0x50c>
lea    -0x430(%rbp),%rdi
lea    -0x14970(%rbp),%rsi
lea    -0x13cf0(%rbp),%rdx
lea    -0x13cbc(%rbp),%rcx
lea    -0x13cb4(%rbp),%r8
lea    -0x13cc8(%rbp),%r9
lea    -0x13cd0(%rbp),%rbx
lea    -0x13cd8(%rbp),%r11
lea    -0x13ce0(%rbp),%r10
lea    -0x13cb8(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1090 <sscanf@plt>
cmpl   $0xffffffff,-0x13cb8(%rbp)
jne    1588 <main+0x3e8>
lea    -0x14120(%rbp),%rdi
lea    -0x13d20(%rbp),%rsi
lea    -0x14520(%rbp),%rdx
mov    -0x13cf0(%rbp),%ecx
movslq -0x13cf0(%rbp),%rax
mov    -0x14d80(%rbp,%rax,4),%r8d
ff
mov    $0x0,%al
call   10c0 <sprintf@plt>
cmpq   $0x0,-0x28(%rbp)
je     149a <main+0x2fa>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x14120(%rbp),%rdi
lea    0xff2(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10a0 <printHeader@plt>
movl   $0x0,-0x13ce4(%rbp)
cmpl   $0x4e20,-0x13ce4(%rbp)
jge    14fa <main+0x35a>
movslq -0x13ce4(%rbp),%rax
movl   $0xffffffff,-0x13cb0(%rbp,%rax,4)
ff ff ff ff
mov    -0x13ce4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13ce4(%rbp)
jmp    14c4 <main+0x324>
mov    -0x28(%rbp),%rdi
mov    -0x13cf0(%rbp),%ecx
movsd  -0x13cc8(%rbp),%xmm0
ff
movsd  -0x13cd0(%rbp),%xmm1
ff
movsd  -0x13cd8(%rbp),%xmm2
ff
movsd  -0x13ce0(%rbp),%xmm3
ff
lea    0xf71(%rip),%rsi
mov    $0x1,%edx
mov    $0xffffffff,%r8d
call   1070 <fprintf@plt>
mov    -0x13cbc(%rbp),%eax
mov    %eax,-0x13cac(%rbp)
mov    -0x13cf0(%rbp),%esi
mov    -0x13cbc(%rbp),%edx
lea    0xf58(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x13cf0(%rbp),%rax
mov    -0x14d80(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14d80(%rbp,%rax,4)
movl   $0x1,-0x13ce4(%rbp)
jmp    1698 <main+0x4f8>
movl   $0x1,-0x13ce8(%rbp)
movl   $0x0,-0x13cec(%rbp)
movslq -0x13ce8(%rbp),%rax
cmpl   $0xffffffff,-0x13cb0(%rbp,%rax,4)
ff
je     15ee <main+0x44e>
movslq -0x13ce8(%rbp),%rax
mov    -0x13cb0(%rbp,%rax,4),%eax
cmp    -0x13cb8(%rbp),%eax
jne    15da <main+0x43a>
movl   $0x1,-0x13cec(%rbp)
jmp    15ee <main+0x44e>
mov    -0x13ce8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13ce8(%rbp)
jmp    159c <main+0x3fc>
cmpl   $0x0,-0x13cec(%rbp)
jne    161a <main+0x47a>
mov    -0x13ce4(%rbp),%esi
mov    -0x13ce8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    16ac <main+0x50c>
mov    -0x28(%rbp),%rdi
mov    -0x13ce4(%rbp),%edx
mov    -0x13cf0(%rbp),%ecx
movsd  -0x13cc8(%rbp),%xmm0
ff
movsd  -0x13cd0(%rbp),%xmm1
ff
movsd  -0x13cd8(%rbp),%xmm2
ff
movsd  -0x13ce0(%rbp),%xmm3
ff
mov    -0x13ce8(%rbp),%r8d
lea    0xe44(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x13cb4(%rbp),%ecx
movslq -0x13ce4(%rbp),%rax
mov    %ecx,-0x13cb0(%rbp,%rax,4)
mov    -0x14974(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14974(%rbp)
movslq -0x13cf0(%rbp),%rax
mov    -0x14b80(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14b80(%rbp,%rax,4)
mov    -0x13ce4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13ce4(%rbp)
jmp    13c6 <main+0x226>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14974(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x13ce4(%rbp)
cmpl   $0x80,-0x13ce4(%rbp)
jge    173c <main+0x59c>
movslq -0x13ce4(%rbp),%rax
cmpl   $0x0,-0x14b80(%rbp,%rax,4)
je     1723 <main+0x583>
mov    -0x13ce4(%rbp),%esi
movslq -0x13ce4(%rbp),%rax
mov    -0x14b80(%rbp,%rax,4),%edx
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1728 <main+0x588>
mov    -0x13ce4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13ce4(%rbp)
jmp    16dc <main+0x53c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x14d98,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x14d58,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
movaps 0xe33(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe14(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movb   $0x0,0xa0(%rsp)
lea    0xe6d(%rip),%rsi
lea    0x4d0(%rsp),%rdi
mov    $0x400,%edx
call   10a0 <memcpy@plt>
movups 0xe1d(%rip),%xmm0
movups %xmm0,0xb9(%rsp)
movaps 0xe05(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movabs $0xa732573257325,%rax
mov    %rax,0x56(%rsp)
movabs $0x7325732573257325,%rax
73 25 73
mov    %rax,0x50(%rsp)
movabs $0x435753203a206425,%rax
53 57 43
mov    %rax,0x40(%rsp)
movw   $0x28,0x48(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x203a2029,0xc(%rsp)
20
movaps 0xdd5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movw   $0x20,0x70(%rsp)
lea    0xd0(%rsp),%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1070 <memset@plt>
lea    0x2d0(%rsp),%r15
mov    $0x200,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xb0(%rsp),%rbx
lea    0x60(%rsp),%r10
lea    0x8d0(%rsp),%rdi
lea    0x50(%rsp),%rsi
lea    0x40(%rsp),%rdx
lea    0xc(%rsp),%r8
mov    %rbx,%rcx
mov    %rbx,%r9
xor    %eax,%eax
push   %rbx
push   %r10
call   10e0 <sprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1040 <puts@plt>
cmp    $0x3,%ebp
je     1312 <main+0x152>
cmp    $0x1,%ebp
jne    1323 <main+0x163>
lea    0x11f7(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
jmp    15a8 <main+0x3e8>
mov    0x10(%r14),%rdi
lea    0x4d0(%rsp),%rsi
call   1030 <strcpy@plt>
mov    0x8(%r14),%rdi
lea    0x115f(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
lea    0x10d0(%rsp),%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     154e <main+0x38e>
mov    $0x80,%r14d
lea    0x10d0(%rsp),%r13
xor    %r12d,%r12d
xor    %ebp,%ebp
mov    %r13,%rdi
lea    0x8d0(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x38(%rsp),%r9
lea    0x18(%rsp),%rax
push   %rax
lea    0x28(%rsp),%rax
push   %rax
lea    0x38(%rsp),%rax
push   %rax
lea    0x48(%rsp),%rax
push   %rax
call   10b0 <sscanf@plt>
add    $0x20,%rsp
mov    0x18(%rsp),%eax
cmp    $0xffffffff,%eax
je     13f0 <main+0x230>
mov    0x14d4(%rsp),%ecx
cmp    $0xffffffff,%ecx
je     15ba <main+0x3fa>
mov    $0x2,%r8d
cs nopw 0x0(%rax,%rax,1)
cmp    %eax,%ecx
je     14c0 <main+0x300>
mov    0x14d0(%rsp,%r8,4),%ecx
add    $0x1,%r8
cmp    $0xffffffff,%ecx
jne    13d0 <main+0x210>
jmp    1534 <main+0x374>
xchg   %ax,%ax
movslq 0x8(%rsp),%rcx
mov    0x2d0(%rsp,%rcx,4),%r8d
lea    0xcd0(%rsp),%rdi
lea    0x80(%rsp),%rsi
lea    0x4d0(%rsp),%rdx
xor    %eax,%eax
call   10e0 <sprintf@plt>
test   %rbp,%rbp
je     1429 <main+0x269>
mov    %rbp,%rdi
call   1050 <fclose@plt>
lea    0xcd0(%rsp),%rdi
lea    0x1057(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   10c0 <printHeader@plt>
mov    $0x13880,%edx
lea    0x14d0(%rsp),%rdi
mov    $0xff,%esi
call   1070 <memset@plt>
mov    0x8(%rsp),%ecx
movsd  0x38(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
mov    $0x1,%r14d
mov    %rbp,%rdi
lea    0x1006(%rip),%rsi
mov    $0x1,%edx
mov    $0xffffffff,%r8d
call   1090 <fprintf@plt>
mov    0x14(%rsp),%edx
mov    %edx,0x14d4(%rsp)
mov    0x8(%rsp),%esi
lea    0xff6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rax
jmp    150c <main+0x34c>
nopl   (%rax)
add    $0xffffffff,%r8d
mov    0x8(%rsp),%ecx
movsd  0x38(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
mov    %rbp,%rdi
lea    0xfa7(%rip),%rsi
mov    %r14d,%edx
call   1090 <fprintf@plt>
mov    0x1c(%rsp),%eax
movslq %r14d,%rcx
mov    %eax,0x14d0(%rsp,%rcx,4)
add    $0x1,%r12d
lea    0xd0(%rsp),%rax
movslq 0x8(%rsp),%rcx
addl   $0x1,(%rax,%rcx,4)
add    $0x1,%r14d
mov    %r13,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
jne    1367 <main+0x1a7>
jmp    1553 <main+0x393>
add    $0xffffffff,%r8d
lea    0xf7e(%rip),%rdi
mov    %r14d,%esi
mov    %r8d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1553 <main+0x393>
xor    %ebp,%ebp
xor    %r12d,%r12d
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xf64(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf6c(%rip),%rbx
xor    %ebp,%ebp
jmp    158d <main+0x3cd>
nop
add    $0x1,%rbp
cmp    $0x80,%rbp
je     15a6 <main+0x3e6>
mov    0xd0(%rsp,%rbp,4),%edx
test   %edx,%edx
je     1580 <main+0x3c0>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1580 <main+0x3c0>
xor    %eax,%eax
add    $0x14d58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r8d
jmp    1538 <main+0x378>

LLVM IR (-O0):
@__const.main.filename_template = [33 x i8] c"%sCell_BN_1056_node%d_part%d.swc\00"
@__const.main.dirname = [1024 x i8] c"./split_swc/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.cell_name = [25 x i8] c"Cell_BN_1056[0].dend[%d]\00"
@__const.main.scanf_template = [14 x i8] c"%s%s%s%s%s%s\0A\00"
@__const.main.scanf_template1 = [10 x i8] c"%d : SWC(\00"
@__const.main.scanf_template2 = [5 x i8] c") : \00"
@__const.main.scanf_template3 = [18 x i8] c" %lf %lf %lf %lf \00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"USEAGE : \0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [22 x i8] c"%d %d %f %f %f %f %d\0A\00"
@.str.5 = [22 x i8] c"node = %d, root = %d\0A\00"
@.str.6 = [17 x i8] c"error i=%d j=%d\0A\00"
@.str.7 = [25 x i8] c"Total Compartments : %d\0A\00"
@.str.8 = [19 x i8] c" NODE%d : %d comp\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [1024 x i8]
%9 = alloca [20000 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [33 x i8]
%22 = alloca [1024 x i8]
%23 = alloca [1024 x i8]
%24 = alloca [25 x i8]
%25 = alloca [14 x i8]
%26 = alloca [10 x i8]
%27 = alloca [5 x i8]
%28 = alloca [18 x i8]
%29 = alloca [1024 x i8]
%30 = alloca i32
%31 = alloca [128 x i32]
%32 = alloca [128 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %7
%33 = bitcast [33 x i8]* %21 to i8*
%34 = bitcast [1024 x i8]* %23 to i8*
%35 = bitcast [25 x i8]* %24 to i8*
%36 = bitcast [14 x i8]* %25 to i8*
%37 = bitcast [10 x i8]* %26 to i8*
%38 = bitcast [5 x i8]* %27 to i8*
%39 = bitcast [18 x i8]* %28 to i8*
store i32 0, i32* %30
store i32 0, i32* %17
br label %40
40: ; preds = %50, %2
%41 = load i32, i32* %17
%42 = icmp slt i32 %41, 128
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i32, i32* %17
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [128 x i32], [128 x i32]* %31, i64 0, i64 %45
store i32 0, i32* %46
%47 = load i32, i32* %17
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [128 x i32], [128 x i32]* %32, i64 0, i64 %48
store i32 0, i32* %49
br label %50
50: ; preds = %43
%51 = load i32, i32* %17
%52 = add nsw i32 %51, 1
store i32 %52, i32* %17
br label %40
53: ; preds = %40
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %29, i64 0, i64 0
%55 = getelementptr inbounds [14 x i8], [14 x i8]* %25, i64 0, i64 0
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %26, i64 0, i64 0
%57 = getelementptr inbounds [25 x i8], [25 x i8]* %24, i64 0, i64 0
%58 = getelementptr inbounds [5 x i8], [5 x i8]* %27, i64 0, i64 0
%59 = getelementptr inbounds [25 x i8], [25 x i8]* %24, i64 0, i64 0
%60 = getelementptr inbounds [18 x i8], [18 x i8]* %28, i64 0, i64 0
%61 = getelementptr inbounds [25 x i8], [25 x i8]* %24, i64 0, i64 0
%62 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %54, i8* %55, i8* %56, i8* %57, i8* %58, i8* %59, i8* %60, i8* %61)
%63 = getelementptr inbounds [25 x i8], [25 x i8]* %24, i64 0, i64 0
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %63)
%65 = load i32, i32* %4
%66 = icmp eq i32 %65, 1
br i1 %66, label %67, label %69
67: ; preds = %53
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %221
69: ; preds = %53
%70 = load i32, i32* %4
%71 = icmp eq i32 %70, 3
br i1 %71, label %72, label %78
72: ; preds = %69
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 2
%75 = load i8*, i8** %74
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %23, i64 0, i64 0
%77 = call i32 @strcpy(i8* %75, i8* %76)
br label %78
78: ; preds = %72, %69
br label %79
79: ; preds = %78
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32* @fopen(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %83, i32** %6
br label %84
84: ; preds = %79, %190
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%86 = load i32*, i32** %6
%87 = call i32* @fgets(i8* %85, i32 1024, i32* %86)
%88 = icmp eq i32* %87, null
br i1 %88, label %89, label %90
89: ; preds = %84
br label %193
90: ; preds = %84
%91 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%92 = getelementptr inbounds [1024 x i8], [1024 x i8]* %29, i64 0, i64 0
%93 = call i32 @sscanf(i8* %91, i8* %92, i32* %20, i32* %12, i32* %10, double* %13, double* %14, double* %15, double* %16, i32* %11)
%94 = load i32, i32* %11
%95 = icmp eq i32 %94, -1
br i1 %95, label %96, label %144
96: ; preds = %90
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
%98 = getelementptr inbounds [33 x i8], [33 x i8]* %21, i64 0, i64 0
%99 = getelementptr inbounds [1024 x i8], [1024 x i8]* %23, i64 0, i64 0
%100 = load i32, i32* %20
%101 = load i32, i32* %20
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [128 x i32], [128 x i32]* %32, i64 0, i64 %102
%104 = load i32, i32* %103
%105 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %97, i8* %98, i8* %99, i32 %100, i32 %104)
%106 = load i32*, i32** %7
%107 = icmp ne i32* %106, null
br i1 %107, label %108, label %111
108: ; preds = %96
%109 = load i32*, i32** %7
%110 = call i32 @fclose(i32* %109)
br label %111
111: ; preds = %108, %96
%112 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
%113 = call i32* @fopen(i8* %112, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %113, i32** %7
%114 = load i32*, i32** %7
%115 = call i32 @printHeader(i32* %114)
store i32 0, i32* %17
br label %116
116: ; preds = %123, %111
%117 = load i32, i32* %17
%118 = icmp slt i32 %117, 20000
br i1 %118, label %119, label %126
119: ; preds = %116
%120 = load i32, i32* %17
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [20000 x i32], [20000 x i32]* %9, i64 0, i64 %121
store i32 -1, i32* %122
br label %123
123: ; preds = %119
%124 = load i32, i32* %17
%125 = add nsw i32 %124, 1
store i32 %125, i32* %17
br label %116
126: ; preds = %116
%127 = load i32*, i32** %7
%128 = load i32, i32* %20
%129 = load double, double* %13
%130 = load double, double* %14
%131 = load double, double* %15
%132 = load double, double* %16
%133 = call i32 @fprintf(i32* %127, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %128, double %129, double %130, double %131, double %132, i32 -1)
%134 = load i32, i32* %12
%135 = getelementptr inbounds [20000 x i32], [20000 x i32]* %9, i64 0, i64 1
store i32 %134, i32* %135
%136 = load i32, i32* %20
%137 = load i32, i32* %12
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %136, i32 %137)
%139 = load i32, i32* %20
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [128 x i32], [128 x i32]* %32, i64 0, i64 %140
%142 = load i32, i32* %141
%143 = add nsw i32 %142, 1
store i32 %143, i32* %141
store i32 1, i32* %17
br label %190
144: ; preds = %90
store i32 1, i32* %18
store i32 0, i32* %19
br label %145
145: ; preds = %159, %144
%146 = load i32, i32* %18
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [20000 x i32], [20000 x i32]* %9, i64 0, i64 %147
%149 = load i32, i32* %148
%150 = icmp ne i32 %149, -1
br i1 %150, label %151, label %162
151: ; preds = %145
%152 = load i32, i32* %18
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [20000 x i32], [20000 x i32]* %9, i64 0, i64 %153
%155 = load i32, i32* %154
%156 = load i32, i32* %11
%157 = icmp eq i32 %155, %156
br i1 %157, label %158, label %159
158: ; preds = %151
store i32 1, i32* %19
br label %162
159: ; preds = %151
%160 = load i32, i32* %18
%161 = add nsw i32 %160, 1
store i32 %161, i32* %18
br label %145
162: ; preds = %158, %145
%163 = load i32, i32* %19
%164 = icmp eq i32 %163, 0
br i1 %164, label %165, label %169
165: ; preds = %162
%166 = load i32, i32* %17
%167 = load i32, i32* %18
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %166, i32 %167)
br label %193
169: ; preds = %162
%170 = load i32*, i32** %7
%171 = load i32, i32* %17
%172 = load i32, i32* %20
%173 = load double, double* %13
%174 = load double, double* %14
%175 = load double, double* %15
%176 = load double, double* %16
%177 = load i32, i32* %18
%178 = call i32 @fprintf(i32* %170, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %171, i32 %172, double %173, double %174, double %175, double %176, i32 %177)
%179 = load i32, i32* %10
%180 = load i32, i32* %17
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [20000 x i32], [20000 x i32]* %9, i64 0, i64 %181
store i32 %179, i32* %182
%183 = load i32, i32* %30
%184 = add nsw i32 %183, 1
store i32 %184, i32* %30
%185 = load i32, i32* %20
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [128 x i32], [128 x i32]* %31, i64 0, i64 %186
%188 = load i32, i32* %187
%189 = add nsw i32 %188, 1
store i32 %189, i32* %187
br label %190
190: ; preds = %169, %126
%191 = load i32, i32* %17
%192 = add nsw i32 %191, 1
store i32 %192, i32* %17
br label %84
193: ; preds = %165, %89
%194 = load i32*, i32** %7
%195 = call i32 @fclose(i32* %194)
%196 = load i32*, i32** %6
%197 = call i32 @fclose(i32* %196)
%198 = load i32, i32* %30
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %198)
store i32 0, i32* %17
br label %200
200: ; preds = %217, %193
%201 = load i32, i32* %17
%202 = icmp slt i32 %201, 128
br i1 %202, label %203, label %220
203: ; preds = %200
%204 = load i32, i32* %17
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [128 x i32], [128 x i32]* %31, i64 0, i64 %205
%207 = load i32, i32* %206
%208 = icmp ne i32 %207, 0
br i1 %208, label %209, label %216
209: ; preds = %203
%210 = load i32, i32* %17
%211 = load i32, i32* %17
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds [128 x i32], [128 x i32]* %31, i64 0, i64 %212
%214 = load i32, i32* %213
%215 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %210, i32 %214)
br label %216
216: ; preds = %209, %203
br label %217
217: ; preds = %216
%218 = load i32, i32* %17
%219 = add nsw i32 %218, 1
store i32 %219, i32* %17
br label %200
220: ; preds = %200
store i32 0, i32* %3
br label %221
221: ; preds = %220, %67
%222 = load i32, i32* %3
ret i32 %222
}

LLVM IR (-O2):
@__const.main.filename_template = [33 x i8] c"%sCell_BN_1056_node%d_part%d.swc\00"
@__const.main.dirname = [1024 x i8] c"./split_swc/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.cell_name = [25 x i8] c"Cell_BN_1056[0].dend[%d]\00"
@__const.main.scanf_template = [14 x i8] c"%s%s%s%s%s%s\0A\00"
@__const.main.scanf_template1 = [10 x i8] c"%d : SWC(\00"
@__const.main.scanf_template2 = [5 x i8] c") : \00"
@__const.main.scanf_template3 = [18 x i8] c" %lf %lf %lf %lf \00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [22 x i8] c"%d %d %f %f %f %f %d\0A\00"
@.str.5 = [22 x i8] c"node = %d, root = %d\0A\00"
@.str.6 = [17 x i8] c"error i=%d j=%d\0A\00"
@.str.7 = [25 x i8] c"Total Compartments : %d\0A\00"
@.str.8 = [19 x i8] c" NODE%d : %d comp\0A\00"
@str = [10 x i8] c"USEAGE : \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [20000 x i32]
%5 = bitcast [20000 x i32]* %4 to i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca [33 x i8]
%15 = alloca [1024 x i8]
%16 = alloca [1024 x i8]
%17 = alloca [25 x i8]
%18 = alloca [14 x i8]
%19 = alloca [10 x i8]
%20 = alloca [5 x i8]
%21 = alloca [18 x i8]
%22 = alloca [1024 x i8]
%23 = alloca [128 x i32]
%24 = bitcast [128 x i32]* %23 to i8*
%25 = alloca [128 x i32]
%26 = bitcast [128 x i32]* %25 to i8*
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%28 = bitcast i32* %6 to i8*
%29 = bitcast i32* %7 to i8*
%30 = bitcast i32* %8 to i8*
%31 = bitcast double* %9 to i8*
%32 = bitcast double* %10 to i8*
%33 = bitcast double* %11 to i8*
%34 = bitcast double* %12 to i8*
%35 = bitcast i32* %13 to i8*
%36 = getelementptr inbounds [33 x i8], [33 x i8]* %14, i64 0, i64 0
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %16, i64 0, i64 0
%39 = getelementptr inbounds [25 x i8], [25 x i8]* %17, i64 0, i64 0
%40 = getelementptr inbounds [14 x i8], [14 x i8]* %18, i64 0, i64 0
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %19, i64 0, i64 0
%42 = getelementptr inbounds [5 x i8], [5 x i8]* %20, i64 0, i64 0
%43 = getelementptr inbounds [18 x i8], [18 x i8]* %21, i64 0, i64 0
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %22, i64 0, i64 0
%45 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %44, i8* %40, i8* %41, i8* %39, i8* %42, i8* %39, i8* %43, i8* %39)
%46 = call i32 @puts(i8* %39)
switch i32 %0, label %53 [
i32 1, label %47
i32 3, label %49
]
47: ; preds = %2
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %148
49: ; preds = %2
%50 = getelementptr inbounds i8*, i8** %1, i64 2
%51 = load i8*, i8** %50
%52 = call i32 @strcpy(i8* %51, i8* %38)
br label %53
53: ; preds = %2, %49
%54 = getelementptr inbounds i8*, i8** %1, i64 1
%55 = load i8*, i8** %54
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%57 = call i32* @fgets(i8* %27, i32 1024, i32* %56)
%58 = icmp eq i32* %57, null
br i1 %58, label %131, label %59
59: ; preds = %53
%60 = getelementptr inbounds [20000 x i32], [20000 x i32]* %4, i64 0, i64 1
br label %61
61: ; preds = %59, %118
%62 = phi i32 [ 0, %59 ], [ %122, %118 ]
%63 = phi i32 [ 128, %59 ], [ %128, %118 ]
%64 = phi i32* [ null, %59 ], [ %120, %118 ]
%65 = call i32 @sscanf(i8* %27, i8* %44, i32* %13, i32* %8, i32* %6, double* %9, double* %10, double* %11, double* %12, i32* %7)
%66 = load i32, i32* %7
%67 = icmp eq i32 %66, -1
br i1 %67, label %71, label %68
68: ; preds = %61
%69 = load i32, i32* %60
%70 = icmp eq i32 %69, -1
br i1 %70, label %103, label %92
71: ; preds = %61
%72 = load i32, i32* %13
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [128 x i32], [128 x i32]* %25, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %37, i8* %36, i8* %38, i32 %72, i32 %75)
%77 = icmp eq i32* %64, null
br i1 %77, label %80, label %78
78: ; preds = %71
%79 = call i32 @fclose(i32* %64)
br label %80
80: ; preds = %78, %71
%81 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%82 = call i32 @printHeader(i32* %81)
%83 = load i32, i32* %13
%84 = load double, double* %9
%85 = load double, double* %10
%86 = load double, double* %11
%87 = load double, double* %12
%88 = call i32 @fprintf(i32* %81, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %83, double %84, double %85, double %86, double %87, i32 -1)
%89 = load i32, i32* %8
store i32 %89, i32* %60
%90 = load i32, i32* %13
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %90, i32 %89)
br label %118
92: ; preds = %68, %96
%93 = phi i64 [ %97, %96 ], [ 1, %68 ]
%94 = phi i32 [ %99, %96 ], [ %69, %68 ]
%95 = icmp eq i32 %94, %66
br i1 %95, label %106, label %96
96: ; preds = %92
%97 = add nuw i64 %93, 1
%98 = getelementptr inbounds [20000 x i32], [20000 x i32]* %4, i64 0, i64 %97
%99 = load i32, i32* %98
%100 = icmp eq i32 %99, -1
br i1 %100, label %101, label %92
101: ; preds = %96
%102 = trunc i64 %97 to i32
br label %103
103: ; preds = %68, %101
%104 = phi i32 [ %102, %101 ], [ 1, %68 ]
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %63, i32 %104)
br label %131
106: ; preds = %92
%107 = trunc i64 %93 to i32
%108 = load i32, i32* %13
%109 = load double, double* %9
%110 = load double, double* %10
%111 = load double, double* %11
%112 = load double, double* %12
%113 = call i32 @fprintf(i32* %64, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %63, i32 %108, double %109, double %110, double %111, double %112, i32 %107)
%114 = load i32, i32* %6
%115 = sext i32 %63 to i64
%116 = getelementptr inbounds [20000 x i32], [20000 x i32]* %4, i64 0, i64 %115
store i32 %114, i32* %116
%117 = add nsw i32 %62, 1
br label %118
118: ; preds = %106, %80
%119 = phi [128 x i32]* [ %23, %106 ], [ %25, %80 ]
%120 = phi i32* [ %64, %106 ], [ %81, %80 ]
%121 = phi i32 [ %63, %106 ], [ 1, %80 ]
%122 = phi i32 [ %117, %106 ], [ %62, %80 ]
%123 = load i32, i32* %13
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [128 x i32], [128 x i32]* %119, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = add nsw i32 %126, 1
store i32 %127, i32* %125
%128 = add nsw i32 %121, 1
%129 = call i32* @fgets(i8* %27, i32 1024, i32* %56)
%130 = icmp eq i32* %129, null
br i1 %130, label %131, label %61
131: ; preds = %118, %53, %103
%132 = phi i32* [ %64, %103 ], [ null, %53 ], [ %120, %118 ]
%133 = phi i32 [ %62, %103 ], [ 0, %53 ], [ %122, %118 ]
%134 = call i32 @fclose(i32* %132)
%135 = call i32 @fclose(i32* %56)
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %133)
br label %137
137: ; preds = %131, %145
%138 = phi i64 [ 0, %131 ], [ %146, %145 ]
%139 = getelementptr inbounds [128 x i32], [128 x i32]* %23, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = icmp eq i32 %140, 0
br i1 %141, label %145, label %142
142: ; preds = %137
%143 = trunc i64 %138 to i32
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %143, i32 %140)
br label %145
145: ; preds = %137, %142
%146 = add nuw nsw i64 %138, 1
%147 = icmp eq i64 %146, 128
br i1 %147, label %148, label %137
148: ; preds = %145, %47
%149 = phi i32 [ -1, %47 ], [ 0, %145 ]
ret i32 %149
}