int expand_lonlat_grid(int gridID) {
  char units[256];
  int gridIDnew;
  long nx, ny, nxp4, nyp4;
  double *xvals, *yvals;
  nx = gridInqXsize(gridID);
  ny = gridInqYsize(gridID);
  nxp4 = nx + 4;
  nyp4 = ny + 4;
  xvals = (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/remaplib.c",
      464, (nxp4 * sizeof(double)));
  yvals = (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/remaplib.c",
      465, (nyp4 * sizeof(double)));
  gridInqXvals(gridID, xvals + 2);
  gridInqYvals(gridID, yvals + 2);
  gridIDnew = gridCreate(4, nxp4 * nyp4);
  gridDefXsize(gridIDnew, nxp4);
  gridDefYsize(gridIDnew, nyp4);
  gridInqXunits(gridID, units);
  gridDefXunits(gridIDnew, units);
  gridInqYunits(gridID, units);
  gridDefYunits(gridIDnew, units);
  xvals[0] = xvals[2] - 2 * gridInqXinc(gridID);
  xvals[1] = xvals[2] - gridInqXinc(gridID);
  xvals[nxp4 - 2] = xvals[nx + 1] + gridInqXinc(gridID);
  xvals[nxp4 - 1] = xvals[nx + 1] + 2 * gridInqXinc(gridID);
  yvals[0] = yvals[2] - 2 * gridInqYinc(gridID);
  yvals[1] = yvals[2] - gridInqYinc(gridID);
  yvals[nyp4 - 2] = yvals[ny + 1] + gridInqYinc(gridID);
  yvals[nyp4 - 1] = yvals[ny + 1] + 2 * gridInqYinc(gridID);
  gridDefXvals(gridIDnew, xvals);
  gridDefYvals(gridIDnew, yvals);
  Free(__func__,
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c",
       491, (xvals));
  Free(__func__,
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c",
       492, (yvals));
  if (gridIsRotated(gridID)) {
    gridDefXpole(gridIDnew, gridInqXpole(gridID));
    gridDefYpole(gridIDnew, gridInqYpole(gridID));
    gridDefAngle(gridIDnew, gridInqAngle(gridID));
  }
  return (gridIDnew);
}


