#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ check_ll(long double, long long const);
int /*<<< orphan*/ check_ull(long double, long long const);
int main() {
  const long long ll_max = (long long)((1ULL << 63) - 1);
  const long long ll_min = -ll_max - 1;
  check_ll(206.23253, 206LL);
  check_ull(206.23253, 206ULL);
  check_ll((long double)ll_max, ll_max);
  check_ull((long double)ll_max, ll_max);
  check_ll((long double)ll_min, ll_min);
  check_ll(0.0, 0);
  check_ull(0.0, 0);
  check_ll(-1.0, -1);
  check_ll((long double)0xffffffffffffffffULL, ll_max);
  check_ull((long double)0xffffffffffffffffULL, 0xffffffffffffffffULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x18(%rbp)
mov    %rsp,%rax
fldl   0xed4(%rip)
fstpt  (%rax)
mov    $0xce,%edi
call   1040 <check_ll@plt>
mov    %rsp,%rax
fldl   0xebf(%rip)
fstpt  (%rax)
mov    $0xce,%edi
call   1030 <check_ull@plt>
mov    %rsp,%rax
fldt   0xe92(%rip)
fstpt  (%rax)
movabs $0x7fffffffffffffff,%rdi
ff ff 7f
call   1040 <check_ll@plt>
mov    %rsp,%rax
fldt   0xe78(%rip)
fstpt  (%rax)
movabs $0x7fffffffffffffff,%rdi
ff ff 7f
call   1030 <check_ull@plt>
mov    %rsp,%rax
flds   0xe6e(%rip)
fstpt  (%rax)
movabs $0x8000000000000000,%rdi
call   1040 <check_ll@plt>
mov    %rsp,%rax
fldz
fstpt  (%rax)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <check_ll@plt>
mov    %rsp,%rax
fldz
fstpt  (%rax)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <check_ull@plt>
mov    %rsp,%rax
fld1
fchs
fstpt  (%rax)
mov    $0xffffffffffffffff,%rdi
call   1040 <check_ll@plt>
mov    %rsp,%rax
fldt   0xdff(%rip)
fstpt  (%rax)
movabs $0x7fffffffffffffff,%rdi
ff ff 7f
call   1040 <check_ll@plt>
mov    %rsp,%rax
fldt   0xde5(%rip)
fstpt  (%rax)
mov    $0xffffffffffffffff,%rdi
call   1030 <check_ull@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
fldl   0xed5(%rip)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
mov    $0xce,%edi
call   1040 <check_ll@plt>
fldt   0x14(%rsp)
fstpt  (%rsp)
mov    $0xce,%edi
call   1030 <check_ull@plt>
fldt   0xebb(%rip)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
mov    %rbx,%rdi
call   1040 <check_ll@plt>
fldt   0x14(%rsp)
fstpt  (%rsp)
mov    %rbx,%rdi
call   1030 <check_ull@plt>
lea    0x1(%rbx),%rdi
flds   0xea7(%rip)
fstpt  (%rsp)
call   1040 <check_ll@plt>
fldz
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
xor    %edi,%edi
call   1040 <check_ll@plt>
fldt   0x14(%rsp)
fstpt  (%rsp)
xor    %edi,%edi
call   1030 <check_ull@plt>
fld1
fchs
fstpt  (%rsp)
mov    $0xffffffffffffffff,%rdi
call   1040 <check_ll@plt>
fldt   0xe56(%rip)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
mov    %rbx,%rdi
call   1040 <check_ll@plt>
fldt   0x14(%rsp)
fstpt  (%rsp)
mov    $0xffffffffffffffff,%rdi
call   1030 <check_ull@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 9223372036854775807, i64* %2
store i64 -9223372036854775808, i64* %3
%4 = call i32 @check_ll(x86_fp80 0xK4006CE3B87160956C000, i64 206)
%5 = call i32 @check_ull(x86_fp80 0xK4006CE3B87160956C000, i64 206)
%6 = call i32 @check_ll(x86_fp80 0xK403DFFFFFFFFFFFFFFFE, i64 9223372036854775807)
%7 = call i32 @check_ull(x86_fp80 0xK403DFFFFFFFFFFFFFFFE, i64 9223372036854775807)
%8 = call i32 @check_ll(x86_fp80 0xKC03E8000000000000000, i64 -9223372036854775808)
%9 = call i32 @check_ll(x86_fp80 0xK00000000000000000000, i64 0)
%10 = call i32 @check_ull(x86_fp80 0xK00000000000000000000, i64 0)
%11 = call i32 @check_ll(x86_fp80 0xKBFFF8000000000000000, i64 -1)
%12 = call i32 @check_ll(x86_fp80 0xK403EFFFFFFFFFFFFFFFF, i64 9223372036854775807)
%13 = call i32 @check_ull(x86_fp80 0xK403EFFFFFFFFFFFFFFFF, i64 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @check_ll(x86_fp80 0xK4006CE3B87160956C000, i64 206)
%2 = tail call i32 @check_ull(x86_fp80 0xK4006CE3B87160956C000, i64 206)
%3 = tail call i32 @check_ll(x86_fp80 0xK403DFFFFFFFFFFFFFFFE, i64 9223372036854775807)
%4 = tail call i32 @check_ull(x86_fp80 0xK403DFFFFFFFFFFFFFFFE, i64 9223372036854775807)
%5 = tail call i32 @check_ll(x86_fp80 0xKC03E8000000000000000, i64 -9223372036854775808)
%6 = tail call i32 @check_ll(x86_fp80 0xK00000000000000000000, i64 0)
%7 = tail call i32 @check_ull(x86_fp80 0xK00000000000000000000, i64 0)
%8 = tail call i32 @check_ll(x86_fp80 0xKBFFF8000000000000000, i64 -1)
%9 = tail call i32 @check_ll(x86_fp80 0xK403EFFFFFFFFFFFFFFFF, i64 9223372036854775807)
%10 = tail call i32 @check_ull(x86_fp80 0xK403EFFFFFFFFFFFFFFFF, i64 -1)
ret i32 0
}