int genThinoutGrid(int gridID1, int xinc, int yinc) {
  int ilon, ilat, olon, olat;
  int gridID2, gridtype;
  int nlon1, nlat1;
  int gridsize2, nlon2, nlat2;
  double *xvals1, *yvals1, *xvals2, *yvals2;
  gridtype = gridInqType(gridID1);
  nlon1 = gridInqXsize(gridID1);
  nlat1 = gridInqYsize(gridID1);
  nlon2 = nlon1 / xinc;
  nlat2 = nlat1 / yinc;
  if (nlon1 % xinc)
    nlon2++;
  if (nlat1 % yinc)
    nlat2++;
  gridsize2 = nlon2 * nlat2;
  gridID2 = gridCreate(4, gridsize2);
  gridDefXsize(gridID2, nlon2);
  gridDefYsize(gridID2, nlat2);
  if (gridtype == 2 || gridtype == 4) {
    xvals1 = (double *)Malloc(
        __func__,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Intgrid.c",
        56, (nlon1 * sizeof(double)));
    yvals1 = (double *)Malloc(
        __func__,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Intgrid.c",
        57, (nlat1 * sizeof(double)));
    xvals2 = (double *)Malloc(
        __func__,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Intgrid.c",
        58, (nlon2 * sizeof(double)));
    yvals2 = (double *)Malloc(
        __func__,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Intgrid.c",
        59, (nlat2 * sizeof(double)));
    gridInqXvals(gridID1, xvals1);
    gridInqYvals(gridID1, yvals1);
    olat = 0;
    for (ilat = 0; ilat < nlat1; ilat += yinc) {
      yvals2[olat] = yvals1[ilat];
      olat++;
    }
    olon = 0;
    for (ilon = 0; ilon < nlon1; ilon += xinc) {
      xvals2[olon] = xvals1[ilon];
      olon++;
    }
    gridDefXvals(gridID2, xvals2);
    gridDefYvals(gridID2, yvals2);
  } else {
    cdoAbort("Unsupported grid: %s", gridNamePtr(gridtype));
  }
  return gridID2;
}


