void test_builtin_cargl(_Complex long double ld) {
  if (__builtin_cargl(ld) != __builtin_cargl(ld))
    link_failure_builtin_cargl();
}


x86 assembly (clang, -O0):
<test_builtin_cargl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
movaps -0x20(%rbp),%xmm0
movaps -0x10(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <cargl@plt>
mov    -0x58(%rbp),%rax
fstpt  -0x4c(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <cargl@plt>
fldt   -0x4c(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jne    119a <test_builtin_cargl+0x7a>
jp     119a <test_builtin_cargl+0x7a>
jmp    11a1 <test_builtin_cargl+0x81>
mov    $0x0,%al
call   1040 <link_failure_builtin_cargl@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_cargl>:
sub    $0x98,%rsp
fldt   0xa0(%rsp)
fld    %st(0)
fstpt  0x38(%rsp)
fldt   0xb0(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fxch   %st(1)
fstpt  0x70(%rsp)
fstpt  0x80(%rsp)
movaps 0x70(%rsp),%xmm0
movaps 0x80(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <cargl@plt>
fstpt  0x44(%rsp)
fldt   0x38(%rsp)
fstpt  0x50(%rsp)
fldt   0x2c(%rsp)
fstpt  0x60(%rsp)
movaps 0x50(%rsp),%xmm0
movaps 0x60(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <cargl@plt>
fldt   0x44(%rsp)
fucomip %st(1),%st
fstp   %st(0)
jne    11a1 <test_builtin_cargl+0x81>
jnp    11af <test_builtin_cargl+0x8f>
xor    %eax,%eax
add    $0x98,%rsp
jmp    1040 <link_failure_builtin_cargl@plt>
add    $0x98,%rsp
ret

LLVM IR (-O0):
define void @test_builtin_cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = call x86_fp80 @cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
%11 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%12 = load x86_fp80, x86_fp80* %11
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%14 = load x86_fp80, x86_fp80* %13
%15 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%16 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %12, x86_fp80* %15
store x86_fp80 %14, x86_fp80* %16
%17 = call x86_fp80 @cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%18 = fcmp une x86_fp80 %10, %17
br i1 %18, label %19, label %21
19: ; preds = %1
%20 = call i32 (...) @link_failure_builtin_cargl()
br label %21
21: ; preds = %19, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_cargl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = tail call x86_fp80 @cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
%11 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i64 0, i32 0
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i64 0, i32 1
store x86_fp80 %5, x86_fp80* %11
store x86_fp80 %7, x86_fp80* %12
%13 = tail call x86_fp80 @cargl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%14 = fcmp une x86_fp80 %10, %13
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = tail call i32 (...) @link_failure_builtin_cargl()
br label %17
17: ; preds = %15, %1
ret void
}