#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
void assertd_failure(char *, int, char *);
int quantile_compare(const void *d1, const void *d2) {
  if (*(double *)d1 < *(double *)d2) {
    return -1;
  } else if (*(double *)d1 == *(double *)d2) {
    return 0;
  } else {
    ((*(double *)d1 > *(double *)d2)
         ? (void)0
         : assertd_failure("/scratch/repos/new/home/jordi_armengol_estape/"
                           "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                           "GT-CoLisEU/Android/refs/heads/dev/CoLisEU-API/src/"
                           "main/jni/bwctl-1.5.4/thrulay/reporting.c",
                           225, "*(double *)d1 > *(double *)d2"));
    return 1;
  }
}


x86 assembly (clang, -O0):
<quantile_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <quantile_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a8 <quantile_compare+0x98>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    116e <quantile_compare+0x5e>
jp     116e <quantile_compare+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <quantile_compare+0x98>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1189 <quantile_compare+0x79>
jmp    11a1 <quantile_compare+0x91>
lea    0xe70(%rip),%rdi
mov    $0xe1,%esi
lea    0xf19(%rip),%rdx
call   1030 <assertd_failure@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantile_compare>:
push   %rbx
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    $0xffffffff,%ebx
ucomisd %xmm0,%xmm1
ja     114d <quantile_compare+0x3d>
xor    %ebx,%ebx
ucomisd %xmm1,%xmm0
jne    112e <quantile_compare+0x1e>
jnp    114d <quantile_compare+0x3d>
mov    $0x1,%ebx
ja     114d <quantile_compare+0x3d>
lea    0xec4(%rip),%rdi
lea    0xf72(%rip),%rdx
mov    $0xe1,%esi
call   1030 <assertd_failure@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [181 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GT-CoLisEU/Android/refs/heads/dev/CoLisEU-API/src/main/jni/bwctl-1.5.4/thrulay/reporting.c\00"
@.str.1 = [30 x i8] c"*(double *)d1 > *(double *)d2\00"
define i32 @quantile_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %34
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp oeq double %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %34
23: ; preds = %14
%24 = load i8*, i8** %4
%25 = bitcast i8* %24 to double*
%26 = load double, double* %25
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to double*
%29 = load double, double* %28
%30 = fcmp ogt double %26, %29
br i1 %30, label %31, label %32
31: ; preds = %23
br label %33
32: ; preds = %23
br label %33
33: ; preds = %32, %31
store i32 1, i32* %3
br label %34
34: ; preds = %33, %22, %13
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str = [181 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GT-CoLisEU/Android/refs/heads/dev/CoLisEU-API/src/main/jni/bwctl-1.5.4/thrulay/reporting.c\00"
@.str.1 = [30 x i8] c"*(double *)d1 > *(double *)d2\00"
define i32 @quantile_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = fcmp oeq double %4, %6
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = fcmp ogt double %4, %6
br i1 %11, label %13, label %12
12: ; preds = %10
tail call void @assertd_failure(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %12, %10, %8, %2
%14 = phi i32 [ -1, %2 ], [ 0, %8 ], [ 1, %10 ], [ 1, %12 ]
ret i32 %14
}