x86 assembly (clang, -O0):
<genThinoutGrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10e0 <gridInqType@plt>
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1080 <gridInqXsize@plt>
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1060 <gridInqYsize@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     1235 <genThinoutGrid+0x65>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     124e <genThinoutGrid+0x7e>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%esi
mov    $0x4,%edi
mov    $0x0,%al
call   1040 <gridCreate@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    $0x0,%al
call   1090 <gridDefXsize@plt>
mov    -0x20(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    $0x0,%al
call   10c0 <gridDefYsize@plt>
cmpl   $0x2,-0x24(%rbp)
je     1298 <genThinoutGrid+0xc8>
cmpl   $0x4,-0x24(%rbp)
jne    140b <genThinoutGrid+0x23b>
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
lea    0xd59(%rip),%rdi
lea    0xd61(%rip),%rsi
mov    $0x38,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x40(%rbp)
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
lea    0xd31(%rip),%rdi
lea    0xd39(%rip),%rsi
mov    $0x39,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x48(%rbp)
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
lea    0xd09(%rip),%rdi
lea    0xd11(%rip),%rsi
mov    $0x3a,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x50(%rbp)
movslq -0x38(%rbp),%rcx
shl    $0x3,%rcx
lea    0xce1(%rip),%rdi
lea    0xce9(%rip),%rsi
mov    $0x3b,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x58(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x40(%rbp),%rsi
mov    $0x0,%al
call   10b0 <gridInqXvals@plt>
mov    -0x4(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1070 <gridInqYvals@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    139f <genThinoutGrid+0x1cf>
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1362 <genThinoutGrid+0x192>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13ea <genThinoutGrid+0x21a>
mov    -0x40(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    13ad <genThinoutGrid+0x1dd>
mov    -0x20(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    $0x0,%al
call   10f0 <gridDefXvals@plt>
mov    -0x20(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    $0x0,%al
call   1050 <gridDefYvals@plt>
jmp    1425 <genThinoutGrid+0x255>
mov    -0x24(%rbp),%edi
mov    $0x0,%al
call   10d0 <gridNamePtr@plt>
mov    %eax,%esi
lea    0xc74(%rip),%rdi
mov    $0x0,%al
call   10a0 <cdoAbort@plt>
mov    -0x20(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genThinoutGrid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%r15d
xor    %eax,%eax
call   10e0 <gridInqType@plt>
mov    %eax,%r13d
mov    %r15d,%edi
xor    %eax,%eax
call   1080 <gridInqXsize@plt>
mov    %eax,%ebp
mov    %r15d,%edi
xor    %eax,%eax
call   1060 <gridInqYsize@plt>
mov    %eax,%r12d
mov    %ebp,0x4(%rsp)
mov    %ebp,%eax
cltd
mov    %ebx,0xc(%rsp)
idiv   %ebx
mov    %eax,%ebx
cmp    $0x1,%edx
sbb    $0xffffffff,%ebx
mov    %r12d,%eax
cltd
mov    %r14d,0x8(%rsp)
idiv   %r14d
mov    %eax,%r14d
cmp    $0x1,%edx
sbb    $0xffffffff,%r14d
mov    %r14d,%esi
imul   %ebx,%esi
mov    $0x4,%edi
xor    %eax,%eax
call   1040 <gridCreate@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1090 <gridDefXsize@plt>
mov    %ebp,(%rsp)
mov    %ebp,%edi
mov    %r14d,%esi
xor    %eax,%eax
call   10c0 <gridDefYsize@plt>
cmp    $0x4,%r13d
je     1272 <genThinoutGrid+0xa2>
cmp    $0x2,%r13d
jne    137d <genThinoutGrid+0x1ad>
movslq 0x4(%rsp),%rcx
shl    $0x3,%rcx
lea    0xd7e(%rip),%r13
lea    0xd86(%rip),%rsi
mov    %r13,%rdi
mov    $0x38,%edx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rbp
movslq %r12d,%rcx
shl    $0x3,%rcx
mov    %r13,%rdi
lea    0xd63(%rip),%rsi
mov    $0x39,%edx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%r13
movslq %ebx,%rcx
shl    $0x3,%rcx
lea    0xd37(%rip),%rdi
lea    0xd3f(%rip),%rsi
mov    $0x3a,%edx
xor    %eax,%eax
call   1030 <Malloc@plt>
mov    %eax,%ebx
movslq %r14d,%rcx
shl    $0x3,%rcx
lea    0xd14(%rip),%rdi
lea    0xd1c(%rip),%rsi
mov    $0x3b,%edx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%r14
mov    %r15d,%edi
mov    %rbp,0x10(%rsp)
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <gridInqXvals@plt>
mov    %r15d,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <gridInqYvals@plt>
test   %r12d,%r12d
jle    157d <genThinoutGrid+0x3ad>
mov    0x8(%rsp),%ecx
movslq %ecx,%r11
cmp    %ecx,%r12d
cmovle %ecx,%r12d
add    $0xffffffff,%r12d
xor    %esi,%esi
mov    %r12d,%eax
xor    %edx,%edx
div    %ecx
add    $0x1,%eax
cmp    $0x4,%eax
jb     139f <genThinoutGrid+0x1cf>
mov    $0x0,%edx
cmp    $0x1,%ecx
jne    14c1 <genThinoutGrid+0x2f1>
lea    0x0(,%rax,8),%rcx
add    %r13,%rcx
cmp    %rcx,%r14
jae    13a6 <genThinoutGrid+0x1d6>
lea    (%r14,%rax,8),%rcx
cmp    %rcx,%r13
jae    13a6 <genThinoutGrid+0x1d6>
xor    %esi,%esi
xor    %edx,%edx
jmp    14c1 <genThinoutGrid+0x2f1>
mov    %r13d,%edi
xor    %eax,%eax
call   10d0 <gridNamePtr@plt>
lea    0xd04(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10a0 <cdoAbort@plt>
mov    (%rsp),%ebx
jmp    17b1 <genThinoutGrid+0x5e1>
xor    %edx,%edx
jmp    14c1 <genThinoutGrid+0x2f1>
mov    %ebx,%r12d
mov    %eax,%esi
and    $0xfffffffc,%esi
lea    -0x4(%rsi),%rcx
mov    %rcx,%r10
shr    $0x2,%r10
add    $0x1,%r10
mov    %r10d,%r8d
and    $0x3,%r8d
cmp    $0xc,%rcx
jae    13d1 <genThinoutGrid+0x201>
xor    %ebx,%ebx
jmp    145c <genThinoutGrid+0x28c>
and    $0xfffffffffffffffc,%r10
mov    %r11,%r9
shl    $0x7,%r9
mov    %r11,%rcx
shl    $0x5,%rcx
xor    %ebx,%ebx
mov    %r13,%rdx
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movups (%rdx),%xmm0
movups 0x10(%rdx),%xmm1
movups %xmm0,(%r14,%rbx,8)
movups %xmm1,0x10(%r14,%rbx,8)
lea    (%rdx,%rcx,1),%rbp
movups (%rdx,%rcx,1),%xmm0
movups 0x10(%rdx,%rcx,1),%xmm1
movups %xmm0,0x20(%r14,%rbx,8)
movups %xmm1,0x30(%r14,%rbx,8)
lea    0x0(%rbp,%rcx,1),%r15
movups (%rcx,%rbp,1),%xmm0
movups 0x10(%rcx,%rbp,1),%xmm1
movups %xmm0,0x40(%r14,%rbx,8)
movups %xmm1,0x50(%r14,%rbx,8)
movups (%rcx,%r15,1),%xmm0
movups 0x10(%rcx,%r15,1),%xmm1
movups %xmm0,0x60(%r14,%rbx,8)
movups %xmm1,0x70(%r14,%rbx,8)
add    $0x10,%rbx
add    $0x4,%rdi
add    %r9,%rdx
cmp    %r10,%rdi
jne    13f0 <genThinoutGrid+0x220>
test   %r8,%r8
je     14ae <genThinoutGrid+0x2de>
lea    (%r14,%rbx,8),%rcx
add    $0x10,%rcx
imul   %r11,%rbx
lea    0x10(,%rbx,8),%rdx
add    %r13,%rdx
mov    %r11,%rdi
shl    $0x5,%rdi
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups -0x10(%rdx),%xmm0
movups (%rdx),%xmm1
movups %xmm0,-0x10(%rcx)
movups %xmm1,(%rcx)
add    $0x1,%rbp
add    $0x20,%rcx
add    %rdi,%rdx
cmp    %r8,%rbp
jne    1490 <genThinoutGrid+0x2c0>
cmp    %rax,%rsi
mov    %r12d,%ebx
je     157d <genThinoutGrid+0x3ad>
mov    %rsi,%rdx
imul   %r11,%rdx
mov    %rsi,%rcx
not    %rcx
add    %rax,%rcx
mov    %rax,%rdi
and    $0x3,%rdi
je     14fe <genThinoutGrid+0x32e>
mov    %ebx,%r8d
lea    (%r14,%rsi,8),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
movsd  0x0(%r13,%rdx,8),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    %r11,%rdx
add    $0x1,%rbp
cmp    %rdi,%rbp
jne    14e0 <genThinoutGrid+0x310>
add    %rbp,%rsi
mov    %r8d,%ebx
cmp    $0x3,%rcx
jb     157d <genThinoutGrid+0x3ad>
lea    0x0(,%rdx,8),%rcx
add    %r13,%rcx
mov    %r11,%rdi
shl    $0x5,%rdi
lea    0x0(,%r11,8),%rbp
lea    0x0(%rbp,%rbp,2),%rbp
add    %r11,%rdx
shl    $0x4,%r11
lea    0x0(,%rdx,8),%rdx
add    %r13,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rcx),%xmm0
movsd  %xmm0,(%r14,%rsi,8)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x8(%r14,%rsi,8)
movsd  (%rcx,%r11,1),%xmm0
movsd  %xmm0,0x10(%r14,%rsi,8)
movsd  (%rcx,%rbp,1),%xmm0
movsd  %xmm0,0x18(%r14,%rsi,8)
add    $0x4,%rsi
add    %rdi,%rcx
add    %rdi,%rdx
cmp    %rax,%rsi
jne    1540 <genThinoutGrid+0x370>
movslq %ebx,%rsi
mov    0x4(%rsp),%eax
test   %eax,%eax
mov    0x10(%rsp),%r13
jle    1799 <genThinoutGrid+0x5c9>
mov    0xc(%rsp),%ecx
movslq %ecx,%r10
cmp    %ecx,%eax
cmovle %ecx,%eax
add    $0xffffffff,%eax
xor    %edi,%edi
xor    %edx,%edx
div    %ecx
add    $0x1,%eax
cmp    $0x4,%eax
jb     15d7 <genThinoutGrid+0x407>
mov    $0x0,%edx
cmp    $0x1,%ecx
jne    16de <genThinoutGrid+0x50e>
lea    0x0(,%rax,8),%rcx
add    %r13,%rcx
cmp    %rcx,%rsi
jae    15de <genThinoutGrid+0x40e>
lea    (%rsi,%rax,8),%rcx
cmp    %rcx,%r13
jae    15de <genThinoutGrid+0x40e>
xor    %edi,%edi
xor    %edx,%edx
jmp    16de <genThinoutGrid+0x50e>
mov    %eax,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rcx
mov    %rcx,%r11
shr    $0x2,%r11
add    $0x1,%r11
mov    %r11d,%r8d
and    $0x3,%r8d
cmp    $0xc,%rcx
jae    1606 <genThinoutGrid+0x436>
xor    %ebx,%ebx
jmp    1684 <genThinoutGrid+0x4b4>
and    $0xfffffffffffffffc,%r11
mov    %r10,%r9
shl    $0x7,%r9
mov    %r10,%rcx
shl    $0x5,%rcx
xor    %ebx,%ebx
mov    %r13,%rdx
xor    %r15d,%r15d
movups (%rdx),%xmm0
movups 0x10(%rdx),%xmm1
movups %xmm0,(%rsi,%rbx,8)
movups %xmm1,0x10(%rsi,%rbx,8)
lea    (%rdx,%rcx,1),%rbp
movups (%rdx,%rcx,1),%xmm0
movups 0x10(%rdx,%rcx,1),%xmm1
movups %xmm0,0x20(%rsi,%rbx,8)
movups %xmm1,0x30(%rsi,%rbx,8)
lea    0x0(%rbp,%rcx,1),%r12
movups (%rcx,%rbp,1),%xmm0
movups 0x10(%rcx,%rbp,1),%xmm1
movups %xmm0,0x40(%rsi,%rbx,8)
movups %xmm1,0x50(%rsi,%rbx,8)
movups (%rcx,%r12,1),%xmm0
movups 0x10(%rcx,%r12,1),%xmm1
movups %xmm0,0x60(%rsi,%rbx,8)
movups %xmm1,0x70(%rsi,%rbx,8)
add    $0x10,%rbx
add    $0x4,%r15
add    %r9,%rdx
cmp    %r11,%r15
jne    1620 <genThinoutGrid+0x450>
test   %r8,%r8
je     16ce <genThinoutGrid+0x4fe>
lea    (%rsi,%rbx,8),%rcx
add    $0x10,%rcx
imul   %r10,%rbx
lea    0x10(,%rbx,8),%rdx
add    %r13,%rdx
mov    %r10,%rbp
shl    $0x5,%rbp
xor    %ebx,%ebx
nopl   0x0(%rax)
movups -0x10(%rdx),%xmm0
movups (%rdx),%xmm1
movups %xmm0,-0x10(%rcx)
movups %xmm1,(%rcx)
add    $0x1,%rbx
add    $0x20,%rcx
add    %rbp,%rdx
cmp    %r8,%rbx
jne    16b0 <genThinoutGrid+0x4e0>
cmp    %rax,%rdi
je     1799 <genThinoutGrid+0x5c9>
mov    %rdi,%rdx
imul   %r10,%rdx
mov    %rdi,%r8
not    %r8
add    %rax,%r8
mov    %rax,%rbp
and    $0x3,%rbp
je     171b <genThinoutGrid+0x54b>
lea    (%rsi,%rdi,8),%rcx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsd  0x0(%r13,%rdx,8),%xmm0
movsd  %xmm0,(%rcx,%rbx,8)
add    %r10,%rdx
add    $0x1,%rbx
cmp    %rbp,%rbx
jne    1700 <genThinoutGrid+0x530>
add    %rbx,%rdi
cmp    $0x3,%r8
jb     1799 <genThinoutGrid+0x5c9>
lea    0x0(,%rdx,8),%rcx
add    %r13,%rcx
mov    %r10,%rbx
shl    $0x5,%rbx
lea    0x0(,%r10,8),%rbp
lea    0x0(%rbp,%rbp,2),%rbp
add    %r10,%rdx
shl    $0x4,%r10
lea    0x0(,%rdx,8),%rdx
add    %r13,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rcx),%xmm0
movsd  %xmm0,(%rsi,%rdi,8)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x8(%rsi,%rdi,8)
movsd  (%rcx,%r10,1),%xmm0
movsd  %xmm0,0x10(%rsi,%rdi,8)
movsd  (%rcx,%rbp,1),%xmm0
movsd  %xmm0,0x18(%rsi,%rdi,8)
add    $0x4,%rdi
add    %rbx,%rcx
add    %rbx,%rdx
cmp    %rax,%rdi
jne    1760 <genThinoutGrid+0x590>
mov    (%rsp),%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   10f0 <gridDefXvals@plt>
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <gridDefYvals@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__func__.genThinoutGrid = [15 x i8] c"genThinoutGrid\00"
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Intgrid.c\00"
@.str.1 = [21 x i8] c"Unsupported grid: %s\00"
define i32 @genThinoutGrid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%22 = load i32, i32* %4
%23 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqType to i32 (i32, ...)*)(i32 %22)
store i32 %23, i32* %12
%24 = load i32, i32* %4
%25 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %24)
store i32 %25, i32* %13
%26 = load i32, i32* %4
%27 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %26)
store i32 %27, i32* %14
%28 = load i32, i32* %13
%29 = load i32, i32* %5
%30 = sdiv i32 %28, %29
store i32 %30, i32* %16
%31 = load i32, i32* %14
%32 = load i32, i32* %6
%33 = sdiv i32 %31, %32
store i32 %33, i32* %17
%34 = load i32, i32* %13
%35 = load i32, i32* %5
%36 = srem i32 %34, %35
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %3
%39 = load i32, i32* %16
%40 = add nsw i32 %39, 1
store i32 %40, i32* %16
br label %41
41: ; preds = %38, %3
%42 = load i32, i32* %14
%43 = load i32, i32* %6
%44 = srem i32 %42, %43
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %41
%47 = load i32, i32* %17
%48 = add nsw i32 %47, 1
store i32 %48, i32* %17
br label %49
49: ; preds = %46, %41
%50 = load i32, i32* %16
%51 = load i32, i32* %17
%52 = mul nsw i32 %50, %51
store i32 %52, i32* %15
%53 = load i32, i32* %15
%54 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i32, ...)*)(i32 4, i32 %53)
store i32 %54, i32* %11
%55 = load i32, i32* %11
%56 = load i32, i32* %16
%57 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i32, ...)*)(i32 %55, i32 %56)
%58 = load i32, i32* %11
%59 = load i32, i32* %17
%60 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i32, ...)*)(i32 %58, i32 %59)
%61 = load i32, i32* %12
%62 = icmp eq i32 %61, 2
br i1 %62, label %66, label %63
63: ; preds = %49
%64 = load i32, i32* %12
%65 = icmp eq i32 %64, 4
br i1 %65, label %66, label %145
66: ; preds = %63, %49
%67 = load i32, i32* %13
%68 = sext i32 %67 to i64
%69 = mul i64 %68, 8
%70 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 56, i64 %69)
%71 = sext i32 %70 to i64
%72 = inttoptr i64 %71 to double*
store double* %72, double** %18
%73 = load i32, i32* %14
%74 = sext i32 %73 to i64
%75 = mul i64 %74, 8
%76 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 57, i64 %75)
%77 = sext i32 %76 to i64
%78 = inttoptr i64 %77 to double*
store double* %78, double** %19
%79 = load i32, i32* %16
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 8
%82 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 58, i64 %81)
%83 = sext i32 %82 to i64
%84 = inttoptr i64 %83 to double*
store double* %84, double** %20
%85 = load i32, i32* %17
%86 = sext i32 %85 to i64
%87 = mul i64 %86, 8
%88 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 59, i64 %87)
%89 = sext i32 %88 to i64
%90 = inttoptr i64 %89 to double*
store double* %90, double** %21
%91 = load i32, i32* %4
%92 = load double*, double** %18
%93 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %91, double* %92)
%94 = load i32, i32* %4
%95 = load double*, double** %19
%96 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqYvals to i32 (i32, double*, ...)*)(i32 %94, double* %95)
store i32 0, i32* %10
store i32 0, i32* %8
br label %97
97: ; preds = %113, %66
%98 = load i32, i32* %8
%99 = load i32, i32* %14
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %117
101: ; preds = %97
%102 = load double*, double** %19
%103 = load i32, i32* %8
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load double, double* %105
%107 = load double*, double** %21
%108 = load i32, i32* %10
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
store double %106, double* %110
%111 = load i32, i32* %10
%112 = add nsw i32 %111, 1
store i32 %112, i32* %10
br label %113
113: ; preds = %101
%114 = load i32, i32* %6
%115 = load i32, i32* %8
%116 = add nsw i32 %115, %114
store i32 %116, i32* %8
br label %97
117: ; preds = %97
store i32 0, i32* %9
store i32 0, i32* %7
br label %118
118: ; preds = %134, %117
%119 = load i32, i32* %7
%120 = load i32, i32* %13
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %138
122: ; preds = %118
%123 = load double*, double** %18
%124 = load i32, i32* %7
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
%127 = load double, double* %126
%128 = load double*, double** %20
%129 = load i32, i32* %9
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
store double %127, double* %131
%132 = load i32, i32* %9
%133 = add nsw i32 %132, 1
store i32 %133, i32* %9
br label %134
134: ; preds = %122
%135 = load i32, i32* %5
%136 = load i32, i32* %7
%137 = add nsw i32 %136, %135
store i32 %137, i32* %7
br label %118
138: ; preds = %118
%139 = load i32, i32* %11
%140 = load double*, double** %20
%141 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefXvals to i32 (i32, double*, ...)*)(i32 %139, double* %140)
%142 = load i32, i32* %11
%143 = load double*, double** %21
%144 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefYvals to i32 (i32, double*, ...)*)(i32 %142, double* %143)
br label %149
145: ; preds = %63
%146 = load i32, i32* %12
%147 = call i32 (i32, ...) bitcast (i32 (...)* @gridNamePtr to i32 (i32, ...)*)(i32 %146)
%148 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @cdoAbort to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %147)
br label %149
149: ; preds = %145, %138
%150 = load i32, i32* %11
ret i32 %150
}

