#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 /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ make_accumulation(int **, int **, int, int);
int /*<<< orphan*/ printf(char *, ...);
int read_file(char *, int **, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ write_accumulation(int **, int, int);
void main(int argc, char **argv) {
  FILE *fp;
  char direc[400];
  int DATA[500][500];
  int ACC[500][500];
  int cols, rows, i, j;
  float uplftlat, uplftlon;
  float lat, lon, xllcorner, yllcorner;
  float resolution;
  int valid_cells;
  char junk[40];
  int void_nr;
  if (argc != 2) {
    fprintf(stderr, "Usage: %s <direction file>\n", argv[0]);
    fprintf(stderr, "\tThis program computes the flow accumulation for each "
                    "grid cell based on the given routing direction file.\n");
    fprintf(stderr, "\tThe accumulation file is output to stdout.\n");
    exit(0);
  }
  strcpy(direc, argv[1]);
  fprintf(stderr, "Welcome to make_accumulation.c \n");
  if ((fp = fopen(direc, "r")) == NULL) {
    printf("Cannot open file maskfile %s \n", direc);
    exit(0);
  }
  fscanf(fp, "%s", junk);
  fscanf(fp, "%d", &cols);
  printf("%-15s %d\n", junk, cols);
  fscanf(fp, "%s", junk);
  fscanf(fp, "%d", &rows);
  printf("%-15s %d\n", junk, rows);
  fscanf(fp, "%s", junk);
  printf("%-15s", junk);
  fscanf(fp, "%f", &xllcorner);
  printf("%.4f\n", xllcorner);
  fscanf(fp, "%s", junk);
  printf("%-15s", junk);
  fscanf(fp, "%f", &yllcorner);
  printf("%.4f\n", yllcorner);
  fscanf(fp, "%s", junk);
  printf("%-15s", junk);
  fscanf(fp, "%f", &resolution);
  printf("%.4f\n", resolution);
  fscanf(fp, "%s", junk);
  fscanf(fp, "%d", &void_nr);
  printf("%-15s %d\n", junk, void_nr);
  lon = uplftlon = xllcorner + (resolution / 2);
  lat = uplftlat = yllcorner + (rows * resolution) - (resolution / 2);
  fprintf(stderr, "uplftlon %.4f uplftlat %.4f\n", uplftlon, uplftlat);
  fclose(fp);
  for (i = 0; i < rows + 2; i++)
    for (j = 0; j < cols + 2; j++)
      DATA[i][j] = 9;
  for (i = 0; i < rows + 2; i++)
    for (j = 0; j < cols + 2; j++)
      ACC[i][j] = 0;
  fprintf(stderr, "READING FILE\n");
  valid_cells = read_file(direc, DATA, rows, cols);
  fprintf(stderr, "valid_cells = %d\n", valid_cells);
  make_accumulation(DATA, ACC, rows, cols);
  write_accumulation(ACC, rows, cols);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e86a0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     120f <main+0x6f>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe31(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%edi
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0x1b0(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1277 <main+0xd7>
lea    -0x1b0(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8690(%rbp),%rdx
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe63(%rip),%rsi
lea    -0x1e8634(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x1e8690(%rbp),%rsi
mov    -0x1e8634(%rbp),%edx
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8690(%rbp),%rdx
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe16(%rip),%rsi
lea    -0x1e8638(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x1e8690(%rbp),%rsi
mov    -0x1e8638(%rbp),%edx
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8690(%rbp),%rdx
lea    0xdd8(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x1e8690(%rbp),%rsi
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdc7(%rip),%rsi
lea    -0x1e8654(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  -0x1e8654(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xdc0(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8690(%rbp),%rdx
lea    0xd77(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x1e8690(%rbp),%rsi
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd66(%rip),%rsi
lea    -0x1e8658(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  -0x1e8658(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd5f(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8690(%rbp),%rdx
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x1e8690(%rbp),%rsi
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd05(%rip),%rsi
lea    -0x1e865c(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  -0x1e865c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xcfe(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8690(%rbp),%rdx
lea    0xcb5(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    0xca6(%rip),%rsi
lea    -0x1e8694(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
lea    -0x1e8690(%rbp),%rsi
mov    -0x1e8694(%rbp),%edx
lea    0xc87(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movss  -0x1e8654(%rbp),%xmm0
ff
movss  -0x1e865c(%rbp),%xmm1
ff
movss  0xb67(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1e8648(%rbp)
ff
movss  %xmm0,-0x1e8650(%rbp)
ff
movss  -0x1e8658(%rbp),%xmm1
ff
cvtsi2ssl -0x1e8638(%rbp),%xmm0
ff
movss  -0x1e865c(%rbp),%xmm2
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x1e865c(%rbp),%xmm1
ff
movss  0xb1f(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x1e8644(%rbp)
ff
movss  %xmm0,-0x1e864c(%rbp)
ff
mov    0x2ae0(%rip),%rax
mov    (%rax),%edi
movss  -0x1e8648(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x1e8644(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xbf3(%rip),%rsi
mov    $0x2,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x1e863c(%rbp)
mov    -0x1e863c(%rbp),%eax
mov    -0x1e8638(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    15c6 <main+0x426>
movl   $0x0,-0x1e8640(%rbp)
mov    -0x1e8640(%rbp),%eax
mov    -0x1e8634(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    15ad <main+0x40d>
movslq -0x1e863c(%rbp),%rcx
lea    -0xf43f0(%rbp),%rax
imul   $0x7d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x1e8640(%rbp),%rcx
movl   $0x9,(%rax,%rcx,4)
mov    -0x1e8640(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e8640(%rbp)
jmp    155c <main+0x3bc>
jmp    15b2 <main+0x412>
mov    -0x1e863c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e863c(%rbp)
jmp    153b <main+0x39b>
movl   $0x0,-0x1e863c(%rbp)
mov    -0x1e863c(%rbp),%eax
mov    -0x1e8638(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    165b <main+0x4bb>
movl   $0x0,-0x1e8640(%rbp)
mov    -0x1e8640(%rbp),%eax
mov    -0x1e8634(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    1642 <main+0x4a2>
movslq -0x1e863c(%rbp),%rcx
lea    -0x1e8630(%rbp),%rax
imul   $0x7d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x1e8640(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1e8640(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e8640(%rbp)
jmp    15f1 <main+0x451>
jmp    1647 <main+0x4a7>
mov    -0x1e863c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e863c(%rbp)
jmp    15d0 <main+0x430>
mov    0x297e(%rip),%rax
mov    (%rax),%edi
lea    0xac6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0xf43f0(%rbp),%rsi
mov    -0x1e8638(%rbp),%edx
mov    -0x1e8634(%rbp),%ecx
call   10a0 <read_file@plt>
mov    %eax,-0x1e8660(%rbp)
mov    0x2942(%rip),%rax
mov    (%rax),%edi
mov    -0x1e8660(%rbp),%edx
lea    0xa92(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0xf43f0(%rbp),%rdi
lea    -0x1e8630(%rbp),%rsi
mov    -0x1e8638(%rbp),%edx
mov    -0x1e8634(%rbp),%ecx
call   1080 <make_accumulation@plt>
lea    -0x1e8630(%rbp),%rdi
mov    -0x1e8638(%rbp),%esi
mov    -0x1e8634(%rbp),%edx
call   1040 <write_accumulation@plt>
add    $0x1e86a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8668,%rsp
cmp    $0x2,%edi
jne    16cc <main+0x51c>
mov    0x8(%rsi),%rsi
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0xefd(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     170d <main+0x55d>
mov    %rax,%rbx
lea    0xf03(%rip),%r15
lea    0x20(%rsp),%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
lea    0xeea(%rip),%r12
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0xc(%rsp),%edx
lea    0xed0(%rip),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x8(%rsp),%edx
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
lea    0xe83(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe75(%rip),%rbp
lea    0x18(%rsp),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6c(%rip),%r13
mov    %r13,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
lea    0xd90(%rip),%rsi
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x1c(%rsp),%edx
lea    0xd81(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
movss  0x10(%rsp),%xmm0
movss  0xc4c(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  0x18(%rsp),%xmm2
cvtsi2ssl 0x8(%rsp),%xmm3
addss  %xmm1,%xmm2
mulss  %xmm0,%xmm3
addss  0x14(%rsp),%xmm3
subss  %xmm1,%xmm3
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
lea    0xd3c(%rip),%rsi
mov    $0x2,%al
call   10a0 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%r8d
cmp    $0xffffffff,%r8d
jl     15d2 <main+0x422>
lea    0x2(%r8),%eax
mov    0xc(%rsp),%r15d
test   %r15d,%r15d
mov    $0xffffffff,%edx
cmovns %r15d,%edx
add    $0x2,%edx
cmp    $0x2,%eax
mov    $0x1,%r13d
cmovge %eax,%r13d
mov    %edx,%r14d
and    $0xfffffff8,%r14d
lea    -0x8(%r14),%r9
mov    %r9,%r10
shr    $0x3,%r10
add    $0x1,%r10
mov    %r10d,%r11d
and    $0x3,%r11d
and    $0xfffffffffffffffc,%r10
lea    0xf4490(%rsp),%rax
mov    %r11,%rdi
shl    $0x5,%rdi
lea    0xf4420(%rsp),%rbp
xor    %esi,%esi
movaps 0xb98(%rip),%xmm0
jmp    149a <main+0x2ea>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rsi
add    $0x7d0,%rax
add    $0x7d0,%rbp
cmp    %r13,%rsi
je     1546 <main+0x396>
cmp    $0xffffffff,%r15d
jl     1480 <main+0x2d0>
cmp    $0x8,%edx
jae    14b0 <main+0x300>
xor    %ecx,%ecx
jmp    1530 <main+0x380>
nopl   0x0(%rax)
cmp    $0x18,%r9
jae    14ba <main+0x30a>
xor    %ebx,%ebx
jmp    14f1 <main+0x341>
mov    %r10,%rcx
xor    %ebx,%ebx
nop
movaps %xmm0,-0x70(%rax,%rbx,4)
movaps %xmm0,-0x60(%rax,%rbx,4)
movaps %xmm0,-0x50(%rax,%rbx,4)
movaps %xmm0,-0x40(%rax,%rbx,4)
movaps %xmm0,-0x30(%rax,%rbx,4)
movaps %xmm0,-0x20(%rax,%rbx,4)
movaps %xmm0,-0x10(%rax,%rbx,4)
movaps %xmm0,(%rax,%rbx,4)
add    $0x20,%rbx
add    $0xfffffffffffffffc,%rcx
jne    14c0 <main+0x310>
test   %r11,%r11
je     1522 <main+0x372>
lea    0x0(,%rbx,4),%rcx
add    %rbp,%rcx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps %xmm0,(%rcx,%rbx,1)
movaps %xmm0,0x10(%rcx,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%rdi
jne    1510 <main+0x360>
mov    %r14,%rcx
cmp    %rdx,%r14
je     1480 <main+0x2d0>
xchg   %ax,%ax
movl   $0x9,0x0(%rbp,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1530 <main+0x380>
jmp    1480 <main+0x2d0>
cmp    $0xffffffff,%r8d
jl     15d2 <main+0x422>
mov    0xc(%rsp),%r15d
test   %r15d,%r15d
mov    $0xffffffff,%eax
cmovns %r15d,%eax
add    $0x1,%eax
lea    0x4(,%rax,4),%r14
lea    -0x1(%r13),%rax
mov    %r13d,%r12d
and    $0x3,%r12d
cmp    $0x3,%rax
jae    1657 <main+0x4a7>
xor    %ebx,%ebx
test   %r12,%r12
je     15d2 <main+0x422>
imul   $0x7d0,%rbx,%rax
lea    (%rsp,%rax,1),%r13
add    $0x1e0,%r13
imul   $0x7d0,%r12,%rbp
xor    %ebx,%ebx
jmp    15bc <main+0x40c>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x7d0,%rbx
cmp    %rbx,%rbp
je     15d2 <main+0x422>
cmp    $0xffffffff,%r15d
jl     15b0 <main+0x400>
lea    (%rbx,%r13,1),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
jmp    15b0 <main+0x400>
mov    0x2a07(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xb6a(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0x50(%rsp),%rdi
lea    0xf4420(%rsp),%rbx
mov    %rbx,%rsi
call   10b0 <read_file@plt>
mov    0x0(%rbp),%edi
lea    0xb4a(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0x1e0(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <make_accumulation@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %rbp,%rdi
call   1040 <write_accumulation@plt>
add    $0x1e8668,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
and    $0x7ffffffc,%r13d
lea    0x1e0(%rsp),%rbp
xor    %ebx,%ebx
jmp    1684 <main+0x4d4>
nopw   0x0(%rax,%rax,1)
add    $0x4,%rbx
add    $0x1f40,%rbp
cmp    %rbx,%r13
je     1583 <main+0x3d3>
cmp    $0xffffffff,%r15d
jl     1670 <main+0x4c0>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
lea    0x7d0(%rbp),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
lea    0xfa0(%rbp),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
lea    0x1770(%rbp),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1070 <memset@plt>
jmp    1670 <main+0x4c0>
mov    0x290d(%rip),%rbx
mov    (%rbx),%edi
mov    (%rsi),%rdx
lea    0x941(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0x94d(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0x9a9(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0x9e4(%rip),%rdi
lea    0x50(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s <direction file>\0A\00"
@.str.1 = [108 x i8] c"\09This program computes the flow accumulation for each grid cell based on the given routing direction file.\0A\00"
@.str.2 = [45 x i8] c"\09The accumulation file is output to stdout.\0A\00"
@.str.3 = [33 x i8] c"Welcome to make_accumulation.c \0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [31 x i8] c"Cannot open file maskfile %s \0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [10 x i8] c"%-15s %d\0A\00"
@.str.9 = [6 x i8] c"%-15s\00"
@.str.10 = [3 x i8] c"%f\00"
@.str.11 = [6 x i8] c"%.4f\0A\00"
@.str.12 = [29 x i8] c"uplftlon %.4f uplftlat %.4f\0A\00"
@.str.13 = [14 x i8] c"READING FILE\0A\00"
@.str.14 = [18 x i8] c"valid_cells = %d\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca [400 x i8]
%7 = alloca [500 x [500 x i32]]
%8 = alloca [500 x [500 x i32]]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca i32
%21 = alloca [40 x i8]
%22 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%23 = load i32, i32* %3
%24 = icmp ne i32 %23, 2
br i1 %24, label %25, label %36
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %4
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 @exit(i32 0)
unreachable
36: ; preds = %2
%37 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%38 = load i8**, i8*** %4
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @strcpy(i8* %37, i8* %40)
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%44 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%45 = call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %45, i32** %5
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %51
47: ; preds = %36
%48 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %48)
%50 = call i32 @exit(i32 0)
unreachable
51: ; preds = %36
%52 = load i32*, i32** %5
%53 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%54 = call i32 (i32*, i8*, ...) @fscanf(i32* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %53)
%55 = load i32*, i32** %5
%56 = call i32 (i32*, i8*, ...) @fscanf(i32* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %9)
%57 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%58 = load i32, i32* %9
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %57, i32 %58)
%60 = load i32*, i32** %5
%61 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%62 = call i32 (i32*, i8*, ...) @fscanf(i32* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %61)
%63 = load i32*, i32** %5
%64 = call i32 (i32*, i8*, ...) @fscanf(i32* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %10)
%65 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%66 = load i32, i32* %10
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %65, i32 %66)
%68 = load i32*, i32** %5
%69 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%70 = call i32 (i32*, i8*, ...) @fscanf(i32* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %69)
%71 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %71)
%73 = load i32*, i32** %5
%74 = call i32 (i32*, i8*, ...) @fscanf(i32* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %17)
%75 = load float, float* %17
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), double %76)
%78 = load i32*, i32** %5
%79 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%80 = call i32 (i32*, i8*, ...) @fscanf(i32* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %79)
%81 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %81)
%83 = load i32*, i32** %5
%84 = call i32 (i32*, i8*, ...) @fscanf(i32* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %18)
%85 = load float, float* %18
%86 = fpext float %85 to double
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), double %86)
%88 = load i32*, i32** %5
%89 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%90 = call i32 (i32*, i8*, ...) @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %89)
%91 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %91)
%93 = load i32*, i32** %5
%94 = call i32 (i32*, i8*, ...) @fscanf(i32* %93, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %19)
%95 = load float, float* %19
%96 = fpext float %95 to double
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), double %96)
%98 = load i32*, i32** %5
%99 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%100 = call i32 (i32*, i8*, ...) @fscanf(i32* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %99)
%101 = load i32*, i32** %5
%102 = call i32 (i32*, i8*, ...) @fscanf(i32* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %22)
%103 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%104 = load i32, i32* %22
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %103, i32 %104)
%106 = load float, float* %17
%107 = load float, float* %19
%108 = fdiv float %107, 2.000000e+00
%109 = fadd float %106, %108
store float %109, float* %14
store float %109, float* %16
%110 = load float, float* %18
%111 = load i32, i32* %10
%112 = sitofp i32 %111 to float
%113 = load float, float* %19
%114 = call float @llvm.fmuladd.f32(float %112, float %113, float %110)
%115 = load float, float* %19
%116 = fdiv float %115, 2.000000e+00
%117 = fsub float %114, %116
store float %117, float* %13
store float %117, float* %15
%118 = load i32, i32* @stderr
%119 = load float, float* %14
%120 = fpext float %119 to double
%121 = load float, float* %13
%122 = fpext float %121 to double
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), double %120, double %122)
%124 = load i32*, i32** %5
%125 = call i32 @fclose(i32* %124)
store i32 0, i32* %11
br label %126
126: ; preds = %148, %51
%127 = load i32, i32* %11
%128 = load i32, i32* %10
%129 = add nsw i32 %128, 2
%130 = icmp slt i32 %127, %129
br i1 %130, label %131, label %151
131: ; preds = %126
store i32 0, i32* %12
br label %132
132: ; preds = %144, %131
%133 = load i32, i32* %12
%134 = load i32, i32* %9
%135 = add nsw i32 %134, 2
%136 = icmp slt i32 %133, %135
br i1 %136, label %137, label %147
137: ; preds = %132
%138 = load i32, i32* %11
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %7, i64 0, i64 %139
%141 = load i32, i32* %12
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [500 x i32], [500 x i32]* %140, i64 0, i64 %142
store i32 9, i32* %143
br label %144
144: ; preds = %137
%145 = load i32, i32* %12
%146 = add nsw i32 %145, 1
store i32 %146, i32* %12
br label %132
147: ; preds = %132
br label %148
148: ; preds = %147
%149 = load i32, i32* %11
%150 = add nsw i32 %149, 1
store i32 %150, i32* %11
br label %126
151: ; preds = %126
store i32 0, i32* %11
br label %152
152: ; preds = %174, %151
%153 = load i32, i32* %11
%154 = load i32, i32* %10
%155 = add nsw i32 %154, 2
%156 = icmp slt i32 %153, %155
br i1 %156, label %157, label %177
157: ; preds = %152
store i32 0, i32* %12
br label %158
158: ; preds = %170, %157
%159 = load i32, i32* %12
%160 = load i32, i32* %9
%161 = add nsw i32 %160, 2
%162 = icmp slt i32 %159, %161
br i1 %162, label %163, label %173
163: ; preds = %158
%164 = load i32, i32* %11
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %8, i64 0, i64 %165
%167 = load i32, i32* %12
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [500 x i32], [500 x i32]* %166, i64 0, i64 %168
store i32 0, i32* %169
br label %170
170: ; preds = %163
%171 = load i32, i32* %12
%172 = add nsw i32 %171, 1
store i32 %172, i32* %12
br label %158
173: ; preds = %158
br label %174
174: ; preds = %173
%175 = load i32, i32* %11
%176 = add nsw i32 %175, 1
store i32 %176, i32* %11
br label %152
177: ; preds = %152
%178 = load i32, i32* @stderr
%179 = call i32 (i32, i8*, ...) @fprintf(i32 %178, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%180 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%181 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %7, i64 0, i64 0
%182 = bitcast [500 x i32]* %181 to i32**
%183 = load i32, i32* %10
%184 = load i32, i32* %9
%185 = call i32 @read_file(i8* %180, i32** %182, i32 %183, i32 %184)
store i32 %185, i32* %20
%186 = load i32, i32* @stderr
%187 = load i32, i32* %20
%188 = call i32 (i32, i8*, ...) @fprintf(i32 %186, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %187)
%189 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %7, i64 0, i64 0
%190 = bitcast [500 x i32]* %189 to i32**
%191 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %8, i64 0, i64 0
%192 = bitcast [500 x i32]* %191 to i32**
%193 = load i32, i32* %10
%194 = load i32, i32* %9
%195 = call i32 @make_accumulation(i32** %190, i32** %192, i32 %193, i32 %194)
%196 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %8, i64 0, i64 0
%197 = bitcast [500 x i32]* %196 to i32**
%198 = load i32, i32* %10
%199 = load i32, i32* %9
%200 = call i32 @write_accumulation(i32** %197, i32 %198, i32 %199)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s <direction file>\0A\00"
@.str.1 = [108 x i8] c"\09This program computes the flow accumulation for each grid cell based on the given routing direction file.\0A\00"
@.str.2 = [45 x i8] c"\09The accumulation file is output to stdout.\0A\00"
@.str.3 = [33 x i8] c"Welcome to make_accumulation.c \0A\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [31 x i8] c"Cannot open file maskfile %s \0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [10 x i8] c"%-15s %d\0A\00"
@.str.9 = [6 x i8] c"%-15s\00"
@.str.10 = [3 x i8] c"%f\00"
@.str.11 = [6 x i8] c"%.4f\0A\00"
@.str.12 = [29 x i8] c"uplftlon %.4f uplftlat %.4f\0A\00"
@.str.13 = [14 x i8] c"READING FILE\0A\00"
@.str.14 = [18 x i8] c"valid_cells = %d\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca [400 x i8]
%4 = alloca [500 x [500 x i32]]
%5 = alloca [500 x [500 x i32]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca [40 x i8]
%12 = alloca i32
%13 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%14 = bitcast [500 x [500 x i32]]* %4 to i8*
%15 = bitcast [500 x [500 x i32]]* %5 to i8*
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = bitcast float* %8 to i8*
%19 = bitcast float* %9 to i8*
%20 = bitcast float* %10 to i8*
%21 = getelementptr inbounds [40 x i8], [40 x i8]* %11, i64 0, i64 0
%22 = bitcast i32* %12 to i8*
%23 = icmp eq i32 %0, 2
br i1 %23, label %33, label %24
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = load i8*, i8** %1
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.1, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i32 @exit(i32 0)
unreachable
33: ; preds = %2
%34 = getelementptr inbounds i8*, i8** %1, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcpy(i8* %13, i8* %35)
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %44
41: ; preds = %33
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%43 = call i32 @exit(i32 0)
unreachable
44: ; preds = %33
%45 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%46 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %6)
%47 = load i32, i32* %6
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %21, i32 %47)
%49 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%50 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %7)
%51 = load i32, i32* %7
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %21, i32 %51)
%53 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %21)
%55 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %8)
%56 = load float, float* %8
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), double %57)
%59 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %21)
%61 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %9)
%62 = load float, float* %9
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), double %63)
%65 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %21)
%67 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %10)
%68 = load float, float* %10
%69 = fpext float %68 to double
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), double %69)
%71 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %21)
%72 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %12)
%73 = load i32, i32* %12
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %21, i32 %73)
%75 = load float, float* %8
%76 = load float, float* %10
%77 = fmul float %76, 5.000000e-01
%78 = fadd float %75, %77
%79 = load float, float* %9
%80 = load i32, i32* %7
%81 = sitofp i32 %80 to float
%82 = call float @llvm.fmuladd.f32(float %81, float %76, float %79)
%83 = fsub float %82, %77
%84 = load i32, i32* @stderr
%85 = fpext float %78 to double
%86 = fpext float %83 to double
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), double %85, double %86)
%88 = call i32 @fclose(i32* %39)
%89 = load i32, i32* %7
%90 = icmp sgt i32 %89, -2
br i1 %90, label %91, label %209
91: ; preds = %44
%92 = add i32 %89, 2
%93 = load i32, i32* %6
%94 = icmp sgt i32 %93, -2
%95 = call i32 @llvm.smax.i32(i32 %93, i32 -1)
%96 = add i32 %95, 2
%97 = call i32 @llvm.smax.i32(i32 %92, i32 1)
%98 = zext i32 %97 to i64
%99 = zext i32 %96 to i64
%100 = and i64 %99, 4294967288
%101 = add nsw i64 %100, -8
%102 = lshr exact i64 %101, 3
%103 = add nuw nsw i64 %102, 1
%104 = icmp ult i32 %96, 8
%105 = and i64 %99, 4294967288
%106 = and i64 %103, 3
%107 = icmp ult i64 %101, 24
%108 = and i64 %103, 4611686018427387900
%109 = icmp eq i64 %106, 0
%110 = icmp eq i64 %105, %99
br label %111
111: ; preds = %91, %174
%112 = phi i64 [ 0, %91 ], [ %175, %174 ]
br i1 %94, label %113, label %174
113: ; preds = %111
br i1 %104, label %153, label %114
114: ; preds = %113
br i1 %107, label %140, label %115
115: ; preds = %114, %115
%116 = phi i64 [ %137, %115 ], [ 0, %114 ]
%117 = phi i64 [ %138, %115 ], [ 0, %114 ]
%118 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %4, i64 0, i64 %112, i64 %116
%119 = bitcast i32* %118 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %119
%120 = getelementptr inbounds i32, i32* %118, i64 4
%121 = bitcast i32* %120 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %121
%122 = or i64 %116, 8
%123 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %4, i64 0, i64 %112, i64 %122
%124 = bitcast i32* %123 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %124
%125 = getelementptr inbounds i32, i32* %123, i64 4
%126 = bitcast i32* %125 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %126
%127 = or i64 %116, 16
%128 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %4, i64 0, i64 %112, i64 %127
%129 = bitcast i32* %128 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %129
%130 = getelementptr inbounds i32, i32* %128, i64 4
%131 = bitcast i32* %130 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %131
%132 = or i64 %116, 24
%133 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %4, i64 0, i64 %112, i64 %132
%134 = bitcast i32* %133 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %134
%135 = getelementptr inbounds i32, i32* %133, i64 4
%136 = bitcast i32* %135 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %136
%137 = add nuw i64 %116, 32
%138 = add i64 %117, 4
%139 = icmp eq i64 %138, %108
br i1 %139, label %140, label %115
140: ; preds = %115, %114
%141 = phi i64 [ 0, %114 ], [ %137, %115 ]
br i1 %109, label %152, label %142
142: ; preds = %140, %142
%143 = phi i64 [ %149, %142 ], [ %141, %140 ]
%144 = phi i64 [ %150, %142 ], [ 0, %140 ]
%145 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %4, i64 0, i64 %112, i64 %143
%146 = bitcast i32* %145 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %146
%147 = getelementptr inbounds i32, i32* %145, i64 4
%148 = bitcast i32* %147 to <4 x i32>*
store <4 x i32> <i32 9, i32 9, i32 9, i32 9>, <4 x i32>* %148
%149 = add nuw i64 %143, 8
%150 = add i64 %144, 1
%151 = icmp eq i64 %150, %106
br i1 %151, label %152, label %142
152: ; preds = %142, %140
br i1 %110, label %174, label %153
153: ; preds = %113, %152
%154 = phi i64 [ 0, %113 ], [ %105, %152 ]
br label %169
155: ; preds = %174
br i1 %90, label %156, label %209
156: ; preds = %155
%157 = load i32, i32* %6
%158 = icmp sgt i32 %157, -2
%159 = call i32 @llvm.smax.i32(i32 %157, i32 -1)
%160 = add nsw i32 %159, 1
%161 = zext i32 %160 to i64
%162 = shl nuw nsw i64 %161, 2
%163 = add nuw nsw i64 %162, 4
%164 = add nsw i64 %98, -1
%165 = and i64 %98, 3
%166 = icmp ult i64 %164, 3
br i1 %166, label %196, label %167
167: ; preds = %156
%168 = and i64 %98, 2147483644
br label %177
169: ; preds = %153, %169
%170 = phi i64 [ %172, %169 ], [ %154, %153 ]
%171 = getelementptr inbounds [500 x [500 x i32]], [500 x [500 x i32]]* %4, i64 0, i64 %112, i64 %170
store i32 9, i32* %171
%172 = add nuw nsw i64 %170, 1
%173 = icmp eq i64 %172, %99
br i1 %173, label %174, label %169
174: ; preds = %169, %152, %111
%175 = add nuw nsw i64 %112, 1
%176 = icmp eq i64 %175, %98
br i1 %176, label %155, label %111
177: ; preds = %192, %167
%178 = phi i64 [ 0, %167 ], [ %193, %192 ]
%179 = phi i64 [ 0, %167 ], [ %194, %192 ]
br i1 %158, label %180, label %192
180: ; preds = %177
%181 = getelementptr [500 x [500 x i32]], [500 x [500 x i32]]* %5, i64 0, i64 %178, i64 0
%182 = bitcast i32* %181 to i8*
%183 = or i64 %178, 1
%184 = getelementptr [500 x [500 x i32]], [500 x [500 x i32]]* %5, i64 0, i64 %183, i64 0
%185 = bitcast i32* %184 to i8*
%186 = or i64 %178, 2
%187 = getelementptr [500 x [500 x i32]], [500 x [500 x i32]]* %5, i64 0, i64 %186, i64 0
%188 = bitcast i32* %187 to i8*
%189 = or i64 %178, 3
%190 = getelementptr [500 x [500 x i32]], [500 x [500 x i32]]* %5, i64 0, i64 %189, i64 0
%191 = bitcast i32* %190 to i8*
br label %192
192: ; preds = %177, %180
%193 = add nuw nsw i64 %178, 4
%194 = add i64 %179, 4
%195 = icmp eq i64 %194, %168
br i1 %195, label %196, label %177
196: ; preds = %192, %156
%197 = phi i64 [ 0, %156 ], [ %193, %192 ]
%198 = icmp eq i64 %165, 0
br i1 %198, label %209, label %199
199: ; preds = %196, %205
%200 = phi i64 [ %206, %205 ], [ %197, %196 ]
%201 = phi i64 [ %207, %205 ], [ 0, %196 ]
br i1 %158, label %202, label %205
202: ; preds = %199
%203 = getelementptr [500 x [500 x i32]], [500 x [500 x i32]]* %5, i64 0, i64 %200, i64 0
%204 = bitcast i32* %203 to i8*
br label %205
205: ; preds = %202, %199
%206 = add nuw nsw i64 %200, 1
%207 = add i64 %201, 1
%208 = icmp eq i64 %207, %165
br i1 %208, label %209, label %199
209: ; preds = %196, %205, %44, %155
%210 = load i32, i32* @stderr
%211 = call i32 (i32, i8*, ...) @fprintf(i32 %210, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%212 = bitcast [500 x [500 x i32]]* %4 to i32**
%213 = load i32, i32* %7
%214 = load i32, i32* %6
%215 = call i32 @read_file(i8* %13, i32** %212, i32 %213, i32 %214)
%216 = load i32, i32* @stderr
%217 = call i32 (i32, i8*, ...) @fprintf(i32 %216, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %215)
%218 = bitcast [500 x [500 x i32]]* %5 to i32**
%219 = load i32, i32* %7
%220 = load i32, i32* %6
%221 = call i32 @make_accumulation(i32** %212, i32** %218, i32 %219, i32 %220)
%222 = load i32, i32* %7
%223 = load i32, i32* %6
%224 = call i32 @write_accumulation(i32** %218, i32 %222, i32 %223)
ret void
}