void check(__float128 a, __float128 b, int eq, int ne, int lt, int le, int gt,
           int ge, int i_lt, int i_le, int i_gt, int i_ge, int i_lg, int i_un) {
  if (eq != (a == b))
    abort();
  if (ne != (a != b))
    abort();
  if (lt != (a < b))
    abort();
  if (le != (a <= b))
    abort();
  if (gt != (a > b))
    abort();
  if (ge != (a >= b))
    abort();
  if (i_lt != __builtin_isless(a, b))
    abort();
  if (i_le != __builtin_islessequal(a, b))
    abort();
  if (i_gt != __builtin_isgreater(a, b))
    abort();
  if (i_ge != __builtin_isgreaterequal(a, b))
    abort();
  if (i_lg != __builtin_islessgreater(a, b))
    abort();
  if (i_un != __builtin_isunordered(a, b))
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
movaps %xmm0,-0x10(%rbp)
movaps %xmm1,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %ecx,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    %r9d,-0x38(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   1c40 <__eqtf2>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
test   %ecx,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1179 <check+0x69>
call   1030 <abort@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x40(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   1c40 <__eqtf2>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
test   %ecx,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     11a9 <check+0x99>
call   1030 <abort@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x44(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   18f0 <__letf2>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
test   %ecx,%ecx
sets   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     11d9 <check+0xc9>
call   1030 <abort@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x48(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   18f0 <__letf2>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
test   %ecx,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1209 <check+0xf9>
call   1030 <abort@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   15b0 <__getf2>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
test   %ecx,%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1239 <check+0x129>
call   1030 <abort@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x50(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   15b0 <__getf2>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
test   %ecx,%ecx
setns  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1269 <check+0x159>
call   1030 <abort@plt>
mov    0x10(%rbp),%eax
mov    %eax,-0x54(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   18f0 <__letf2>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
test   %ecx,%ecx
sets   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1299 <check+0x189>
call   1030 <abort@plt>
mov    0x18(%rbp),%eax
mov    %eax,-0x58(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   18f0 <__letf2>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
test   %ecx,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     12c9 <check+0x1b9>
call   1030 <abort@plt>
mov    0x20(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   15b0 <__getf2>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
test   %ecx,%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     12f9 <check+0x1e9>
call   1030 <abort@plt>
mov    0x28(%rbp),%eax
mov    %eax,-0x60(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   15b0 <__getf2>
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
test   %ecx,%ecx
setns  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1329 <check+0x219>
call   1030 <abort@plt>
mov    0x30(%rbp),%eax
mov    %eax,-0x64(%rbp)
movaps -0x10(%rbp),%xmm0
movaps %xmm0,-0x90(%rbp)
movaps -0x20(%rbp),%xmm1
movaps %xmm1,-0x80(%rbp)
call   1c40 <__eqtf2>
movaps -0x90(%rbp),%xmm0
movaps -0x80(%rbp),%xmm1
test   %eax,%eax
setne  %al
mov    %al,-0x65(%rbp)
call   13c0 <__unordtf2>
mov    -0x65(%rbp),%dl
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
test   %ecx,%ecx
sete   %cl
and    %dl,%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1381 <check+0x271>
call   1030 <abort@plt>
mov    0x38(%rbp),%eax
mov    %eax,-0x94(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   13c0 <__unordtf2>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
test   %ecx,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     13b7 <check+0x2a7>
call   1030 <abort@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
movaps %xmm0,(%rsp)
movaps %xmm1,0x10(%rsp)
call   1af0 <__eqtf2>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
cmp    %ebp,%ecx
jne    1261 <check+0x151>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1af0 <__eqtf2>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
cmp    %ebx,%ecx
jne    1261 <check+0x151>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   17a0 <__letf2>
xor    %ecx,%ecx
test   %eax,%eax
sets   %cl
cmp    %r13d,%ecx
jne    1261 <check+0x151>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   17a0 <__letf2>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
cmp    %r12d,%ecx
jne    1261 <check+0x151>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1460 <__getf2>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
cmp    %r15d,%ecx
jne    1261 <check+0x151>
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1460 <__getf2>
xor    %ecx,%ecx
test   %eax,%eax
setns  %cl
cmp    %r14d,%ecx
jne    1261 <check+0x151>
cmp    0x60(%rsp),%r13d
jne    1261 <check+0x151>
cmp    0x68(%rsp),%r12d
movaps 0x10(%rsp),%xmm1
movaps (%rsp),%xmm0
jne    1261 <check+0x151>
cmp    0x70(%rsp),%r15d
jne    1261 <check+0x151>
cmp    0x78(%rsp),%r14d
jne    1261 <check+0x151>
mov    0x80(%rsp),%ebp
call   1af0 <__eqtf2>
test   %eax,%eax
setne  %bl
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1270 <__unordtf2>
test   %eax,%eax
sete   %al
and    %bl,%al
movzbl %al,%eax
cmp    %ebp,%eax
jne    1261 <check+0x151>
mov    0x88(%rsp),%ebx
movaps (%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1270 <__unordtf2>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
cmp    %ebx,%ecx
jne    1261 <check+0x151>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
call   1030 <abort@plt>
cs nopw 0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @check(fp128 %0, fp128 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13) {
%15 = alloca fp128
%16 = alloca fp128
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store fp128 %0, fp128* %15
store fp128 %1, fp128* %16
store i32 %2, i32* %17
store i32 %3, i32* %18
store i32 %4, i32* %19
store i32 %5, i32* %20
store i32 %6, i32* %21
store i32 %7, i32* %22
store i32 %8, i32* %23
store i32 %9, i32* %24
store i32 %10, i32* %25
store i32 %11, i32* %26
store i32 %12, i32* %27
store i32 %13, i32* %28
%29 = load i32, i32* %17
%30 = load fp128, fp128* %15
%31 = load fp128, fp128* %16
%32 = fcmp oeq fp128 %30, %31
%33 = zext i1 %32 to i32
%34 = icmp ne i32 %29, %33
br i1 %34, label %35, label %36
35: ; preds = %14
unreachable
36: ; preds = %14
%37 = load i32, i32* %18
%38 = load fp128, fp128* %15
%39 = load fp128, fp128* %16
%40 = fcmp une fp128 %38, %39
%41 = zext i1 %40 to i32
%42 = icmp ne i32 %37, %41
br i1 %42, label %43, label %44
43: ; preds = %36
unreachable
44: ; preds = %36
%45 = load i32, i32* %19
%46 = load fp128, fp128* %15
%47 = load fp128, fp128* %16
%48 = fcmp olt fp128 %46, %47
%49 = zext i1 %48 to i32
%50 = icmp ne i32 %45, %49
br i1 %50, label %51, label %52
51: ; preds = %44
unreachable
52: ; preds = %44
%53 = load i32, i32* %20
%54 = load fp128, fp128* %15
%55 = load fp128, fp128* %16
%56 = fcmp ole fp128 %54, %55
%57 = zext i1 %56 to i32
%58 = icmp ne i32 %53, %57
br i1 %58, label %59, label %60
59: ; preds = %52
unreachable
60: ; preds = %52
%61 = load i32, i32* %21
%62 = load fp128, fp128* %15
%63 = load fp128, fp128* %16
%64 = fcmp ogt fp128 %62, %63
%65 = zext i1 %64 to i32
%66 = icmp ne i32 %61, %65
br i1 %66, label %67, label %68
67: ; preds = %60
unreachable
68: ; preds = %60
%69 = load i32, i32* %22
%70 = load fp128, fp128* %15
%71 = load fp128, fp128* %16
%72 = fcmp oge fp128 %70, %71
%73 = zext i1 %72 to i32
%74 = icmp ne i32 %69, %73
br i1 %74, label %75, label %76
75: ; preds = %68
unreachable
76: ; preds = %68
%77 = load i32, i32* %23
%78 = load fp128, fp128* %15
%79 = load fp128, fp128* %16
%80 = fcmp olt fp128 %78, %79
%81 = zext i1 %80 to i32
%82 = icmp ne i32 %77, %81
br i1 %82, label %83, label %84
83: ; preds = %76
unreachable
84: ; preds = %76
%85 = load i32, i32* %24
%86 = load fp128, fp128* %15
%87 = load fp128, fp128* %16
%88 = fcmp ole fp128 %86, %87
%89 = zext i1 %88 to i32
%90 = icmp ne i32 %85, %89
br i1 %90, label %91, label %92
91: ; preds = %84
unreachable
92: ; preds = %84
%93 = load i32, i32* %25
%94 = load fp128, fp128* %15
%95 = load fp128, fp128* %16
%96 = fcmp ogt fp128 %94, %95
%97 = zext i1 %96 to i32
%98 = icmp ne i32 %93, %97
br i1 %98, label %99, label %100
99: ; preds = %92
unreachable
100: ; preds = %92
%101 = load i32, i32* %26
%102 = load fp128, fp128* %15
%103 = load fp128, fp128* %16
%104 = fcmp oge fp128 %102, %103
%105 = zext i1 %104 to i32
%106 = icmp ne i32 %101, %105
br i1 %106, label %107, label %108
107: ; preds = %100
unreachable
108: ; preds = %100
%109 = load i32, i32* %27
%110 = load fp128, fp128* %15
%111 = load fp128, fp128* %16
%112 = fcmp one fp128 %110, %111
%113 = zext i1 %112 to i32
%114 = icmp ne i32 %109, %113
br i1 %114, label %115, label %116
115: ; preds = %108
unreachable
116: ; preds = %108
%117 = load i32, i32* %28
%118 = load fp128, fp128* %15
%119 = load fp128, fp128* %16
%120 = fcmp uno fp128 %118, %119
%121 = zext i1 %120 to i32
%122 = icmp ne i32 %117, %121
br i1 %122, label %123, label %124
123: ; preds = %116
unreachable
124: ; preds = %116
ret void
}

LLVM IR (-O2):
define void @check(fp128 %0, fp128 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13) {
%15 = fcmp oeq fp128 %0, %1
%16 = zext i1 %15 to i32
%17 = icmp eq i32 %16, %2
br i1 %17, label %19, label %18
18: ; preds = %14
tail call void @abort()
unreachable
19: ; preds = %14
%20 = fcmp une fp128 %0, %1
%21 = zext i1 %20 to i32
%22 = icmp eq i32 %21, %3
br i1 %22, label %24, label %23
23: ; preds = %19
tail call void @abort()
unreachable
24: ; preds = %19
%25 = fcmp olt fp128 %0, %1
%26 = zext i1 %25 to i32
%27 = icmp eq i32 %26, %4
br i1 %27, label %29, label %28
28: ; preds = %24
tail call void @abort()
unreachable
29: ; preds = %24
%30 = fcmp ole fp128 %0, %1
%31 = zext i1 %30 to i32
%32 = icmp eq i32 %31, %5
br i1 %32, label %34, label %33
33: ; preds = %29
tail call void @abort()
unreachable
34: ; preds = %29
%35 = fcmp ogt fp128 %0, %1
%36 = zext i1 %35 to i32
%37 = icmp eq i32 %36, %6
br i1 %37, label %39, label %38
38: ; preds = %34
tail call void @abort()
unreachable
39: ; preds = %34
%40 = fcmp oge fp128 %0, %1
%41 = zext i1 %40 to i32
%42 = icmp eq i32 %41, %7
br i1 %42, label %44, label %43
43: ; preds = %39
tail call void @abort()
unreachable
44: ; preds = %39
%45 = icmp eq i32 %4, %8
br i1 %45, label %47, label %46
46: ; preds = %44
tail call void @abort()
unreachable
47: ; preds = %44
%48 = icmp eq i32 %5, %9
br i1 %48, label %50, label %49
49: ; preds = %47
tail call void @abort()
unreachable
50: ; preds = %47
%51 = icmp eq i32 %6, %10
br i1 %51, label %53, label %52
52: ; preds = %50
tail call void @abort()
unreachable
53: ; preds = %50
%54 = icmp eq i32 %7, %11
br i1 %54, label %56, label %55
55: ; preds = %53
tail call void @abort()
unreachable
56: ; preds = %53
%57 = fcmp one fp128 %0, %1
%58 = zext i1 %57 to i32
%59 = icmp eq i32 %58, %12
br i1 %59, label %61, label %60
60: ; preds = %56
tail call void @abort()
unreachable
61: ; preds = %56
%62 = fcmp uno fp128 %0, %1
%63 = zext i1 %62 to i32
%64 = icmp eq i32 %63, %13
br i1 %64, label %66, label %65
65: ; preds = %61
tail call void @abort()
unreachable
66: ; preds = %61
ret void
}