#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*/ *gzFile;

/* Variables and functions */
int /*<<< orphan*/ Z_FINISH;
int /*<<< orphan*/ exit(int);
char **getprops(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ gzbuffer(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ gzclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ gzflush(int /*<<< orphan*/ *, int /*<<< orphan*/);
scalar_t__ gzgets(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ *gzopen(char *, char *);
int /*<<< orphan*/ gzputs(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strtok(char *, char *);
void ff2arff(char *model) {
  char pos[40];
  char neg[40];
  char arff[40];
  char buffer[2048];
  int i = 0;
  strcpy(pos, model);
  strcpy(neg, model);
  strcpy(arff, model);
  strcat(arff, ".arff.gz");
  strcat(pos, ".pos.ff.gz");
  strcat(neg, ".neg.ff.gz");
  gzFile pin = gzopen(pos, "rb");
  gzFile out = gzopen(arff, "wb9");
  if (pin == NULL) {
    printf("Error opening %s\n", pos);
    exit(1);
  }
  if (out == NULL) {
    printf("Error opening %s\n", arff);
    exit(1);
  }
  gzbuffer(pin, 1024 * 128);
  gzputs(out,
         "% 1. Title: SFSU Feature File\n"
         "%\n% 2. Sources:\n%\n% 3. Author: San Francisco State University\n\n"
         "@RELATION ");
  gzputs(out, model);
  gzputs(out, "\n\n");
  char **props = getprops(pin, buffer);
  for (i = 0; i < 80; i++) {
    int j;
    for (j = 0; j < 6; j++) {
      char name[2048];
      sprintf(name, "@ATTRIBUTE %s_s%d_c%d NUMERIC\n", props[i], j, i * 6 + j);
      gzputs(out, name);
    }
  }
  gzputs(out, "@ATTRIBUTE class {1,-1}\n\n@DATA\n");
  while (buffer[0] == '#') {
    gzgets(pin, buffer, 2048);
  }
  do {
    strtok(buffer, "\t");
    for (i = 0; i < 80 * 6; i++) {
      gzputs(out, strtok(NULL, "\t"));
      gzputs(out, ",");
    }
    gzputs(out, "1\n");
  } while (gzgets(pin, buffer, 2048));
  gzclose(pin);
  gzFile nin = gzopen(neg, "rb");
  if (nin == NULL) {
    printf("Error opening %s\n", arff);
    exit(1);
  }
  gzgets(nin, buffer, 2048);
  while (buffer[0] == '#') {
    gzgets(nin, buffer, 2048);
  }
  do {
    strtok(buffer, "\t");
    for (i = 0; i < 80 * 6; i++) {
      gzputs(out, strtok(NULL, "\t"));
      gzputs(out, ",");
    }
    gzputs(out, "-1\n");
  } while (gzgets(nin, buffer, 2048));
  gzclose(nin);
  gzflush(out, Z_FINISH);
  gzclose(out);
}


x86 assembly (clang, -O0):
<ff2arff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10e0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x894(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xddf(%rip),%rsi
call   10d0 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   10d0 <strcat@plt>
lea    -0x60(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   10d0 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   10b0 <gzopen@plt>
mov    %rax,-0x8a0(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xdb7(%rip),%rsi
call   10b0 <gzopen@plt>
mov    %rax,-0x8a8(%rbp)
cmpq   $0x0,-0x8a0(%rbp)
jne    129f <ff2arff+0xcf>
lea    -0x30(%rbp),%rsi
lea    0xd96(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
cmpq   $0x0,-0x8a8(%rbp)
jne    12ca <ff2arff+0xfa>
lea    -0x90(%rbp),%rsi
lea    0xd6b(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x8a0(%rbp),%rdi
mov    $0x20000,%esi
call   1070 <gzbuffer@plt>
mov    -0x8a8(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   10a0 <gzputs@plt>
mov    -0x8a8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10a0 <gzputs@plt>
mov    -0x8a8(%rbp),%rdi
lea    0xd94(%rip),%rsi
call   10a0 <gzputs@plt>
mov    -0x8a0(%rbp),%rdi
lea    -0x890(%rbp),%rsi
call   1030 <getprops@plt>
mov    %rax,-0x8b0(%rbp)
movl   $0x0,-0x894(%rbp)
cmpl   $0x50,-0x894(%rbp)
jge    13d3 <ff2arff+0x203>
movl   $0x0,-0x8b4(%rbp)
cmpl   $0x6,-0x8b4(%rbp)
jge    13ba <ff2arff+0x1ea>
lea    -0x10c0(%rbp),%rdi
mov    -0x8b0(%rbp),%rax
movslq -0x894(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8b4(%rbp),%ecx
imul   $0x6,-0x894(%rbp),%r8d
06
add    -0x8b4(%rbp),%r8d
lea    0xd15(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0x8a8(%rbp),%rdi
lea    -0x10c0(%rbp),%rsi
call   10a0 <gzputs@plt>
mov    -0x8b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8b4(%rbp)
jmp    134c <ff2arff+0x17c>
jmp    13bf <ff2arff+0x1ef>
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1335 <ff2arff+0x165>
mov    -0x8a8(%rbp),%rdi
lea    0xce1(%rip),%rsi
call   10a0 <gzputs@plt>
movsbl -0x890(%rbp),%eax
cmp    $0x23,%eax
jne    1413 <ff2arff+0x243>
mov    -0x8a0(%rbp),%rdi
lea    -0x890(%rbp),%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
jmp    13e6 <ff2arff+0x216>
jmp    1418 <ff2arff+0x248>
lea    -0x890(%rbp),%rdi
lea    0xcbc(%rip),%rsi
call   10c0 <strtok@plt>
movl   $0x0,-0x894(%rbp)
cmpl   $0x1e0,-0x894(%rbp)
jge    1499 <ff2arff+0x2c9>
mov    -0x8a8(%rbp),%rax
mov    %rax,-0x10d0(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc84(%rip),%rsi
call   10c0 <strtok@plt>
mov    -0x10d0(%rbp),%rdi
mov    %rax,%rsi
call   10a0 <gzputs@plt>
mov    -0x8a8(%rbp),%rdi
lea    0xc64(%rip),%rsi
call   10a0 <gzputs@plt>
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1435 <ff2arff+0x265>
mov    -0x8a8(%rbp),%rdi
lea    0xc40(%rip),%rsi
call   10a0 <gzputs@plt>
mov    -0x8a0(%rbp),%rdi
lea    -0x890(%rbp),%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
cmp    $0x0,%rax
jne    1418 <ff2arff+0x248>
mov    -0x8a0(%rbp),%rdi
call   1040 <gzclose@plt>
lea    -0x60(%rbp),%rdi
lea    0xb3a(%rip),%rsi
call   10b0 <gzopen@plt>
mov    %rax,-0x10c8(%rbp)
cmpq   $0x0,-0x10c8(%rbp)
jne    151c <ff2arff+0x34c>
lea    -0x90(%rbp),%rsi
lea    0xb19(%rip),%rdi
call   1080 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x10c8(%rbp),%rdi
lea    -0x890(%rbp),%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
movsbl -0x890(%rbp),%eax
cmp    $0x23,%eax
jne    1561 <ff2arff+0x391>
mov    -0x10c8(%rbp),%rdi
lea    -0x890(%rbp),%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
jmp    1534 <ff2arff+0x364>
jmp    1566 <ff2arff+0x396>
lea    -0x890(%rbp),%rdi
lea    0xb6e(%rip),%rsi
call   10c0 <strtok@plt>
movl   $0x0,-0x894(%rbp)
cmpl   $0x1e0,-0x894(%rbp)
jge    15e7 <ff2arff+0x417>
mov    -0x8a8(%rbp),%rax
mov    %rax,-0x10d8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xb36(%rip),%rsi
call   10c0 <strtok@plt>
mov    -0x10d8(%rbp),%rdi
mov    %rax,%rsi
call   10a0 <gzputs@plt>
mov    -0x8a8(%rbp),%rdi
lea    0xb16(%rip),%rsi
call   10a0 <gzputs@plt>
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1583 <ff2arff+0x3b3>
mov    -0x8a8(%rbp),%rdi
lea    0xaf1(%rip),%rsi
call   10a0 <gzputs@plt>
mov    -0x10c8(%rbp),%rdi
lea    -0x890(%rbp),%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
cmp    $0x0,%rax
jne    1566 <ff2arff+0x396>
mov    -0x10c8(%rbp),%rdi
call   1040 <gzclose@plt>
mov    -0x8a8(%rbp),%rdi
mov    0x29aa(%rip),%rax
mov    (%rax),%esi
call   1090 <gzflush@plt>
mov    -0x8a8(%rbp),%rdi
call   1040 <gzclose@plt>
add    $0x10e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff2arff>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1098,%rsp
mov    %rdi,%r15
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcpy@plt>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <strcpy@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
call   1050 <strcpy@plt>
lea    0xde7(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <strcat@plt>
lea    0xde1(%rip),%rsi
mov    %rbx,%rdi
call   10d0 <strcat@plt>
lea    0xddd(%rip),%rsi
mov    %r14,%rdi
call   10d0 <strcat@plt>
lea    0xdd9(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <gzopen@plt>
mov    %rax,%r14
lea    0xdca(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <gzopen@plt>
test   %r14,%r14
je     15a8 <ff2arff+0x3d8>
mov    %rax,%rbx
test   %rax,%rax
je     159c <ff2arff+0x3cc>
mov    %r14,%rdi
mov    $0x20000,%esi
call   1070 <gzbuffer@plt>
lea    0xdaf(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <gzputs@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10a0 <gzputs@plt>
lea    0xdfd(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <gzputs@plt>
lea    0x90(%rsp),%rsi
mov    %r14,%rdi
call   1030 <getprops@plt>
mov    %rax,%r15
mov    $0xfffffffffffffe20,%rbp
lea    0xdd7(%rip),%r12
lea    0x890(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%rdx
lea    0x1e0(%rbp),%r8d
mov    %r13,%rdi
mov    %r12,%rsi
xor    %ecx,%ecx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
mov    (%r15),%rdx
lea    0x1e1(%rbp),%r8d
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x1,%ecx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
mov    (%r15),%rdx
lea    0x1e2(%rbp),%r8d
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x2,%ecx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
mov    (%r15),%rdx
lea    0x1e3(%rbp),%r8d
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x3,%ecx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
mov    (%r15),%rdx
lea    0x1e4(%rbp),%r8d
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x4,%ecx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
mov    (%r15),%rdx
lea    0x1e5(%rbp),%r8d
mov    %r13,%rdi
mov    %r12,%rsi
mov    $0x5,%ecx
call   10e0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
add    $0x8,%r15
add    $0x6,%rbp
jne    12e0 <ff2arff+0x110>
lea    0xcf2(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <gzputs@plt>
cmpb   $0x23,0x90(%rsp)
23
jne    140a <ff2arff+0x23a>
lea    0x90(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
cmpb   $0x23,0x90(%rsp)
23
je     13f0 <ff2arff+0x220>
lea    0xcd1(%rip),%r15
lea    0x90(%rsp),%r12
lea    0xcc4(%rip),%r13
mov    %r14,%rbp
mov    %r12,%rdi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    $0x1e0,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   10a0 <gzputs@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
add    $0xffffffff,%r14d
jne    1440 <ff2arff+0x270>
mov    %rbx,%rdi
lea    0xc77(%rip),%rsi
call   10a0 <gzputs@plt>
mov    %rbp,%r14
mov    %rbp,%rdi
mov    %r12,%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
test   %rax,%rax
jne    1420 <ff2arff+0x250>
mov    %r14,%rdi
call   1040 <gzclose@plt>
lea    0xb83(%rip),%rsi
lea    0x30(%rsp),%rdi
call   10b0 <gzopen@plt>
test   %rax,%rax
je     159c <ff2arff+0x3cc>
mov    %rax,%r14
lea    0x90(%rsp),%rsi
mov    %rax,%rdi
mov    $0x800,%edx
call   1060 <gzgets@plt>
cmpb   $0x23,0x90(%rsp)
23
jne    14fa <ff2arff+0x32a>
lea    0x90(%rsp),%rbp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
cmpb   $0x23,0x90(%rsp)
23
je     14e0 <ff2arff+0x310>
lea    0xbe1(%rip),%r15
lea    0x90(%rsp),%r12
lea    0xbd4(%rip),%r13
mov    %r12,%rdi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    $0x1e0,%ebp
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   10a0 <gzputs@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10a0 <gzputs@plt>
add    $0xffffffff,%ebp
jne    1520 <ff2arff+0x350>
mov    %rbx,%rdi
lea    0xb97(%rip),%rsi
call   10a0 <gzputs@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x800,%edx
call   1060 <gzgets@plt>
test   %rax,%rax
jne    1510 <ff2arff+0x340>
mov    %r14,%rdi
call   1040 <gzclose@plt>
mov    0x2a68(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1090 <gzflush@plt>
mov    %rbx,%rdi
call   1040 <gzclose@plt>
add    $0x1098,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa83(%rip),%rdi
mov    %rsp,%rsi
jmp    15b4 <ff2arff+0x3e4>
lea    0xa77(%rip),%rdi
lea    0x60(%rsp),%rsi
call   1080 <printf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c".arff.gz\00"
@.str.1 = [11 x i8] c".pos.ff.gz\00"
@.str.2 = [11 x i8] c".neg.ff.gz\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [4 x i8] c"wb9\00"
@.str.5 = [18 x i8] c"Error opening %s\0A\00"
@.str.6 = [104 x i8] c"% 1. Title: SFSU Feature File\0A%\0A% 2. Sources:\0A%\0A% 3. Author: San Francisco State University\0A\0A@RELATION \00"
@.str.7 = [3 x i8] c"\0A\0A\00"
@.str.8 = [31 x i8] c"@ATTRIBUTE %s_s%d_c%d NUMERIC\0A\00"
@.str.9 = [32 x i8] c"@ATTRIBUTE class {1,-1}\0A\0A@DATA\0A\00"
@.str.10 = [2 x i8] c"\09\00"
@.str.11 = [2 x i8] c",\00"
@.str.12 = [3 x i8] c"1\0A\00"
@.str.13 = [4 x i8] c"-1\0A\00"
@Z_FINISH = global i32 0
define void @ff2arff(i8* %0) {
%2 = alloca i8*
%3 = alloca [40 x i8]
%4 = alloca [40 x i8]
%5 = alloca [40 x i8]
%6 = alloca [2048 x i8]
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8**
%11 = alloca i32
%12 = alloca [2048 x i8]
%13 = alloca i32*
store i8* %0, i8** %2
store i32 0, i32* %7
%14 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%18 = load i8*, i8** %2
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%21 = load i8*, i8** %2
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%25 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%27 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%28 = call i32 @strcat(i8* %27, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%29 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%30 = call i32* @gzopen(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %30, i32** %8
%31 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%32 = call i32* @gzopen(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
store i32* %32, i32** %9
%33 = load i32*, i32** %8
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %39
35: ; preds = %1
%36 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %1
%40 = load i32*, i32** %9
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%44 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %43)
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %39
%47 = load i32*, i32** %8
%48 = call i32 @gzbuffer(i32* %47, i32 131072)
%49 = load i32*, i32** %9
%50 = call i32 @gzputs(i32* %49, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.6, i64 0, i64 0))
%51 = load i32*, i32** %9
%52 = load i8*, i8** %2
%53 = call i32 @gzputs(i32* %51, i8* %52)
%54 = load i32*, i32** %9
%55 = call i32 @gzputs(i32* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%56 = load i32*, i32** %8
%57 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%58 = call i8** @getprops(i32* %56, i8* %57)
store i8** %58, i8*** %10
store i32 0, i32* %7
br label %59
59: ; preds = %86, %46
%60 = load i32, i32* %7
%61 = icmp slt i32 %60, 80
br i1 %61, label %62, label %89
62: ; preds = %59
store i32 0, i32* %11
br label %63
63: ; preds = %82, %62
%64 = load i32, i32* %11
%65 = icmp slt i32 %64, 6
br i1 %65, label %66, label %85
66: ; preds = %63
%67 = getelementptr inbounds [2048 x i8], [2048 x i8]* %12, i64 0, i64 0
%68 = load i8**, i8*** %10
%69 = load i32, i32* %7
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %68, i64 %70
%72 = load i8*, i8** %71
%73 = load i32, i32* %11
%74 = load i32, i32* %7
%75 = mul nsw i32 %74, 6
%76 = load i32, i32* %11
%77 = add nsw i32 %75, %76
%78 = call i32 @sprintf(i8* %67, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %72, i32 %73, i32 %77)
%79 = load i32*, i32** %9
%80 = getelementptr inbounds [2048 x i8], [2048 x i8]* %12, i64 0, i64 0
%81 = call i32 @gzputs(i32* %79, i8* %80)
br label %82
82: ; preds = %66
%83 = load i32, i32* %11
%84 = add nsw i32 %83, 1
store i32 %84, i32* %11
br label %63
85: ; preds = %63
br label %86
86: ; preds = %85
%87 = load i32, i32* %7
%88 = add nsw i32 %87, 1
store i32 %88, i32* %7
br label %59
89: ; preds = %59
%90 = load i32*, i32** %9
%91 = call i32 @gzputs(i32* %90, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
br label %92
92: ; preds = %97, %89
%93 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 35
br i1 %96, label %97, label %101
97: ; preds = %92
%98 = load i32*, i32** %8
%99 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%100 = call i64 @gzgets(i32* %98, i8* %99, i32 2048)
br label %92
101: ; preds = %92
br label %102
102: ; preds = %120, %101
%103 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%104 = call i8* @strtok(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %7
br label %105
105: ; preds = %114, %102
%106 = load i32, i32* %7
%107 = icmp slt i32 %106, 480
br i1 %107, label %108, label %117
108: ; preds = %105
%109 = load i32*, i32** %9
%110 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%111 = call i32 @gzputs(i32* %109, i8* %110)
%112 = load i32*, i32** %9
%113 = call i32 @gzputs(i32* %112, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %114
114: ; preds = %108
%115 = load i32, i32* %7
%116 = add nsw i32 %115, 1
store i32 %116, i32* %7
br label %105
117: ; preds = %105
%118 = load i32*, i32** %9
%119 = call i32 @gzputs(i32* %118, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %120
120: ; preds = %117
%121 = load i32*, i32** %8
%122 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%123 = call i64 @gzgets(i32* %121, i8* %122, i32 2048)
%124 = icmp ne i64 %123, 0
br i1 %124, label %102, label %125
125: ; preds = %120
%126 = load i32*, i32** %8
%127 = call i32 @gzclose(i32* %126)
%128 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%129 = call i32* @gzopen(i8* %128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %129, i32** %13
%130 = load i32*, i32** %13
%131 = icmp eq i32* %130, null
br i1 %131, label %132, label %136
132: ; preds = %125
%133 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%134 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %133)
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %125
%137 = load i32*, i32** %13
%138 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%139 = call i64 @gzgets(i32* %137, i8* %138, i32 2048)
br label %140
140: ; preds = %145, %136
%141 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%142 = load i8, i8* %141
%143 = sext i8 %142 to i32
%144 = icmp eq i32 %143, 35
br i1 %144, label %145, label %149
145: ; preds = %140
%146 = load i32*, i32** %13
%147 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%148 = call i64 @gzgets(i32* %146, i8* %147, i32 2048)
br label %140
149: ; preds = %140
br label %150
150: ; preds = %168, %149
%151 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%152 = call i8* @strtok(i8* %151, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %7
br label %153
153: ; preds = %162, %150
%154 = load i32, i32* %7
%155 = icmp slt i32 %154, 480
br i1 %155, label %156, label %165
156: ; preds = %153
%157 = load i32*, i32** %9
%158 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%159 = call i32 @gzputs(i32* %157, i8* %158)
%160 = load i32*, i32** %9
%161 = call i32 @gzputs(i32* %160, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %162
162: ; preds = %156
%163 = load i32, i32* %7
%164 = add nsw i32 %163, 1
store i32 %164, i32* %7
br label %153
165: ; preds = %153
%166 = load i32*, i32** %9
%167 = call i32 @gzputs(i32* %166, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
br label %168
168: ; preds = %165
%169 = load i32*, i32** %13
%170 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%171 = call i64 @gzgets(i32* %169, i8* %170, i32 2048)
%172 = icmp ne i64 %171, 0
br i1 %172, label %150, label %173
173: ; preds = %168
%174 = load i32*, i32** %13
%175 = call i32 @gzclose(i32* %174)
%176 = load i32*, i32** %9
%177 = load i32, i32* @Z_FINISH
%178 = call i32 @gzflush(i32* %176, i32 %177)
%179 = load i32*, i32** %9
%180 = call i32 @gzclose(i32* %179)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c".arff.gz\00"
@.str.1 = [11 x i8] c".pos.ff.gz\00"
@.str.2 = [11 x i8] c".neg.ff.gz\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [4 x i8] c"wb9\00"
@.str.5 = [18 x i8] c"Error opening %s\0A\00"
@.str.6 = [104 x i8] c"% 1. Title: SFSU Feature File\0A%\0A% 2. Sources:\0A%\0A% 3. Author: San Francisco State University\0A\0A@RELATION \00"
@.str.7 = [3 x i8] c"\0A\0A\00"
@.str.8 = [31 x i8] c"@ATTRIBUTE %s_s%d_c%d NUMERIC\0A\00"
@.str.9 = [32 x i8] c"@ATTRIBUTE class {1,-1}\0A\0A@DATA\0A\00"
@.str.10 = [2 x i8] c"\09\00"
@.str.11 = [2 x i8] c",\00"
@.str.12 = [3 x i8] c"1\0A\00"
@.str.13 = [4 x i8] c"-1\0A\00"
@Z_FINISH = global i32 0
define void @ff2arff(i8* %0) {
%2 = alloca [40 x i8]
%3 = alloca [40 x i8]
%4 = alloca [40 x i8]
%5 = alloca [2048 x i8]
%6 = alloca [2048 x i8]
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 @strcpy(i8* %7, i8* %0)
%12 = call i32 @strcpy(i8* %8, i8* %0)
%13 = call i32 @strcpy(i8* %9, i8* %0)
%14 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32* @gzopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32* @gzopen(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i32* %17, null
br i1 %19, label %20, label %23
20: ; preds = %1
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %1
%24 = icmp eq i32* %18, null
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %23
%29 = call i32 @gzbuffer(i32* %17, i32 131072)
%30 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str.6, i64 0, i64 0))
%31 = call i32 @gzputs(i32* %18, i8* %0)
%32 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%33 = call i8** @getprops(i32* %17, i8* %10)
%34 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
br label %35
35: ; preds = %28, %35
%36 = phi i64 [ 0, %28 ], [ %68, %35 ]
%37 = getelementptr inbounds i8*, i8** %33, i64 %36
%38 = mul nuw nsw i64 %36, 6
%39 = load i8*, i8** %37
%40 = trunc i64 %38 to i32
%41 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %39, i32 0, i32 %40)
%42 = call i32 @gzputs(i32* %18, i8* %34)
%43 = load i8*, i8** %37
%44 = trunc i64 %38 to i32
%45 = or i32 %44, 1
%46 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %43, i32 1, i32 %45)
%47 = call i32 @gzputs(i32* %18, i8* %34)
%48 = load i8*, i8** %37
%49 = trunc i64 %38 to i32
%50 = add i32 %49, 2
%51 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %48, i32 2, i32 %50)
%52 = call i32 @gzputs(i32* %18, i8* %34)
%53 = load i8*, i8** %37
%54 = trunc i64 %38 to i32
%55 = add i32 %54, 3
%56 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %53, i32 3, i32 %55)
%57 = call i32 @gzputs(i32* %18, i8* %34)
%58 = load i8*, i8** %37
%59 = trunc i64 %38 to i32
%60 = add i32 %59, 4
%61 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %58, i32 4, i32 %60)
%62 = call i32 @gzputs(i32* %18, i8* %34)
%63 = load i8*, i8** %37
%64 = trunc i64 %38 to i32
%65 = add i32 %64, 5
%66 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i8* %63, i32 5, i32 %65)
%67 = call i32 @gzputs(i32* %18, i8* %34)
%68 = add nuw nsw i64 %36, 1
%69 = icmp eq i64 %68, 80
br i1 %69, label %70, label %35
70: ; preds = %35
%71 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%72 = load i8, i8* %10
%73 = icmp eq i8 %72, 35
br i1 %73, label %74, label %78
74: ; preds = %70, %74
%75 = call i64 @gzgets(i32* %17, i8* %10, i32 2048)
%76 = load i8, i8* %10
%77 = icmp eq i8 %76, 35
br i1 %77, label %74, label %78
78: ; preds = %74, %70
br label %79
79: ; preds = %78, %88
%80 = call i8* @strtok(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %81
81: ; preds = %79, %81
%82 = phi i32 [ 0, %79 ], [ %86, %81 ]
%83 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%84 = call i32 @gzputs(i32* %18, i8* %83)
%85 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%86 = add nuw nsw i32 %82, 1
%87 = icmp eq i32 %86, 480
br i1 %87, label %88, label %81
88: ; preds = %81
%89 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%90 = call i64 @gzgets(i32* %17, i8* %10, i32 2048)
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %79
92: ; preds = %88
%93 = call i32 @gzclose(i32* %17)
%94 = call i32* @gzopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%95 = icmp eq i32* %94, null
br i1 %95, label %96, label %99
96: ; preds = %92
%97 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%98 = call i32 @exit(i32 1)
unreachable
99: ; preds = %92
%100 = call i64 @gzgets(i32* %94, i8* %10, i32 2048)
%101 = load i8, i8* %10
%102 = icmp eq i8 %101, 35
br i1 %102, label %103, label %107
103: ; preds = %99, %103
%104 = call i64 @gzgets(i32* %94, i8* %10, i32 2048)
%105 = load i8, i8* %10
%106 = icmp eq i8 %105, 35
br i1 %106, label %103, label %107
107: ; preds = %103, %99
br label %108
108: ; preds = %107, %117
%109 = call i8* @strtok(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %110
110: ; preds = %108, %110
%111 = phi i32 [ 0, %108 ], [ %115, %110 ]
%112 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%113 = call i32 @gzputs(i32* %18, i8* %112)
%114 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%115 = add nuw nsw i32 %111, 1
%116 = icmp eq i32 %115, 480
br i1 %116, label %117, label %110
117: ; preds = %110
%118 = call i32 @gzputs(i32* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%119 = call i64 @gzgets(i32* %94, i8* %10, i32 2048)
%120 = icmp eq i64 %119, 0
br i1 %120, label %121, label %108
121: ; preds = %117
%122 = call i32 @gzclose(i32* %94)
%123 = load i32, i32* @Z_FINISH
%124 = call i32 @gzflush(i32* %18, i32 %123)
%125 = call i32 @gzclose(i32* %18)
ret void
}