x86 assembly (clang, -O0):
<expand_lonlat_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1100 <gridInqXsize@plt>
cltq
mov    %rax,-0x120(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10e0 <gridInqYsize@plt>
cltq
mov    %rax,-0x128(%rbp)
mov    -0x120(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x130(%rbp)
mov    -0x128(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x138(%rbp)
mov    -0x130(%rbp),%rcx
shl    $0x3,%rcx
lea    0xd16(%rip),%rdi
lea    0xd22(%rip),%rsi
mov    $0x1d0,%edx
mov    $0x0,%al
call   1040 <Malloc@plt>
cltq
mov    %rax,-0x140(%rbp)
mov    -0x138(%rbp),%rcx
shl    $0x3,%rcx
lea    0xce8(%rip),%rdi
lea    0xcf4(%rip),%rsi
mov    $0x1d1,%edx
mov    $0x0,%al
call   1040 <Malloc@plt>
cltq
mov    %rax,-0x148(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x140(%rbp),%rsi
add    $0x10,%rsi
mov    $0x0,%al
call   1120 <gridInqXvals@plt>
mov    -0x4(%rbp),%edi
mov    -0x148(%rbp),%rsi
add    $0x10,%rsi
mov    $0x0,%al
call   10f0 <gridInqYvals@plt>
mov    -0x130(%rbp),%rsi
imul   -0x138(%rbp),%rsi
ff
mov    $0x4,%edi
mov    $0x0,%al
call   1060 <gridCreate@plt>
mov    %eax,-0x114(%rbp)
mov    -0x114(%rbp),%edi
mov    -0x130(%rbp),%rsi
mov    $0x0,%al
call   1110 <gridDefXsize@plt>
mov    -0x114(%rbp),%edi
mov    -0x138(%rbp),%rsi
mov    $0x0,%al
call   1140 <gridDefYsize@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1170 <gridInqXunits@plt>
mov    -0x114(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1150 <gridDefXunits@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1160 <gridInqYunits@plt>
mov    -0x114(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1090 <gridDefYunits@plt>
mov    -0x140(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10c0 <gridInqXinc@plt>
movsd  -0x188(%rbp),%xmm0
ff
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
mov    -0x140(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x140(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10c0 <gridInqXinc@plt>
movsd  -0x180(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
mov    -0x140(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x140(%rbp),%rax
mov    -0x120(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10c0 <gridInqXinc@plt>
movsd  -0x178(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0x140(%rbp),%rax
mov    -0x130(%rbp),%rcx
sub    $0x2,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x140(%rbp),%rax
mov    -0x120(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10c0 <gridInqXinc@plt>
movsd  -0x170(%rbp),%xmm0
ff
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0x140(%rbp),%rax
mov    -0x130(%rbp),%rcx
sub    $0x1,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x148(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10d0 <gridInqYinc@plt>
movsd  -0x168(%rbp),%xmm0
ff
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
mov    -0x148(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x148(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10d0 <gridInqYinc@plt>
movsd  -0x160(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
mov    -0x148(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x148(%rbp),%rax
mov    -0x128(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10d0 <gridInqYinc@plt>
movsd  -0x158(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0x148(%rbp),%rax
mov    -0x138(%rbp),%rcx
sub    $0x2,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x148(%rbp),%rax
mov    -0x128(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10d0 <gridInqYinc@plt>
movsd  -0x150(%rbp),%xmm0
ff
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0x148(%rbp),%rax
mov    -0x138(%rbp),%rcx
sub    $0x1,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x114(%rbp),%edi
mov    -0x140(%rbp),%rsi
mov    $0x0,%al
call   11a0 <gridDefXvals@plt>
mov    -0x114(%rbp),%edi
mov    -0x148(%rbp),%rsi
mov    $0x0,%al
call   10b0 <gridDefYvals@plt>
mov    -0x140(%rbp),%rcx
lea    0x9b3(%rip),%rdi
lea    0x9bf(%rip),%rsi
mov    $0x1eb,%edx
mov    $0x0,%al
call   1130 <Free@plt>
mov    -0x148(%rbp),%rcx
lea    0x992(%rip),%rdi
lea    0x99e(%rip),%rsi
mov    $0x1ec,%edx
mov    $0x0,%al
call   1130 <Free@plt>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1180 <gridIsRotated@plt>
cmp    $0x0,%eax
je     1703 <expand_lonlat_grid+0x483>
mov    -0x114(%rbp),%eax
mov    %eax,-0x194(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <gridInqXpole@plt>
mov    -0x194(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1050 <gridDefXpole@plt>
mov    -0x114(%rbp),%eax
mov    %eax,-0x190(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1080 <gridInqYpole@plt>
mov    -0x190(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   10a0 <gridDefYpole@plt>
mov    -0x114(%rbp),%eax
mov    %eax,-0x18c(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1070 <gridInqAngle@plt>
mov    -0x18c(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1190 <gridDefAngle@plt>
mov    -0x114(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_lonlat_grid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1100 <gridInqXsize@plt>
movslq %eax,%rbp
mov    %ebx,%edi
xor    %eax,%eax
call   10e0 <gridInqYsize@plt>
cltq
mov    %rbp,%rcx
mov    %rbp,0x10(%rsp)
lea    0x4(%rbp),%rdx
mov    %rdx,0x8(%rsp)
lea    0x4(%rax),%r14
mov    %rax,%rbp
mov    %rax,0x18(%rsp)
lea    0x20(,%rcx,8),%rcx
lea    0xd2c(%rip),%r15
lea    0xd38(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1d0,%edx
xor    %eax,%eax
call   1040 <Malloc@plt>
movslq %eax,%r13
lea    0x20(,%rbp,8),%rcx
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1d1,%edx
xor    %eax,%eax
call   1040 <Malloc@plt>
movslq %eax,%r12
lea    0x10(%r13),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1120 <gridInqXvals@plt>
lea    0x10(%r12),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   10f0 <gridInqYvals@plt>
mov    %r14,%rsi
mov    0x8(%rsp),%rbp
imul   %rbp,%rsi
mov    $0x4,%edi
xor    %eax,%eax
call   1060 <gridCreate@plt>
mov    %eax,%r15d
mov    %eax,%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1110 <gridDefXsize@plt>
mov    %r15d,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1140 <gridDefYsize@plt>
lea    0x20(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1170 <gridInqXunits@plt>
mov    %r15d,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1150 <gridDefXunits@plt>
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1160 <gridInqYunits@plt>
mov    %r15d,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <gridDefYunits@plt>
movsd  0x10(%r13),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10c0 <gridInqXinc@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%r13)
movsd  0x10(%r13),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10c0 <gridInqXinc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r13)
mov    0x10(%rsp),%rbp
movsd  0x8(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10c0 <gridInqXinc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%r13,%rbp,8)
movsd  0x8(%r13,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10c0 <gridInqXinc@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%r13,%rbp,8)
movsd  0x10(%r12),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10d0 <gridInqYinc@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r12)
movsd  0x10(%r12),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10d0 <gridInqYinc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r12)
mov    0x18(%rsp),%rbp
movsd  0x8(%r12,%rbp,8),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   10d0 <gridInqYinc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
mov    %rbp,%rax
mov    %r15d,%ebp
movsd  %xmm0,0x10(%r12,%rax,8)
movsd  0x8(%r12,%rax,8),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %rax,%r14
mov    %ebx,%edi
xor    %eax,%eax
call   10d0 <gridInqYinc@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x18(%r12,%r14,8)
mov    %r15d,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   11a0 <gridDefXvals@plt>
mov    %r15d,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   10b0 <gridDefYvals@plt>
lea    0xad6(%rip),%r14
mov    %r14,%rdi
lea    0xadf(%rip),%r15
mov    %r15,%rsi
mov    $0x1eb,%edx
mov    %r13,%rcx
xor    %eax,%eax
call   1130 <Free@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x1ec,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   1130 <Free@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1180 <gridIsRotated@plt>
test   %eax,%eax
je     15a4 <expand_lonlat_grid+0x324>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <gridInqXpole@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <gridDefXpole@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1080 <gridInqYpole@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
call   10a0 <gridDefYpole@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1070 <gridInqAngle@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1190 <gridDefAngle@plt>
mov    %ebp,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__func__.expand_lonlat_grid = [19 x i8] c"expand_lonlat_grid\00"
@.str = [132 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/remaplib.c\00"
define i32 @expand_lonlat_grid(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca double*
%10 = alloca double*
store i32 %0, i32* %2
%11 = load i32, i32* %2
%12 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %11)
%13 = sext i32 %12 to i64
store i64 %13, i64* %5
%14 = load i32, i32* %2
%15 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %14)
%16 = sext i32 %15 to i64
store i64 %16, i64* %6
%17 = load i64, i64* %5
%18 = add nsw i64 %17, 4
store i64 %18, i64* %7
%19 = load i64, i64* %6
%20 = add nsw i64 %19, 4
store i64 %20, i64* %8
%21 = load i64, i64* %7
%22 = mul i64 %21, 8
%23 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 464, i64 %22)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to double*
store double* %25, double** %9
%26 = load i64, i64* %8
%27 = mul i64 %26, 8
%28 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 465, i64 %27)
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to double*
store double* %30, double** %10
%31 = load i32, i32* %2
%32 = load double*, double** %9
%33 = getelementptr inbounds double, double* %32, i64 2
%34 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %31, double* %33)
%35 = load i32, i32* %2
%36 = load double*, double** %10
%37 = getelementptr inbounds double, double* %36, i64 2
%38 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqYvals to i32 (i32, double*, ...)*)(i32 %35, double* %37)
%39 = load i64, i64* %7
%40 = load i64, i64* %8
%41 = mul nsw i64 %39, %40
%42 = call i32 (i32, i64, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i64, ...)*)(i32 4, i64 %41)
store i32 %42, i32* %4
%43 = load i32, i32* %4
%44 = load i64, i64* %7
%45 = call i32 (i32, i64, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i64, ...)*)(i32 %43, i64 %44)
%46 = load i32, i32* %4
%47 = load i64, i64* %8
%48 = call i32 (i32, i64, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i64, ...)*)(i32 %46, i64 %47)
%49 = load i32, i32* %2
%50 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%51 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridInqXunits to i32 (i32, i8*, ...)*)(i32 %49, i8* %50)
%52 = load i32, i32* %4
%53 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%54 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridDefXunits to i32 (i32, i8*, ...)*)(i32 %52, i8* %53)
%55 = load i32, i32* %2
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%57 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridInqYunits to i32 (i32, i8*, ...)*)(i32 %55, i8* %56)
%58 = load i32, i32* %4
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%60 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridDefYunits to i32 (i32, i8*, ...)*)(i32 %58, i8* %59)
%61 = load double*, double** %9
%62 = getelementptr inbounds double, double* %61, i64 2
%63 = load double, double* %62
%64 = load i32, i32* %2
%65 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %64)
%66 = mul nsw i32 2, %65
%67 = sitofp i32 %66 to double
%68 = fsub double %63, %67
%69 = load double*, double** %9
%70 = getelementptr inbounds double, double* %69, i64 0
store double %68, double* %70
%71 = load double*, double** %9
%72 = getelementptr inbounds double, double* %71, i64 2
%73 = load double, double* %72
%74 = load i32, i32* %2
%75 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %74)
%76 = sitofp i32 %75 to double
%77 = fsub double %73, %76
%78 = load double*, double** %9
%79 = getelementptr inbounds double, double* %78, i64 1
store double %77, double* %79
%80 = load double*, double** %9
%81 = load i64, i64* %5
%82 = add nsw i64 %81, 1
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = load i32, i32* %2
%86 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %85)
%87 = sitofp i32 %86 to double
%88 = fadd double %84, %87
%89 = load double*, double** %9
%90 = load i64, i64* %7
%91 = sub nsw i64 %90, 2
%92 = getelementptr inbounds double, double* %89, i64 %91
store double %88, double* %92
%93 = load double*, double** %9
%94 = load i64, i64* %5
%95 = add nsw i64 %94, 1
%96 = getelementptr inbounds double, double* %93, i64 %95
%97 = load double, double* %96
%98 = load i32, i32* %2
%99 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %98)
%100 = mul nsw i32 2, %99
%101 = sitofp i32 %100 to double
%102 = fadd double %97, %101
%103 = load double*, double** %9
%104 = load i64, i64* %7
%105 = sub nsw i64 %104, 1
%106 = getelementptr inbounds double, double* %103, i64 %105
store double %102, double* %106
%107 = load double*, double** %10
%108 = getelementptr inbounds double, double* %107, i64 2
%109 = load double, double* %108
%110 = load i32, i32* %2
%111 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %110)
%112 = mul nsw i32 2, %111
%113 = sitofp i32 %112 to double
%114 = fsub double %109, %113
%115 = load double*, double** %10
%116 = getelementptr inbounds double, double* %115, i64 0
store double %114, double* %116
%117 = load double*, double** %10
%118 = getelementptr inbounds double, double* %117, i64 2
%119 = load double, double* %118
%120 = load i32, i32* %2
%121 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %120)
%122 = sitofp i32 %121 to double
%123 = fsub double %119, %122
%124 = load double*, double** %10
%125 = getelementptr inbounds double, double* %124, i64 1
store double %123, double* %125
%126 = load double*, double** %10
%127 = load i64, i64* %6
%128 = add nsw i64 %127, 1
%129 = getelementptr inbounds double, double* %126, i64 %128
%130 = load double, double* %129
%131 = load i32, i32* %2
%132 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %131)
%133 = sitofp i32 %132 to double
%134 = fadd double %130, %133
%135 = load double*, double** %10
%136 = load i64, i64* %8
%137 = sub nsw i64 %136, 2
%138 = getelementptr inbounds double, double* %135, i64 %137
store double %134, double* %138
%139 = load double*, double** %10
%140 = load i64, i64* %6
%141 = add nsw i64 %140, 1
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = load i32, i32* %2
%145 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %144)
%146 = mul nsw i32 2, %145
%147 = sitofp i32 %146 to double
%148 = fadd double %143, %147
%149 = load double*, double** %10
%150 = load i64, i64* %8
%151 = sub nsw i64 %150, 1
%152 = getelementptr inbounds double, double* %149, i64 %151
store double %148, double* %152
%153 = load i32, i32* %4
%154 = load double*, double** %9
%155 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefXvals to i32 (i32, double*, ...)*)(i32 %153, double* %154)
%156 = load i32, i32* %4
%157 = load double*, double** %10
%158 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefYvals to i32 (i32, double*, ...)*)(i32 %156, double* %157)
%159 = load double*, double** %9
%160 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 491, double* %159)
%161 = load double*, double** %10
%162 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 492, double* %161)
%163 = load i32, i32* %2
%164 = call i32 (i32, ...) bitcast (i32 (...)* @gridIsRotated to i32 (i32, ...)*)(i32 %163)
%165 = icmp ne i32 %164, 0
br i1 %165, label %166, label %179
166: ; preds = %1
%167 = load i32, i32* %4
%168 = load i32, i32* %2
%169 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXpole to i32 (i32, ...)*)(i32 %168)
%170 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefXpole to i32 (i32, i32, ...)*)(i32 %167, i32 %169)
%171 = load i32, i32* %4
%172 = load i32, i32* %2
%173 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYpole to i32 (i32, ...)*)(i32 %172)
%174 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefYpole to i32 (i32, i32, ...)*)(i32 %171, i32 %173)
%175 = load i32, i32* %4
%176 = load i32, i32* %2
%177 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqAngle to i32 (i32, ...)*)(i32 %176)
%178 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefAngle to i32 (i32, i32, ...)*)(i32 %175, i32 %177)
br label %179
179: ; preds = %166, %1
%180 = load i32, i32* %4
ret i32 %180
}

