#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*/ uint8_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
scalar_t__ EOF;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ encode_chunk(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *, int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ gen_encoding_matrix(int /*<<< orphan*/ *, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write_metadata(char *, int, int, int);
void encode_file(char *file, int nativeBlockNum, int parityBlockNum) {
  int chunkSize = 1;
  int totalSize;
  FILE *fp_in;
  FILE *fp_out;
  if ((fp_in = fopen(file, "rb")) == NULL) {
    printf("Can not open source file!\n");
    exit(0);
  }
  fseek(fp_in, 0L, SEEK_END);
  totalSize = ftell(fp_in);
  chunkSize = (totalSize / nativeBlockNum) + (totalSize % nativeBlockNum != 0);
  uint8_t *dataBuf;
  uint8_t *codeBuf;
  int dataSize = nativeBlockNum * chunkSize * sizeof(uint8_t);
  int codeSize = parityBlockNum * chunkSize * sizeof(uint8_t);
  dataBuf = (uint8_t *)malloc(nativeBlockNum * chunkSize * sizeof(uint8_t));
  memset(dataBuf, 0, dataSize);
  codeBuf = (uint8_t *)malloc(parityBlockNum * chunkSize * sizeof(uint8_t));
  memset(codeBuf, 0, codeSize);
  int i;
  for (i = 0; i < nativeBlockNum; i++) {
    if (fseek(fp_in, i * chunkSize, SEEK_SET) == -1) {
      printf("fseek error!\n");
      exit(0);
    }
    if (fread(dataBuf + i * chunkSize, sizeof(uint8_t), chunkSize, fp_in) ==
        EOF) {
      printf("fread error!\n");
      exit(0);
    }
  }
  fclose(fp_in);
  struct timespec start, end;
  double totalTime;
  clock_gettime(CLOCK_REALTIME, &start);
  uint8_t *encodingMatrix;
  encodingMatrix =
      (uint8_t *)malloc(parityBlockNum * nativeBlockNum * sizeof(uint8_t));
  gen_encoding_matrix(encodingMatrix, parityBlockNum, nativeBlockNum);
  encode_chunk(dataBuf, encodingMatrix, codeBuf, nativeBlockNum, parityBlockNum,
               chunkSize);
  clock_gettime(CLOCK_REALTIME, &end);
  totalTime = (double)(end.tv_sec - start.tv_sec) * 1000 +
              (double)(end.tv_nsec - start.tv_nsec) / (double)1000000L;
  printf("Total CPU encoding time: %fms\n", totalTime);
  char metadata_file_name[strlen(file) + 15];
  sprintf(metadata_file_name, "%s.METADATA", file);
  write_metadata(metadata_file_name, totalSize, parityBlockNum, nativeBlockNum);
  char output_file_name[strlen(file) + 5];
  for (i = 0; i < nativeBlockNum; i++) {
    sprintf(output_file_name, "_%d_%s", i, file);
    if ((fp_out = fopen(output_file_name, "wb")) == NULL) {
      printf("Can not open source file!\n");
      exit(0);
    }
    if (fwrite(dataBuf + i * chunkSize, sizeof(uint8_t), chunkSize, fp_out) !=
        sizeof(uint8_t) * chunkSize) {
      printf("fwrite error!\n");
      exit(0);
    }
    fclose(fp_out);
  }
  for (i = 0; i < parityBlockNum; i++) {
    sprintf(output_file_name, "_%d_%s", i + nativeBlockNum, file);
    if ((fp_out = fopen(output_file_name, "wb")) == NULL) {
      printf("Can not open source file!\n");
      exit(0);
    }
    if (fwrite(codeBuf + i * chunkSize, sizeof(uint8_t), chunkSize, fp_out) !=
        sizeof(uint8_t) * chunkSize) {
      printf("fwrite error!\n");
      exit(0);
    }
    fclose(fp_out);
  }
  free(dataBuf);
  free(codeBuf);
  free(encodingMatrix);
}


x86 assembly (clang, -O0):
<encode_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    125f <encode_file+0x4f>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    0x2d7e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10d0 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <ftell@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x94(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x94(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x3c(%rbp),%edx
xor    %esi,%esi
call   1090 <memset@plt>
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%edx
xor    %esi,%esi
call   1090 <memset@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13bd <encode_file+0x1ad>
mov    -0x20(%rbp),%rdi
mov    -0x44(%rbp),%esi
imul   -0x14(%rbp),%esi
mov    0x2c95(%rip),%rax
mov    (%rax),%edx
call   10d0 <fseek@plt>
cmp    $0xffffffff,%eax
jne    1360 <encode_file+0x150>
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fread@plt>
mov    0x2c54(%rip),%rcx
cmp    (%rcx),%rax
jne    13aa <encode_file+0x19a>
lea    0xca0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
jmp    13af <encode_file+0x19f>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    131d <encode_file+0x10d>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    0x2bfb(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
call   1050 <clock_gettime@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%eax
imul   %eax,%edi
shl    $0x2,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1130 <gen_encoding_matrix@plt>
mov    -0x30(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
call   10f0 <encode_chunk@plt>
mov    -0xb0(%rbp),%rax
mov    (%rax),%edi
lea    -0x68(%rbp),%rsi
call   1050 <clock_gettime@plt>
mov    -0x68(%rbp),%rax
mov    -0x60(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x50(%rbp),%rsi
sub    %rsi,%rdx
cvtsi2sd %rdx,%xmm0
sub    %rcx,%rax
cvtsi2sd %rax,%xmm1
movsd  0xba7(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xba3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
lea    0xbcc(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <strlen@plt>
add    $0xf,%eax
mov    %rsp,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0xa8(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x88(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xba4(%rip),%rsi
xor    %eax,%eax
call   1100 <sprintf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   10a0 <write_metadata@plt>
mov    -0x8(%rbp),%rdi
call   1070 <strlen@plt>
add    $0x5,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x90(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15d8 <encode_file+0x3c8>
mov    -0xa0(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xb3e(%rip),%rsi
mov    $0x0,%al
call   1100 <sprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0xb30(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1574 <encode_file+0x364>
lea    0xaad(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    $0x4,%esi
call   1120 <fwrite@plt>
cltq
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
cmp    %rcx,%rax
je     15c1 <encode_file+0x3b1>
lea    0xacc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1516 <encode_file+0x306>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    16a4 <encode_file+0x494>
mov    -0xa0(%rbp),%rdi
mov    -0x44(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xa72(%rip),%rsi
mov    $0x0,%al
call   1100 <sprintf@plt>
mov    -0xa0(%rbp),%rdi
lea    0xa64(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1640 <encode_file+0x430>
lea    0x9e1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x38(%rbp),%rdi
mov    -0x44(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    $0x4,%esi
call   1120 <fwrite@plt>
cltq
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
cmp    %rcx,%rax
je     168d <encode_file+0x47d>
lea    0xa00(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15df <encode_file+0x3cf>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_file>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %edx,-0x30(%rbp)
mov    %esi,%ebx
lea    0xdd3(%rip),%rsi
mov    %rdi,-0x68(%rbp)
call   10f0 <fopen@plt>
test   %rax,%rax
je     15c0 <encode_file+0x3a0>
mov    %rax,%r12
mov    0x2d8f(%rip),%rax
mov    (%rax),%edx
xor    %r13d,%r13d
mov    %r12,%rdi
xor    %esi,%esi
call   10e0 <fseek@plt>
mov    %r12,%rdi
call   10c0 <ftell@plt>
mov    %eax,-0x6c(%rbp)
cltd
idiv   %ebx
mov    %eax,%r15d
cmp    $0x1,%edx
sbb    $0xffffffff,%r15d
mov    %rbx,-0x60(%rbp)
lea    0x0(,%rbx,4),%r14d
mov    %r14d,-0x48(%rbp)
imul   %r15d,%r14d
mov    -0x30(%rbp),%ebx
imul   %r15d,%ebx
shl    $0x2,%ebx
mov    %r14d,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   10a0 <memset@plt>
mov    %ebx,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   10a0 <memset@plt>
mov    %r15d,-0x2c(%rbp)
movslq %r15d,%rax
mov    %rax,-0x50(%rbp)
mov    -0x60(%rbp),%rcx
mov    %ecx,%eax
mov    %rax,-0x78(%rbp)
test   %ecx,%ecx
jle    135d <encode_file+0x13d>
mov    -0x50(%rbp),%rax
lea    0x0(,%rax,4),%rax
mov    %rax,-0x40(%rbp)
mov    -0x78(%rbp),%r15
mov    -0x38(%rbp),%rbx
mov    -0x2c(%rbp),%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x2cb9(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    %r13d,%esi
call   10e0 <fseek@plt>
cmp    $0xffffffff,%eax
je     15d2 <encode_file+0x3b2>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %r12,%rcx
call   1050 <fread@plt>
mov    0x2c99(%rip),%rcx
cmp    (%rcx),%rax
je     15db <encode_file+0x3bb>
add    -0x40(%rbp),%rbx
add    %r14d,%r13d
add    $0xffffffffffffffff,%r15
jne    1310 <encode_file+0xf0>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    0x2c5c(%rip),%r15
mov    (%r15),%edi
lea    -0xa0(%rbp),%rsi
call   1060 <clock_gettime@plt>
mov    -0x30(%rbp),%r12d
mov    -0x48(%rbp),%edi
imul   %r12d,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12d,%esi
mov    -0x60(%rbp),%r14
mov    %r14d,%edx
call   1140 <gen_encoding_matrix@plt>
mov    -0x38(%rbp),%rdi
mov    %rbx,-0x48(%rbp)
mov    %rbx,%rsi
mov    -0x58(%rbp),%rdx
mov    %r14d,%ecx
mov    %r12d,%r8d
mov    -0x2c(%rbp),%r9d
call   1100 <encode_chunk@plt>
mov    (%r15),%edi
lea    -0x90(%rbp),%rsi
call   1060 <clock_gettime@plt>
mov    -0x90(%rbp),%rax
mov    -0x88(%rbp),%rcx
sub    -0x98(%rbp),%rcx
cvtsi2sd %rcx,%xmm0
sub    -0xa0(%rbp),%rax
cvtsi2sd %rax,%xmm1
divsd  0xc05(%rip),%xmm1
mulsd  0xc05(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xc05(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x68(%rbp),%r15
mov    %r15,%rdi
call   1080 <strlen@plt>
mov    %rsp,-0x80(%rbp)
add    $0xf,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xbf2(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1110 <sprintf@plt>
mov    %rbx,%rdi
mov    -0x6c(%rbp),%esi
mov    %r12d,%edx
mov    %r14d,%ecx
call   10b0 <write_metadata@plt>
mov    %r15,%rdi
call   1080 <strlen@plt>
add    $0x5,%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
test   %r14d,%r14d
mov    -0x78(%rbp),%r12
jle    1509 <encode_file+0x2e9>
mov    -0x50(%rbp),%rax
lea    0x0(,%rax,4),%r15
mov    -0x38(%rbp),%r14
xor    %r13d,%r13d
xchg   %ax,%ax
mov    -0x40(%rbp),%rbx
mov    %rbx,%rdi
lea    0xb90(%rip),%rsi
mov    %r13d,%edx
mov    -0x68(%rbp),%rcx
xor    %eax,%eax
call   1110 <sprintf@plt>
mov    %rbx,%rdi
lea    0xb7f(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     15c0 <encode_file+0x3a0>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x4,%esi
mov    -0x2c(%rbp),%edx
mov    %rax,%rcx
call   1130 <fwrite@plt>
cltq
cmp    %rax,%r15
jne    15c9 <encode_file+0x3a9>
mov    %rbx,%rdi
call   1070 <fclose@plt>
add    $0x1,%r13
add    %r15,%r14
cmp    %r13,%r12
jne    14a0 <encode_file+0x280>
mov    -0x30(%rbp),%eax
test   %eax,%eax
mov    -0x60(%rbp),%r15
mov    -0x50(%rbp),%r12
jle    1592 <encode_file+0x372>
shl    $0x2,%r12
mov    %eax,%r14d
mov    -0x58(%rbp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x40(%rbp),%rbx
mov    %rbx,%rdi
lea    0xb00(%rip),%rsi
mov    %r15d,%edx
mov    -0x68(%rbp),%rcx
xor    %eax,%eax
call   1110 <sprintf@plt>
mov    %rbx,%rdi
lea    0xaef(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     15c0 <encode_file+0x3a0>
mov    %rax,%rbx
mov    %r13,%rdi
mov    $0x4,%esi
mov    -0x2c(%rbp),%edx
mov    %rax,%rcx
call   1130 <fwrite@plt>
cltq
cmp    %rax,%r12
jne    15c9 <encode_file+0x3a9>
mov    %rbx,%rdi
call   1070 <fclose@plt>
add    $0x1,%r15d
add    %r12,%r13
add    $0xffffffffffffffff,%r14
jne    1530 <encode_file+0x310>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xaa9(%rip),%rdi
jmp    15e2 <encode_file+0x3c2>
lea    0xa78(%rip),%rdi
jmp    15e2 <encode_file+0x3c2>
lea    0xa8a(%rip),%rdi
jmp    15e2 <encode_file+0x3c2>
lea    0xa74(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@.str = [3 x i8] c"rb\00"
@.str.1 = [27 x i8] c"Can not open source file!\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [14 x i8] c"fseek error!\0A\00"
@EOF = global i64 0
@.str.3 = [14 x i8] c"fread error!\0A\00"
@CLOCK_REALTIME = global i32 0
@.str.4 = [31 x i8] c"Total CPU encoding time: %fms\0A\00"
@.str.5 = [12 x i8] c"%s.METADATA\00"
@.str.6 = [7 x i8] c"_%d_%s\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [15 x i8] c"fwrite error!\0A\00"
define void @encode_file(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca %struct.timespec
%17 = alloca %struct.timespec
%18 = alloca double
%19 = alloca i32*
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
%23 = load i8*, i8** %4
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %24, i32** %9
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 0)
unreachable
29: ; preds = %3
%30 = load i32*, i32** %9
%31 = load i32, i32* @SEEK_END
%32 = call i32 @fseek(i32* %30, i32 0, i32 %31)
%33 = load i32*, i32** %9
%34 = call i32 @ftell(i32* %33)
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = load i32, i32* %5
%37 = sdiv i32 %35, %36
%38 = load i32, i32* %8
%39 = load i32, i32* %5
%40 = srem i32 %38, %39
%41 = icmp ne i32 %40, 0
%42 = zext i1 %41 to i32
%43 = add nsw i32 %37, %42
store i32 %43, i32* %7
%44 = load i32, i32* %5
%45 = load i32, i32* %7
%46 = mul nsw i32 %44, %45
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 4
%49 = trunc i64 %48 to i32
store i32 %49, i32* %13
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = mul nsw i32 %50, %51
%53 = sext i32 %52 to i64
%54 = mul i64 %53, 4
%55 = trunc i64 %54 to i32
store i32 %55, i32* %14
%56 = load i32, i32* %5
%57 = load i32, i32* %7
%58 = mul nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = mul i64 %59, 4
%61 = trunc i64 %60 to i32
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to i32*
store i32* %63, i32** %11
%64 = load i32*, i32** %11
%65 = load i32, i32* %13
%66 = call i32 @memset(i32* %64, i32 0, i32 %65)
%67 = load i32, i32* %6
%68 = load i32, i32* %7
%69 = mul nsw i32 %67, %68
%70 = sext i32 %69 to i64
%71 = mul i64 %70, 4
%72 = trunc i64 %71 to i32
%73 = call i64 @malloc(i32 %72)
%74 = inttoptr i64 %73 to i32*
store i32* %74, i32** %12
%75 = load i32*, i32** %12
%76 = load i32, i32* %14
%77 = call i32 @memset(i32* %75, i32 0, i32 %76)
store i32 0, i32* %15
br label %78
78: ; preds = %109, %29
%79 = load i32, i32* %15
%80 = load i32, i32* %5
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %112
82: ; preds = %78
%83 = load i32*, i32** %9
%84 = load i32, i32* %15
%85 = load i32, i32* %7
%86 = mul nsw i32 %84, %85
%87 = load i32, i32* @SEEK_SET
%88 = call i32 @fseek(i32* %83, i32 %86, i32 %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %93
90: ; preds = %82
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%92 = call i32 @exit(i32 0)
unreachable
93: ; preds = %82
%94 = load i32*, i32** %11
%95 = load i32, i32* %15
%96 = load i32, i32* %7
%97 = mul nsw i32 %95, %96
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %94, i64 %98
%100 = load i32, i32* %7
%101 = load i32*, i32** %9
%102 = call i64 @fread(i32* %99, i32 4, i32 %100, i32* %101)
%103 = load i64, i64* @EOF
%104 = icmp eq i64 %102, %103
br i1 %104, label %105, label %108
105: ; preds = %93
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%107 = call i32 @exit(i32 0)
unreachable
108: ; preds = %93
br label %109
109: ; preds = %108
%110 = load i32, i32* %15
%111 = add nsw i32 %110, 1
store i32 %111, i32* %15
br label %78
112: ; preds = %78
%113 = load i32*, i32** %9
%114 = call i32 @fclose(i32* %113)
%115 = load i32, i32* @CLOCK_REALTIME
%116 = call i32 @clock_gettime(i32 %115, %struct.timespec* %16)
%117 = load i32, i32* %6
%118 = load i32, i32* %5
%119 = mul nsw i32 %117, %118
%120 = sext i32 %119 to i64
%121 = mul i64 %120, 4
%122 = trunc i64 %121 to i32
%123 = call i64 @malloc(i32 %122)
%124 = inttoptr i64 %123 to i32*
store i32* %124, i32** %19
%125 = load i32*, i32** %19
%126 = load i32, i32* %6
%127 = load i32, i32* %5
%128 = call i32 @gen_encoding_matrix(i32* %125, i32 %126, i32 %127)
%129 = load i32*, i32** %11
%130 = load i32*, i32** %19
%131 = load i32*, i32** %12
%132 = load i32, i32* %5
%133 = load i32, i32* %6
%134 = load i32, i32* %7
%135 = call i32 @encode_chunk(i32* %129, i32* %130, i32* %131, i32 %132, i32 %133, i32 %134)
%136 = load i32, i32* @CLOCK_REALTIME
%137 = call i32 @clock_gettime(i32 %136, %struct.timespec* %17)
%138 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
%139 = load i64, i64* %138
%140 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 1
%141 = load i64, i64* %140
%142 = sub nsw i64 %139, %141
%143 = sitofp i64 %142 to double
%144 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 0
%145 = load i64, i64* %144
%146 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 0
%147 = load i64, i64* %146
%148 = sub nsw i64 %145, %147
%149 = sitofp i64 %148 to double
%150 = fdiv double %149, 1.000000e+06
%151 = call double @llvm.fmuladd.f64(double %143, double 1.000000e+03, double %150)
store double %151, double* %18
%152 = load double, double* %18
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %152)
%154 = load i8*, i8** %4
%155 = call i32 @strlen(i8* %154)
%156 = add nsw i32 %155, 15
%157 = zext i32 %156 to i64
%158 = call i8* @llvm.stacksave()
store i8* %158, i8** %20
%159 = alloca i8, i64 %157
store i64 %157, i64* %21
%160 = load i8*, i8** %4
%161 = call i32 (i8*, i8*, ...) @sprintf(i8* %159, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %160)
%162 = load i32, i32* %8
%163 = load i32, i32* %6
%164 = load i32, i32* %5
%165 = call i32 @write_metadata(i8* %159, i32 %162, i32 %163, i32 %164)
%166 = load i8*, i8** %4
%167 = call i32 @strlen(i8* %166)
%168 = add nsw i32 %167, 5
%169 = zext i32 %168 to i64
%170 = alloca i8, i64 %169
store i64 %169, i64* %22
store i32 0, i32* %15
br label %171
171: ; preds = %205, %112
%172 = load i32, i32* %15
%173 = load i32, i32* %5
%174 = icmp slt i32 %172, %173
br i1 %174, label %175, label %208
175: ; preds = %171
%176 = load i32, i32* %15
%177 = load i8*, i8** %4
%178 = call i32 (i8*, i8*, ...) @sprintf(i8* %170, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %176, i8* %177)
%179 = call i32* @fopen(i8* %170, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %179, i32** %10
%180 = icmp eq i32* %179, null
br i1 %180, label %181, label %184
181: ; preds = %175
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%183 = call i32 @exit(i32 0)
unreachable
184: ; preds = %175
%185 = load i32*, i32** %11
%186 = load i32, i32* %15
%187 = load i32, i32* %7
%188 = mul nsw i32 %186, %187
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32, i32* %185, i64 %189
%191 = load i32, i32* %7
%192 = load i32*, i32** %10
%193 = call i32 @fwrite(i32* %190, i32 4, i32 %191, i32* %192)
%194 = sext i32 %193 to i64
%195 = load i32, i32* %7
%196 = sext i32 %195 to i64
%197 = mul i64 4, %196
%198 = icmp ne i64 %194, %197
br i1 %198, label %199, label %202
199: ; preds = %184
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%201 = call i32 @exit(i32 0)
unreachable
202: ; preds = %184
%203 = load i32*, i32** %10
%204 = call i32 @fclose(i32* %203)
br label %205
205: ; preds = %202
%206 = load i32, i32* %15
%207 = add nsw i32 %206, 1
store i32 %207, i32* %15
br label %171
208: ; preds = %171
store i32 0, i32* %15
br label %209
209: ; preds = %245, %208
%210 = load i32, i32* %15
%211 = load i32, i32* %6
%212 = icmp slt i32 %210, %211
br i1 %212, label %213, label %248
213: ; preds = %209
%214 = load i32, i32* %15
%215 = load i32, i32* %5
%216 = add nsw i32 %214, %215
%217 = load i8*, i8** %4
%218 = call i32 (i8*, i8*, ...) @sprintf(i8* %170, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %216, i8* %217)
%219 = call i32* @fopen(i8* %170, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %219, i32** %10
%220 = icmp eq i32* %219, null
br i1 %220, label %221, label %224
221: ; preds = %213
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%223 = call i32 @exit(i32 0)
unreachable
224: ; preds = %213
%225 = load i32*, i32** %12
%226 = load i32, i32* %15
%227 = load i32, i32* %7
%228 = mul nsw i32 %226, %227
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds i32, i32* %225, i64 %229
%231 = load i32, i32* %7
%232 = load i32*, i32** %10
%233 = call i32 @fwrite(i32* %230, i32 4, i32 %231, i32* %232)
%234 = sext i32 %233 to i64
%235 = load i32, i32* %7
%236 = sext i32 %235 to i64
%237 = mul i64 4, %236
%238 = icmp ne i64 %234, %237
br i1 %238, label %239, label %242
239: ; preds = %224
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%241 = call i32 @exit(i32 0)
unreachable
242: ; preds = %224
%243 = load i32*, i32** %10
%244 = call i32 @fclose(i32* %243)
br label %245
245: ; preds = %242
%246 = load i32, i32* %15
%247 = add nsw i32 %246, 1
store i32 %247, i32* %15
br label %209
248: ; preds = %209
%249 = load i32*, i32** %11
%250 = call i32 @free(i32* %249)
%251 = load i32*, i32** %12
%252 = call i32 @free(i32* %251)
%253 = load i32*, i32** %19
%254 = call i32 @free(i32* %253)
%255 = load i8*, i8** %20
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@EOF = global i64 0
@CLOCK_REALTIME = global i32 0
@.str.4 = [31 x i8] c"Total CPU encoding time: %fms\0A\00"
@.str.5 = [12 x i8] c"%s.METADATA\00"
@.str.6 = [7 x i8] c"_%d_%s\00"
@.str.7 = [3 x i8] c"wb\00"
@str.10 = [14 x i8] c"fwrite error!\00"
@str.12 = [13 x i8] c"fread error!\00"
@str.13 = [13 x i8] c"fseek error!\00"
@str.14 = [26 x i8] c"Can not open source file!\00"
define void @encode_file(i8* %0, i32 %1, i32 %2) {
%4 = alloca %struct.timespec
%5 = alloca %struct.timespec
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %3
%12 = load i32, i32* @SEEK_END
%13 = tail call i32 @fseek(i32* %6, i32 0, i32 %12)
%14 = tail call i32 @ftell(i32* %6)
%15 = sdiv i32 %14, %1
%16 = srem i32 %14, %1
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
%19 = add nsw i32 %15, %18
%20 = shl i32 %1, 2
%21 = mul i32 %20, %19
%22 = shl i32 %2, 2
%23 = mul i32 %22, %19
%24 = tail call i64 @malloc(i32 %21)
%25 = inttoptr i64 %24 to i32*
%26 = tail call i32 @memset(i32* %25, i32 0, i32 %21)
%27 = tail call i64 @malloc(i32 %23)
%28 = inttoptr i64 %27 to i32*
%29 = tail call i32 @memset(i32* %28, i32 0, i32 %23)
%30 = icmp sgt i32 %1, 0
br i1 %30, label %31, label %55
31: ; preds = %11
%32 = sext i32 %19 to i64
%33 = zext i32 %1 to i64
br label %36
34: ; preds = %46
%35 = icmp eq i64 %51, %33
br i1 %35, label %55, label %36
36: ; preds = %31, %34
%37 = phi i64 [ 0, %31 ], [ %51, %34 ]
%38 = mul nsw i64 %37, %32
%39 = load i32, i32* @SEEK_SET
%40 = trunc i64 %38 to i32
%41 = tail call i32 @fseek(i32* %6, i32 %40, i32 %39)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
%45 = tail call i32 @exit(i32 0)
unreachable
46: ; preds = %36
%47 = getelementptr inbounds i32, i32* %25, i64 %38
%48 = tail call i64 @fread(i32* %47, i32 4, i32 %19, i32* %6)
%49 = load i64, i64* @EOF
%50 = icmp eq i64 %48, %49
%51 = add nuw nsw i64 %37, 1
br i1 %50, label %52, label %34
52: ; preds = %46
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
%54 = tail call i32 @exit(i32 0)
unreachable
55: ; preds = %34, %11
%56 = tail call i32 @fclose(i32* %6)
%57 = bitcast %struct.timespec* %4 to i8*
%58 = bitcast %struct.timespec* %5 to i8*
%59 = load i32, i32* @CLOCK_REALTIME
%60 = call i32 @clock_gettime(i32 %59, %struct.timespec* %4)
%61 = mul i32 %20, %2
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to i32*
%64 = call i32 @gen_encoding_matrix(i32* %63, i32 %2, i32 %1)
%65 = call i32 @encode_chunk(i32* %25, i32* %63, i32* %28, i32 %1, i32 %2, i32 %19)
%66 = load i32, i32* @CLOCK_REALTIME
%67 = call i32 @clock_gettime(i32 %66, %struct.timespec* %5)
%68 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 1
%69 = load i64, i64* %68
%70 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%71 = load i64, i64* %70
%72 = sub nsw i64 %69, %71
%73 = sitofp i64 %72 to double
%74 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 0
%75 = load i64, i64* %74
%76 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%77 = load i64, i64* %76
%78 = sub nsw i64 %75, %77
%79 = sitofp i64 %78 to double
%80 = fdiv double %79, 1.000000e+06
%81 = call double @llvm.fmuladd.f64(double %73, double 1.000000e+03, double %80)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), double %81)
%83 = call i32 @strlen(i8* %0)
%84 = add nsw i32 %83, 15
%85 = zext i32 %84 to i64
%86 = call i8* @llvm.stacksave()
%87 = alloca i8, i64 %85
%88 = call i32 (i8*, i8*, ...) @sprintf(i8* %87, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %0)
%89 = call i32 @write_metadata(i8* %87, i32 %14, i32 %2, i32 %1)
%90 = call i32 @strlen(i8* %0)
%91 = add nsw i32 %90, 5
%92 = zext i32 %91 to i64
%93 = alloca i8, i64 %92
br i1 %30, label %94, label %98
94: ; preds = %55
%95 = sext i32 %19 to i64
%96 = shl nsw i64 %95, 2
%97 = zext i32 %1 to i64
br label %104
98: ; preds = %122, %55
%99 = icmp sgt i32 %2, 0
br i1 %99, label %100, label %149
100: ; preds = %98
%101 = sext i32 %19 to i64
%102 = shl nsw i64 %101, 2
%103 = zext i32 %2 to i64
br label %126
104: ; preds = %94, %122
%105 = phi i64 [ 0, %94 ], [ %124, %122 ]
%106 = trunc i64 %105 to i32
%107 = call i32 (i8*, i8*, ...) @sprintf(i8* %93, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %106, i8* %0)
%108 = call i32* @fopen(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%109 = icmp eq i32* %108, null
br i1 %109, label %110, label %113
110: ; preds = %104
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%112 = call i32 @exit(i32 0)
unreachable
113: ; preds = %104
%114 = mul nsw i64 %105, %95
%115 = getelementptr inbounds i32, i32* %25, i64 %114
%116 = call i32 @fwrite(i32* %115, i32 4, i32 %19, i32* %108)
%117 = sext i32 %116 to i64
%118 = icmp eq i64 %96, %117
br i1 %118, label %122, label %119
119: ; preds = %113
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0))
%121 = call i32 @exit(i32 0)
unreachable
122: ; preds = %113
%123 = call i32 @fclose(i32* %108)
%124 = add nuw nsw i64 %105, 1
%125 = icmp eq i64 %124, %97
br i1 %125, label %98, label %104
126: ; preds = %100, %145
%127 = phi i64 [ 0, %100 ], [ %147, %145 ]
%128 = trunc i64 %127 to i32
%129 = add i32 %128, %1
%130 = call i32 (i8*, i8*, ...) @sprintf(i8* %93, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %129, i8* %0)
%131 = call i32* @fopen(i8* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%132 = icmp eq i32* %131, null
br i1 %132, label %133, label %136
133: ; preds = %126
%134 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%135 = call i32 @exit(i32 0)
unreachable
136: ; preds = %126
%137 = mul nsw i64 %127, %101
%138 = getelementptr inbounds i32, i32* %28, i64 %137
%139 = call i32 @fwrite(i32* %138, i32 4, i32 %19, i32* %131)
%140 = sext i32 %139 to i64
%141 = icmp eq i64 %102, %140
br i1 %141, label %145, label %142
142: ; preds = %136
%143 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0))
%144 = call i32 @exit(i32 0)
unreachable
145: ; preds = %136
%146 = call i32 @fclose(i32* %131)
%147 = add nuw nsw i64 %127, 1
%148 = icmp eq i64 %147, %103
br i1 %148, label %149, label %126
149: ; preds = %145, %98
%150 = call i32 @free(i32* %25)
%151 = call i32 @free(i32* %28)
%152 = call i32 @free(i32* %63)
ret void
}