int main() {
  __float128 a = 0.0;
  __float128 b = 1.0;
  int r;
  r = test_lt(a, b);
  if (r != ((double)a < (double)b))
    abort();
  r = test_gt(a, b);
  if (r != ((double)a > (double)b))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x20(%rbp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps -0x20(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    $0x2,%al
call   1050 <test_lt@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
movaps -0x20(%rbp),%xmm0
call   1200 <__trunctfdf2>
movsd  %xmm0,-0x40(%rbp)
movaps -0x30(%rbp),%xmm0
call   1200 <__trunctfdf2>
movsd  -0x40(%rbp),%xmm1
mov    -0x38(%rbp),%eax
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     11a2 <main+0x72>
call   1030 <abort@plt>
movaps -0x20(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    $0x2,%al
call   1040 <test_gt@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movaps -0x20(%rbp),%xmm0
call   1200 <__trunctfdf2>
movsd  %xmm0,-0x48(%rbp)
movaps -0x30(%rbp),%xmm0
call   1200 <__trunctfdf2>
mov    -0x4c(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     11f6 <main+0xc6>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<main>:
push   %rax
movaps 0xec8(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
call   1050 <test_lt@plt>
cmp    $0x1,%eax
jne    1160 <main+0x30>
movaps 0xeb2(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    $0x2,%al
call   1040 <test_gt@plt>
test   %eax,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca fp128
%3 = alloca fp128
%4 = alloca i32
store i32 0, i32* %1
store fp128 0xL00000000000000000000000000000000, fp128* %2
store fp128 0xL00000000000000003FFF000000000000, fp128* %3
%5 = load fp128, fp128* %2
%6 = load fp128, fp128* %3
%7 = call i32 (fp128, fp128, ...) bitcast (i32 (...)* @test_lt to i32 (fp128, fp128, ...)*)(fp128 %5, fp128 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load fp128, fp128* %2
%10 = fptrunc fp128 %9 to double
%11 = load fp128, fp128* %3
%12 = fptrunc fp128 %11 to double
%13 = fcmp olt double %10, %12
%14 = zext i1 %13 to i32
%15 = icmp ne i32 %8, %14
br i1 %15, label %16, label %17
16: ; preds = %0
unreachable
17: ; preds = %0
%18 = load fp128, fp128* %2
%19 = load fp128, fp128* %3
%20 = call i32 (fp128, fp128, ...) bitcast (i32 (...)* @test_gt to i32 (fp128, fp128, ...)*)(fp128 %18, fp128 %19)
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = load fp128, fp128* %2
%23 = fptrunc fp128 %22 to double
%24 = load fp128, fp128* %3
%25 = fptrunc fp128 %24 to double
%26 = fcmp ogt double %23, %25
%27 = zext i1 %26 to i32
%28 = icmp ne i32 %21, %27
br i1 %28, label %29, label %30
29: ; preds = %17
unreachable
30: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (fp128, fp128, ...) bitcast (i32 (...)* @test_lt to i32 (fp128, fp128, ...)*)(fp128 0xL00000000000000000000000000000000, fp128 0xL00000000000000003FFF000000000000)
%2 = icmp eq i32 %1, 1
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
%5 = tail call i32 (fp128, fp128, ...) bitcast (i32 (...)* @test_gt to i32 (fp128, fp128, ...)*)(fp128 0xL00000000000000000000000000000000, fp128 0xL00000000000000003FFF000000000000)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
tail call void @abort()
unreachable
8: ; preds = %4
ret i32 0
}