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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int fread(float *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  FILE *infile, *outfile;
  int fileLen;
  uint8_t *buffer;
  float grayRatio, z;
  int g_flag, bytes_read, res_w, res_h;
  int i, r, c;
  if (argc != 6) {
    printf("Usage: %s <input file> <output file> width height [0|1]\n",
           argv[0]);
    printf("           infile      Read RAW gray image file to be read.\n");
    printf(
        "           outfile     Write the XYZ formated file to be written.\n");
    printf("           width       The width of the RAW image.\n");
    printf("           height      The height of the RAW image.\n");
    printf("           gray        With grayscale value in the XYZ(Yes/No)\n");
    printf("                       Yes: Set to 1\n");
    printf("                       No : Set to 0\n");
    return -1;
  }
  res_w = atoi(argv[3]);
  res_h = atoi(argv[4]);
  g_flag = atoi(argv[5]);
  infile = fopen(argv[1], "rb");
  fileLen = 0;
  if (infile == 0) {
    printf("Could not open file\n");
    fclose(infile);
    return -2;
  } else {
    fseek(infile, 0, SEEK_END);
    fileLen = ftell(infile);
    fseek(infile, 0, SEEK_SET);
    if (fileLen == 0) {
      printf("File contain zero byte\n");
      fclose(infile);
      return -3;
    } else if (fileLen != (res_w * res_h)) {
      printf("File size not equal to user input width and height\n");
      fclose(infile);
      return -4;
    } else {
      grayRatio = 3.642857;
      buffer = (uint8_t *)malloc(sizeof(uint8_t) * fileLen);
      if (buffer == 0) {
        printf("Failed to alocate memory\n");
        fclose(infile);
        return -5;
      } else {
        bytes_read = fread(buffer, sizeof(uint8_t), fileLen, infile);
        if (bytes_read == 0) {
          printf("Can't read file to buffer\n");
          fclose(infile);
          return -6;
        } else {
          outfile = fopen(argv[2], "w");
          if (outfile == 0) {
            printf("Could not open file\n");
            fclose(infile);
            return -7;
          } else {
            fprintf(outfile, "#Created by PointClound Creator - Version 1.0\n");
            if (g_flag == 0) {
              fprintf(outfile, "#xyz\n");
            } else if (g_flag == 1) {
              fprintf(outfile, "#xyz_g\n");
            }
            fprintf(outfile, "#N/A\n");
            fprintf(outfile, "#N/A\n");
            fprintf(outfile, "#N/A\n");
            fprintf(outfile, "#%d\n", res_w);
            fprintf(outfile, "#%d\n", res_h);
            fprintf(outfile, "#N/A\n");
            fprintf(outfile, "#N/A\n");
            i = 0;
            for (r = 0; r < res_h; r++) {
              for (c = 0; c < res_w; c++) {
                z = (buffer[i] * grayRatio) * (0.013);
                if (g_flag == 0) {
                  fprintf(outfile, "%d %d %f\n", c, r * -1, z);
                } else if (g_flag == 1) {
                  fprintf(outfile, "%d %d %f %d\n", c, r * -1, z, buffer[i]);
                }
                i++;
              }
            }
          }
        }
      }
      free(buffer);
    }
    fclose(infile);
    fclose(outfile);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     1243 <main+0xa3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf50(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf68(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1632 <main+0x492>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xf3c(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12c0 <main+0x120>
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1632 <main+0x492>
mov    -0x18(%rbp),%rdi
mov    0x2d1d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2ced(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1321 <main+0x181>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1632 <main+0x492>
mov    -0x24(%rbp),%eax
mov    -0x44(%rbp),%ecx
imul   -0x48(%rbp),%ecx
cmp    %ecx,%eax
je     1356 <main+0x1b6>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xfffffffc,-0x4(%rbp)
jmp    1632 <main+0x492>
movss  0xca2(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13a4 <main+0x204>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xfffffffb,-0x4(%rbp)
jmp    1632 <main+0x492>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fread@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jne    13e9 <main+0x249>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xfffffffa,-0x4(%rbp)
jmp    1632 <main+0x492>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe5f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    142f <main+0x28f>
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0xfffffff9,-0x4(%rbp)
jmp    1632 <main+0x492>
mov    -0x20(%rbp),%rdi
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpl   $0x0,-0x3c(%rbp)
jne    1462 <main+0x2c2>
mov    -0x20(%rbp),%rdi
lea    0xe32(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1483 <main+0x2e3>
cmpl   $0x1,-0x3c(%rbp)
jne    147e <main+0x2de>
mov    -0x20(%rbp),%rdi
lea    0xe17(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1483 <main+0x2e3>
mov    -0x20(%rbp),%rdi
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x44(%rbp),%edx
lea    0xdd5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%edx
lea    0xdc0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xda8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    15fc <main+0x45c>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    15e9 <main+0x449>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mulss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xab6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    1590 <main+0x3f0>
mov    -0x20(%rbp),%rdi
mov    -0x54(%rbp),%edx
imul   $0xffffffff,-0x50(%rbp),%ecx
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd1d(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    15d2 <main+0x432>
cmpl   $0x1,-0x3c(%rbp)
jne    15cd <main+0x42d>
mov    -0x20(%rbp),%rdi
mov    -0x54(%rbp),%edx
imul   $0xffffffff,-0x50(%rbp),%ecx
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rsi
movss  (%rax,%rsi,4),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xce5(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
jmp    15d2 <main+0x432>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1528 <main+0x388>
jmp    15ee <main+0x44e>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1515 <main+0x375>
jmp    1601 <main+0x461>
jmp    1606 <main+0x466>
jmp    160b <main+0x46b>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
jmp    1619 <main+0x479>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
cmp    $0x6,%edi
jne    130a <main+0x14a>
mov    0x18(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r12d
mov    0x20(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r13d
mov    0x28(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
lea    0xe41(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1379 <main+0x1b9>
mov    %rax,%r15
mov    0x2dc8(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r15,%rdi
call   1090 <ftell@plt>
mov    %eax,%r14d
mov    0x2d9a(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
test   %r14d,%r14d
je     1396 <main+0x1d6>
mov    %r13d,%eax
imul   %r12d,%eax
cmp    %eax,%r14d
jne    13b4 <main+0x1f4>
lea    0x0(,%r14,4),%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     13d2 <main+0x212>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    $0x4,%esi
mov    %r14d,%edx
mov    %r15,%rcx
call   1050 <fread@plt>
test   %eax,%eax
je     13f0 <main+0x230>
mov    0x10(%rbx),%rdi
lea    0xda8(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     140e <main+0x24e>
mov    %rax,%rbx
lea    0xd92(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10e0 <fwrite@plt>
test   %ebp,%ebp
mov    %r15,0x18(%rsp)
je     142c <main+0x26c>
cmp    $0x1,%ebp
mov    %rbx,%r15
mov    0x8(%rsp),%rbx
jne    144d <main+0x28d>
lea    0xd90(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10e0 <fwrite@plt>
jmp    144d <main+0x28d>
mov    (%rbx),%rsi
lea    0xcfc(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe1c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe4c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe82(%rip),%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
lea    0xf04(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
jmp    15fb <main+0x43b>
lea    0xdaa(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <fclose@plt>
mov    $0xfffffffe,%eax
jmp    15fb <main+0x43b>
lea    0xd76(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    $0xfffffffd,%eax
jmp    15fb <main+0x43b>
lea    0xd25(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    $0xfffffffc,%eax
jmp    15fb <main+0x43b>
lea    0xcee(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    $0xfffffffb,%eax
jmp    15fb <main+0x43b>
lea    0xcb6(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    $0xfffffffa,%eax
jmp    15fb <main+0x43b>
lea    0xd15(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    $0xfffffff9,%eax
jmp    15fb <main+0x43b>
lea    0xc4a(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%r15
mov    0x8(%rsp),%rbx
lea    0xc37(%rip),%r14
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
lea    0xbf7(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xbc0(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xba7(%rip),%rdi
mov    %r15,%r14
mov    %r15,%rcx
call   10e0 <fwrite@plt>
test   %r13d,%r13d
jle    15df <main+0x41f>
mov    %r12d,%r15d
xor    %eax,%eax
movl   $0x0,0x4(%rsp)
mov    %r12d,0x14(%rsp)
mov    %r13d,0x10(%rsp)
jmp    1545 <main+0x385>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %r12d,0x4(%rsp)
mov    0x14(%rsp),%r12d
mov    0x10(%rsp),%r13d
mov    0x8(%rsp),%rbx
mov    0x20(%rsp),%rax
add    $0x1,%eax
cmp    %r13d,%eax
je     15df <main+0x41f>
test   %r12d,%r12d
jle    1539 <main+0x379>
mov    %rax,0x20(%rsp)
mov    %eax,%r13d
neg    %r13d
movslq 0x4(%rsp),%rax
lea    (%rbx,%rax,4),%rbx
xor    %r12d,%r12d
jmp    1594 <main+0x3d4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
lea    0xb18(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    $0x1,%al
call   1080 <fprintf@plt>
add    $0x1,%r12
cmp    %r12d,%r15d
je     1520 <main+0x360>
movss  (%rbx,%r12,4),%xmm1
movaps %xmm1,%xmm0
mulss  0xa5b(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xa57(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
test   %ebp,%ebp
je     1570 <main+0x3b0>
cmp    $0x1,%ebp
jne    158b <main+0x3cb>
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mov    %r14,%rdi
lea    0xad0(%rip),%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    $0x2,%al
call   1080 <fprintf@plt>
jmp    158b <main+0x3cb>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Usage: %s <input file> <output file> width height [0|1]\0A\00"
@.str.1 = [61 x i8] c" infile Read RAW gray image file to be read.\0A\00"
@.str.2 = [67 x i8] c" outfile Write the XYZ formated file to be written.\0A\00"
@.str.3 = [52 x i8] c" width The width of the RAW image.\0A\00"
@.str.4 = [53 x i8] c" height The height of the RAW image.\0A\00"
@.str.5 = [64 x i8] c" gray With grayscale value in the XYZ(Yes/No)\0A\00"
@.str.6 = [38 x i8] c" Yes: Set to 1\0A\00"
@.str.7 = [38 x i8] c" No : Set to 0\0A\00"
@.str.8 = [3 x i8] c"rb\00"
@.str.9 = [21 x i8] c"Could not open file\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.10 = [24 x i8] c"File contain zero byte\0A\00"
@.str.11 = [52 x i8] c"File size not equal to user input width and height\0A\00"
@.str.12 = [26 x i8] c"Failed to alocate memory\0A\00"
@.str.13 = [27 x i8] c"Can't read file to buffer\0A\00"
@.str.14 = [2 x i8] c"w\00"
@.str.15 = [47 x i8] c"#Created by PointClound Creator - Version 1.0\0A\00"
@.str.16 = [6 x i8] c"#xyz\0A\00"
@.str.17 = [8 x i8] c"#xyz_g\0A\00"
@.str.18 = [6 x i8] c"#N/A\0A\00"
@.str.19 = [5 x i8] c"#%d\0A\00"
@.str.20 = [10 x i8] c"%d %d %f\0A\00"
@.str.21 = [13 x i8] c"%d %d %f %d\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 float*
%10 = alloca float
%11 = alloca float
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 6
br i1 %20, label %21, label %33
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %3
br label %219
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 3
%36 = load i8*, i8** %35
%37 = call i32 @atoi(i8* %36)
store i32 %37, i32* %14
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 4
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %15
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 5
%44 = load i8*, i8** %43
%45 = call i32 @atoi(i8* %44)
store i32 %45, i32* %12
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %49, i32** %6
store i32 0, i32* %8
%50 = load i32*, i32** %6
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %56
52: ; preds = %33
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
%54 = load i32*, i32** %6
%55 = call i32 @fclose(i32* %54)
store i32 -2, i32* %3
br label %219
56: ; preds = %33
%57 = load i32*, i32** %6
%58 = load i32, i32* @SEEK_END
%59 = call i32 @fseek(i32* %57, i32 0, i32 %58)
%60 = load i32*, i32** %6
%61 = call i32 @ftell(i32* %60)
store i32 %61, i32* %8
%62 = load i32*, i32** %6
%63 = load i32, i32* @SEEK_SET
%64 = call i32 @fseek(i32* %62, i32 0, i32 %63)
%65 = load i32, i32* %8
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %71
67: ; preds = %56
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%69 = load i32*, i32** %6
%70 = call i32 @fclose(i32* %69)
store i32 -3, i32* %3
br label %219
71: ; preds = %56
%72 = load i32, i32* %8
%73 = load i32, i32* %14
%74 = load i32, i32* %15
%75 = mul nsw i32 %73, %74
%76 = icmp ne i32 %72, %75
br i1 %76, label %77, label %81
77: ; preds = %71
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0))
%79 = load i32*, i32** %6
%80 = call i32 @fclose(i32* %79)
store i32 -4, i32* %3
br label %219
81: ; preds = %71
store float 0x400D249240000000, float* %10
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = mul i64 4, %83
%85 = trunc i64 %84 to i32
%86 = call i64 @malloc(i32 %85)
%87 = inttoptr i64 %86 to float*
store float* %87, float** %9
%88 = load float*, float** %9
%89 = icmp eq float* %88, null
br i1 %89, label %90, label %94
90: ; preds = %81
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0))
%92 = load i32*, i32** %6
%93 = call i32 @fclose(i32* %92)
store i32 -5, i32* %3
br label %219
94: ; preds = %81
%95 = load float*, float** %9
%96 = load i32, i32* %8
%97 = load i32*, i32** %6
%98 = call i32 @fread(float* %95, i32 4, i32 %96, i32* %97)
store i32 %98, i32* %13
%99 = load i32, i32* %13
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %105
101: ; preds = %94
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%103 = load i32*, i32** %6
%104 = call i32 @fclose(i32* %103)
store i32 -6, i32* %3
br label %219
105: ; preds = %94
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 2
%108 = load i8*, i8** %107
%109 = call i32* @fopen(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
store i32* %109, i32** %7
%110 = load i32*, i32** %7
%111 = icmp eq i32* %110, null
br i1 %111, label %112, label %116
112: ; preds = %105
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
%114 = load i32*, i32** %6
%115 = call i32 @fclose(i32* %114)
store i32 -7, i32* %3
br label %219
116: ; preds = %105
%117 = load i32*, i32** %7
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %117, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.15, i64 0, i64 0))
%119 = load i32, i32* %12
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %124
121: ; preds = %116
%122 = load i32*, i32** %7
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %131
124: ; preds = %116
%125 = load i32, i32* %12
%126 = icmp eq i32 %125, 1
br i1 %126, label %127, label %130
127: ; preds = %124
%128 = load i32*, i32** %7
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %128, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %130
130: ; preds = %127, %124
br label %131
131: ; preds = %130, %121
%132 = load i32*, i32** %7
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%134 = load i32*, i32** %7
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%136 = load i32*, i32** %7
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%138 = load i32*, i32** %7
%139 = load i32, i32* %14
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 %139)
%141 = load i32*, i32** %7
%142 = load i32, i32* %15
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 %142)
%144 = load i32*, i32** %7
%145 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%146 = load i32*, i32** %7
%147 = call i32 (i32*, i8*, ...) @fprintf(i32* %146, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
store i32 0, i32* %16
store i32 0, i32* %17
br label %148
148: ; preds = %203, %131
%149 = load i32, i32* %17
%150 = load i32, i32* %15
%151 = icmp slt i32 %149, %150
br i1 %151, label %152, label %206
152: ; preds = %148
store i32 0, i32* %18
br label %153
153: ; preds = %199, %152
%154 = load i32, i32* %18
%155 = load i32, i32* %14
%156 = icmp slt i32 %154, %155
br i1 %156, label %157, label %202
157: ; preds = %153
%158 = load float*, float** %9
%159 = load i32, i32* %16
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds float, float* %158, i64 %160
%162 = load float, float* %161
%163 = load float, float* %10
%164 = fmul float %162, %163
%165 = fpext float %164 to double
%166 = fmul double %165, 1.300000e-02
%167 = fptrunc double %166 to float
store float %167, float* %11
%168 = load i32, i32* %12
%169 = icmp eq i32 %168, 0
br i1 %169, label %170, label %178
170: ; preds = %157
%171 = load i32*, i32** %7
%172 = load i32, i32* %18
%173 = load i32, i32* %17
%174 = mul nsw i32 %173, -1
%175 = load float, float* %11
%176 = fpext float %175 to double
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %171, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i32 %172, i32 %174, double %176)
br label %196
178: ; preds = %157
%179 = load i32, i32* %12
%180 = icmp eq i32 %179, 1
br i1 %180, label %181, label %195
181: ; preds = %178
%182 = load i32*, i32** %7
%183 = load i32, i32* %18
%184 = load i32, i32* %17
%185 = mul nsw i32 %184, -1
%186 = load float, float* %11
%187 = fpext float %186 to double
%188 = load float*, float** %9
%189 = load i32, i32* %16
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds float, float* %188, i64 %190
%192 = load float, float* %191
%193 = fpext float %192 to double
%194 = call i32 (i32*, i8*, ...) @fprintf(i32* %182, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.21, i64 0, i64 0), i32 %183, i32 %185, double %187, double %193)
br label %195
195: ; preds = %181, %178
br label %196
196: ; preds = %195, %170
%197 = load i32, i32* %16
%198 = add nsw i32 %197, 1
store i32 %198, i32* %16
br label %199
199: ; preds = %196
%200 = load i32, i32* %18
%201 = add nsw i32 %200, 1
store i32 %201, i32* %18
br label %153
202: ; preds = %153
br label %203
203: ; preds = %202
%204 = load i32, i32* %17
%205 = add nsw i32 %204, 1
store i32 %205, i32* %17
br label %148
206: ; preds = %148
br label %207
207: ; preds = %206
br label %208
208: ; preds = %207
br label %209
209: ; preds = %208
%210 = load float*, float** %9
%211 = call i32 @free(float* %210)
br label %212
212: ; preds = %209
br label %213
213: ; preds = %212
%214 = load i32*, i32** %6
%215 = call i32 @fclose(i32* %214)
%216 = load i32*, i32** %7
%217 = call i32 @fclose(i32* %216)
br label %218
218: ; preds = %213
store i32 0, i32* %3
br label %219
219: ; preds = %218, %112, %101, %90, %77, %67, %52, %21
%220 = load i32, i32* %3
ret i32 %220
}

LLVM IR (-O2):
@.str = [57 x i8] c"Usage: %s <input file> <output file> width height [0|1]\0A\00"
@.str.8 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.14 = [2 x i8] c"w\00"
@.str.15 = [47 x i8] c"#Created by PointClound Creator - Version 1.0\0A\00"
@.str.16 = [6 x i8] c"#xyz\0A\00"
@.str.17 = [8 x i8] c"#xyz_g\0A\00"
@.str.18 = [6 x i8] c"#N/A\0A\00"
@.str.19 = [5 x i8] c"#%d\0A\00"
@.str.20 = [10 x i8] c"%d %d %f\0A\00"
@.str.21 = [13 x i8] c"%d %d %f %d\0A\00"
@str.22 = [26 x i8] c"Can't read file to buffer\00"
@str.23 = [25 x i8] c"Failed to alocate memory\00"
@str.24 = [51 x i8] c"File size not equal to user input width and height\00"
@str.25 = [23 x i8] c"File contain zero byte\00"
@str.26 = [20 x i8] c"Could not open file\00"
@str.27 = [60 x i8] c" infile Read RAW gray image file to be read.\00"
@str.28 = [66 x i8] c" outfile Write the XYZ formated file to be written.\00"
@str.29 = [51 x i8] c" width The width of the RAW image.\00"
@str.30 = [52 x i8] c" height The height of the RAW image.\00"
@str.31 = [63 x i8] c" gray With grayscale value in the XYZ(Yes/No)\00"
@str.32 = [37 x i8] c" Yes: Set to 1\00"
@str.33 = [37 x i8] c" No : Set to 0\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 6
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.27, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.28, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.29, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.30, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.31, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.32, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.33, i64 0, i64 0))
br label %127
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 5
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %31
28: ; preds = %14
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.26, i64 0, i64 0))
%30 = tail call i32 @fclose(i32* null)
br label %127
31: ; preds = %14
%32 = load i32, i32* @SEEK_END
%33 = tail call i32 @fseek(i32* %26, i32 0, i32 %32)
%34 = tail call i32 @ftell(i32* %26)
%35 = load i32, i32* @SEEK_SET
%36 = tail call i32 @fseek(i32* %26, i32 0, i32 %35)
%37 = icmp eq i32 %34, 0
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.25, i64 0, i64 0))
%40 = tail call i32 @fclose(i32* %26)
br label %127
41: ; preds = %31
%42 = mul nsw i32 %20, %17
%43 = icmp eq i32 %34, %42
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.24, i64 0, i64 0))
%46 = tail call i32 @fclose(i32* %26)
br label %127
47: ; preds = %41
%48 = shl i32 %34, 2
%49 = tail call i64 @malloc(i32 %48)
%50 = inttoptr i64 %49 to float*
%51 = icmp eq i64 %49, 0
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.23, i64 0, i64 0))
%54 = tail call i32 @fclose(i32* %26)
br label %127
55: ; preds = %47
%56 = tail call i32 @fread(float* %50, i32 4, i32 %34, i32* %26)
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%60 = tail call i32 @fclose(i32* %26)
br label %127
61: ; preds = %55
%62 = getelementptr inbounds i8*, i8** %1, i64 2
%63 = load i8*, i8** %62
%64 = tail call i32* @fopen(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%65 = icmp eq i32* %64, null
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.26, i64 0, i64 0))
%68 = tail call i32 @fclose(i32* %26)
br label %127
69: ; preds = %61
%70 = tail call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.15, i64 0, i64 0), i64 46, i64 1, i32* %64)
%71 = icmp eq i32 %23, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i64 5, i64 1, i32* %64)
br label %78
74: ; preds = %69
%75 = icmp eq i32 %23, 1
br i1 %75, label %76, label %78
76: ; preds = %74
%77 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i64 7, i64 1, i32* %64)
br label %78
78: ; preds = %74, %76, %72
%79 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i64 5, i64 1, i32* %64)
%80 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i64 5, i64 1, i32* %64)
%81 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i64 5, i64 1, i32* %64)
%82 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 %17)
%83 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i32 %20)
%84 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i64 5, i64 1, i32* %64)
%85 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i64 5, i64 1, i32* %64)
%86 = icmp sgt i32 %20, 0
br i1 %86, label %87, label %123
87: ; preds = %78
%88 = icmp sgt i32 %17, 0
%89 = icmp eq i32 %23, 1
br label %90
90: ; preds = %87, %119
%91 = phi i32 [ 0, %87 ], [ %121, %119 ]
%92 = phi i32 [ 0, %87 ], [ %120, %119 ]
br i1 %88, label %93, label %119
93: ; preds = %90
%94 = sub nsw i32 0, %91
%95 = sext i32 %92 to i64
br label %96
96: ; preds = %93, %113
%97 = phi i64 [ %95, %93 ], [ %114, %113 ]
%98 = phi i32 [ 0, %93 ], [ %115, %113 ]
%99 = getelementptr inbounds float, float* %50, i64 %97
%100 = load float, float* %99
%101 = fmul float %100, 0x400D249240000000
%102 = fpext float %101 to double
%103 = fmul double %102, 1.300000e-02
%104 = fptrunc double %103 to float
br i1 %71, label %105, label %108
105: ; preds = %96
%106 = fpext float %104 to double
%107 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), i32 %98, i32 %94, double %106)
br label %113
108: ; preds = %96
br i1 %89, label %109, label %113
109: ; preds = %108
%110 = fpext float %104 to double
%111 = fpext float %100 to double
%112 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.21, i64 0, i64 0), i32 %98, i32 %94, double %110, double %111)
br label %113
113: ; preds = %108, %109, %105
%114 = add nsw i64 %97, 1
%115 = add nuw nsw i32 %98, 1
%116 = icmp eq i32 %115, %17
br i1 %116, label %117, label %96
117: ; preds = %113
%118 = trunc i64 %114 to i32
br label %119
119: ; preds = %117, %90
%120 = phi i32 [ %92, %90 ], [ %118, %117 ]
%121 = add nuw nsw i32 %91, 1
%122 = icmp eq i32 %121, %20
br i1 %122, label %123, label %90
123: ; preds = %119, %78
%124 = tail call i32 @free(float* %50)
%125 = tail call i32 @fclose(i32* %26)
%126 = tail call i32 @fclose(i32* %64)
br label %127
127: ; preds = %123, %66, %58, %52, %44, %38, %28, %4
%128 = phi i32 [ -1, %4 ], [ -2, %28 ], [ -3, %38 ], [ -4, %44 ], [ -5, %52 ], [ -6, %58 ], [ -7, %66 ], [ 0, %123 ]
ret i32 %128
}