void *Transpose(void *argument) {
  int streamID1, streamID2;
  int gridsize;
  int ngrids, index;
  int gridID1, gridID2;
  int nx, ny;
  int nrecs, recID;
  int gridID, tsID;
  int varID, levelID;
  int vlistID1, vlistID2;
  int nmiss;
  int taxisID1, taxisID2;
  double *array1, *array2;
  cdoInitialize(argument);
  streamID1 = pstreamOpenRead(cdoStreamName(0));
  vlistID1 = pstreamInqVlist(streamID1);
  vlistID2 = vlistDuplicate(vlistID1);
  ngrids = vlistNgrids(vlistID1);
  for (index = 0; index < ngrids; index++) {
    gridID1 = vlistGrid(vlistID1, index);
    nx = gridInqXsize(gridID1);
    ny = gridInqYsize(gridID1);
    gridID2 = gridCreate(1, nx * ny);
    gridDefXsize(gridID2, ny);
    gridDefYsize(gridID2, nx);
    vlistChangeGridIndex(vlistID2, index, gridID2);
  }
  taxisID1 = vlistInqTaxis(vlistID1);
  taxisID2 = taxisDuplicate(taxisID1);
  vlistDefTaxis(vlistID2, taxisID2);
  streamID2 = pstreamOpenWrite(cdoStreamName(1), cdoFiletype());
  pstreamDefVlist(streamID2, vlistID2);
  gridsize = vlistGridsizeMax(vlistID1);
  array1 = (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/Transpose.c",
      101, (gridsize * sizeof(double)));
  array2 = (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/Transpose.c",
      102, (gridsize * sizeof(double)));
  tsID = 0;
  while ((nrecs = pstreamInqTimestep(streamID1, tsID))) {
    taxisCopyTimestep(taxisID2, taxisID1);
    pstreamDefTimestep(streamID2, tsID);
    for (recID = 0; recID < nrecs; recID++) {
      pstreamInqRecord(streamID1, &varID, &levelID);
      pstreamReadRecord(streamID1, array1, &nmiss);
      gridID = vlistInqVarGrid(vlistID1, varID);
      transxy(gridID, array1, array2);
      pstreamDefRecord(streamID2, varID, levelID);
      pstreamWriteRecord(streamID2, array2, nmiss);
    }
    tsID++;
  }
  pstreamClose(streamID2);
  pstreamClose(streamID1);
  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/Transpose.c",
       129, (array1));
  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/Transpose.c",
       130, (array2));
  cdoFinish();
  return (0);
}


