#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 uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ epistasis_dataset_close(int *, size_t);
int *epistasis_dataset_load(int *, int *, size_t *, size_t *, size_t *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  int num_affected, num_unaffected, num_samples;
  size_t num_variants, file_len, genotypes_offset;
  char *filename, *output_filename;
  if (argc < 2) {
    printf("Usage: hpgvariant2mdrjava <filename>\n");
    exit(1);
  }
  filename = argv[1];
  output_filename = malloc((strlen(filename) + 5) * sizeof(char));
  sprintf(output_filename, "%s.txt", filename);
  printf("output file is %s\n", output_filename);
  uint8_t *input_file =
      epistasis_dataset_load(&num_affected, &num_unaffected, &num_variants,
                             &file_len, &genotypes_offset, filename);
  uint8_t *genotypes = input_file + genotypes_offset;
  num_samples = num_affected + num_unaffected;
  FILE *outfile = fopen(output_filename, "w");
  printf("genotypes offset is %zu\n", genotypes_offset);
  int i, j;
  for (i = 0; i < num_variants; i++) {
    fprintf(outfile, "S%d\t", i);
  }
  fprintf(outfile, "Class\n");
  for (j = 0; j < num_affected; j++) {
    for (i = 0; i < num_variants; i++) {
      uint8_t gt = genotypes[i * num_samples + j];
      if (gt == 255)
        gt = 3;
      fprintf(outfile, "%d\t", gt);
    }
    fprintf(outfile, "0\n");
  }
  for (j = num_affected; j < num_samples; j++) {
    for (i = 0; i < num_variants; i++) {
      uint8_t gt = genotypes[i * num_samples + j];
      if (gt == 255)
        gt = 3;
      fprintf(outfile, "%d\t", gt);
    }
    fprintf(outfile, "1\n");
  }
  fclose(outfile);
  epistasis_dataset_close(input_file, file_len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11d8 <main+0x38>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x5,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xe16(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x48(%rbp),%rsi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x40(%rbp),%r9
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x38(%rbp),%r8
call   1090 <epistasis_dataset_load@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    12c2 <main+0x122>
mov    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%edx
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1291 <main+0xf1>
mov    -0x60(%rbp),%rdi
lea    0xd93(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    136a <main+0x1ca>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    134a <main+0x1aa>
mov    -0x58(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x6c(%rbp)
cmpl   $0xff,-0x6c(%rbp)
jne    1327 <main+0x187>
movl   $0x3,-0x6c(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x6c(%rbp),%edx
lea    0xd27(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    12ee <main+0x14e>
mov    -0x60(%rbp),%rdi
lea    0xd12(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    12db <main+0x13b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13ff <main+0x25f>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    13df <main+0x23f>
mov    -0x58(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x70(%rbp)
cmpl   $0xff,-0x70(%rbp)
jne    13bc <main+0x21c>
movl   $0x3,-0x70(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%edx
lea    0xc92(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1383 <main+0x1e3>
mov    -0x60(%rbp),%rdi
lea    0xc80(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1370 <main+0x1d0>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x50(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <epistasis_dataset_close@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
cmp    $0x1,%edi
jle    1463 <main+0x2a3>
mov    0x8(%rsi),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0x5(%rax),%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
lea    0xe0b(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   10c0 <sprintf@plt>
lea    0xe00(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x3c(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x50(%rsp),%rcx
lea    0x40(%rsp),%r8
mov    %r14,%r9
call   10a0 <epistasis_dataset_load@plt>
mov    %rax,0x20(%rsp)
mov    0x40(%rsp),%rbp
mov    0x3c(%rsp),%eax
add    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
lea    0xdcb(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
mov    %rax,%r13
mov    0x40(%rsp),%rsi
lea    0xdb6(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
cmpq   $0x0,0x10(%rsp)
je     129a <main+0xda>
lea    0xdb9(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,0x10(%rsp)
ja     1280 <main+0xc0>
lea    0xd99(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10e0 <fwrite@plt>
mov    0xc(%rsp),%eax
movslq 0x8(%rsp),%rcx
mov    %rcx,0x28(%rsp)
test   %eax,%eax
jle    1381 <main+0x1c1>
mov    0x20(%rsp),%rax
mov    %rbp,0x48(%rsp)
lea    (%rax,%rbp,4),%rax
mov    %rax,0x18(%rsp)
mov    0x28(%rsp),%rax
lea    0x0(,%rax,4),%rbp
mov    $0x3,%r15d
lea    0xd40(%rip),%r12
xor    %ecx,%ecx
jmp    1332 <main+0x172>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xd30(%rip),%rdi
mov    %r13,%rcx
call   10e0 <fwrite@plt>
mov    0x30(%rsp),%rcx
add    $0x1,%rcx
movslq 0xc(%rsp),%rax
addq   $0x4,0x18(%rsp)
cmp    %rax,%rcx
jge    137c <main+0x1bc>
mov    %rcx,0x30(%rsp)
cmpq   $0x0,0x10(%rsp)
je     1300 <main+0x140>
mov    $0x1,%r14d
mov    0x18(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%edx
cmp    $0xff,%edx
cmove  %r15d,%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14d,%eax
add    %rbp,%rbx
add    $0x1,%r14
cmp    %rax,0x10(%rsp)
ja     1350 <main+0x190>
jmp    1300 <main+0x140>
mov    0x48(%rsp),%rbp
cmp    0x8(%rsp),%eax
jge    143b <main+0x27b>
movslq %eax,%rcx
add    %rcx,%rbp
mov    0x20(%rsp),%rax
lea    (%rax,%rbp,4),%rax
mov    %rax,0x18(%rsp)
shlq   $0x2,0x28(%rsp)
mov    $0x3,%r15d
lea    0xc84(%rip),%r12
mov    0x28(%rsp),%r14
jmp    13ee <main+0x22e>
nopl   0x0(%rax)
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xc73(%rip),%rdi
mov    %r13,%rcx
call   10e0 <fwrite@plt>
mov    0x30(%rsp),%rcx
add    $0x1,%rcx
addq   $0x4,0x18(%rsp)
cmp    %ecx,0x8(%rsp)
je     143b <main+0x27b>
mov    %rcx,0x30(%rsp)
cmpq   $0x0,0x10(%rsp)
je     13c0 <main+0x200>
mov    $0x1,%ebp
mov    0x18(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%edx
cmp    $0xff,%edx
cmove  %r15d,%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %ebp,%eax
add    %r14,%rbx
add    $0x1,%rbp
cmp    %rax,0x10(%rsp)
ja     1410 <main+0x250>
jmp    13c0 <main+0x200>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x50(%rsp),%rsi
mov    0x20(%rsp),%rdi
call   1030 <epistasis_dataset_close@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbdd(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: hpgvariant2mdrjava <filename>\0A\00"
@.str.1 = [7 x i8] c"%s.txt\00"
@.str.2 = [19 x i8] c"output file is %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [25 x i8] c"genotypes offset is %zu\0A\00"
@.str.5 = [5 x i8] c"S%d\09\00"
@.str.6 = [7 x i8] c"Class\0A\00"
@.str.7 = [4 x i8] c"%d\09\00"
@.str.8 = [3 x i8] c"0\0A\00"
@.str.9 = [3 x i8] c"1\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 i32
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 2
br i1 %22, label %23, label %26
23: ; preds = %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
store i8* %29, i8** %12
%30 = load i8*, i8** %12
%31 = call i32 @strlen(i8* %30)
%32 = add nsw i32 %31, 5
%33 = sext i32 %32 to i64
%34 = mul i64 %33, 1
%35 = trunc i64 %34 to i32
%36 = call i8* @malloc(i32 %35)
store i8* %36, i8** %13
%37 = load i8*, i8** %13
%38 = load i8*, i8** %12
%39 = call i32 @sprintf(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = load i8*, i8** %13
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %12
%43 = call i32* @epistasis_dataset_load(i32* %6, i32* %7, i64* %9, i64* %10, i64* %11, i8* %42)
store i32* %43, i32** %14
%44 = load i32*, i32** %14
%45 = load i64, i64* %11
%46 = getelementptr inbounds i32, i32* %44, i64 %45
store i32* %46, i32** %15
%47 = load i32, i32* %6
%48 = load i32, i32* %7
%49 = add nsw i32 %47, %48
store i32 %49, i32* %8
%50 = load i8*, i8** %13
%51 = call i32* @fopen(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %51, i32** %16
%52 = load i64, i64* %11
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i64 %52)
store i32 0, i32* %17
br label %54
54: ; preds = %63, %26
%55 = load i32, i32* %17
%56 = sext i32 %55 to i64
%57 = load i64, i64* %9
%58 = icmp ult i64 %56, %57
br i1 %58, label %59, label %66
59: ; preds = %54
%60 = load i32*, i32** %16
%61 = load i32, i32* %17
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %59
%64 = load i32, i32* %17
%65 = add nsw i32 %64, 1
store i32 %65, i32* %17
br label %54
66: ; preds = %54
%67 = load i32*, i32** %16
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %18
br label %69
69: ; preds = %102, %66
%70 = load i32, i32* %18
%71 = load i32, i32* %6
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %105
73: ; preds = %69
store i32 0, i32* %17
br label %74
74: ; preds = %96, %73
%75 = load i32, i32* %17
%76 = sext i32 %75 to i64
%77 = load i64, i64* %9
%78 = icmp ult i64 %76, %77
br i1 %78, label %79, label %99
79: ; preds = %74
%80 = load i32*, i32** %15
%81 = load i32, i32* %17
%82 = load i32, i32* %8
%83 = mul nsw i32 %81, %82
%84 = load i32, i32* %18
%85 = add nsw i32 %83, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %80, i64 %86
%88 = load i32, i32* %87
store i32 %88, i32* %19
%89 = load i32, i32* %19
%90 = icmp eq i32 %89, 255
br i1 %90, label %91, label %92
91: ; preds = %79
store i32 3, i32* %19
br label %92
92: ; preds = %91, %79
%93 = load i32*, i32** %16
%94 = load i32, i32* %19
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %94)
br label %96
96: ; preds = %92
%97 = load i32, i32* %17
%98 = add nsw i32 %97, 1
store i32 %98, i32* %17
br label %74
99: ; preds = %74
%100 = load i32*, i32** %16
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %102
102: ; preds = %99
%103 = load i32, i32* %18
%104 = add nsw i32 %103, 1
store i32 %104, i32* %18
br label %69
105: ; preds = %69
%106 = load i32, i32* %6
store i32 %106, i32* %18
br label %107
107: ; preds = %140, %105
%108 = load i32, i32* %18
%109 = load i32, i32* %8
%110 = icmp slt i32 %108, %109
br i1 %110, label %111, label %143
111: ; preds = %107
store i32 0, i32* %17
br label %112
112: ; preds = %134, %111
%113 = load i32, i32* %17
%114 = sext i32 %113 to i64
%115 = load i64, i64* %9
%116 = icmp ult i64 %114, %115
br i1 %116, label %117, label %137
117: ; preds = %112
%118 = load i32*, i32** %15
%119 = load i32, i32* %17
%120 = load i32, i32* %8
%121 = mul nsw i32 %119, %120
%122 = load i32, i32* %18
%123 = add nsw i32 %121, %122
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32, i32* %118, i64 %124
%126 = load i32, i32* %125
store i32 %126, i32* %20
%127 = load i32, i32* %20
%128 = icmp eq i32 %127, 255
br i1 %128, label %129, label %130
129: ; preds = %117
store i32 3, i32* %20
br label %130
130: ; preds = %129, %117
%131 = load i32*, i32** %16
%132 = load i32, i32* %20
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %131, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %132)
br label %134
134: ; preds = %130
%135 = load i32, i32* %17
%136 = add nsw i32 %135, 1
store i32 %136, i32* %17
br label %112
137: ; preds = %112
%138 = load i32*, i32** %16
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %140
140: ; preds = %137
%141 = load i32, i32* %18
%142 = add nsw i32 %141, 1
store i32 %142, i32* %18
br label %107
143: ; preds = %107
%144 = load i32*, i32** %16
%145 = call i32 @fclose(i32* %144)
%146 = load i32*, i32** %14
%147 = load i64, i64* %10
%148 = call i32 @epistasis_dataset_close(i32* %146, i64 %147)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%s.txt\00"
@.str.2 = [19 x i8] c"output file is %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [25 x i8] c"genotypes offset is %zu\0A\00"
@.str.5 = [5 x i8] c"S%d\09\00"
@.str.6 = [7 x i8] c"Class\0A\00"
@.str.7 = [4 x i8] c"%d\09\00"
@.str.8 = [3 x i8] c"0\0A\00"
@.str.9 = [3 x i8] c"1\0A\00"
@str = [37 x i8] c"Usage: hpgvariant2mdrjava <filename>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i64* %5 to i8*
%11 = bitcast i64* %6 to i8*
%12 = bitcast i64* %7 to i8*
%13 = icmp slt i32 %0, 2
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32 @strlen(i8* %19)
%21 = add nsw i32 %20, 5
%22 = tail call i8* @malloc(i32 %21)
%23 = tail call i32 @sprintf(i8* dereferenceable(1) %22, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%25 = call i32* @epistasis_dataset_load(i32* %3, i32* %4, i64* %5, i64* %6, i64* %7, i8* %19)
%26 = load i64, i64* %7
%27 = getelementptr inbounds i32, i32* %25, i64 %26
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = add i32 %29, %28
%31 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = load i64, i64* %7
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i64 %32)
%34 = load i64, i64* %5
%35 = icmp eq i64 %34, 0
br i1 %35, label %43, label %36
36: ; preds = %17, %36
%37 = phi i64 [ %40, %36 ], [ 0, %17 ]
%38 = trunc i64 %37 to i32
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%40 = add nuw i64 %37, 1
%41 = load i64, i64* %5
%42 = icmp ugt i64 %41, %40
br i1 %42, label %36, label %43
43: ; preds = %36, %17
%44 = call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i64 6, i64 1, i32* %31)
%45 = load i32, i32* %3
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %43
%48 = sext i32 %30 to i64
br label %49
49: ; preds = %47, %72
%50 = phi i64 [ 0, %47 ], [ %74, %72 ]
%51 = load i64, i64* %5
%52 = icmp eq i64 %51, 0
br i1 %52, label %72, label %59
53: ; preds = %72, %43
%54 = phi i32 [ %45, %43 ], [ %75, %72 ]
%55 = icmp slt i32 %54, %30
br i1 %55, label %56, label %100
56: ; preds = %53
%57 = sext i32 %30 to i64
%58 = sext i32 %54 to i64
br label %78
59: ; preds = %49, %59
%60 = phi i64 [ %68, %59 ], [ 0, %49 ]
%61 = mul nsw i64 %60, %48
%62 = add nsw i64 %61, %50
%63 = getelementptr inbounds i32, i32* %27, i64 %62
%64 = load i32, i32* %63
%65 = icmp eq i32 %64, 255
%66 = select i1 %65, i32 3, i32 %64
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %66)
%68 = add nuw i64 %60, 1
%69 = and i64 %68, 4294967295
%70 = load i64, i64* %5
%71 = icmp ugt i64 %70, %69
br i1 %71, label %59, label %72
72: ; preds = %59, %49
%73 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %31)
%74 = add nuw nsw i64 %50, 1
%75 = load i32, i32* %3
%76 = sext i32 %75 to i64
%77 = icmp slt i64 %74, %76
br i1 %77, label %49, label %53
78: ; preds = %56, %95
%79 = phi i64 [ %58, %56 ], [ %97, %95 ]
%80 = load i64, i64* %5
%81 = icmp eq i64 %80, 0
br i1 %81, label %95, label %82
82: ; preds = %78, %82
%83 = phi i64 [ %91, %82 ], [ 0, %78 ]
%84 = mul nsw i64 %83, %57
%85 = add nsw i64 %84, %79
%86 = getelementptr inbounds i32, i32* %27, i64 %85
%87 = load i32, i32* %86
%88 = icmp eq i32 %87, 255
%89 = select i1 %88, i32 3, i32 %87
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %89)
%91 = add nuw i64 %83, 1
%92 = and i64 %91, 4294967295
%93 = load i64, i64* %5
%94 = icmp ugt i64 %93, %92
br i1 %94, label %82, label %95
95: ; preds = %82, %78
%96 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 2, i64 1, i32* %31)
%97 = add nsw i64 %79, 1
%98 = trunc i64 %97 to i32
%99 = icmp eq i32 %30, %98
br i1 %99, label %100, label %78
100: ; preds = %95, %53
%101 = call i32 @fclose(i32* %31)
%102 = load i64, i64* %6
%103 = call i32 @epistasis_dataset_close(i32* %25, i64 %102)
ret i32 0
}