LLVM IR (-O2):
@__func__.expand_lonlat_grid = [19 x i8] c"expand_lonlat_grid\00"
@.str = [132 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/remaplib.c\00"
define i32 @expand_lonlat_grid(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %0)
%5 = sext i32 %4 to i64
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %0)
%7 = sext i32 %6 to i64
%8 = add nsw i64 %5, 4
%9 = add nsw i64 %7, 4
%10 = shl nsw i64 %8, 3
%11 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 464, i64 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to double*
%14 = shl nsw i64 %9, 3
%15 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 465, i64 %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to double*
%18 = getelementptr inbounds double, double* %13, i64 2
%19 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %0, double* %18)
%20 = getelementptr inbounds double, double* %17, i64 2
%21 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqYvals to i32 (i32, double*, ...)*)(i32 %0, double* %20)
%22 = mul nsw i64 %9, %8
%23 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i64, ...)*)(i32 4, i64 %22)
%24 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i64, ...)*)(i32 %23, i64 %8)
%25 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i64, ...)*)(i32 %23, i64 %9)
%26 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridInqXunits to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
%27 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridDefXunits to i32 (i32, i8*, ...)*)(i32 %23, i8* %3)
%28 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridInqYunits to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
%29 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridDefYunits to i32 (i32, i8*, ...)*)(i32 %23, i8* %3)
%30 = load double, double* %18
%31 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %0)
%32 = shl nsw i32 %31, 1
%33 = sitofp i32 %32 to double
%34 = fsub double %30, %33
store double %34, double* %13
%35 = load double, double* %18
%36 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %0)
%37 = sitofp i32 %36 to double
%38 = fsub double %35, %37
%39 = getelementptr inbounds double, double* %13, i64 1
store double %38, double* %39
%40 = add nsw i64 %5, 1
%41 = getelementptr inbounds double, double* %13, i64 %40
%42 = load double, double* %41
%43 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %0)
%44 = sitofp i32 %43 to double
%45 = fadd double %42, %44
%46 = add nsw i64 %5, 2
%47 = getelementptr inbounds double, double* %13, i64 %46
store double %45, double* %47
%48 = load double, double* %41
%49 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXinc to i32 (i32, ...)*)(i32 %0)
%50 = shl nsw i32 %49, 1
%51 = sitofp i32 %50 to double
%52 = fadd double %48, %51
%53 = add nsw i64 %5, 3
%54 = getelementptr inbounds double, double* %13, i64 %53
store double %52, double* %54
%55 = load double, double* %20
%56 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %0)
%57 = shl nsw i32 %56, 1
%58 = sitofp i32 %57 to double
%59 = fsub double %55, %58
store double %59, double* %17
%60 = load double, double* %20
%61 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %0)
%62 = sitofp i32 %61 to double
%63 = fsub double %60, %62
%64 = getelementptr inbounds double, double* %17, i64 1
store double %63, double* %64
%65 = add nsw i64 %7, 1
%66 = getelementptr inbounds double, double* %17, i64 %65
%67 = load double, double* %66
%68 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %0)
%69 = sitofp i32 %68 to double
%70 = fadd double %67, %69
%71 = add nsw i64 %7, 2
%72 = getelementptr inbounds double, double* %17, i64 %71
store double %70, double* %72
%73 = load double, double* %66
%74 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYinc to i32 (i32, ...)*)(i32 %0)
%75 = shl nsw i32 %74, 1
%76 = sitofp i32 %75 to double
%77 = fadd double %73, %76
%78 = add nsw i64 %7, 3
%79 = getelementptr inbounds double, double* %17, i64 %78
store double %77, double* %79
%80 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefXvals to i32 (i32, double*, ...)*)(i32 %23, double* %13)
%81 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefYvals to i32 (i32, double*, ...)*)(i32 %23, double* %17)
%82 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 491, double* %13)
%83 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.expand_lonlat_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 492, double* %17)
%84 = call i32 (i32, ...) bitcast (i32 (...)* @gridIsRotated to i32 (i32, ...)*)(i32 %0)
%85 = icmp eq i32 %84, 0
br i1 %85, label %93, label %86
86: ; preds = %1
%87 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXpole to i32 (i32, ...)*)(i32 %0)
%88 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefXpole to i32 (i32, i32, ...)*)(i32 %23, i32 %87)
%89 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYpole to i32 (i32, ...)*)(i32 %0)
%90 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefYpole to i32 (i32, i32, ...)*)(i32 %23, i32 %89)
%91 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqAngle to i32 (i32, ...)*)(i32 %0)
%92 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefAngle to i32 (i32, i32, ...)*)(i32 %23, i32 %91)
br label %93
93: ; preds = %86, %1
ret i32 %23
}