long double xcmpl(x, y)
long double x, y;
{
  long double ans;
  char str[40];
  e64toasc(&x, str, 100);
  printf("x = %s\n", str);
  e64toasc(&y, str, 100);
  printf("y = %s\n", str);
  ans = -2.0;
  if (x == y) {
    printf("x == y ");
    ans = 0.0;
  }
  if (x < y) {
    printf("x < y");
    ans = -1.0;
  }
  if (x > y) {
    printf("x > y");
    ans = 1.0;
  }
  return (ans);
}


x86 assembly (clang, -O0):
<xcmpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
mov    %al,-0x61(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    %rsi,-0x70(%rbp)
mov    $0x64,%edx
mov    %edx,-0x74(%rbp)
call   1040 <e64toasc@plt>
mov    -0x70(%rbp),%rsi
mov    -0x61(%rbp),%al
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%edx
mov    -0x70(%rbp),%rsi
mov    -0x61(%rbp),%al
lea    -0x20(%rbp),%rdi
call   1040 <e64toasc@plt>
mov    -0x70(%rbp),%rsi
mov    -0x61(%rbp),%al
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
flds   0xe6c(%rip)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11c7 <xcmpl+0xa7>
jp     11c7 <xcmpl+0xa7>
jmp    11b4 <xcmpl+0x94>
lea    0xe59(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldz
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    11f1 <xcmpl+0xd1>
jmp    11dc <xcmpl+0xbc>
lea    0xe39(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fld1
fchs
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    121b <xcmpl+0xfb>
jmp    1208 <xcmpl+0xe8>
lea    0xe13(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fld1
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcmpl>:
push   %rbx
sub    $0x50,%rsp
fldt   0x70(%rsp)
fldt   0x60(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0x10(%rsp),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1040 <e64toasc@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1040 <e64toasc@plt>
lea    0xe95(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x10(%rsp)
fldt   (%rsp)
flds   0xe72(%rip)
fxch   %st(2)
fucomi %st(1),%st
jne    11b7 <xcmpl+0x97>
jp     11b7 <xcmpl+0x97>
fstp   %st(2)
fstp   %st(1)
fstp   %st(0)
lea    0xe71(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x10(%rsp)
fldz
fldt   (%rsp)
fxch   %st(1)
fxch   %st(2)
fxch   %st(1)
fucomi %st(1),%st
jbe    11e2 <xcmpl+0xc2>
fstp   %st(2)
fstp   %st(0)
fstp   %st(0)
lea    0xe52(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x10(%rsp)
fld1
fchs
fldt   (%rsp)
fxch   %st(1)
fxch   %st(2)
fxch   %st(1)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    11fc <xcmpl+0xdc>
fstp   %st(0)
lea    0xe2f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fld1
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"x = %s\0A\00"
@.str.1 = [8 x i8] c"y = %s\0A\00"
@.str.2 = [8 x i8] c"x == y \00"
@.str.3 = [6 x i8] c"x < y\00"
@.str.4 = [6 x i8] c"x > y\00"
define x86_fp80 @xcmpl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca [40 x i8]
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%8 = call i32 (x86_fp80*, i8*, i32, ...) bitcast (i32 (...)* @e64toasc to i32 (x86_fp80*, i8*, i32, ...)*)(x86_fp80* %3, i8* %7, i32 100)
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%12 = call i32 (x86_fp80*, i8*, i32, ...) bitcast (i32 (...)* @e64toasc to i32 (x86_fp80*, i8*, i32, ...)*)(x86_fp80* %4, i8* %11, i32 100)
%13 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %13)
store x86_fp80 0xKC0008000000000000000, x86_fp80* %5
%15 = load x86_fp80, x86_fp80* %3
%16 = load x86_fp80, x86_fp80* %4
%17 = fcmp oeq x86_fp80 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store x86_fp80 0xK00000000000000000000, x86_fp80* %5
br label %20
20: ; preds = %18, %2
%21 = load x86_fp80, x86_fp80* %3
%22 = load x86_fp80, x86_fp80* %4
%23 = fcmp olt x86_fp80 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store x86_fp80 0xKBFFF8000000000000000, x86_fp80* %5
br label %26
26: ; preds = %24, %20
%27 = load x86_fp80, x86_fp80* %3
%28 = load x86_fp80, x86_fp80* %4
%29 = fcmp ogt x86_fp80 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %5
br label %32
32: ; preds = %30, %26
%33 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %33
}

LLVM IR (-O2):
@.str = [8 x i8] c"x = %s\0A\00"
@.str.1 = [8 x i8] c"y = %s\0A\00"
@.str.2 = [8 x i8] c"x == y \00"
@.str.3 = [6 x i8] c"x < y\00"
@.str.4 = [6 x i8] c"x > y\00"
define x86_fp80 @xcmpl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca [40 x i8]
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%7 = call i32 (x86_fp80*, i8*, i32, ...) bitcast (i32 (...)* @e64toasc to i32 (x86_fp80*, i8*, i32, ...)*)(x86_fp80* %3, i8* %6, i32 100)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = call i32 (x86_fp80*, i8*, i32, ...) bitcast (i32 (...)* @e64toasc to i32 (x86_fp80*, i8*, i32, ...)*)(x86_fp80* %4, i8* %6, i32 100)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%11 = load x86_fp80, x86_fp80* %3
%12 = load x86_fp80, x86_fp80* %4
%13 = fcmp oeq x86_fp80 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%16 = load x86_fp80, x86_fp80* %3
%17 = load x86_fp80, x86_fp80* %4
br label %18
18: ; preds = %14, %2
%19 = phi x86_fp80 [ %17, %14 ], [ %12, %2 ]
%20 = phi x86_fp80 [ %16, %14 ], [ %11, %2 ]
%21 = phi x86_fp80 [ 0xK00000000000000000000, %14 ], [ 0xKC0008000000000000000, %2 ]
%22 = fcmp olt x86_fp80 %20, %19
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%25 = load x86_fp80, x86_fp80* %3
%26 = load x86_fp80, x86_fp80* %4
br label %27
27: ; preds = %23, %18
%28 = phi x86_fp80 [ %26, %23 ], [ %19, %18 ]
%29 = phi x86_fp80 [ %25, %23 ], [ %20, %18 ]
%30 = phi x86_fp80 [ 0xKBFFF8000000000000000, %23 ], [ %21, %18 ]
%31 = fcmp ogt x86_fp80 %29, %28
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %27
%35 = phi x86_fp80 [ 0xK3FFF8000000000000000, %32 ], [ %30, %27 ]
ret x86_fp80 %35
}