x86 assembly (clang, -O0):
<Transpose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1220 <cdoInitialize@plt>
xor    %edi,%edi
mov    $0x0,%al
call   10a0 <cdoStreamName@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1140 <pstreamOpenRead@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1130 <pstreamInqVlist@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%edi
mov    $0x0,%al
call   10b0 <vlistDuplicate@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%edi
mov    $0x0,%al
call   1060 <vlistNgrids@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13ee <Transpose+0xde>
mov    -0x48(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <vlistGrid@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x0,%al
call   1100 <gridInqXsize@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x0,%al
call   10f0 <gridInqYsize@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%esi
imul   -0x2c(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1090 <gridCreate@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    $0x0,%al
call   1120 <gridDefXsize@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    $0x0,%al
call   11a0 <gridDefYsize@plt>
mov    -0x4c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    $0x0,%al
call   10e0 <vlistChangeGridIndex@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    136a <Transpose+0x5a>
mov    -0x48(%rbp),%edi
mov    $0x0,%al
call   10d0 <vlistInqTaxis@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
mov    $0x0,%al
call   1230 <taxisDuplicate@plt>
mov    %eax,-0x58(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x58(%rbp),%esi
mov    $0x0,%al
call   1050 <vlistDefTaxis@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   10a0 <cdoStreamName@plt>
mov    %eax,-0x6c(%rbp)
mov    $0x0,%al
call   11b0 <cdoFiletype@plt>
mov    -0x6c(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1110 <pstreamOpenWrite@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    $0x0,%al
call   11f0 <pstreamDefVlist@plt>
mov    -0x48(%rbp),%edi
mov    $0x0,%al
call   1200 <vlistGridsizeMax@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
lea    0xb9d(%rip),%rdi
lea    0xba0(%rip),%rsi
mov    $0x65,%edx
mov    $0x0,%al
call   1040 <Malloc@plt>
cltq
mov    %rax,-0x60(%rbp)
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
lea    0xb75(%rip),%rdi
lea    0xb78(%rip),%rsi
mov    $0x66,%edx
mov    $0x0,%al
call   1040 <Malloc@plt>
cltq
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    $0x0,%al
call   1160 <pstreamInqTimestep@plt>
mov    %eax,-0x30(%rbp)
cmp    $0x0,%eax
je     1574 <Transpose+0x264>
mov    -0x58(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    $0x0,%al
call   11e0 <taxisCopyTimestep@plt>
mov    -0x10(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    $0x0,%al
call   1070 <pstreamDefTimestep@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1566 <Transpose+0x256>
mov    -0xc(%rbp),%edi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
mov    $0x0,%al
call   1150 <pstreamInqRecord@plt>
mov    -0xc(%rbp),%edi
mov    -0x60(%rbp),%rsi
lea    -0x50(%rbp),%rdx
mov    $0x0,%al
call   11c0 <pstreamReadRecord@plt>
mov    -0x48(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    $0x0,%al
call   1080 <vlistInqVarGrid@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x60(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    $0x0,%al
call   1170 <transxy@plt>
mov    -0x10(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    $0x0,%al
call   10c0 <pstreamDefRecord@plt>
mov    -0x10(%rbp),%edi
mov    -0x68(%rbp),%rsi
mov    -0x50(%rbp),%edx
mov    $0x0,%al
call   1210 <pstreamWriteRecord@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14e5 <Transpose+0x1d5>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14ab <Transpose+0x19b>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1180 <pstreamClose@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1180 <pstreamClose@plt>
mov    -0x60(%rbp),%rcx
lea    0xa6d(%rip),%rdi
lea    0xa70(%rip),%rsi
mov    $0x81,%edx
mov    $0x0,%al
call   1190 <Free@plt>
mov    -0x68(%rbp),%rcx
lea    0xa4f(%rip),%rdi
lea    0xa52(%rip),%rsi
mov    $0x82,%edx
mov    $0x0,%al
call   1190 <Free@plt>
mov    $0x0,%al
call   11d0 <cdoFinish@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Transpose>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %eax,%eax
call   1220 <cdoInitialize@plt>
xor    %edi,%edi
xor    %eax,%eax
call   10a0 <cdoStreamName@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1140 <pstreamOpenRead@plt>
mov    %eax,0x4(%rsp)
mov    %eax,%edi
xor    %eax,%eax
call   1130 <pstreamInqVlist@plt>
mov    %eax,%r14d
mov    %eax,%edi
xor    %eax,%eax
call   10b0 <vlistDuplicate@plt>
mov    %eax,%r15d
mov    %r14d,%edi
xor    %eax,%eax
call   1060 <vlistNgrids@plt>
test   %eax,%eax
mov    %r14d,0xc(%rsp)
jle    13de <Transpose+0xce>
mov    %eax,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <vlistGrid@plt>
mov    %eax,%ebp
mov    %eax,%edi
xor    %eax,%eax
call   1100 <gridInqXsize@plt>
mov    %eax,%r12d
mov    %ebp,%edi
xor    %eax,%eax
call   10f0 <gridInqYsize@plt>
mov    %eax,%ebp
mov    %eax,%esi
imul   %r12d,%esi
mov    $0x1,%edi
xor    %eax,%eax
call   1090 <gridCreate@plt>
mov    %eax,%r14d
mov    %eax,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1120 <gridDefXsize@plt>
mov    %r14d,%edi
mov    %r12d,%esi
xor    %eax,%eax
call   11a0 <gridDefYsize@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
mov    0xc(%rsp),%r14d
xor    %eax,%eax
call   10e0 <vlistChangeGridIndex@plt>
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    1370 <Transpose+0x60>
mov    %r14d,%edi
xor    %eax,%eax
call   10d0 <vlistInqTaxis@plt>
mov    %eax,0x18(%rsp)
mov    %eax,%edi
xor    %eax,%eax
call   1230 <taxisDuplicate@plt>
mov    %r15d,%edi
mov    %eax,0x14(%rsp)
mov    %eax,%esi
xor    %eax,%eax
call   1050 <vlistDefTaxis@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   10a0 <cdoStreamName@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   11b0 <cdoFiletype@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1110 <pstreamOpenWrite@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r15d,%esi
xor    %eax,%eax
call   11f0 <pstreamDefVlist@plt>
mov    %r14d,%edi
xor    %eax,%eax
call   1200 <vlistGridsizeMax@plt>
movslq %eax,%r14
shl    $0x3,%r14
lea    0xbb5(%rip),%r15
lea    0xbb8(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x65,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <Malloc@plt>
cltq
mov    %rax,0x30(%rsp)
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x66,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <Malloc@plt>
cltq
mov    %rax,0x28(%rsp)
mov    0x4(%rsp),%edi
xor    %esi,%esi
xor    %eax,%eax
call   1160 <pstreamInqTimestep@plt>
test   %eax,%eax
je     1582 <Transpose+0x272>
mov    %eax,%r12d
xor    %ebp,%ebp
mov    %ebx,0x8(%rsp)
mov    0x4(%rsp),%r14d
mov    0x30(%rsp),%r13
jmp    14e2 <Transpose+0x1d2>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x1c(%rsp),%ebp
add    $0x1,%ebp
mov    %r14d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1160 <pstreamInqTimestep@plt>
mov    %eax,%r12d
test   %eax,%eax
mov    0x8(%rsp),%ebx
je     1582 <Transpose+0x272>
mov    0x14(%rsp),%edi
mov    0x18(%rsp),%esi
xor    %eax,%eax
call   11e0 <taxisCopyTimestep@plt>
mov    %ebx,%edi
mov    %ebp,0x1c(%rsp)
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <pstreamDefTimestep@plt>
test   %r12d,%r12d
lea    0x20(%rsp),%r15
mov    0x28(%rsp),%rbx
jle    14c0 <Transpose+0x1b0>
nop
mov    %r14d,%edi
lea    0x10(%rsp),%rsi
lea    0x24(%rsp),%rdx
xor    %eax,%eax
call   1150 <pstreamInqRecord@plt>
mov    %r14d,%edi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   11c0 <pstreamReadRecord@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edi
xor    %eax,%eax
call   1080 <vlistInqVarGrid@plt>
mov    %eax,%edi
mov    %r13,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1170 <transxy@plt>
mov    0x10(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x8(%rsp),%ebp
mov    %ebp,%edi
xor    %eax,%eax
call   10c0 <pstreamDefRecord@plt>
mov    0x20(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1210 <pstreamWriteRecord@plt>
add    $0xffffffff,%r12d
jne    1510 <Transpose+0x200>
jmp    14c0 <Transpose+0x1b0>
mov    %ebx,%edi
xor    %eax,%eax
call   1180 <pstreamClose@plt>
mov    0x4(%rsp),%edi
xor    %eax,%eax
call   1180 <pstreamClose@plt>
lea    0xa63(%rip),%rbp
lea    0xa66(%rip),%r15
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x81,%edx
mov    0x30(%rsp),%rcx
xor    %eax,%eax
call   1190 <Free@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x82,%edx
mov    0x28(%rsp),%rcx
xor    %eax,%eax
call   1190 <Free@plt>
xor    %eax,%eax
call   11d0 <cdoFinish@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__func__.Transpose = [10 x i8] c"Transpose\00"
@.str = [133 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/Transpose.c\00"
define i8* @Transpose(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%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 i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca double*
%24 = alloca double*
store i8* %0, i8** %2
%25 = load i8*, i8** %2
%26 = call i32 (i8*, ...) bitcast (i32 (...)* @cdoInitialize to i32 (i8*, ...)*)(i8* %25)
%27 = call i32 (i32, ...) bitcast (i32 (...)* @cdoStreamName to i32 (i32, ...)*)(i32 0)
%28 = call i32 (i32, ...) bitcast (i32 (...)* @pstreamOpenRead to i32 (i32, ...)*)(i32 %27)
store i32 %28, i32* %3
%29 = load i32, i32* %3
%30 = call i32 (i32, ...) bitcast (i32 (...)* @pstreamInqVlist to i32 (i32, ...)*)(i32 %29)
store i32 %30, i32* %18
%31 = load i32, i32* %18
%32 = call i32 (i32, ...) bitcast (i32 (...)* @vlistDuplicate to i32 (i32, ...)*)(i32 %31)
store i32 %32, i32* %19
%33 = load i32, i32* %18
%34 = call i32 (i32, ...) bitcast (i32 (...)* @vlistNgrids to i32 (i32, ...)*)(i32 %33)
store i32 %34, i32* %6
store i32 0, i32* %7
br label %35
35: ; preds = %61, %1
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %64
39: ; preds = %35
%40 = load i32, i32* %18
%41 = load i32, i32* %7
%42 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vlistGrid to i32 (i32, i32, ...)*)(i32 %40, i32 %41)
store i32 %42, i32* %8
%43 = load i32, i32* %8
%44 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %43)
store i32 %44, i32* %10
%45 = load i32, i32* %8
%46 = call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %45)
store i32 %46, i32* %11
%47 = load i32, i32* %10
%48 = load i32, i32* %11
%49 = mul nsw i32 %47, %48
%50 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i32, ...)*)(i32 1, i32 %49)
store i32 %50, i32* %9
%51 = load i32, i32* %9
%52 = load i32, i32* %11
%53 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i32, ...)*)(i32 %51, i32 %52)
%54 = load i32, i32* %9
%55 = load i32, i32* %10
%56 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i32, ...)*)(i32 %54, i32 %55)
%57 = load i32, i32* %19
%58 = load i32, i32* %7
%59 = load i32, i32* %9
%60 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @vlistChangeGridIndex to i32 (i32, i32, i32, ...)*)(i32 %57, i32 %58, i32 %59)
br label %61
61: ; preds = %39
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %35
64: ; preds = %35
%65 = load i32, i32* %18
%66 = call i32 (i32, ...) bitcast (i32 (...)* @vlistInqTaxis to i32 (i32, ...)*)(i32 %65)
store i32 %66, i32* %21
%67 = load i32, i32* %21
%68 = call i32 (i32, ...) bitcast (i32 (...)* @taxisDuplicate to i32 (i32, ...)*)(i32 %67)
store i32 %68, i32* %22
%69 = load i32, i32* %19
%70 = load i32, i32* %22
%71 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vlistDefTaxis to i32 (i32, i32, ...)*)(i32 %69, i32 %70)
%72 = call i32 (i32, ...) bitcast (i32 (...)* @cdoStreamName to i32 (i32, ...)*)(i32 1)
%73 = call i32 (...) @cdoFiletype()
%74 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamOpenWrite to i32 (i32, i32, ...)*)(i32 %72, i32 %73)
store i32 %74, i32* %4
%75 = load i32, i32* %4
%76 = load i32, i32* %19
%77 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamDefVlist to i32 (i32, i32, ...)*)(i32 %75, i32 %76)
%78 = load i32, i32* %18
%79 = call i32 (i32, ...) bitcast (i32 (...)* @vlistGridsizeMax to i32 (i32, ...)*)(i32 %78)
store i32 %79, i32* %5
%80 = load i32, i32* %5
%81 = sext i32 %80 to i64
%82 = mul i64 %81, 8
%83 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 101, i64 %82)
%84 = sext i32 %83 to i64
%85 = inttoptr i64 %84 to double*
store double* %85, double** %23
%86 = load i32, i32* %5
%87 = sext i32 %86 to i64
%88 = mul i64 %87, 8
%89 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 102, i64 %88)
%90 = sext i32 %89 to i64
%91 = inttoptr i64 %90 to double*
store double* %91, double** %24
store i32 0, i32* %15
br label %92
92: ; preds = %132, %64
%93 = load i32, i32* %3
%94 = load i32, i32* %15
%95 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamInqTimestep to i32 (i32, i32, ...)*)(i32 %93, i32 %94)
store i32 %95, i32* %12
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %135
97: ; preds = %92
%98 = load i32, i32* %22
%99 = load i32, i32* %21
%100 = call i32 (i32, i32, ...) bitcast (i32 (...)* @taxisCopyTimestep to i32 (i32, i32, ...)*)(i32 %98, i32 %99)
%101 = load i32, i32* %4
%102 = load i32, i32* %15
%103 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamDefTimestep to i32 (i32, i32, ...)*)(i32 %101, i32 %102)
store i32 0, i32* %13
br label %104
104: ; preds = %129, %97
%105 = load i32, i32* %13
%106 = load i32, i32* %12
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %132
108: ; preds = %104
%109 = load i32, i32* %3
%110 = call i32 (i32, i32*, i32*, ...) bitcast (i32 (...)* @pstreamInqRecord to i32 (i32, i32*, i32*, ...)*)(i32 %109, i32* %16, i32* %17)
%111 = load i32, i32* %3
%112 = load double*, double** %23
%113 = call i32 (i32, double*, i32*, ...) bitcast (i32 (...)* @pstreamReadRecord to i32 (i32, double*, i32*, ...)*)(i32 %111, double* %112, i32* %20)
%114 = load i32, i32* %18
%115 = load i32, i32* %16
%116 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vlistInqVarGrid to i32 (i32, i32, ...)*)(i32 %114, i32 %115)
store i32 %116, i32* %14
%117 = load i32, i32* %14
%118 = load double*, double** %23
%119 = load double*, double** %24
%120 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @transxy to i32 (i32, double*, double*, ...)*)(i32 %117, double* %118, double* %119)
%121 = load i32, i32* %4
%122 = load i32, i32* %16
%123 = load i32, i32* %17
%124 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @pstreamDefRecord to i32 (i32, i32, i32, ...)*)(i32 %121, i32 %122, i32 %123)
%125 = load i32, i32* %4
%126 = load double*, double** %24
%127 = load i32, i32* %20
%128 = call i32 (i32, double*, i32, ...) bitcast (i32 (...)* @pstreamWriteRecord to i32 (i32, double*, i32, ...)*)(i32 %125, double* %126, i32 %127)
br label %129
129: ; preds = %108
%130 = load i32, i32* %13
%131 = add nsw i32 %130, 1
store i32 %131, i32* %13
br label %104
132: ; preds = %104
%133 = load i32, i32* %15
%134 = add nsw i32 %133, 1
store i32 %134, i32* %15
br label %92
135: ; preds = %92
%136 = load i32, i32* %4
%137 = call i32 (i32, ...) bitcast (i32 (...)* @pstreamClose to i32 (i32, ...)*)(i32 %136)
%138 = load i32, i32* %3
%139 = call i32 (i32, ...) bitcast (i32 (...)* @pstreamClose to i32 (i32, ...)*)(i32 %138)
%140 = load double*, double** %23
%141 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 129, double* %140)
%142 = load double*, double** %24
%143 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 130, double* %142)
%144 = call i32 (...) @cdoFinish()
ret i8* null
}

