void compare_lon_reg2d(int xsize, int gridID1, int gridID2) {
  if (xsize > 1) {
    double *xvals1, *xvals2;
    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/cdo_vlist.c",
        68, (xsize * 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/cdo_vlist.c",
        69, (xsize * sizeof(double)));
    gridInqXvals(gridID1, xvals1);
    gridInqXvals(gridID2, xvals2);
    for (int i = 0; i < xsize; ++i)
      if (fabs(xvals1[i] - xvals2[i]) > 1.e-5) {
        cdoWarning("Grid longitudes differ!");
        break;
      }
    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/cdo_vlist.c",
         81, (xvals1));
    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/cdo_vlist.c",
         82, (xvals2));
  }
}


x86 assembly (clang, -O0):
<compare_lon_reg2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1273 <compare_lon_reg2d+0x133>
movslq -0x4(%rbp),%rcx
shl    $0x3,%rcx
lea    0xeb6(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x44,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rcx
shl    $0x3,%rcx
lea    0xe8e(%rip),%rdi
lea    0xe99(%rip),%rsi
mov    $0x45,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <gridInqXvals@plt>
mov    -0xc(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <gridInqXvals@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1237 <compare_lon_reg2d+0xf7>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xe15(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xdf9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1224 <compare_lon_reg2d+0xe4>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1060 <cdoWarning@plt>
jmp    1237 <compare_lon_reg2d+0xf7>
jmp    1229 <compare_lon_reg2d+0xe9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ce <compare_lon_reg2d+0x8e>
mov    -0x18(%rbp),%rcx
lea    0xdde(%rip),%rdi
lea    0xde9(%rip),%rsi
mov    $0x51,%edx
mov    $0x0,%al
call   1050 <Free@plt>
mov    -0x20(%rbp),%rcx
lea    0xdc0(%rip),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x52,%edx
mov    $0x0,%al
call   1050 <Free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_lon_reg2d>:
cmp    $0x2,%edi
jl     11f1 <compare_lon_reg2d+0xb1>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%r12d
lea    0x0(,%r12,8),%rbx
lea    0xead(%rip),%rdi
lea    0xeb8(%rip),%rsi
xor    %r13d,%r13d
mov    $0x44,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%r14
lea    0xe8a(%rip),%rdi
lea    0xe95(%rip),%rsi
mov    $0x45,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rbx
mov    %ebp,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <gridInqXvals@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <gridInqXvals@plt>
movapd 0xe38(%rip),%xmm0
movsd  0xe40(%rip),%xmm1
movsd  (%r14,%r13,8),%xmm2
subsd  (%rbx,%r13,8),%xmm2
andpd  %xmm0,%xmm2
ucomisd %xmm1,%xmm2
ja     11f2 <compare_lon_reg2d+0xb2>
add    $0x1,%r13
cmp    %r13,%r12
jne    11d0 <compare_lon_reg2d+0x90>
jmp    1200 <compare_lon_reg2d+0xc0>
ret
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1060 <cdoWarning@plt>
lea    0xe11(%rip),%rbp
lea    0xe1c(%rip),%r15
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x51,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <Free@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    $0x52,%edx
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <Free@plt>

LLVM IR (-O0):
@__func__.compare_lon_reg2d = [18 x i8] c"compare_lon_reg2d\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/cdo_vlist.c\00"
@.str.1 = [24 x i8] c"Grid longitudes differ!\00"
define void @compare_lon_reg2d(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %60
12: ; preds = %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 68, i64 %15)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to double*
store double* %18, double** %7
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 69, i64 %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to double*
store double* %24, double** %8
%25 = load i32, i32* %5
%26 = load double*, double** %7
%27 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %25, double* %26)
%28 = load i32, i32* %6
%29 = load double*, double** %8
%30 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %28, double* %29)
store i32 0, i32* %9
br label %31
31: ; preds = %52, %12
%32 = load i32, i32* %9
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %55
35: ; preds = %31
%36 = load double*, double** %7
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %8
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = fsub double %40, %45
%47 = call double @llvm.fabs.f64(double %46)
%48 = fcmp ogt double %47, 1.000000e-05
br i1 %48, label %49, label %51
49: ; preds = %35
%50 = call i32 (i8*, ...) bitcast (i32 (...)* @cdoWarning to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %55
51: ; preds = %35
br label %52
52: ; preds = %51
%53 = load i32, i32* %9
%54 = add nsw i32 %53, 1
store i32 %54, i32* %9
br label %31
55: ; preds = %49, %31
%56 = load double*, double** %7
%57 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 81, double* %56)
%58 = load double*, double** %8
%59 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 82, double* %58)
br label %60
60: ; preds = %55, %3
ret void
}

LLVM IR (-O2):
@__func__.compare_lon_reg2d = [18 x i8] c"compare_lon_reg2d\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/cdo_vlist.c\00"
@.str.1 = [24 x i8] c"Grid longitudes differ!\00"
define void @compare_lon_reg2d(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %33
5: ; preds = %3
%6 = zext i32 %0 to i64
%7 = shl nuw nsw i64 %6, 3
%8 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 68, i64 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to double*
%11 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 69, i64 %7)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to double*
%14 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %1, double* %10)
%15 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %2, double* %13)
br label %18
16: ; preds = %18
%17 = icmp eq i64 %27, %6
br i1 %17, label %30, label %18
18: ; preds = %5, %16
%19 = phi i64 [ 0, %5 ], [ %27, %16 ]
%20 = getelementptr inbounds double, double* %10, i64 %19
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %13, i64 %19
%23 = load double, double* %22
%24 = fsub double %21, %23
%25 = tail call double @llvm.fabs.f64(double %24)
%26 = fcmp ogt double %25, 1.000000e-05
%27 = add nuw nsw i64 %19, 1
br i1 %26, label %28, label %16
28: ; preds = %18
%29 = tail call i32 (i8*, ...) bitcast (i32 (...)* @cdoWarning to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %16, %28
%31 = tail call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 81, double* %10)
%32 = tail call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.compare_lon_reg2d, i64 0, i64 0), i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 82, double* %13)
br label %33
33: ; preds = %30, %3
ret void
}