#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int INT_MAX;
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, ...);
void *malloc(size_t);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 3) {
    fprintf(stderr,
            "usage: {input landsat} {output normfile} (vector fields = 12)\n");
    return 0;
  }
  int cols = 12;
  if (argc >= 4) {
    cols = atoi(argv[3]);
  }
  FILE *fi;
  if ((fi = fopen(argv[1], "r"))) {
    FILE *fo;
    if ((fo = fopen(argv[2], "w"))) {
      char docid[64];
      int vals[cols];
      int minval[cols];
      int maxval[cols];
      for (int i = 0; i < cols; i++) {
        minval[i] = INT_MAX;
        maxval[i] = 0;
      }
      fprintf(stderr, "Finding min/max...\n");
      int lines_read = 0;
      for (;;) {
        if (fscanf(fi, "%s", docid) <= 0)
          break;
        for (int i = 0; i < cols; i++) {
          fscanf(fi, "%d", vals + i);
          if (vals[i] < minval[i])
            minval[i] = vals[i];
          if (vals[i] > maxval[i])
            maxval[i] = vals[i];
        }
        lines_read++;
        if (lines_read % 100000 == 0) {
          fprintf(stderr, "...%d\n", lines_read);
        }
      }
      fprintf(stderr, "Read %d lines\n", lines_read);
      fprintf(stderr, "Min vals: ");
      for (int i = 0; i < cols; i++)
        fprintf(stderr, "%d, ", minval[i]);
      fprintf(stderr, "Max vals: ");
      for (int i = 0; i < cols; i++)
        fprintf(stderr, "%d, ", maxval[i]);
      int **hist = malloc(sizeof(int *) * cols);
      for (int i = 0; i < cols; i++) {
        int range = maxval[i] - minval[i] + 1;
        size_t range_siz = sizeof(int) * range;
        hist[i] = malloc(range_siz);
        memset(hist[i], 0, range_siz);
      }
      rewind(fi);
      fprintf(stderr, "\nGenerating histogram...\n");
      lines_read = 0;
      for (;;) {
        if (fscanf(fi, "%s", docid) <= 0)
          break;
        for (int i = 0; i < cols; i++) {
          fscanf(fi, "%d", vals + i);
          hist[i][vals[i] - minval[i]]++;
        }
        lines_read++;
        if (lines_read % 100000 == 0) {
          fprintf(stderr, "...%d\n", lines_read);
        }
      }
      for (int i = 0; i < cols; i++) {
        int range = maxval[i] - minval[i] + 1;
        int pos = 0;
        for (int j = 0; j < range; j++) {
          int hmag = hist[i][j];
          hist[i][j] = pos;
          pos += hmag;
        }
        int posmax = hist[i][maxval[i] - minval[i]];
        for (int j = 0; j < range; j++) {
          int v = j + minval[i];
          double p = (double)hist[i][j] / (double)posmax;
          fprintf(fo, "%d %d %f\n", i, v, p);
        }
      }
      fclose(fo);
    } else {
      fprintf(stderr, "Unable to open output file\n");
    }
    fclose(fi);
  } else {
    fprintf(stderr, "Unable to open input file\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11c6 <main+0x46>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1983 <main+0x803>
movl   $0xc,-0x14(%rbp)
cmpl   $0x4,-0x8(%rbp)
jl     11e7 <main+0x67>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe49(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1965 <main+0x7e5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe29(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     1940 <main+0x7c0>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x78(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x108(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x80(%rbp)
mov    -0x14(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x100(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
mov    -0x14(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x90(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12fd <main+0x17d>
mov    -0xf8(%rbp),%rax
mov    -0x100(%rbp),%rcx
mov    0x2d19(%rip),%rdx
mov    (%rdx),%esi
movslq -0x94(%rbp),%rdx
mov    %esi,(%rcx,%rdx,4)
movslq -0x94(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    12ab <main+0x12b>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
lea    0xd36(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x98(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd2a(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
cmp    $0x0,%rax
jg     1343 <main+0x1c3>
jmp    1478 <main+0x2f8>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1430 <main+0x2b0>
mov    -0x108(%rbp),%rdx
mov    -0x20(%rbp),%rdi
movslq -0x9c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xcde(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x100(%rbp),%rcx
mov    -0x108(%rbp),%rax
movslq -0x9c(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
movslq -0x9c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    13cd <main+0x24d>
mov    -0x100(%rbp),%rax
mov    -0x108(%rbp),%rcx
movslq -0x9c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x9c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xf8(%rbp),%rcx
mov    -0x108(%rbp),%rax
movslq -0x9c(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
movslq -0x9c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1417 <main+0x297>
mov    -0xf8(%rbp),%rax
mov    -0x108(%rbp),%rcx
movslq -0x9c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x9c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    141c <main+0x29c>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    134d <main+0x1cd>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1473 <main+0x2f3>
mov    0x2b7b(%rip),%rax
mov    (%rax),%edi
mov    -0x98(%rbp),%edx
lea    0xbf1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    131e <main+0x19e>
mov    0x2b59(%rip),%rax
mov    (%rax),%edi
mov    -0x98(%rbp),%edx
lea    0xbd6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2b3c(%rip),%rax
mov    (%rax),%edi
lea    0xbce(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1501 <main+0x381>
mov    -0x100(%rbp),%rax
mov    0x2b05(%rip),%rcx
mov    (%rcx),%edi
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xb98(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    14b6 <main+0x336>
mov    0x2ad0(%rip),%rax
mov    (%rax),%edi
lea    0xb72(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    156d <main+0x3ed>
mov    -0xf8(%rbp),%rax
mov    0x2a99(%rip),%rcx
mov    (%rcx),%edi
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xb2c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1522 <main+0x3a2>
movslq -0x14(%rbp),%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    162c <main+0x4ac>
mov    -0x100(%rbp),%rcx
mov    -0xf8(%rbp),%rax
movslq -0xb4(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
movslq -0xb4(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
movslq -0xb8(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rdi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0xb0(%rbp),%rax
movslq -0xb4(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xb0(%rbp),%rax
movslq -0xb4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0xc0(%rbp),%rdx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    158b <main+0x40b>
mov    -0x20(%rbp),%rdi
call   1040 <rewind@plt>
mov    0x299c(%rip),%rax
mov    (%rax),%edi
lea    0xa49(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x98(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0x9f2(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
cmp    $0x0,%rax
jg     167b <main+0x4fb>
jmp    1757 <main+0x5d7>
movl   $0x0,-0xc4(%rbp)
mov    -0xc4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    170f <main+0x58f>
mov    -0x108(%rbp),%rdx
mov    -0x20(%rbp),%rdi
movslq -0xc4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0x9a6(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x108(%rbp),%rcx
mov    -0x100(%rbp),%rdx
mov    -0xb0(%rbp),%rax
movslq -0xc4(%rbp),%rsi
mov    (%rax,%rsi,8),%rax
movslq -0xc4(%rbp),%rsi
mov    (%rcx,%rsi,4),%ecx
movslq -0xc4(%rbp),%rsi
sub    (%rdx,%rsi,4),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    1685 <main+0x505>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1752 <main+0x5d2>
mov    0x289c(%rip),%rax
mov    (%rax),%edi
mov    -0x98(%rbp),%edx
lea    0x912(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1656 <main+0x4d6>
movl   $0x0,-0xc8(%rbp)
mov    -0xc8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    192b <main+0x7ab>
mov    -0x100(%rbp),%rcx
mov    -0xf8(%rbp),%rax
movslq -0xc8(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
movslq -0xc8(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
movl   $0x0,-0xd0(%rbp)
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xcc(%rbp),%eax
jge    182b <main+0x6ab>
mov    -0xb0(%rbp),%rax
movslq -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xd4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xd8(%rbp)
mov    -0xd0(%rbp),%edx
mov    -0xb0(%rbp),%rax
movslq -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xd4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xd8(%rbp),%eax
add    -0xd0(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    17af <main+0x62f>
mov    -0x100(%rbp),%rdx
mov    -0xf8(%rbp),%rcx
mov    -0xb0(%rbp),%rax
movslq -0xc8(%rbp),%rsi
mov    (%rax,%rsi,8),%rax
movslq -0xc8(%rbp),%rsi
mov    (%rcx,%rsi,4),%ecx
movslq -0xc8(%rbp),%rsi
sub    (%rdx,%rsi,4),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xdc(%rbp)
movl   $0x0,-0xe0(%rbp)
mov    -0xe0(%rbp),%eax
cmp    -0xcc(%rbp),%eax
jge    1912 <main+0x792>
mov    -0x100(%rbp),%rcx
mov    -0xe0(%rbp),%eax
movslq -0xc8(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0xe4(%rbp)
mov    -0xb0(%rbp),%rax
movslq -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xe0(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
cvtsi2sdl -0xdc(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    %eax,%edi
mov    -0xc8(%rbp),%edx
mov    -0xe4(%rbp),%ecx
movsd  -0xf0(%rbp),%xmm0
ff
lea    0x7b1(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
jmp    1875 <main+0x6f5>
jmp    1917 <main+0x797>
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    1761 <main+0x5e1>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x78(%rbp),%rax
mov    %rax,%rsp
jmp    1957 <main+0x7d7>
mov    0x2691(%rip),%rax
mov    (%rax),%edi
lea    0x762(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
jmp    197c <main+0x7fc>
mov    0x266c(%rip),%rax
mov    (%rax),%edi
lea    0x759(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
cmp    $0x2,%edi
jg     11ae <main+0x2e>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
lea    0xe57(%rip),%rsi
jmp    1289 <main+0x109>
mov    %rsi,%rbx
mov    $0xc,%r15d
cmp    $0x3,%edi
je     11c8 <main+0x48>
mov    0x18(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r15d
mov    0x8(%rbx),%rdi
lea    0xe6c(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1279 <main+0xf9>
mov    %rax,%r13
mov    0x10(%rbx),%rdi
lea    0xe52(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1295 <main+0x115>
mov    %rax,-0x78(%rbp)
mov    %rsp,-0x70(%rbp)
mov    %r15d,%esi
mov    %rsp,%rcx
lea    0xf(,%rsi,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
test   %r15d,%r15d
mov    %rbx,-0x30(%rbp)
jle    13cd <main+0x24d>
mov    0x2d9d(%rip),%rax
mov    (%rax),%r12d
lea    0x0(,%rsi,4),%rdx
xor    %r14d,%r14d
mov    -0x68(%rbp),%rdi
mov    %rsi,%rbx
xor    %esi,%esi
call   1050 <memset@plt>
cmp    $0x8,%r15d
jae    12b1 <main+0x131>
mov    %rbx,%rsi
mov    -0x30(%rbp),%rbx
jmp    13c0 <main+0x240>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
lea    0xe45(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    18c9 <main+0x749>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xe0d(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    18c1 <main+0x741>
mov    %ebx,%r14d
and    $0xfffffff8,%r14d
movd   %r12d,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%r14),%rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x38,%rdx
mov    %rbx,%rsi
jae    12ea <main+0x16a>
xor    %edx,%edx
mov    -0x30(%rbp),%rbx
jmp    1385 <main+0x205>
and    $0xfffffffffffffff8,%rcx
xor    %edx,%edx
mov    -0x30(%rbp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm0,(%rbx,%rdx,4)
movdqa %xmm0,0x10(%rbx,%rdx,4)
movdqa %xmm0,0x20(%rbx,%rdx,4)
movdqa %xmm0,0x30(%rbx,%rdx,4)
movdqa %xmm0,0x40(%rbx,%rdx,4)
movdqa %xmm0,0x50(%rbx,%rdx,4)
movdqa %xmm0,0x60(%rbx,%rdx,4)
movdqa %xmm0,0x70(%rbx,%rdx,4)
movdqa %xmm0,0x80(%rbx,%rdx,4)
movdqa %xmm0,0x90(%rbx,%rdx,4)
movdqa %xmm0,0xa0(%rbx,%rdx,4)
movdqa %xmm0,0xb0(%rbx,%rdx,4)
movdqa %xmm0,0xc0(%rbx,%rdx,4)
movdqa %xmm0,0xd0(%rbx,%rdx,4)
movdqa %xmm0,0xe0(%rbx,%rdx,4)
movdqa %xmm0,0xf0(%rbx,%rdx,4)
add    $0x40,%rdx
add    $0xfffffffffffffff8,%rcx
jne    1300 <main+0x180>
test   %rax,%rax
je     13b4 <main+0x234>
lea    (%rbx,%rdx,4),%rcx
add    $0x10,%rcx
shl    $0x5,%rax
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,-0x10(%rcx,%rdx,1)
movdqa %xmm0,(%rcx,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rax
jne    13a0 <main+0x220>
cmp    %rsi,%r14
je     13cd <main+0x24d>
nopl   0x0(%rax)
mov    %r12d,(%rbx,%r14,4)
add    $0x1,%r14
cmp    %r14,%rsi
jne    13c0 <main+0x240>
mov    %rsi,-0x38(%rbp)
mov    0x2c00(%rip),%rax
mov    (%rax),%edi
lea    0xc62(%rip),%rsi
xor    %r12d,%r12d
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xc65(%rip),%rsi
lea    -0xc0(%rbp),%rdx
mov    %r13,-0x40(%rbp)
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %rax,%rax
mov    %r15d,-0x58(%rbp)
jle    14fc <main+0x37c>
mov    -0x38(%rbp),%rax
lea    0x0(,%rax,4),%r14
lea    0xc33(%rip),%rsi
xor    %r12d,%r12d
mov    -0x40(%rbp),%r13
jmp    145d <main+0x2dd>
mov    -0x40(%rbp),%rdi
lea    0xc1c(%rip),%rsi
lea    -0xc0(%rbp),%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %rax,%rax
mov    -0x58(%rbp),%r15d
lea    0xc03(%rip),%rsi
jle    14fc <main+0x37c>
mov    %r12d,-0x50(%rbp)
test   %r15d,%r15d
mov    -0x68(%rbp),%r15
mov    -0x48(%rbp),%rdi
jle    14c0 <main+0x340>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rdi,%r12,1),%rdx
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    -0x48(%rbp),%rdi
mov    (%rdi,%r12,1),%eax
mov    (%rbx,%r12,1),%ecx
cmp    %ecx,%eax
cmovl  %eax,%ecx
mov    (%r15,%r12,1),%edx
cmp    %edx,%eax
cmovg  %eax,%edx
mov    %ecx,(%rbx,%r12,1)
lea    0xba7(%rip),%rsi
mov    %edx,(%r15,%r12,1)
add    $0x4,%r12
cmp    %r12,%r14
jne    1480 <main+0x300>
mov    -0x50(%rbp),%r12d
add    $0x1,%r12d
imul   $0xbcbe61d,%r12d,%eax
ror    $0x5,%eax
cmp    $0xa7c6,%eax
jae    1430 <main+0x2b0>
mov    0x2af4(%rip),%rax
mov    (%rax),%edi
lea    0xb70(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1430 <main+0x2b0>
mov    0x2ad5(%rip),%r13
mov    0x0(%r13),%edi
lea    0xb56(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xb50(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %r15d,%r15d
jle    1623 <main+0x4a3>
xor    %ebx,%ebx
mov    -0x38(%rbp),%r14
mov    %r13,%r12
mov    -0x30(%rbp),%r13
mov    (%r12),%edi
mov    0x0(%r13,%rbx,4),%edx
lea    0xb2e(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1540 <main+0x3c0>
mov    (%r12),%edi
lea    0xb18(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %r15d,%r15d
mov    %r12,%r13
jle    1635 <main+0x4b5>
xor    %ebx,%ebx
mov    -0x38(%rbp),%r14
mov    %r13,%r12
mov    -0x68(%rbp),%r13
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edi
mov    0x0(%r13,%rbx,4),%edx
lea    0xade(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1590 <main+0x410>
movslq %r15d,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x60(%rbp)
test   %r15d,%r15d
jle    161a <main+0x49a>
xor    %ebx,%ebx
mov    %r13,%r15
mov    -0x30(%rbp),%r13
mov    -0x60(%rbp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%eax
sub    0x0(%r13,%rbx,4),%eax
add    $0x1,%eax
movslq %eax,%r12
shl    $0x2,%r12
mov    %r12,%rdi
call   1080 <malloc@plt>
mov    %rax,(%r14,%rbx,8)
mov    %rax,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1050 <memset@plt>
add    $0x1,%rbx
cmp    %rbx,-0x38(%rbp)
jne    15e0 <main+0x460>
mov    -0x58(%rbp),%r15d
mov    0x29b7(%rip),%r13
jmp    1645 <main+0x4c5>
mov    0x0(%r13),%edi
lea    0xa55(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
movslq %r15d,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rbx
mov    %rbx,%rdi
call   1040 <rewind@plt>
mov    0x0(%r13),%edi
lea    0xa32(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0x9ed(%rip),%rsi
lea    -0xc0(%rbp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %rax,%rax
jle    175d <main+0x5dd>
mov    -0x38(%rbp),%rax
lea    0x0(,%rax,4),%r13
lea    0x9c3(%rip),%rsi
xor    %ebx,%ebx
mov    -0x40(%rbp),%r14
mov    -0x30(%rbp),%r12
jmp    16dd <main+0x55d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x40(%rbp),%rdi
lea    0x99c(%rip),%rsi
lea    -0xc0(%rbp),%rdx
xor    %eax,%eax
call   1060 <fscanf@plt>
test   %rax,%rax
mov    -0x58(%rbp),%r15d
lea    0x983(%rip),%rsi
jle    175d <main+0x5dd>
mov    %ebx,-0x50(%rbp)
test   %r15d,%r15d
mov    -0x48(%rbp),%rdi
mov    -0x60(%rbp),%r15
jle    1725 <main+0x5a5>
xor    %ebx,%ebx
nop
lea    (%rdi,%rbx,1),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    -0x48(%rbp),%rdi
mov    (%r15,%rbx,2),%rax
movslq (%rdi,%rbx,1),%rcx
movslq (%r12,%rbx,1),%rdx
sub    %rdx,%rcx
addl   $0x1,(%rax,%rcx,4)
lea    0x93e(%rip),%rsi
add    $0x4,%rbx
cmp    %rbx,%r13
jne    16f0 <main+0x570>
mov    -0x50(%rbp),%ebx
add    $0x1,%ebx
imul   $0xbcbe61d,%ebx,%eax
ror    $0x5,%eax
cmp    $0xa7c6,%eax
jae    16b0 <main+0x530>
mov    0x2892(%rip),%rax
mov    (%rax),%edi
lea    0x90e(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    16b0 <main+0x530>
test   %r15d,%r15d
mov    -0x78(%rbp),%rdi
jle    18b4 <main+0x734>
xor    %r12d,%r12d
lea    0x934(%rip),%rsi
jmp    178e <main+0x60e>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    -0x38(%rbp),%r12
je     18b4 <main+0x734>
mov    -0x68(%rbp),%rax
mov    (%rax,%r12,4),%r10d
mov    -0x30(%rbp),%rax
mov    (%rax,%r12,4),%r14d
mov    %r10d,%r8d
sub    %r14d,%r8d
js     1780 <main+0x600>
mov    -0x60(%rbp),%rax
mov    (%rax,%r12,8),%r15
sub    %r14d,%r10d
add    $0x1,%r10d
lea    -0x1(%r10),%rax
mov    %r10d,%r9d
and    $0x3,%r9d
cmp    $0x3,%rax
jae    17d0 <main+0x650>
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1817 <main+0x697>
nopl   0x0(%rax)
mov    %r10d,%r11d
and    $0xfffffffc,%r11d
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rcx,4),%ebx
add    %eax,%ebx
mov    %eax,(%r15,%rcx,4)
mov    0x4(%r15,%rcx,4),%eax
add    %ebx,%eax
mov    %ebx,0x4(%r15,%rcx,4)
mov    0x8(%r15,%rcx,4),%ebx
add    %eax,%ebx
mov    %eax,0x8(%r15,%rcx,4)
mov    0xc(%r15,%rcx,4),%eax
add    %ebx,%eax
mov    %ebx,0xc(%r15,%rcx,4)
add    $0x4,%rcx
cmp    %rcx,%r11
jne    17e0 <main+0x660>
test   %r9,%r9
je     1845 <main+0x6c5>
lea    (%r15,%rcx,4),%r11
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r11,%rcx,4),%ebx
add    %eax,%ebx
mov    %eax,(%r11,%rcx,4)
add    $0x1,%rcx
mov    %ebx,%eax
cmp    %rcx,%r9
jne    1830 <main+0x6b0>
test   %r8d,%r8d
js     1780 <main+0x600>
mov    %r8d,%eax
xorps  %xmm0,%xmm0
cvtsi2sdl (%r15,%rax,4),%xmm0
movsd  %xmm0,-0x50(%rbp)
xor    %r13d,%r13d
mov    %r14,-0x48(%rbp)
mov    %r15,-0x58(%rbp)
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sdl (%r15,%r13,4),%xmm0
divsd  -0x50(%rbp),%xmm0
lea    (%r14,%r13,1),%ecx
mov    %r12d,%edx
mov    $0x1,%al
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %r10,%r14
call   1070 <fprintf@plt>
mov    %r14,%r10
mov    -0x48(%rbp),%r14
mov    %r15,%rdi
mov    -0x58(%rbp),%r15
mov    %rbx,%rsi
add    $0x1,%r13
cmp    %r13,%r10
jne    1870 <main+0x6f0>
jmp    1780 <main+0x600>
call   1030 <fclose@plt>
mov    -0x70(%rbp),%rsp
mov    -0x40(%rbp),%r13
mov    %r13,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"usage: {input landsat} {output normfile} (vector fields = 12)\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@INT_MAX = global i32 0
@.str.3 = [20 x i8] c"Finding min/max...\0A\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [7 x i8] c"...%d\0A\00"
@.str.7 = [15 x i8] c"Read %d lines\0A\00"
@.str.8 = [11 x i8] c"Min vals: \00"
@.str.9 = [5 x i8] c"%d, \00"
@.str.10 = [11 x i8] c"Max vals: \00"
@.str.11 = [26 x i8] c"\0AGenerating histogram...\0A\00"
@.str.12 = [10 x i8] c"%d %d %f\0A\00"
@.str.13 = [28 x i8] c"Unable to open output file\0A\00"
@.str.14 = [27 x i8] c"Unable to open input file\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 [64 x i8]
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32**
%20 = alloca i32
%21 = alloca i32
%22 = alloca i64
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%33 = load i32, i32* %4
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %38
35: ; preds = %2
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %400
38: ; preds = %2
store i32 12, i32* %6
%39 = load i32, i32* %4
%40 = icmp sge i32 %39, 4
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
%45 = call i32 @atoi(i8* %44)
store i32 %45, i32* %6
br label %46
46: ; preds = %41, %38
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %50, i32** %7
%51 = icmp ne i32* %50, null
br i1 %51, label %52, label %396
52: ; preds = %46
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %56, i32** %8
%57 = icmp ne i32* %56, null
br i1 %57, label %58, label %390
58: ; preds = %52
%59 = load i32, i32* %6
%60 = zext i32 %59 to i64
%61 = call i8* @llvm.stacksave()
store i8* %61, i8** %10
%62 = alloca i32, i64 %60
store i64 %60, i64* %11
%63 = load i32, i32* %6
%64 = zext i32 %63 to i64
%65 = alloca i32, i64 %64
store i64 %64, i64* %12
%66 = load i32, i32* %6
%67 = zext i32 %66 to i64
%68 = alloca i32, i64 %67
store i64 %67, i64* %13
store i32 0, i32* %14
br label %69
69: ; preds = %81, %58
%70 = load i32, i32* %14
%71 = load i32, i32* %6
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %84
73: ; preds = %69
%74 = load i32, i32* @INT_MAX
%75 = load i32, i32* %14
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32, i32* %65, i64 %76
store i32 %74, i32* %77
%78 = load i32, i32* %14
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i32, i32* %68, i64 %79
store i32 0, i32* %80
br label %81
81: ; preds = %73
%82 = load i32, i32* %14
%83 = add nsw i32 %82, 1
store i32 %83, i32* %14
br label %69
84: ; preds = %69
%85 = load i32, i32* @stderr
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %15
br label %87
87: ; preds = %153, %84
%88 = load i32*, i32** %7
%89 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%90 = call i64 (i32*, i8*, ...) @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %89)
%91 = icmp sle i64 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %87
br label %154
93: ; preds = %87
store i32 0, i32* %16
br label %94
94: ; preds = %140, %93
%95 = load i32, i32* %16
%96 = load i32, i32* %6
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %143
98: ; preds = %94
%99 = load i32*, i32** %7
%100 = load i32, i32* %16
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %62, i64 %101
%103 = call i64 (i32*, i8*, ...) @fscanf(i32* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %102)
%104 = load i32, i32* %16
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32, i32* %62, i64 %105
%107 = load i32, i32* %106
%108 = load i32, i32* %16
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i32, i32* %65, i64 %109
%111 = load i32, i32* %110
%112 = icmp slt i32 %107, %111
br i1 %112, label %113, label %121
113: ; preds = %98
%114 = load i32, i32* %16
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i32, i32* %62, i64 %115
%117 = load i32, i32* %116
%118 = load i32, i32* %16
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32, i32* %65, i64 %119
store i32 %117, i32* %120
br label %121
121: ; preds = %113, %98
%122 = load i32, i32* %16
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i32, i32* %62, i64 %123
%125 = load i32, i32* %124
%126 = load i32, i32* %16
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32, i32* %68, i64 %127
%129 = load i32, i32* %128
%130 = icmp sgt i32 %125, %129
br i1 %130, label %131, label %139
131: ; preds = %121
%132 = load i32, i32* %16
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i32, i32* %62, i64 %133
%135 = load i32, i32* %134
%136 = load i32, i32* %16
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32, i32* %68, i64 %137
store i32 %135, i32* %138
br label %139
139: ; preds = %131, %121
br label %140
140: ; preds = %139
%141 = load i32, i32* %16
%142 = add nsw i32 %141, 1
store i32 %142, i32* %16
br label %94
143: ; preds = %94
%144 = load i32, i32* %15
%145 = add nsw i32 %144, 1
store i32 %145, i32* %15
%146 = load i32, i32* %15
%147 = srem i32 %146, 100000
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %143
%150 = load i32, i32* @stderr
%151 = load i32, i32* %15
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %149, %143
br label %87
154: ; preds = %92
%155 = load i32, i32* @stderr
%156 = load i32, i32* %15
%157 = call i32 (i32, i8*, ...) @fprintf(i32 %155, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %156)
%158 = load i32, i32* @stderr
%159 = call i32 (i32, i8*, ...) @fprintf(i32 %158, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %17
br label %160
160: ; preds = %171, %154
%161 = load i32, i32* %17
%162 = load i32, i32* %6
%163 = icmp slt i32 %161, %162
br i1 %163, label %164, label %174
164: ; preds = %160
%165 = load i32, i32* @stderr
%166 = load i32, i32* %17
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i32, i32* %65, i64 %167
%169 = load i32, i32* %168
%170 = call i32 (i32, i8*, ...) @fprintf(i32 %165, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %169)
br label %171
171: ; preds = %164
%172 = load i32, i32* %17
%173 = add nsw i32 %172, 1
store i32 %173, i32* %17
br label %160
174: ; preds = %160
%175 = load i32, i32* @stderr
%176 = call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %18
br label %177
177: ; preds = %188, %174
%178 = load i32, i32* %18
%179 = load i32, i32* %6
%180 = icmp slt i32 %178, %179
br i1 %180, label %181, label %191
181: ; preds = %177
%182 = load i32, i32* @stderr
%183 = load i32, i32* %18
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i32, i32* %68, i64 %184
%186 = load i32, i32* %185
%187 = call i32 (i32, i8*, ...) @fprintf(i32 %182, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %186)
br label %188
188: ; preds = %181
%189 = load i32, i32* %18
%190 = add nsw i32 %189, 1
store i32 %190, i32* %18
br label %177
191: ; preds = %177
%192 = load i32, i32* %6
%193 = sext i32 %192 to i64
%194 = mul i64 8, %193
%195 = call i8* @malloc(i64 %194)
%196 = bitcast i8* %195 to i32**
store i32** %196, i32*** %19
store i32 0, i32* %20
br label %197
197: ; preds = %229, %191
%198 = load i32, i32* %20
%199 = load i32, i32* %6
%200 = icmp slt i32 %198, %199
br i1 %200, label %201, label %232
201: ; preds = %197
%202 = load i32, i32* %20
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds i32, i32* %68, i64 %203
%205 = load i32, i32* %204
%206 = load i32, i32* %20
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i32, i32* %65, i64 %207
%209 = load i32, i32* %208
%210 = sub nsw i32 %205, %209
%211 = add nsw i32 %210, 1
store i32 %211, i32* %21
%212 = load i32, i32* %21
%213 = sext i32 %212 to i64
%214 = mul i64 4, %213
store i64 %214, i64* %22
%215 = load i64, i64* %22
%216 = call i8* @malloc(i64 %215)
%217 = bitcast i8* %216 to i32*
%218 = load i32**, i32*** %19
%219 = load i32, i32* %20
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i32*, i32** %218, i64 %220
store i32* %217, i32** %221
%222 = load i32**, i32*** %19
%223 = load i32, i32* %20
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds i32*, i32** %222, i64 %224
%226 = load i32*, i32** %225
%227 = load i64, i64* %22
%228 = call i32 @memset(i32* %226, i32 0, i64 %227)
br label %229
229: ; preds = %201
%230 = load i32, i32* %20
%231 = add nsw i32 %230, 1
store i32 %231, i32* %20
br label %197
232: ; preds = %197
%233 = load i32*, i32** %7
%234 = call i32 @rewind(i32* %233)
%235 = load i32, i32* @stderr
%236 = call i32 (i32, i8*, ...) @fprintf(i32 %235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %15
br label %237
237: ; preds = %285, %232
%238 = load i32*, i32** %7
%239 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%240 = call i64 (i32*, i8*, ...) @fscanf(i32* %238, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %239)
%241 = icmp sle i64 %240, 0
br i1 %241, label %242, label %243
242: ; preds = %237
br label %286
243: ; preds = %237
store i32 0, i32* %23
br label %244
244: ; preds = %272, %243
%245 = load i32, i32* %23
%246 = load i32, i32* %6
%247 = icmp slt i32 %245, %246
br i1 %247, label %248, label %275
248: ; preds = %244
%249 = load i32*, i32** %7
%250 = load i32, i32* %23
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds i32, i32* %62, i64 %251
%253 = call i64 (i32*, i8*, ...) @fscanf(i32* %249, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %252)
%254 = load i32**, i32*** %19
%255 = load i32, i32* %23
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds i32*, i32** %254, i64 %256
%258 = load i32*, i32** %257
%259 = load i32, i32* %23
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds i32, i32* %62, i64 %260
%262 = load i32, i32* %261
%263 = load i32, i32* %23
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds i32, i32* %65, i64 %264
%266 = load i32, i32* %265
%267 = sub nsw i32 %262, %266
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i32, i32* %258, i64 %268
%270 = load i32, i32* %269
%271 = add nsw i32 %270, 1
store i32 %271, i32* %269
br label %272
272: ; preds = %248
%273 = load i32, i32* %23
%274 = add nsw i32 %273, 1
store i32 %274, i32* %23
br label %244
275: ; preds = %244
%276 = load i32, i32* %15
%277 = add nsw i32 %276, 1
store i32 %277, i32* %15
%278 = load i32, i32* %15
%279 = srem i32 %278, 100000
%280 = icmp eq i32 %279, 0
br i1 %280, label %281, label %285
281: ; preds = %275
%282 = load i32, i32* @stderr
%283 = load i32, i32* %15
%284 = call i32 (i32, i8*, ...) @fprintf(i32 %282, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %283)
br label %285
285: ; preds = %281, %275
br label %237
286: ; preds = %242
store i32 0, i32* %24
br label %287
287: ; preds = %383, %286
%288 = load i32, i32* %24
%289 = load i32, i32* %6
%290 = icmp slt i32 %288, %289
br i1 %290, label %291, label %386
291: ; preds = %287
%292 = load i32, i32* %24
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds i32, i32* %68, i64 %293
%295 = load i32, i32* %294
%296 = load i32, i32* %24
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds i32, i32* %65, i64 %297
%299 = load i32, i32* %298
%300 = sub nsw i32 %295, %299
%301 = add nsw i32 %300, 1
store i32 %301, i32* %25
store i32 0, i32* %26
store i32 0, i32* %27
br label %302
302: ; preds = %328, %291
%303 = load i32, i32* %27
%304 = load i32, i32* %25
%305 = icmp slt i32 %303, %304
br i1 %305, label %306, label %331
306: ; preds = %302
%307 = load i32**, i32*** %19
%308 = load i32, i32* %24
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds i32*, i32** %307, i64 %309
%311 = load i32*, i32** %310
%312 = load i32, i32* %27
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds i32, i32* %311, i64 %313
%315 = load i32, i32* %314
store i32 %315, i32* %28
%316 = load i32, i32* %26
%317 = load i32**, i32*** %19
%318 = load i32, i32* %24
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds i32*, i32** %317, i64 %319
%321 = load i32*, i32** %320
%322 = load i32, i32* %27
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds i32, i32* %321, i64 %323
store i32 %316, i32* %324
%325 = load i32, i32* %28
%326 = load i32, i32* %26
%327 = add nsw i32 %326, %325
store i32 %327, i32* %26
br label %328
328: ; preds = %306
%329 = load i32, i32* %27
%330 = add nsw i32 %329, 1
store i32 %330, i32* %27
br label %302
331: ; preds = %302
%332 = load i32**, i32*** %19
%333 = load i32, i32* %24
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds i32*, i32** %332, i64 %334
%336 = load i32*, i32** %335
%337 = load i32, i32* %24
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds i32, i32* %68, i64 %338
%340 = load i32, i32* %339
%341 = load i32, i32* %24
%342 = sext i32 %341 to i64
%343 = getelementptr inbounds i32, i32* %65, i64 %342
%344 = load i32, i32* %343
%345 = sub nsw i32 %340, %344
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds i32, i32* %336, i64 %346
%348 = load i32, i32* %347
store i32 %348, i32* %29
store i32 0, i32* %30
br label %349
349: ; preds = %379, %331
%350 = load i32, i32* %30
%351 = load i32, i32* %25
%352 = icmp slt i32 %350, %351
br i1 %352, label %353, label %382
353: ; preds = %349
%354 = load i32, i32* %30
%355 = load i32, i32* %24
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds i32, i32* %65, i64 %356
%358 = load i32, i32* %357
%359 = add nsw i32 %354, %358
store i32 %359, i32* %31
%360 = load i32**, i32*** %19
%361 = load i32, i32* %24
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds i32*, i32** %360, i64 %362
%364 = load i32*, i32** %363
%365 = load i32, i32* %30
%366 = sext i32 %365 to i64
%367 = getelementptr inbounds i32, i32* %364, i64 %366
%368 = load i32, i32* %367
%369 = sitofp i32 %368 to double
%370 = load i32, i32* %29
%371 = sitofp i32 %370 to double
%372 = fdiv double %369, %371
store double %372, double* %32
%373 = load i32*, i32** %8
%374 = ptrtoint i32* %373 to i32
%375 = load i32, i32* %24
%376 = load i32, i32* %31
%377 = load double, double* %32
%378 = call i32 (i32, i8*, ...) @fprintf(i32 %374, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %375, i32 %376, double %377)
br label %379
379: ; preds = %353
%380 = load i32, i32* %30
%381 = add nsw i32 %380, 1
store i32 %381, i32* %30
br label %349
382: ; preds = %349
br label %383
383: ; preds = %382
%384 = load i32, i32* %24
%385 = add nsw i32 %384, 1
store i32 %385, i32* %24
br label %287
386: ; preds = %287
%387 = load i32*, i32** %8
%388 = call i32 @fclose(i32* %387)
%389 = load i8*, i8** %10
br label %393
390: ; preds = %52
%391 = load i32, i32* @stderr
%392 = call i32 (i32, i8*, ...) @fprintf(i32 %391, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
br label %393
393: ; preds = %390, %386
%394 = load i32*, i32** %7
%395 = call i32 @fclose(i32* %394)
br label %399
396: ; preds = %46
%397 = load i32, i32* @stderr
%398 = call i32 (i32, i8*, ...) @fprintf(i32 %397, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
br label %399
399: ; preds = %396, %393
store i32 0, i32* %3
br label %400
400: ; preds = %399, %35
%401 = load i32, i32* %3
ret i32 %401
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"usage: {input landsat} {output normfile} (vector fields = 12)\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@INT_MAX = global i32 0
@.str.3 = [20 x i8] c"Finding min/max...\0A\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [7 x i8] c"...%d\0A\00"
@.str.7 = [15 x i8] c"Read %d lines\0A\00"
@.str.8 = [11 x i8] c"Min vals: \00"
@.str.9 = [5 x i8] c"%d, \00"
@.str.10 = [11 x i8] c"Max vals: \00"
@.str.11 = [26 x i8] c"\0AGenerating histogram...\0A\00"
@.str.12 = [10 x i8] c"%d %d %f\0A\00"
@.str.13 = [28 x i8] c"Unable to open output file\0A\00"
@.str.14 = [27 x i8] c"Unable to open input file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [64 x i8]
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
br label %333
8: ; preds = %2
%9 = icmp eq i32 %0, 3
br i1 %9, label %14, label %10
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
br label %14
14: ; preds = %10, %8
%15 = phi i32 [ %13, %10 ], [ 12, %8 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %330, label %20
20: ; preds = %14
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %325, label %25
25: ; preds = %20
%26 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%27 = zext i32 %15 to i64
%28 = tail call i8* @llvm.stacksave()
%29 = alloca i32, i64 %27
%30 = alloca i32, i64 %27
%31 = alloca i32, i64 %27
%32 = icmp sgt i32 %15, 0
br i1 %32, label %33, label %113
33: ; preds = %25
%34 = bitcast i32* %31 to i8*
%35 = load i32, i32* @INT_MAX
%36 = shl nuw nsw i64 %27, 2
%37 = icmp ult i32 %15, 8
br i1 %37, label %111, label %38
38: ; preds = %33
%39 = and i64 %27, 4294967288
%40 = insertelement <4 x i32> poison, i32 %35, i64 0
%41 = shufflevector <4 x i32> %40, <4 x i32> poison, <4 x i32> zeroinitializer
%42 = insertelement <4 x i32> poison, i32 %35, i64 0
%43 = shufflevector <4 x i32> %42, <4 x i32> poison, <4 x i32> zeroinitializer
%44 = add nsw i64 %39, -8
%45 = lshr exact i64 %44, 3
%46 = add nuw nsw i64 %45, 1
%47 = and i64 %46, 7
%48 = icmp ult i64 %44, 56
br i1 %48, label %96, label %49
49: ; preds = %38
%50 = and i64 %46, 4611686018427387896
br label %51
51: ; preds = %51, %49
%52 = phi i64 [ 0, %49 ], [ %93, %51 ]
%53 = phi i64 [ 0, %49 ], [ %94, %51 ]
%54 = getelementptr inbounds i32, i32* %30, i64 %52
%55 = bitcast i32* %54 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %55
%56 = getelementptr inbounds i32, i32* %54, i64 4
%57 = bitcast i32* %56 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %57
%58 = or i64 %52, 8
%59 = getelementptr inbounds i32, i32* %30, i64 %58
%60 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %60
%61 = getelementptr inbounds i32, i32* %59, i64 4
%62 = bitcast i32* %61 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %62
%63 = or i64 %52, 16
%64 = getelementptr inbounds i32, i32* %30, i64 %63
%65 = bitcast i32* %64 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %65
%66 = getelementptr inbounds i32, i32* %64, i64 4
%67 = bitcast i32* %66 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %67
%68 = or i64 %52, 24
%69 = getelementptr inbounds i32, i32* %30, i64 %68
%70 = bitcast i32* %69 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %70
%71 = getelementptr inbounds i32, i32* %69, i64 4
%72 = bitcast i32* %71 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %72
%73 = or i64 %52, 32
%74 = getelementptr inbounds i32, i32* %30, i64 %73
%75 = bitcast i32* %74 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %75
%76 = getelementptr inbounds i32, i32* %74, i64 4
%77 = bitcast i32* %76 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %77
%78 = or i64 %52, 40
%79 = getelementptr inbounds i32, i32* %30, i64 %78
%80 = bitcast i32* %79 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %80
%81 = getelementptr inbounds i32, i32* %79, i64 4
%82 = bitcast i32* %81 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %82
%83 = or i64 %52, 48
%84 = getelementptr inbounds i32, i32* %30, i64 %83
%85 = bitcast i32* %84 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %85
%86 = getelementptr inbounds i32, i32* %84, i64 4
%87 = bitcast i32* %86 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %87
%88 = or i64 %52, 56
%89 = getelementptr inbounds i32, i32* %30, i64 %88
%90 = bitcast i32* %89 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %90
%91 = getelementptr inbounds i32, i32* %89, i64 4
%92 = bitcast i32* %91 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %92
%93 = add nuw i64 %52, 64
%94 = add nuw i64 %53, 8
%95 = icmp eq i64 %94, %50
br i1 %95, label %96, label %51
96: ; preds = %51, %38
%97 = phi i64 [ 0, %38 ], [ %93, %51 ]
%98 = icmp eq i64 %47, 0
br i1 %98, label %109, label %99
99: ; preds = %96, %99
%100 = phi i64 [ %106, %99 ], [ %97, %96 ]
%101 = phi i64 [ %107, %99 ], [ 0, %96 ]
%102 = getelementptr inbounds i32, i32* %30, i64 %100
%103 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %103
%104 = getelementptr inbounds i32, i32* %102, i64 4
%105 = bitcast i32* %104 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %105
%106 = add nuw i64 %100, 8
%107 = add i64 %101, 1
%108 = icmp eq i64 %107, %47
br i1 %108, label %109, label %99
109: ; preds = %99, %96
%110 = icmp eq i64 %39, %27
br i1 %110, label %113, label %111
111: ; preds = %33, %109
%112 = phi i64 [ 0, %33 ], [ %39, %109 ]
br label %118
113: ; preds = %118, %109, %25
%114 = load i32, i32* @stderr
%115 = tail call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%116 = call i64 (i32*, i8*, ...) @fscanf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%117 = icmp slt i64 %116, 1
br i1 %117, label %150, label %123
118: ; preds = %111, %118
%119 = phi i64 [ %121, %118 ], [ %112, %111 ]
%120 = getelementptr inbounds i32, i32* %30, i64 %119
store i32 %35, i32* %120
%121 = add nuw nsw i64 %119, 1
%122 = icmp eq i64 %121, %27
br i1 %122, label %113, label %118
123: ; preds = %113, %147
%124 = phi i32 [ %126, %147 ], [ 0, %113 ]
br i1 %32, label %129, label %125
125: ; preds = %129, %123
%126 = add nuw nsw i32 %124, 1
%127 = urem i32 %126, 100000
%128 = icmp eq i32 %127, 0
br i1 %128, label %144, label %147
129: ; preds = %123, %129
%130 = phi i64 [ %142, %129 ], [ 0, %123 ]
%131 = getelementptr inbounds i32, i32* %29, i64 %130
%132 = call i64 (i32*, i8*, ...) @fscanf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %131)
%133 = load i32, i32* %131
%134 = getelementptr inbounds i32, i32* %30, i64 %130
%135 = load i32, i32* %134
%136 = icmp slt i32 %133, %135
%137 = select i1 %136, i32 %133, i32 %135
store i32 %137, i32* %134
%138 = getelementptr inbounds i32, i32* %31, i64 %130
%139 = load i32, i32* %138
%140 = icmp sgt i32 %133, %139
%141 = select i1 %140, i32 %133, i32 %139
store i32 %141, i32* %138
%142 = add nuw nsw i64 %130, 1
%143 = icmp eq i64 %142, %27
br i1 %143, label %125, label %129
144: ; preds = %125
%145 = load i32, i32* @stderr
%146 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %126)
br label %147
147: ; preds = %144, %125
%148 = call i64 (i32*, i8*, ...) @fscanf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%149 = icmp slt i64 %148, 1
br i1 %149, label %150, label %123
150: ; preds = %147, %113
%151 = phi i32 [ 0, %113 ], [ %126, %147 ]
%152 = load i32, i32* @stderr
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %152, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %151)
%154 = load i32, i32* @stderr
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br i1 %32, label %162, label %156
156: ; preds = %150
%157 = load i32, i32* @stderr
%158 = call i32 (i32, i8*, ...) @fprintf(i32 %157, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br label %170
159: ; preds = %162
%160 = load i32, i32* @stderr
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br i1 %32, label %180, label %170
162: ; preds = %150, %162
%163 = phi i64 [ %168, %162 ], [ 0, %150 ]
%164 = load i32, i32* @stderr
%165 = getelementptr inbounds i32, i32* %30, i64 %163
%166 = load i32, i32* %165
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %164, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %166)
%168 = add nuw nsw i64 %163, 1
%169 = icmp eq i64 %168, %27
br i1 %169, label %159, label %162
170: ; preds = %156, %159
%171 = sext i32 %15 to i64
%172 = shl nsw i64 %171, 3
%173 = call i8* @malloc(i64 %172)
%174 = bitcast i8* %173 to i32**
br label %188
175: ; preds = %180
%176 = sext i32 %15 to i64
%177 = shl nsw i64 %176, 3
%178 = call i8* @malloc(i64 %177)
%179 = bitcast i8* %178 to i32**
br i1 %32, label %195, label %188
180: ; preds = %159, %180
%181 = phi i64 [ %186, %180 ], [ 0, %159 ]
%182 = load i32, i32* @stderr
%183 = getelementptr inbounds i32, i32* %31, i64 %181
%184 = load i32, i32* %183
%185 = call i32 (i32, i8*, ...) @fprintf(i32 %182, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %184)
%186 = add nuw nsw i64 %181, 1
%187 = icmp eq i64 %186, %27
br i1 %187, label %175, label %180
188: ; preds = %195, %170, %175
%189 = phi i32** [ %174, %170 ], [ %179, %175 ], [ %179, %195 ]
%190 = call i32 @rewind(i32* %18)
%191 = load i32, i32* @stderr
%192 = call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%193 = call i64 (i32*, i8*, ...) @fscanf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%194 = icmp slt i64 %193, 1
br i1 %194, label %214, label %212
195: ; preds = %175, %195
%196 = phi i64 [ %210, %195 ], [ 0, %175 ]
%197 = getelementptr inbounds i32, i32* %31, i64 %196
%198 = load i32, i32* %197
%199 = getelementptr inbounds i32, i32* %30, i64 %196
%200 = load i32, i32* %199
%201 = add i32 %198, 1
%202 = sub i32 %201, %200
%203 = sext i32 %202 to i64
%204 = shl nsw i64 %203, 2
%205 = call i8* @malloc(i64 %204)
%206 = bitcast i8* %205 to i32*
%207 = getelementptr inbounds i32*, i32** %179, i64 %196
%208 = bitcast i32** %207 to i8**
store i8* %205, i8** %208
%209 = call i32 @memset(i32* %206, i32 0, i64 %204)
%210 = add nuw nsw i64 %196, 1
%211 = icmp eq i64 %210, %27
br i1 %211, label %188, label %195
212: ; preds = %188, %241
%213 = phi i32 [ %219, %241 ], [ 0, %188 ]
br i1 %32, label %222, label %218
214: ; preds = %241, %188
br i1 %32, label %215, label %244
215: ; preds = %214
%216 = ptrtoint i32* %23 to i64
%217 = trunc i64 %216 to i32
br label %246
218: ; preds = %222, %212
%219 = add nuw nsw i32 %213, 1
%220 = urem i32 %219, 100000
%221 = icmp eq i32 %220, 0
br i1 %221, label %238, label %241
222: ; preds = %212, %222
%223 = phi i64 [ %236, %222 ], [ 0, %212 ]
%224 = getelementptr inbounds i32, i32* %29, i64 %223
%225 = call i64 (i32*, i8*, ...) @fscanf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %224)
%226 = getelementptr inbounds i32*, i32** %189, i64 %223
%227 = load i32*, i32** %226
%228 = load i32, i32* %224
%229 = getelementptr inbounds i32, i32* %30, i64 %223
%230 = load i32, i32* %229
%231 = sub nsw i32 %228, %230
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds i32, i32* %227, i64 %232
%234 = load i32, i32* %233
%235 = add nsw i32 %234, 1
store i32 %235, i32* %233
%236 = add nuw nsw i64 %223, 1
%237 = icmp eq i64 %236, %27
br i1 %237, label %218, label %222
238: ; preds = %218
%239 = load i32, i32* @stderr
%240 = call i32 (i32, i8*, ...) @fprintf(i32 %239, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 %219)
br label %241
241: ; preds = %238, %218
%242 = call i64 (i32*, i8*, ...) @fscanf(i32* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%243 = icmp slt i64 %242, 1
br i1 %243, label %214, label %212
244: ; preds = %311, %214
%245 = call i32 @fclose(i32* %23)
br label %328
246: ; preds = %215, %311
%247 = phi i64 [ 0, %215 ], [ %312, %311 ]
%248 = getelementptr inbounds i32, i32* %31, i64 %247
%249 = load i32, i32* %248
%250 = getelementptr inbounds i32, i32* %30, i64 %247
%251 = load i32, i32* %250
%252 = sub nsw i32 %249, %251
%253 = icmp slt i32 %252, 0
br i1 %253, label %311, label %254
254: ; preds = %246
%255 = getelementptr inbounds i32*, i32** %189, i64 %247
%256 = load i32*, i32** %255
%257 = add i32 %249, 1
%258 = sub i32 %257, %251
%259 = zext i32 %258 to i64
%260 = add nsw i64 %259, -1
%261 = and i64 %259, 3
%262 = icmp ult i64 %260, 3
br i1 %262, label %265, label %263
263: ; preds = %254
%264 = and i64 %259, 4294967292
br label %289
265: ; preds = %289, %254
%266 = phi i64 [ 0, %254 ], [ %308, %289 ]
%267 = phi i32 [ 0, %254 ], [ %307, %289 ]
%268 = icmp eq i64 %261, 0
br i1 %268, label %279, label %269
269: ; preds = %265, %269
%270 = phi i64 [ %276, %269 ], [ %266, %265 ]
%271 = phi i32 [ %275, %269 ], [ %267, %265 ]
%272 = phi i64 [ %277, %269 ], [ 0, %265 ]
%273 = getelementptr inbounds i32, i32* %256, i64 %270
%274 = load i32, i32* %273
store i32 %271, i32* %273
%275 = add nsw i32 %274, %271
%276 = add nuw nsw i64 %270, 1
%277 = add i64 %272, 1
%278 = icmp eq i64 %277, %261
br i1 %278, label %279, label %269
279: ; preds = %269, %265
br i1 %253, label %311, label %280
280: ; preds = %279
%281 = zext i32 %252 to i64
%282 = getelementptr inbounds i32, i32* %256, i64 %281
%283 = load i32, i32* %282
%284 = sitofp i32 %283 to double
%285 = add i32 %249, 1
%286 = sub i32 %285, %251
%287 = zext i32 %286 to i64
%288 = trunc i64 %247 to i32
br label %314
289: ; preds = %289, %263
%290 = phi i64 [ 0, %263 ], [ %308, %289 ]
%291 = phi i32 [ 0, %263 ], [ %307, %289 ]
%292 = phi i64 [ 0, %263 ], [ %309, %289 ]
%293 = getelementptr inbounds i32, i32* %256, i64 %290
%294 = load i32, i32* %293
store i32 %291, i32* %293
%295 = add nsw i32 %294, %291
%296 = or i64 %290, 1
%297 = getelementptr inbounds i32, i32* %256, i64 %296
%298 = load i32, i32* %297
store i32 %295, i32* %297
%299 = add nsw i32 %298, %295
%300 = or i64 %290, 2
%301 = getelementptr inbounds i32, i32* %256, i64 %300
%302 = load i32, i32* %301
store i32 %299, i32* %301
%303 = add nsw i32 %302, %299
%304 = or i64 %290, 3
%305 = getelementptr inbounds i32, i32* %256, i64 %304
%306 = load i32, i32* %305
store i32 %303, i32* %305
%307 = add nsw i32 %306, %303
%308 = add nuw nsw i64 %290, 4
%309 = add i64 %292, 4
%310 = icmp eq i64 %309, %264
br i1 %310, label %265, label %289
311: ; preds = %314, %246, %279
%312 = add nuw nsw i64 %247, 1
%313 = icmp eq i64 %312, %27
br i1 %313, label %244, label %246
314: ; preds = %280, %314
%315 = phi i64 [ 0, %280 ], [ %323, %314 ]
%316 = getelementptr inbounds i32, i32* %256, i64 %315
%317 = load i32, i32* %316
%318 = sitofp i32 %317 to double
%319 = fdiv double %318, %284
%320 = trunc i64 %315 to i32
%321 = add i32 %251, %320
%322 = call i32 (i32, i8*, ...) @fprintf(i32 %217, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %288, i32 %321, double %319)
%323 = add nuw nsw i64 %315, 1
%324 = icmp eq i64 %323, %287
br i1 %324, label %311, label %314
325: ; preds = %20
%326 = load i32, i32* @stderr
%327 = tail call i32 (i32, i8*, ...) @fprintf(i32 %326, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
br label %328
328: ; preds = %325, %244
%329 = call i32 @fclose(i32* %18)
br label %333
330: ; preds = %14
%331 = load i32, i32* @stderr
%332 = tail call i32 (i32, i8*, ...) @fprintf(i32 %331, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
br label %333
333: ; preds = %328, %330, %5
ret i32 0
}