LLVM IR (-O2):
@__func__.genThinoutGrid = [15 x i8] c"genThinoutGrid\00"
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/Intgrid.c\00"
@.str.1 = [21 x i8] c"Unsupported grid: %s\00"
define i32 @genThinoutGrid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqType to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %0)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %0)
%7 = sdiv i32 %5, %1
%8 = sdiv i32 %6, %2
%9 = srem i32 %5, %1
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = srem i32 %6, %2
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
%16 = add nsw i32 %8, %15
%17 = mul nsw i32 %16, %12
%18 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i32, ...)*)(i32 4, i32 %17)
%19 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i32, ...)*)(i32 %18, i32 %12)
%20 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i32, ...)*)(i32 %18, i32 %16)
switch i32 %4, label %352 [
i32 4, label %21
i32 2, label %21
]
21: ; preds = %3, %3
%22 = sext i32 %5 to i64
%23 = shl nsw i64 %22, 3
%24 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 56, i64 %23)
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to double*
%27 = inttoptr i64 %25 to i8*
%28 = sext i32 %6 to i64
%29 = shl nsw i64 %28, 3
%30 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 57, i64 %29)
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to double*
%33 = inttoptr i64 %31 to i8*
%34 = sext i32 %12 to i64
%35 = shl nsw i64 %34, 3
%36 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 58, i64 %35)
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to double*
%39 = inttoptr i64 %37 to i8*
%40 = sext i32 %16 to i64
%41 = shl nsw i64 %40, 3
%42 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.genThinoutGrid, i64 0, i64 0), i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 59, i64 %41)
%43 = sext i32 %42 to i64
%44 = inttoptr i64 %43 to double*
%45 = inttoptr i64 %43 to i8*
%46 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %0, double* %26)
%47 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqYvals to i32 (i32, double*, ...)*)(i32 %0, double* %32)
%48 = icmp sgt i32 %6, 0
br i1 %48, label %49, label %174
49: ; preds = %21
%50 = sext i32 %2 to i64
%51 = call i32 @llvm.smax.i32(i32 %6, i32 %2)
%52 = add nsw i32 %51, -1
%53 = udiv i32 %52, %2
%54 = add i32 %53, 1
%55 = zext i32 %54 to i64
%56 = icmp ugt i32 %54, 3
%57 = icmp eq i32 %2, 1
%58 = and i1 %56, %57
br i1 %58, label %59, label %152
59: ; preds = %49
%60 = getelementptr double, double* %44, i64 %55
%61 = bitcast double* %60 to i8*
%62 = getelementptr double, double* %32, i64 %55
%63 = bitcast double* %62 to i8*
%64 = icmp ult i8* %45, %63
%65 = icmp ult i8* %33, %61
%66 = and i1 %64, %65
br i1 %66, label %152, label %67
67: ; preds = %59
%68 = and i64 %55, 4294967292
%69 = mul nsw i64 %68, %50
%70 = add nsw i64 %68, -4
%71 = lshr exact i64 %70, 2
%72 = add nuw nsw i64 %71, 1
%73 = and i64 %72, 3
%74 = icmp ult i64 %70, 12
br i1 %74, label %130, label %75
75: ; preds = %67
%76 = and i64 %72, 9223372036854775804
br label %77
77: ; preds = %77, %75
%78 = phi i64 [ 0, %75 ], [ %127, %77 ]
%79 = phi i64 [ 0, %75 ], [ %128, %77 ]
%80 = mul i64 %78, %50
%81 = getelementptr inbounds double, double* %32, i64 %80
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = getelementptr inbounds double, double* %81, i64 2
%85 = bitcast double* %84 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = getelementptr inbounds double, double* %44, i64 %78
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %83, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
%91 = or i64 %78, 4
%92 = mul i64 %91, %50
%93 = getelementptr inbounds double, double* %32, i64 %92
%94 = bitcast double* %93 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = getelementptr inbounds double, double* %93, i64 2
%97 = bitcast double* %96 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = getelementptr inbounds double, double* %44, i64 %91
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %95, <2 x double>* %100
%101 = getelementptr inbounds double, double* %99, i64 2
%102 = bitcast double* %101 to <2 x double>*
store <2 x double> %98, <2 x double>* %102
%103 = or i64 %78, 8
%104 = mul i64 %103, %50
%105 = getelementptr inbounds double, double* %32, i64 %104
%106 = bitcast double* %105 to <2 x double>*
%107 = load <2 x double>, <2 x double>* %106
%108 = getelementptr inbounds double, double* %105, i64 2
%109 = bitcast double* %108 to <2 x double>*
%110 = load <2 x double>, <2 x double>* %109
%111 = getelementptr inbounds double, double* %44, i64 %103
%112 = bitcast double* %111 to <2 x double>*
store <2 x double> %107, <2 x double>* %112
%113 = getelementptr inbounds double, double* %111, i64 2
%114 = bitcast double* %113 to <2 x double>*
store <2 x double> %110, <2 x double>* %114
%115 = or i64 %78, 12
%116 = mul i64 %115, %50
%117 = getelementptr inbounds double, double* %32, i64 %116
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = getelementptr inbounds double, double* %117, i64 2
%121 = bitcast double* %120 to <2 x double>*
%122 = load <2 x double>, <2 x double>* %121
%123 = getelementptr inbounds double, double* %44, i64 %115
%124 = bitcast double* %123 to <2 x double>*
store <2 x double> %119, <2 x double>* %124
%125 = getelementptr inbounds double, double* %123, i64 2
%126 = bitcast double* %125 to <2 x double>*
store <2 x double> %122, <2 x double>* %126
%127 = add nuw i64 %78, 16
%128 = add nuw i64 %79, 4
%129 = icmp eq i64 %128, %76
br i1 %129, label %130, label %77
130: ; preds = %77, %67
%131 = phi i64 [ 0, %67 ], [ %127, %77 ]
%132 = icmp eq i64 %73, 0
br i1 %132, label %150, label %133
133: ; preds = %130, %133
%134 = phi i64 [ %147, %133 ], [ %131, %130 ]
%135 = phi i64 [ %148, %133 ], [ 0, %130 ]
%136 = mul i64 %134, %50
%137 = getelementptr inbounds double, double* %32, i64 %136
%138 = bitcast double* %137 to <2 x double>*
%139 = load <2 x double>, <2 x double>* %138
%140 = getelementptr inbounds double, double* %137, i64 2
%141 = bitcast double* %140 to <2 x double>*
%142 = load <2 x double>, <2 x double>* %141
%143 = getelementptr inbounds double, double* %44, i64 %134
%144 = bitcast double* %143 to <2 x double>*
store <2 x double> %139, <2 x double>* %144
%145 = getelementptr inbounds double, double* %143, i64 2
%146 = bitcast double* %145 to <2 x double>*
store <2 x double> %142, <2 x double>* %146
%147 = add nuw i64 %134, 4
%148 = add i64 %135, 1
%149 = icmp eq i64 %148, %73
br i1 %149, label %150, label %133
150: ; preds = %133, %130
%151 = icmp eq i64 %68, %55
br i1 %151, label %174, label %152
152: ; preds = %59, %49, %150
%153 = phi i64 [ 0, %59 ], [ 0, %49 ], [ %68, %150 ]
%154 = phi i64 [ 0, %59 ], [ 0, %49 ], [ %69, %150 ]
%155 = xor i64 %153, -1
%156 = add nsw i64 %155, %55
%157 = and i64 %55, 3
%158 = icmp eq i64 %157, 0
br i1 %158, label %170, label %159
159: ; preds = %152, %159
%160 = phi i64 [ %166, %159 ], [ %153, %152 ]
%161 = phi i64 [ %167, %159 ], [ %154, %152 ]
%162 = phi i64 [ %168, %159 ], [ 0, %152 ]
%163 = getelementptr inbounds double, double* %32, i64 %161
%164 = load double, double* %163
%165 = getelementptr inbounds double, double* %44, i64 %160
store double %164, double* %165
%166 = add nuw nsw i64 %160, 1
%167 = add i64 %161, %50
%168 = add i64 %162, 1
%169 = icmp eq i64 %168, %157
br i1 %169, label %170, label %159
170: ; preds = %159, %152
%171 = phi i64 [ %153, %152 ], [ %166, %159 ]
%172 = phi i64 [ %154, %152 ], [ %167, %159 ]
%173 = icmp ult i64 %156, 3
br i1 %173, label %174, label %301
174: ; preds = %170, %301, %150, %21
%175 = icmp sgt i32 %5, 0
br i1 %175, label %176, label %349
176: ; preds = %174
%177 = sext i32 %1 to i64
%178 = call i32 @llvm.smax.i32(i32 %5, i32 %1)
%179 = add nsw i32 %178, -1
%180 = udiv i32 %179, %1
%181 = add i32 %180, 1
%182 = zext i32 %181 to i64
%183 = icmp ugt i32 %181, 3
%184 = icmp eq i32 %1, 1
%185 = and i1 %183, %184
br i1 %185, label %186, label %279
186: ; preds = %176
%187 = getelementptr double, double* %38, i64 %182
%188 = bitcast double* %187 to i8*
%189 = getelementptr double, double* %26, i64 %182
%190 = bitcast double* %189 to i8*
%191 = icmp ult i8* %39, %190
%192 = icmp ult i8* %27, %188
%193 = and i1 %191, %192
br i1 %193, label %279, label %194
194: ; preds = %186
%195 = and i64 %182, 4294967292
%196 = mul nsw i64 %195, %177
%197 = add nsw i64 %195, -4
%198 = lshr exact i64 %197, 2
%199 = add nuw nsw i64 %198, 1
%200 = and i64 %199, 3
%201 = icmp ult i64 %197, 12
br i1 %201, label %257, label %202
202: ; preds = %194
%203 = and i64 %199, 9223372036854775804
br label %204
204: ; preds = %204, %202
%205 = phi i64 [ 0, %202 ], [ %254, %204 ]
%206 = phi i64 [ 0, %202 ], [ %255, %204 ]
%207 = mul i64 %205, %177
%208 = getelementptr inbounds double, double* %26, i64 %207
%209 = bitcast double* %208 to <2 x double>*
%210 = load <2 x double>, <2 x double>* %209
%211 = getelementptr inbounds double, double* %208, i64 2
%212 = bitcast double* %211 to <2 x double>*
%213 = load <2 x double>, <2 x double>* %212
%214 = getelementptr inbounds double, double* %38, i64 %205
%215 = bitcast double* %214 to <2 x double>*
store <2 x double> %210, <2 x double>* %215
%216 = getelementptr inbounds double, double* %214, i64 2
%217 = bitcast double* %216 to <2 x double>*
store <2 x double> %213, <2 x double>* %217
%218 = or i64 %205, 4
%219 = mul i64 %218, %177
%220 = getelementptr inbounds double, double* %26, i64 %219
%221 = bitcast double* %220 to <2 x double>*
%222 = load <2 x double>, <2 x double>* %221
%223 = getelementptr inbounds double, double* %220, i64 2
%224 = bitcast double* %223 to <2 x double>*
%225 = load <2 x double>, <2 x double>* %224
%226 = getelementptr inbounds double, double* %38, i64 %218
%227 = bitcast double* %226 to <2 x double>*
store <2 x double> %222, <2 x double>* %227
%228 = getelementptr inbounds double, double* %226, i64 2
%229 = bitcast double* %228 to <2 x double>*
store <2 x double> %225, <2 x double>* %229
%230 = or i64 %205, 8
%231 = mul i64 %230, %177
%232 = getelementptr inbounds double, double* %26, i64 %231
%233 = bitcast double* %232 to <2 x double>*
%234 = load <2 x double>, <2 x double>* %233
%235 = getelementptr inbounds double, double* %232, i64 2
%236 = bitcast double* %235 to <2 x double>*
%237 = load <2 x double>, <2 x double>* %236
%238 = getelementptr inbounds double, double* %38, i64 %230
%239 = bitcast double* %238 to <2 x double>*
store <2 x double> %234, <2 x double>* %239
%240 = getelementptr inbounds double, double* %238, i64 2
%241 = bitcast double* %240 to <2 x double>*
store <2 x double> %237, <2 x double>* %241
%242 = or i64 %205, 12
%243 = mul i64 %242, %177
%244 = getelementptr inbounds double, double* %26, i64 %243
%245 = bitcast double* %244 to <2 x double>*
%246 = load <2 x double>, <2 x double>* %245
%247 = getelementptr inbounds double, double* %244, i64 2
%248 = bitcast double* %247 to <2 x double>*
%249 = load <2 x double>, <2 x double>* %248
%250 = getelementptr inbounds double, double* %38, i64 %242
%251 = bitcast double* %250 to <2 x double>*
store <2 x double> %246, <2 x double>* %251
%252 = getelementptr inbounds double, double* %250, i64 2
%253 = bitcast double* %252 to <2 x double>*
store <2 x double> %249, <2 x double>* %253
%254 = add nuw i64 %205, 16
%255 = add nuw i64 %206, 4
%256 = icmp eq i64 %255, %203
br i1 %256, label %257, label %204
257: ; preds = %204, %194
%258 = phi i64 [ 0, %194 ], [ %254, %204 ]
%259 = icmp eq i64 %200, 0
br i1 %259, label %277, label %260
260: ; preds = %257, %260
%261 = phi i64 [ %274, %260 ], [ %258, %257 ]
%262 = phi i64 [ %275, %260 ], [ 0, %257 ]
%263 = mul i64 %261, %177
%264 = getelementptr inbounds double, double* %26, i64 %263
%265 = bitcast double* %264 to <2 x double>*
%266 = load <2 x double>, <2 x double>* %265
%267 = getelementptr inbounds double, double* %264, i64 2
%268 = bitcast double* %267 to <2 x double>*
%269 = load <2 x double>, <2 x double>* %268
%270 = getelementptr inbounds double, double* %38, i64 %261
%271 = bitcast double* %270 to <2 x double>*
store <2 x double> %266, <2 x double>* %271
%272 = getelementptr inbounds double, double* %270, i64 2
%273 = bitcast double* %272 to <2 x double>*
store <2 x double> %269, <2 x double>* %273
%274 = add nuw i64 %261, 4
%275 = add i64 %262, 1
%276 = icmp eq i64 %275, %200
br i1 %276, label %277, label %260
277: ; preds = %260, %257
%278 = icmp eq i64 %195, %182
br i1 %278, label %349, label %279
279: ; preds = %186, %176, %277
%280 = phi i64 [ 0, %186 ], [ 0, %176 ], [ %195, %277 ]
%281 = phi i64 [ 0, %186 ], [ 0, %176 ], [ %196, %277 ]
%282 = xor i64 %280, -1
%283 = add nsw i64 %282, %182
%284 = and i64 %182, 3
%285 = icmp eq i64 %284, 0
br i1 %285, label %297, label %286
286: ; preds = %279, %286
%287 = phi i64 [ %293, %286 ], [ %280, %279 ]
%288 = phi i64 [ %294, %286 ], [ %281, %279 ]
%289 = phi i64 [ %295, %286 ], [ 0, %279 ]
%290 = getelementptr inbounds double, double* %26, i64 %288
%291 = load double, double* %290
%292 = getelementptr inbounds double, double* %38, i64 %287
store double %291, double* %292
%293 = add nuw nsw i64 %287, 1
%294 = add i64 %288, %177
%295 = add i64 %289, 1
%296 = icmp eq i64 %295, %284
br i1 %296, label %297, label %286
297: ; preds = %286, %279
%298 = phi i64 [ %280, %279 ], [ %293, %286 ]
%299 = phi i64 [ %281, %279 ], [ %294, %286 ]
%300 = icmp ult i64 %283, 3
br i1 %300, label %349, label %325
301: ; preds = %170, %301
%302 = phi i64 [ %322, %301 ], [ %171, %170 ]
%303 = phi i64 [ %323, %301 ], [ %172, %170 ]
%304 = getelementptr inbounds double, double* %32, i64 %303
%305 = load double, double* %304
%306 = getelementptr inbounds double, double* %44, i64 %302
store double %305, double* %306
%307 = add nuw nsw i64 %302, 1
%308 = add i64 %303, %50
%309 = getelementptr inbounds double, double* %32, i64 %308
%310 = load double, double* %309
%311 = getelementptr inbounds double, double* %44, i64 %307
store double %310, double* %311
%312 = add nuw nsw i64 %302, 2
%313 = add i64 %308, %50
%314 = getelementptr inbounds double, double* %32, i64 %313
%315 = load double, double* %314
%316 = getelementptr inbounds double, double* %44, i64 %312
store double %315, double* %316
%317 = add nuw nsw i64 %302, 3
%318 = add i64 %313, %50
%319 = getelementptr inbounds double, double* %32, i64 %318
%320 = load double, double* %319
%321 = getelementptr inbounds double, double* %44, i64 %317
store double %320, double* %321
%322 = add nuw nsw i64 %302, 4
%323 = add i64 %318, %50
%324 = icmp eq i64 %322, %55
br i1 %324, label %174, label %301
325: ; preds = %297, %325
%326 = phi i64 [ %346, %325 ], [ %298, %297 ]
%327 = phi i64 [ %347, %325 ], [ %299, %297 ]
%328 = getelementptr inbounds double, double* %26, i64 %327
%329 = load double, double* %328
%330 = getelementptr inbounds double, double* %38, i64 %326
store double %329, double* %330
%331 = add nuw nsw i64 %326, 1
%332 = add i64 %327, %177
%333 = getelementptr inbounds double, double* %26, i64 %332
%334 = load double, double* %333
%335 = getelementptr inbounds double, double* %38, i64 %331
store double %334, double* %335
%336 = add nuw nsw i64 %326, 2
%337 = add i64 %332, %177
%338 = getelementptr inbounds double, double* %26, i64 %337
%339 = load double, double* %338
%340 = getelementptr inbounds double, double* %38, i64 %336
store double %339, double* %340
%341 = add nuw nsw i64 %326, 3
%342 = add i64 %337, %177
%343 = getelementptr inbounds double, double* %26, i64 %342
%344 = load double, double* %343
%345 = getelementptr inbounds double, double* %38, i64 %341
store double %344, double* %345
%346 = add nuw nsw i64 %326, 4
%347 = add i64 %342, %177
%348 = icmp eq i64 %346, %182
br i1 %348, label %349, label %325
349: ; preds = %297, %325, %277, %174
%350 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefXvals to i32 (i32, double*, ...)*)(i32 %18, double* %38)
%351 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefYvals to i32 (i32, double*, ...)*)(i32 %18, double* %44)
br label %355
352: ; preds = %3
%353 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridNamePtr to i32 (i32, ...)*)(i32 %4)
%354 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @cdoAbort to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %353)
br label %355
355: ; preds = %352, %349
ret i32 %18
}