int _fff_abs_comp(const void *x, const void *y) {
  int ans = 1;
  double xx = *((double *)x);
  double yy = *((double *)y);
  xx = ((xx) > 0.0 ? (xx) : (-(xx)));
  yy = ((yy) > 0.0 ? (yy) : (-(yy)));
  if (yy > xx) {
    ans = -1;
    return ans;
  }
  if (yy == xx)
    ans = 0;
  return ans;
}


x86 assembly (clang, -O0):
<_fff_abs_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114e <_fff_abs_comp+0x4e>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    116f <_fff_abs_comp+0x6f>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    119a <_fff_abs_comp+0x9a>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11bb <_fff_abs_comp+0xbb>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11e7 <_fff_abs_comp+0xe7>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    120a <_fff_abs_comp+0x10a>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1204 <_fff_abs_comp+0x104>
jp     1204 <_fff_abs_comp+0x104>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fff_abs_comp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd 0xef0(%rip),%xmm2
xorpd  %xmm3,%xmm3
cmpltsd %xmm0,%xmm3
movapd %xmm3,%xmm4
andpd  %xmm0,%xmm3
xorpd  %xmm2,%xmm0
xorpd  %xmm5,%xmm5
andnpd %xmm0,%xmm4
orpd   %xmm4,%xmm3
xorpd  %xmm1,%xmm2
cmpltsd %xmm1,%xmm5
movapd %xmm5,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm1,%xmm5
orpd   %xmm0,%xmm5
movapd %xmm5,%xmm0
cmpneqsd %xmm3,%xmm0
movq   %xmm0,%rcx
and    $0x1,%ecx
ucomisd %xmm3,%xmm5
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_fff_abs_comp(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 ogt double %4, 0.000000e+00
%8 = fneg double %4
%9 = select i1 %7, double %4, double %8
%10 = fcmp ogt double %6, 0.000000e+00
%11 = fneg double %6
%12 = select i1 %10, double %6, double %11
%13 = fcmp ogt double %12, %9
%14 = fcmp une double %12, %9
%15 = zext i1 %14 to i32
%16 = select i1 %13, i32 -1, i32 %15
ret i32 %16
}