#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 */

/* Variables and functions */
double acos(int);
int cos(double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int *pointIndexOnLat(double **, double **, int *, int, int);
int /*<<< orphan*/ printf(char *, int, char *);
int sin(double);
void nearestNeighbor(double **psouLat, double **psouLon, int nSou,
                     double *tarLat, double *tarLon, int *tarNNSouID,
                     double *tarNNDis, int nTar, double maxR) {
  double *souLat = *psouLat;
  double *souLon = *psouLon;
  const double earthRadius = 6367444;
  double maxradian = maxR / earthRadius;
  int nBlockY = 3.14159265358979323846 / maxradian;
  double blockR = 3.14159265358979323846 / nBlockY;
  for (int i = 0; i < nSou; i++) {
    souLat[i] = souLat[i] * 3.14159265358979323846 / 180;
    souLon[i] = souLon[i] * 3.14159265358979323846 / 180;
  }
  for (int i = 0; i < nTar; i++) {
    tarLat[i] = tarLat[i] * 3.14159265358979323846 / 180;
    tarLon[i] = tarLon[i] * 3.14159265358979323846 / 180;
  }
  int *souID;
  if (NULL == (souID = (int *)malloc(sizeof(double) * nSou))) {
    printf("ERROR: Out of memory at line %d in file %s\n", 409,
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/tsccsj/TerraReproject/refs/heads/master/"
           "src/reproject.c");
    exit(1);
  }
  int *souIndex = pointIndexOnLat(psouLat, psouLon, souID, nSou, nBlockY);
  souLat = *psouLat;
  souLon = *psouLon;
  double tLat, tLon;
  double sLat, sLon;
  int blockID;
  int startBlock, endBlock;
  double pDis;
  double nnDis;
  int nnSouID;
  for (int i = 0; i < nTar; i++) {
    tLat = tarLat[i];
    tLon = tarLon[i];
    blockID = (tLat + 3.14159265358979323846 / 2) / blockR;
    startBlock = blockID - 1;
    endBlock = blockID + 1;
    if (startBlock < 0) {
      startBlock = 0;
    }
    if (endBlock > nBlockY - 1) {
      endBlock = nBlockY - 1;
    }
    nnDis = -1;
    for (int j = souIndex[startBlock]; j < souIndex[endBlock + 1]; j++) {
      sLat = souLat[j];
      sLon = souLon[j];
      pDis = acos(sin(tLat) * sin(sLat) +
                  cos(tLat) * cos(sLat) * cos(tLon - sLon));
      if ((nnDis < 0 || nnDis > pDis) && pDis <= maxradian) {
        nnDis = pDis;
        nnSouID = souID[j];
      }
    }
    if (nnDis < 0) {
      tarNNSouID[i] = -1;
      if (tarNNDis != NULL) {
        tarNNDis[i] = -1;
      }
    } else {
      tarNNSouID[i] = nnSouID;
      if (tarNNDis != NULL) {
        tarNNDis[i] = nnDis * earthRadius;
      }
    }
  }
  free(souID);
  free(souIndex);
  return;
}


x86 assembly (clang, -O0):
<nearestNeighbor>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
movsd  0xe3c(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe11(%rip),%xmm0
divsd  -0x58(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x5c(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm1
movsd  0xdf8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    128e <nearestNeighbor+0x10e>
mov    -0x40(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  0xdcc(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xddf(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  0xd9e(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xdb1(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1218 <nearestNeighbor+0x98>
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    130b <nearestNeighbor+0x18b>
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  0xd4f(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xd62(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  0xd21(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xd34(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1295 <nearestNeighbor+0x115>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x78(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    134e <nearestNeighbor+0x1ce>
lea    0xcf5(%rip),%rdi
mov    $0x199,%esi
lea    0xd15(%rip),%rdx
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x5c(%rbp),%r8d
call   1080 <pointIndexOnLat@plt>
mov    %rax,-0x80(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0xc8(%rbp)
mov    -0xc8(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    166a <nearestNeighbor+0x4ea>
mov    -0x20(%rbp),%rax
movslq -0xc8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0xc8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xc3f(%rip),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
divsd  -0x68(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
cmpl   $0x0,-0xa8(%rbp)
jge    141d <nearestNeighbor+0x29d>
movl   $0x0,-0xa8(%rbp)
mov    -0xac(%rbp),%eax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    143d <nearestNeighbor+0x2bd>
mov    -0x5c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xac(%rbp)
movsd  0xbd3(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x80(%rbp),%rax
movslq -0xa8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xcc(%rbp),%eax
mov    -0x80(%rbp),%rcx
mov    -0xac(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    15c2 <nearestNeighbor+0x442>
mov    -0x40(%rbp),%rax
movslq -0xcc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x48(%rbp),%rax
movslq -0xcc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
call   1060 <sin@plt>
mov    %eax,-0xdc(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
call   1060 <sin@plt>
mov    %eax,%ecx
mov    -0xdc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xd4(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
call   1090 <cos@plt>
mov    %eax,-0xd8(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
call   1090 <cos@plt>
mov    %eax,%ecx
mov    -0xd8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xd0(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
call   1090 <cos@plt>
mov    -0xd4(%rbp),%edi
mov    %eax,%ecx
mov    -0xd0(%rbp),%eax
imul   %ecx,%eax
add    %eax,%edi
call   1050 <acos@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
ja     156e <nearestNeighbor+0x3ee>
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    15a9 <nearestNeighbor+0x429>
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     15a9 <nearestNeighbor+0x429>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x78(%rbp),%rax
movslq -0xcc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc4(%rbp)
jmp    15ae <nearestNeighbor+0x42e>
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    1461 <nearestNeighbor+0x2e1>
xorps  %xmm0,%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    160d <nearestNeighbor+0x48d>
mov    -0x30(%rbp),%rax
movslq -0xc8(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
cmpq   $0x0,0x10(%rbp)
je     1608 <nearestNeighbor+0x488>
mov    0x10(%rbp),%rax
movslq -0xc8(%rbp),%rcx
movsd  0xa15(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1651 <nearestNeighbor+0x4d1>
mov    -0xc4(%rbp),%edx
mov    -0x30(%rbp),%rax
movslq -0xc8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmpq   $0x0,0x10(%rbp)
je     164c <nearestNeighbor+0x4cc>
movsd  0x9d4(%rip),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0xc8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1651 <nearestNeighbor+0x4d1>
jmp    1656 <nearestNeighbor+0x4d6>
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
jmp    138a <nearestNeighbor+0x20a>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearestNeighbor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
movsd  %xmm0,0x28(%rsp)
mov    %r9,%r15
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%r13
mov    0xd8(%rsp),%r14d
mov    0xd0(%rsp),%rax
mov    %rax,0x18(%rsp)
movsd  0xe49(%rip),%xmm3
test   %edx,%edx
jle    122d <nearestNeighbor+0xad>
mov    0x0(%r13),%rax
mov    (%r12),%rbx
mov    %ebp,%edx
cmp    $0x1,%ebp
je     11ec <nearestNeighbor+0x6c>
lea    (%rbx,%rdx,8),%rsi
cmp    %rsi,%rax
jae    1592 <nearestNeighbor+0x412>
lea    (%rax,%rdx,8),%rsi
cmp    %rsi,%rbx
jae    1592 <nearestNeighbor+0x412>
xor    %esi,%esi
movsd  0xe1a(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
movsd  (%rax,%rsi,8),%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rsi,8)
movsd  (%rbx,%rsi,8),%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%rdx
jne    1200 <nearestNeighbor+0x80>
mov    %r14d,%esi
test   %r14d,%r14d
jle    128f <nearestNeighbor+0x10f>
cmp    $0x1,%r14d
je     1255 <nearestNeighbor+0xd5>
lea    (%r8,%rsi,8),%rax
cmp    %rcx,%rax
jbe    15eb <nearestNeighbor+0x46b>
lea    (%rcx,%rsi,8),%rax
cmp    %r8,%rax
jbe    15eb <nearestNeighbor+0x46b>
xor    %eax,%eax
movsd  0xdb1(%rip),%xmm0
nop
movsd  (%rcx,%rax,8),%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx,%rax,8)
movsd  (%r8,%rax,8),%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r8,%rax,8)
add    $0x1,%rax
cmp    %rax,%rsi
jne    1260 <nearestNeighbor+0xe0>
mov    %rsi,0x10(%rsp)
mov    %rcx,0x20(%rsp)
mov    %r8,0x70(%rsp)
lea    0x0(,%rbp,8),%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     164d <nearestNeighbor+0x4cd>
movsd  0x28(%rsp),%xmm0
divsd  0xd3f(%rip),%xmm0
movsd  0xd3f(%rip),%xmm1
movsd  %xmm0,0x28(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,0x60(%rsp)
cvttsd2si %xmm1,%ebx
mov    %r13,%rdi
mov    %r12,%rsi
mov    %rax,0x50(%rsp)
mov    %rax,%rdx
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1080 <pointIndexOnLat@plt>
movsd  0xd0b(%rip),%xmm1
mov    %rax,%rbp
test   %r14d,%r14d
mov    0x20(%rsp),%r8
mov    0x18(%rsp),%r10
mov    0x10(%rsp),%r9
jle    156f <nearestNeighbor+0x3ef>
mov    %ebx,%esi
cvttpd2dq 0x60(%rsp),%xmm0
cvtdq2pd %xmm0,%xmm0
divsd  %xmm0,%xmm1
mov    0x0(%r13),%rax
mov    %rax,0x78(%rsp)
mov    (%r12),%r13
add    $0xffffffff,%esi
xor    %edi,%edi
movsd  0xcd6(%rip),%xmm2
movsd  0xcd6(%rip),%xmm3
mov    %r15,0x40(%rsp)
movsd  %xmm1,0x38(%rsp)
mov    %esi,0xc(%rsp)
jmp    13b7 <nearestNeighbor+0x237>
nopl   0x0(%rax,%rax,1)
mov    0x40(%rsp),%r15
mov    0x20(%rsp),%r8
mov    0x18(%rsp),%r10
movsd  0x38(%rsp),%xmm1
mov    0x10(%rsp),%r9
mov    0xc(%rsp),%esi
mov    0x48(%rsp),%rdi
movsd  0xc8d(%rip),%xmm2
movsd  0xc8d(%rip),%xmm3
movl   $0xffffffff,(%r15,%rdi,4)
ff
movapd %xmm3,%xmm4
test   %r10,%r10
je     13aa <nearestNeighbor+0x22a>
movsd  %xmm4,(%r10,%rdi,8)
add    $0x1,%rdi
cmp    %r9,%rdi
je     156f <nearestNeighbor+0x3ef>
movsd  (%r8,%rdi,8),%xmm0
movsd  %xmm0,0x58(%rsp)
addsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
lea    0x1(%rax),%ecx
test   %eax,%eax
mov    $0x1,%edx
cmovg  %eax,%edx
add    $0xffffffff,%edx
cmp    %eax,%esi
cmovle %esi,%ecx
movslq 0x0(%rbp,%rdx,4),%r12
movslq %ecx,%rbx
cmp    0x4(%rbp,%rbx,4),%r12d
jge    1393 <nearestNeighbor+0x213>
mov    0x70(%rsp),%rax
mov    %rdi,0x48(%rsp)
movsd  (%rax,%rdi,8),%xmm0
movsd  %xmm0,0x80(%rsp)
add    $0x1,%rbx
movapd %xmm3,%xmm4
jmp    1432 <nearestNeighbor+0x2b2>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12
movslq 0x0(%rbp,%rbx,4),%rax
cmp    %rax,%r12
jge    1510 <nearestNeighbor+0x390>
movsd  %xmm4,0x90(%rsp)
mov    0x78(%rsp),%rax
movsd  (%rax,%r12,8),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x80(%rsp),%xmm0
subsd  0x0(%r13,%r12,8),%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0x58(%rsp),%xmm0
call   1060 <sin@plt>
mov    %eax,%r14d
movsd  0x60(%rsp),%xmm0
call   1060 <sin@plt>
imul   %eax,%r14d
movsd  0x58(%rsp),%xmm0
call   1090 <cos@plt>
mov    %eax,%r15d
movsd  0x60(%rsp),%xmm0
call   1090 <cos@plt>
imul   %eax,%r15d
movsd  0x88(%rsp),%xmm0
call   1090 <cos@plt>
imul   %eax,%r15d
add    %r14d,%r15d
mov    %r15d,%edi
call   1050 <acos@plt>
movsd  0x90(%rsp),%xmm4
xorpd  %xmm1,%xmm1
ucomisd %xmm4,%xmm1
setbe  %al
ucomisd %xmm0,%xmm4
setbe  %cl
test   %cl,%al
jne    1420 <nearestNeighbor+0x2a0>
movsd  0x28(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1420 <nearestNeighbor+0x2a0>
mov    0x50(%rsp),%rax
mov    (%rax,%r12,4),%eax
mov    %eax,0x34(%rsp)
movapd %xmm0,%xmm4
jmp    1420 <nearestNeighbor+0x2a0>
cs nopw 0x0(%rax,%rax,1)
nop
xorpd  %xmm0,%xmm0
ucomisd %xmm4,%xmm0
ja     1360 <nearestNeighbor+0x1e0>
mov    0x40(%rsp),%r15
mov    0x48(%rsp),%rdi
mov    0x34(%rsp),%eax
mov    %eax,(%r15,%rdi,4)
mov    0x18(%rsp),%r10
test   %r10,%r10
mov    0x20(%rsp),%r8
movsd  0x38(%rsp),%xmm1
mov    0x10(%rsp),%r9
mov    0xc(%rsp),%esi
movsd  0xac4(%rip),%xmm2
movsd  0xac4(%rip),%xmm3
je     13aa <nearestNeighbor+0x22a>
mulsd  0xa96(%rip),%xmm4
jmp    13a4 <nearestNeighbor+0x224>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
mov    %edx,%esi
and    $0xfffffffe,%esi
xor    %edi,%edi
movapd 0xa8f(%rip),%xmm0
movapd 0xa97(%rip),%xmm1
nopl   0x0(%rax)
movupd (%rax,%rdi,8),%xmm2
mulpd  %xmm0,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rax,%rdi,8)
movupd (%rbx,%rdi,8),%xmm2
mulpd  %xmm0,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rbx,%rdi,8)
add    $0x2,%rdi
cmp    %rdi,%rsi
jne    15b0 <nearestNeighbor+0x430>
cmp    %rdx,%rsi
je     122d <nearestNeighbor+0xad>
jmp    11ee <nearestNeighbor+0x6e>
mov    %esi,%eax
and    $0xfffffffe,%eax
xor    %edx,%edx
movapd 0xa36(%rip),%xmm0
movapd 0xa3e(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd (%rcx,%rdx,8),%xmm2
mulpd  %xmm0,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rcx,%rdx,8)
movupd (%r8,%rdx,8),%xmm2
mulpd  %xmm0,%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%r8,%rdx,8)
add    $0x2,%rdx
cmp    %rdx,%rax
jne    1610 <nearestNeighbor+0x490>
cmp    %rsi,%rax
je     128f <nearestNeighbor+0x10f>
jmp    1257 <nearestNeighbor+0xd7>
lea    0x9fc(%rip),%rdi
lea    0xa21(%rip),%rdx
mov    $0x199,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"ERROR: Out of memory at line %d in file %s\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tsccsj/TerraReproject/refs/heads/master/src/reproject.c\00"
define void @nearestNeighbor(double** %0, double** %1, i32 %2, double* %3, double* %4, i32* %5, double* %6, i32 %7, double %8) {
%10 = alloca double**
%11 = alloca double**
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32*
%16 = alloca double*
%17 = alloca i32
%18 = alloca double
%19 = alloca double*
%20 = alloca double*
%21 = alloca double
%22 = alloca double
%23 = alloca i32
%24 = alloca double
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32*
%28 = alloca i32*
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca double
%37 = alloca double
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
store double** %0, double*** %10
store double** %1, double*** %11
store i32 %2, i32* %12
store double* %3, double** %13
store double* %4, double** %14
store i32* %5, i32** %15
store double* %6, double** %16
store i32 %7, i32* %17
store double %8, double* %18
%41 = load double**, double*** %10
%42 = load double*, double** %41
store double* %42, double** %19
%43 = load double**, double*** %11
%44 = load double*, double** %43
store double* %44, double** %20
store double 0x41584A3500000000, double* %21
%45 = load double, double* %18
%46 = fdiv double %45, 0x41584A3500000000
store double %46, double* %22
%47 = load double, double* %22
%48 = fdiv double 0x400921FB54442D18, %47
%49 = fptosi double %48 to i32
store i32 %49, i32* %23
%50 = load i32, i32* %23
%51 = sitofp i32 %50 to double
%52 = fdiv double 0x400921FB54442D18, %51
store double %52, double* %24
store i32 0, i32* %25
br label %53
53: ; preds = %80, %9
%54 = load i32, i32* %25
%55 = load i32, i32* %12
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %83
57: ; preds = %53
%58 = load double*, double** %19
%59 = load i32, i32* %25
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
%62 = load double, double* %61
%63 = fmul double %62, 0x400921FB54442D18
%64 = fdiv double %63, 1.800000e+02
%65 = load double*, double** %19
%66 = load i32, i32* %25
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
store double %64, double* %68
%69 = load double*, double** %20
%70 = load i32, i32* %25
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = fmul double %73, 0x400921FB54442D18
%75 = fdiv double %74, 1.800000e+02
%76 = load double*, double** %20
%77 = load i32, i32* %25
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
store double %75, double* %79
br label %80
80: ; preds = %57
%81 = load i32, i32* %25
%82 = add nsw i32 %81, 1
store i32 %82, i32* %25
br label %53
83: ; preds = %53
store i32 0, i32* %26
br label %84
84: ; preds = %111, %83
%85 = load i32, i32* %26
%86 = load i32, i32* %17
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %114
88: ; preds = %84
%89 = load double*, double** %13
%90 = load i32, i32* %26
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
%93 = load double, double* %92
%94 = fmul double %93, 0x400921FB54442D18
%95 = fdiv double %94, 1.800000e+02
%96 = load double*, double** %13
%97 = load i32, i32* %26
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
store double %95, double* %99
%100 = load double*, double** %14
%101 = load i32, i32* %26
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %100, i64 %102
%104 = load double, double* %103
%105 = fmul double %104, 0x400921FB54442D18
%106 = fdiv double %105, 1.800000e+02
%107 = load double*, double** %14
%108 = load i32, i32* %26
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
store double %106, double* %110
br label %111
111: ; preds = %88
%112 = load i32, i32* %26
%113 = add nsw i32 %112, 1
store i32 %113, i32* %26
br label %84
114: ; preds = %84
%115 = load i32, i32* %12
%116 = sext i32 %115 to i64
%117 = mul i64 8, %116
%118 = trunc i64 %117 to i32
%119 = call i64 @malloc(i32 %118)
%120 = inttoptr i64 %119 to i32*
store i32* %120, i32** %27
%121 = icmp eq i32* null, %120
br i1 %121, label %122, label %125
122: ; preds = %114
%123 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 409, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0))
%124 = call i32 @exit(i32 1)
unreachable
125: ; preds = %114
%126 = load double**, double*** %10
%127 = load double**, double*** %11
%128 = load i32*, i32** %27
%129 = load i32, i32* %12
%130 = load i32, i32* %23
%131 = call i32* @pointIndexOnLat(double** %126, double** %127, i32* %128, i32 %129, i32 %130)
store i32* %131, i32** %28
%132 = load double**, double*** %10
%133 = load double*, double** %132
store double* %133, double** %19
%134 = load double**, double*** %11
%135 = load double*, double** %134
store double* %135, double** %20
store i32 0, i32* %39
br label %136
136: ; preds = %268, %125
%137 = load i32, i32* %39
%138 = load i32, i32* %17
%139 = icmp slt i32 %137, %138
br i1 %139, label %140, label %271
140: ; preds = %136
%141 = load double*, double** %13
%142 = load i32, i32* %39
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
store double %145, double* %29
%146 = load double*, double** %14
%147 = load i32, i32* %39
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %146, i64 %148
%150 = load double, double* %149
store double %150, double* %30
%151 = load double, double* %29
%152 = fadd double %151, 0x3FF921FB54442D18
%153 = load double, double* %24
%154 = fdiv double %152, %153
%155 = fptosi double %154 to i32
store i32 %155, i32* %33
%156 = load i32, i32* %33
%157 = sub nsw i32 %156, 1
store i32 %157, i32* %34
%158 = load i32, i32* %33
%159 = add nsw i32 %158, 1
store i32 %159, i32* %35
%160 = load i32, i32* %34
%161 = icmp slt i32 %160, 0
br i1 %161, label %162, label %163
162: ; preds = %140
store i32 0, i32* %34
br label %163
163: ; preds = %162, %140
%164 = load i32, i32* %35
%165 = load i32, i32* %23
%166 = sub nsw i32 %165, 1
%167 = icmp sgt i32 %164, %166
br i1 %167, label %168, label %171
168: ; preds = %163
%169 = load i32, i32* %23
%170 = sub nsw i32 %169, 1
store i32 %170, i32* %35
br label %171
171: ; preds = %168, %163
store double -1.000000e+00, double* %37
%172 = load i32*, i32** %28
%173 = load i32, i32* %34
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i32, i32* %172, i64 %174
%176 = load i32, i32* %175
store i32 %176, i32* %40
br label %177
177: ; preds = %232, %171
%178 = load i32, i32* %40
%179 = load i32*, i32** %28
%180 = load i32, i32* %35
%181 = add nsw i32 %180, 1
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds i32, i32* %179, i64 %182
%184 = load i32, i32* %183
%185 = icmp slt i32 %178, %184
br i1 %185, label %186, label %235
186: ; preds = %177
%187 = load double*, double** %19
%188 = load i32, i32* %40
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
%191 = load double, double* %190
store double %191, double* %31
%192 = load double*, double** %20
%193 = load i32, i32* %40
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %192, i64 %194
%196 = load double, double* %195
store double %196, double* %32
%197 = load double, double* %29
%198 = call i32 @sin(double %197)
%199 = load double, double* %31
%200 = call i32 @sin(double %199)
%201 = mul nsw i32 %198, %200
%202 = load double, double* %29
%203 = call i32 @cos(double %202)
%204 = load double, double* %31
%205 = call i32 @cos(double %204)
%206 = mul nsw i32 %203, %205
%207 = load double, double* %30
%208 = load double, double* %32
%209 = fsub double %207, %208
%210 = call i32 @cos(double %209)
%211 = mul nsw i32 %206, %210
%212 = add nsw i32 %201, %211
%213 = call double @acos(i32 %212)
store double %213, double* %36
%214 = load double, double* %37
%215 = fcmp olt double %214, 0.000000e+00
br i1 %215, label %220, label %216
216: ; preds = %186
%217 = load double, double* %37
%218 = load double, double* %36
%219 = fcmp ogt double %217, %218
br i1 %219, label %220, label %231
220: ; preds = %216, %186
%221 = load double, double* %36
%222 = load double, double* %22
%223 = fcmp ole double %221, %222
br i1 %223, label %224, label %231
224: ; preds = %220
%225 = load double, double* %36
store double %225, double* %37
%226 = load i32*, i32** %27
%227 = load i32, i32* %40
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i32, i32* %226, i64 %228
%230 = load i32, i32* %229
store i32 %230, i32* %38
br label %231
231: ; preds = %224, %220, %216
br label %232
232: ; preds = %231
%233 = load i32, i32* %40
%234 = add nsw i32 %233, 1
store i32 %234, i32* %40
br label %177
235: ; preds = %177
%236 = load double, double* %37
%237 = fcmp olt double %236, 0.000000e+00
br i1 %237, label %238, label %251
238: ; preds = %235
%239 = load i32*, i32** %15
%240 = load i32, i32* %39
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i32, i32* %239, i64 %241
store i32 -1, i32* %242
%243 = load double*, double** %16
%244 = icmp ne double* %243, null
br i1 %244, label %245, label %250
245: ; preds = %238
%246 = load double*, double** %16
%247 = load i32, i32* %39
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds double, double* %246, i64 %248
store double -1.000000e+00, double* %249
br label %250
250: ; preds = %245, %238
br label %267
251: ; preds = %235
%252 = load i32, i32* %38
%253 = load i32*, i32** %15
%254 = load i32, i32* %39
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds i32, i32* %253, i64 %255
store i32 %252, i32* %256
%257 = load double*, double** %16
%258 = icmp ne double* %257, null
br i1 %258, label %259, label %266
259: ; preds = %251
%260 = load double, double* %37
%261 = fmul double %260, 0x41584A3500000000
%262 = load double*, double** %16
%263 = load i32, i32* %39
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds double, double* %262, i64 %264
store double %261, double* %265
br label %266
266: ; preds = %259, %251
br label %267
267: ; preds = %266, %250
br label %268
268: ; preds = %267
%269 = load i32, i32* %39
%270 = add nsw i32 %269, 1
store i32 %270, i32* %39
br label %136
271: ; preds = %136
%272 = load i32*, i32** %27
%273 = call i32 @free(i32* %272)
%274 = load i32*, i32** %28
%275 = call i32 @free(i32* %274)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"ERROR: Out of memory at line %d in file %s\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tsccsj/TerraReproject/refs/heads/master/src/reproject.c\00"
define void @nearestNeighbor(double** %0, double** %1, i32 %2, double* nocapture %3, double* nocapture %4, i32* nocapture writeonly %5, double* writeonly %6, i32 %7, double %8) {
%10 = load double*, double** %0
%11 = load double*, double** %1
%12 = fdiv double %8, 0x41584A3500000000
%13 = fdiv double 0x400921FB54442D18, %12
%14 = fptosi double %13 to i32
%15 = sitofp i32 %14 to double
%16 = fdiv double 0x400921FB54442D18, %15
%17 = icmp sgt i32 %2, 0
br i1 %17, label %18, label %49
18: ; preds = %9
%19 = zext i32 %2 to i64
%20 = icmp eq i32 %2, 1
br i1 %20, label %47, label %21
21: ; preds = %18
%22 = getelementptr double, double* %10, i64 %19
%23 = getelementptr double, double* %11, i64 %19
%24 = icmp ult double* %10, %23
%25 = icmp ult double* %11, %22
%26 = and i1 %24, %25
br i1 %26, label %47, label %27
27: ; preds = %21
%28 = and i64 %19, 4294967294
br label %29
29: ; preds = %29, %27
%30 = phi i64 [ 0, %27 ], [ %43, %29 ]
%31 = getelementptr inbounds double, double* %10, i64 %30
%32 = bitcast double* %31 to <2 x double>*
%33 = load <2 x double>, <2 x double>* %32
%34 = fmul <2 x double> %33, <double 0x400921FB54442D18, double 0x400921FB54442D18>
%35 = fdiv <2 x double> %34, <double 1.800000e+02, double 1.800000e+02>
%36 = bitcast double* %31 to <2 x double>*
store <2 x double> %35, <2 x double>* %36
%37 = getelementptr inbounds double, double* %11, i64 %30
%38 = bitcast double* %37 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38
%40 = fmul <2 x double> %39, <double 0x400921FB54442D18, double 0x400921FB54442D18>
%41 = fdiv <2 x double> %40, <double 1.800000e+02, double 1.800000e+02>
%42 = bitcast double* %37 to <2 x double>*
store <2 x double> %41, <2 x double>* %42
%43 = add nuw i64 %30, 2
%44 = icmp eq i64 %43, %28
br i1 %44, label %45, label %29
45: ; preds = %29
%46 = icmp eq i64 %28, %19
br i1 %46, label %49, label %47
47: ; preds = %21, %18, %45
%48 = phi i64 [ 0, %21 ], [ 0, %18 ], [ %28, %45 ]
br label %82
49: ; preds = %82, %45, %9
%50 = icmp sgt i32 %7, 0
br i1 %50, label %51, label %94
51: ; preds = %49
%52 = zext i32 %7 to i64
%53 = icmp eq i32 %7, 1
br i1 %53, label %80, label %54
54: ; preds = %51
%55 = getelementptr double, double* %3, i64 %52
%56 = getelementptr double, double* %4, i64 %52
%57 = icmp ugt double* %56, %3
%58 = icmp ugt double* %55, %4
%59 = and i1 %57, %58
br i1 %59, label %80, label %60
60: ; preds = %54
%61 = and i64 %52, 4294967294
br label %62
62: ; preds = %62, %60
%63 = phi i64 [ 0, %60 ], [ %76, %62 ]
%64 = getelementptr inbounds double, double* %3, i64 %63
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = fmul <2 x double> %66, <double 0x400921FB54442D18, double 0x400921FB54442D18>
%68 = fdiv <2 x double> %67, <double 1.800000e+02, double 1.800000e+02>
%69 = bitcast double* %64 to <2 x double>*
store <2 x double> %68, <2 x double>* %69
%70 = getelementptr inbounds double, double* %4, i64 %63
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = fmul <2 x double> %72, <double 0x400921FB54442D18, double 0x400921FB54442D18>
%74 = fdiv <2 x double> %73, <double 1.800000e+02, double 1.800000e+02>
%75 = bitcast double* %70 to <2 x double>*
store <2 x double> %74, <2 x double>* %75
%76 = add nuw i64 %63, 2
%77 = icmp eq i64 %76, %61
br i1 %77, label %78, label %62
78: ; preds = %62
%79 = icmp eq i64 %61, %52
br i1 %79, label %94, label %80
80: ; preds = %54, %51, %78
%81 = phi i64 [ 0, %54 ], [ 0, %51 ], [ %61, %78 ]
br label %99
82: ; preds = %47, %82
%83 = phi i64 [ %92, %82 ], [ %48, %47 ]
%84 = getelementptr inbounds double, double* %10, i64 %83
%85 = load double, double* %84
%86 = fmul double %85, 0x400921FB54442D18
%87 = fdiv double %86, 1.800000e+02
store double %87, double* %84
%88 = getelementptr inbounds double, double* %11, i64 %83
%89 = load double, double* %88
%90 = fmul double %89, 0x400921FB54442D18
%91 = fdiv double %90, 1.800000e+02
store double %91, double* %88
%92 = add nuw nsw i64 %83, 1
%93 = icmp eq i64 %92, %19
br i1 %93, label %49, label %82
94: ; preds = %99, %78, %49
%95 = shl i32 %2, 3
%96 = tail call i64 @malloc(i32 %95)
%97 = inttoptr i64 %96 to i32*
%98 = icmp eq i64 %96, 0
br i1 %98, label %111, label %114
99: ; preds = %80, %99
%100 = phi i64 [ %109, %99 ], [ %81, %80 ]
%101 = getelementptr inbounds double, double* %3, i64 %100
%102 = load double, double* %101
%103 = fmul double %102, 0x400921FB54442D18
%104 = fdiv double %103, 1.800000e+02
store double %104, double* %101
%105 = getelementptr inbounds double, double* %4, i64 %100
%106 = load double, double* %105
%107 = fmul double %106, 0x400921FB54442D18
%108 = fdiv double %107, 1.800000e+02
store double %108, double* %105
%109 = add nuw nsw i64 %100, 1
%110 = icmp eq i64 %109, %52
br i1 %110, label %94, label %99
111: ; preds = %94
%112 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 409, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0))
%113 = tail call i32 @exit(i32 1)
unreachable
114: ; preds = %94
%115 = tail call i32* @pointIndexOnLat(double** %0, double** %1, i32* %97, i32 %2, i32 %14)
%116 = load double*, double** %0
%117 = load double*, double** %1
br i1 %50, label %118, label %122
118: ; preds = %114
%119 = add nsw i32 %14, -1
%120 = icmp eq double* %6, null
%121 = zext i32 %7 to i64
br label %125
122: ; preds = %198, %114
%123 = tail call i32 @free(i32* %97)
%124 = tail call i32 @free(i32* %115)
ret void
125: ; preds = %118, %198
%126 = phi i64 [ 0, %118 ], [ %200, %198 ]
%127 = phi i32 [ undef, %118 ], [ %199, %198 ]
%128 = getelementptr inbounds double, double* %3, i64 %126
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %4, i64 %126
%131 = load double, double* %130
%132 = fadd double %129, 0x3FF921FB54442D18
%133 = fdiv double %132, %16
%134 = fptosi double %133 to i32
%135 = add nsw i32 %134, 1
%136 = icmp sgt i32 %134, 1
%137 = select i1 %136, i32 %134, i32 1
%138 = add nsw i32 %137, -1
%139 = icmp sgt i32 %119, %134
%140 = select i1 %139, i32 %135, i32 %119
%141 = zext i32 %138 to i64
%142 = getelementptr inbounds i32, i32* %115, i64 %141
%143 = load i32, i32* %142
%144 = add nsw i32 %140, 1
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i32, i32* %115, i64 %145
%147 = load i32, i32* %146
%148 = icmp slt i32 %143, %147
br i1 %148, label %149, label %187
149: ; preds = %125
%150 = sext i32 %143 to i64
br label %153
151: ; preds = %180
%152 = fcmp olt double %181, 0.000000e+00
br i1 %152, label %187, label %190
153: ; preds = %149, %180
%154 = phi i64 [ %150, %149 ], [ %183, %180 ]
%155 = phi i32 [ %127, %149 ], [ %182, %180 ]
%156 = phi double [ -1.000000e+00, %149 ], [ %181, %180 ]
%157 = getelementptr inbounds double, double* %116, i64 %154
%158 = load double, double* %157
%159 = getelementptr inbounds double, double* %117, i64 %154
%160 = load double, double* %159
%161 = tail call i32 @sin(double %129)
%162 = tail call i32 @sin(double %158)
%163 = mul nsw i32 %162, %161
%164 = tail call i32 @cos(double %129)
%165 = tail call i32 @cos(double %158)
%166 = mul nsw i32 %165, %164
%167 = fsub double %131, %160
%168 = tail call i32 @cos(double %167)
%169 = mul nsw i32 %166, %168
%170 = add nsw i32 %169, %163
%171 = tail call double @acos(i32 %170)
%172 = fcmp uge double %156, 0.000000e+00
%173 = fcmp ule double %156, %171
%174 = select i1 %172, i1 %173, i1 false
%175 = fcmp ugt double %171, %12
%176 = select i1 %174, i1 true, i1 %175
br i1 %176, label %180, label %177
177: ; preds = %153
%178 = getelementptr inbounds i32, i32* %97, i64 %154
%179 = load i32, i32* %178
br label %180
180: ; preds = %153, %177
%181 = phi double [ %171, %177 ], [ %156, %153 ]
%182 = phi i32 [ %179, %177 ], [ %155, %153 ]
%183 = add nsw i64 %154, 1
%184 = load i32, i32* %146
%185 = sext i32 %184 to i64
%186 = icmp slt i64 %183, %185
br i1 %186, label %153, label %151
187: ; preds = %125, %151
%188 = phi i32 [ %182, %151 ], [ %127, %125 ]
%189 = getelementptr inbounds i32, i32* %5, i64 %126
store i32 -1, i32* %189
br i1 %120, label %198, label %194
190: ; preds = %151
%191 = getelementptr inbounds i32, i32* %5, i64 %126
store i32 %182, i32* %191
br i1 %120, label %198, label %192
192: ; preds = %190
%193 = fmul double %181, 0x41584A3500000000
br label %194
194: ; preds = %187, %192
%195 = phi double [ %193, %192 ], [ -1.000000e+00, %187 ]
%196 = phi i32 [ %182, %192 ], [ %188, %187 ]
%197 = getelementptr inbounds double, double* %6, i64 %126
store double %195, double* %197
br label %198
198: ; preds = %194, %187, %190
%199 = phi i32 [ %188, %187 ], [ %182, %190 ], [ %196, %194 ]
%200 = add nuw nsw i64 %126, 1
%201 = icmp eq i64 %200, %121
br i1 %201, label %122, label %125
}