LLVM IR (-O2):
@__func__.Transpose = [10 x i8] c"Transpose\00"
@.str = [133 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/Transpose.c\00"
define i8* @Transpose(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @cdoInitialize to i32 (i8*, ...)*)(i8* %0)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @cdoStreamName to i32 (i32, ...)*)(i32 0)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @pstreamOpenRead to i32 (i32, ...)*)(i32 %9)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @pstreamInqVlist to i32 (i32, ...)*)(i32 %10)
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @vlistDuplicate to i32 (i32, ...)*)(i32 %11)
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @vlistNgrids to i32 (i32, ...)*)(i32 %11)
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %1, %15
%16 = phi i32 [ %25, %15 ], [ 0, %1 ]
%17 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @vlistGrid to i32 (i32, i32, ...)*)(i32 %11, i32 %16)
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %17)
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %17)
%20 = mul nsw i32 %19, %18
%21 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i32, ...)*)(i32 1, i32 %20)
%22 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i32, ...)*)(i32 %21, i32 %19)
%23 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i32, ...)*)(i32 %21, i32 %18)
%24 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @vlistChangeGridIndex to i32 (i32, i32, i32, ...)*)(i32 %12, i32 %16, i32 %21)
%25 = add nuw nsw i32 %16, 1
%26 = icmp eq i32 %25, %13
br i1 %26, label %27, label %15
27: ; preds = %15, %1
%28 = tail call i32 (i32, ...) bitcast (i32 (...)* @vlistInqTaxis to i32 (i32, ...)*)(i32 %11)
%29 = tail call i32 (i32, ...) bitcast (i32 (...)* @taxisDuplicate to i32 (i32, ...)*)(i32 %28)
%30 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @vlistDefTaxis to i32 (i32, i32, ...)*)(i32 %12, i32 %29)
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @cdoStreamName to i32 (i32, ...)*)(i32 1)
%32 = tail call i32 (...) @cdoFiletype()
%33 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamOpenWrite to i32 (i32, i32, ...)*)(i32 %31, i32 %32)
%34 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamDefVlist to i32 (i32, i32, ...)*)(i32 %33, i32 %12)
%35 = tail call i32 (i32, ...) bitcast (i32 (...)* @vlistGridsizeMax to i32 (i32, ...)*)(i32 %11)
%36 = sext i32 %35 to i64
%37 = shl nsw i64 %36, 3
%38 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 101, i64 %37)
%39 = sext i32 %38 to i64
%40 = inttoptr i64 %39 to double*
%41 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 102, i64 %37)
%42 = sext i32 %41 to i64
%43 = inttoptr i64 %42 to double*
%44 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamInqTimestep to i32 (i32, i32, ...)*)(i32 %10, i32 0)
%45 = icmp eq i32 %44, 0
br i1 %45, label %70, label %46
46: ; preds = %27, %66
%47 = phi i32 [ %68, %66 ], [ %44, %27 ]
%48 = phi i32 [ %67, %66 ], [ 0, %27 ]
%49 = call i32 (i32, i32, ...) bitcast (i32 (...)* @taxisCopyTimestep to i32 (i32, i32, ...)*)(i32 %29, i32 %28)
%50 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamDefTimestep to i32 (i32, i32, ...)*)(i32 %33, i32 %48)
%51 = icmp sgt i32 %47, 0
br i1 %51, label %52, label %66
52: ; preds = %46, %52
%53 = phi i32 [ %64, %52 ], [ 0, %46 ]
%54 = call i32 (i32, i32*, i32*, ...) bitcast (i32 (...)* @pstreamInqRecord to i32 (i32, i32*, i32*, ...)*)(i32 %10, i32* %2, i32* %3)
%55 = call i32 (i32, double*, i32*, ...) bitcast (i32 (...)* @pstreamReadRecord to i32 (i32, double*, i32*, ...)*)(i32 %10, double* %40, i32* %4)
%56 = load i32, i32* %2
%57 = call i32 (i32, i32, ...) bitcast (i32 (...)* @vlistInqVarGrid to i32 (i32, i32, ...)*)(i32 %11, i32 %56)
%58 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @transxy to i32 (i32, double*, double*, ...)*)(i32 %57, double* %40, double* %43)
%59 = load i32, i32* %2
%60 = load i32, i32* %3
%61 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @pstreamDefRecord to i32 (i32, i32, i32, ...)*)(i32 %33, i32 %59, i32 %60)
%62 = load i32, i32* %4
%63 = call i32 (i32, double*, i32, ...) bitcast (i32 (...)* @pstreamWriteRecord to i32 (i32, double*, i32, ...)*)(i32 %33, double* %43, i32 %62)
%64 = add nuw nsw i32 %53, 1
%65 = icmp eq i32 %64, %47
br i1 %65, label %66, label %52
66: ; preds = %52, %46
%67 = add nuw nsw i32 %48, 1
%68 = call i32 (i32, i32, ...) bitcast (i32 (...)* @pstreamInqTimestep to i32 (i32, i32, ...)*)(i32 %10, i32 %67)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %46
70: ; preds = %66, %27
%71 = call i32 (i32, ...) bitcast (i32 (...)* @pstreamClose to i32 (i32, ...)*)(i32 %33)
%72 = call i32 (i32, ...) bitcast (i32 (...)* @pstreamClose to i32 (i32, ...)*)(i32 %10)
%73 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 129, double* %40)
%74 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.Transpose, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 130, double* %43)
%75 = call i32 (...) @cdoFinish()
ret i8* null
}