int qd_gt_qd_dd(const double *a, const double *b) {
  return (a[0] > b[0] || (a[0] == b[0] && a[1] > b[1]) ||
          (a[1] == b[1] && a[2] > 0.0))
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<qd_gt_qd_dd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
ja     119f <qd_gt_qd_dd+0x9f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1160 <qd_gt_qd_dd+0x60>
jp     1160 <qd_gt_qd_dd+0x60>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
ucomisd 0x8(%rcx),%xmm0
mov    %al,-0x11(%rbp)
ja     119f <qd_gt_qd_dd+0x9f>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd 0x8(%rcx),%xmm0
mov    %al,-0x12(%rbp)
jne    1199 <qd_gt_qd_dd+0x99>
jp     1199 <qd_gt_qd_dd+0x99>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_gt_qd_dd>:
movsd  (%rdi),%xmm0
mov    $0x1,%eax
ucomisd (%rsi),%xmm0
ja     1123 <qd_gt_qd_dd+0x23>
movsd  0x8(%rdi),%xmm0
movsd  0x8(%rsi),%xmm1
jne    1124 <qd_gt_qd_dd+0x24>
jp     1124 <qd_gt_qd_dd+0x24>
ucomisd %xmm1,%xmm0
jbe    1124 <qd_gt_qd_dd+0x24>
ret
ucomisd %xmm1,%xmm0
jne    113f <qd_gt_qd_dd+0x3f>
jp     113f <qd_gt_qd_dd+0x3f>
movsd  0x10(%rdi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @qd_gt_qd_dd(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fcmp ogt double %7, %10
br i1 %11, label %43, label %12
12: ; preds = %2
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = fcmp oeq double %15, %18
br i1 %19, label %20, label %28
20: ; preds = %12
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fcmp ogt double %23, %26
br i1 %27, label %43, label %28
28: ; preds = %20, %12
%29 = load double*, double** %3
%30 = getelementptr inbounds double, double* %29, i64 1
%31 = load double, double* %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 1
%34 = load double, double* %33
%35 = fcmp oeq double %31, %34
br i1 %35, label %36, label %41
36: ; preds = %28
%37 = load double*, double** %3
%38 = getelementptr inbounds double, double* %37, i64 2
%39 = load double, double* %38
%40 = fcmp ogt double %39, 0.000000e+00
br label %41
41: ; preds = %36, %28
%42 = phi i1 [ false, %28 ], [ %40, %36 ]
br label %43
43: ; preds = %41, %20, %2
%44 = phi i1 [ true, %20 ], [ true, %2 ], [ %42, %41 ]
%45 = zext i1 %44 to i64
%46 = select i1 %44, i32 1, i32 0
ret i32 %46
}

LLVM IR (-O2):
define i32 @qd_gt_qd_dd(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
br i1 %5, label %21, label %6
6: ; preds = %2
%7 = fcmp oeq double %3, %4
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = fcmp ogt double %9, %11
%13 = select i1 %7, i1 %12, i1 false
br i1 %13, label %21, label %14
14: ; preds = %6
%15 = fcmp oeq double %9, %11
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = getelementptr inbounds double, double* %0, i64 2
%18 = load double, double* %17
%19 = fcmp ogt double %18, 0.000000e+00
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %6, %14, %16, %2
%22 = phi i32 [ 1, %2 ], [ 0, %14 ], [ %20, %16 ], [ 1, %6 ]
ret i32 %22
}