#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*/ printf(char *, unsigned long long, unsigned long long, ...);
void llfloat(void) {
  float fa;
  double da;
  long double lda;
  long long la, lb, lc;
  unsigned long long ula, ulb, ulc;
  la = 0x12345678;
  ula = 0x72345678;
  la = (la << 20) | 0x12345;
  ula = ula << 33;
  printf("la=%Ld ula=%Lu\n", la, ula);
  fa = la;
  da = la;
  lda = la;
  printf("lltof: %f %f %Lf\n", fa, da, lda);
  la = fa;
  lb = da;
  lc = lda;
  printf("ftoll: %Ld %Ld %Ld\n", la, lb, lc);
  fa = ula;
  da = ula;
  lda = ula;
  printf("ulltof: %f %f %Lf\n", fa, da, lda);
  ula = fa;
  ulb = da;
  ulc = lda;
  printf("ftoull: %Lu %Lu %Lu\n", ula, ulb, ulc);
}


x86 assembly (clang, -O0):
<llfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movq   $0x12345678,-0x28(%rbp)
12
movq   $0x72345678,-0x40(%rbp)
72
mov    -0x28(%rbp),%rax
shl    $0x14,%rax
or     $0x12345,%rax
mov    %rax,-0x28(%rbp)
mov    -0x40(%rbp),%rax
shl    $0x21,%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x40(%rbp),%rdx
lea    0xee8(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x81(%rbp)
call   1030 <printf@plt>
mov    -0x81(%rbp),%al
cvtsi2ssq -0x28(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x70(%rbp)
fildll -0x70(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe64(%rip),%xmm2
movss  %xmm2,-0x94(%rbp)
ff
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rsi
mov    %rsi,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rsi
movsd  -0x10(%rbp),%xmm0
movsd  0xe39(%rip),%xmm2
movsd  %xmm2,-0x90(%rbp)
ff
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rdx
mov    %rdx,%rdi
sar    $0x3f,%rdi
and    %rdi,%rcx
or     %rcx,%rdx
fldt   -0x20(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x81(%rbp),%al
cvttss2si -0x4(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
cvttsd2si -0x10(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
fldt   -0x20(%rbp)
fnstcw -0x72(%rbp)
movzwl -0x72(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x74(%rbp)
fldcw  -0x74(%rbp)
fistpll -0x68(%rbp)
fldcw  -0x72(%rbp)
mov    -0x68(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x80(%rbp)
test   %rax,%rax
movss  %xmm0,-0x7c(%rbp)
js     129d <llfloat+0x18d>
movss  -0x80(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movsd  -0x90(%rbp),%xmm2
ff
movss  -0x94(%rbp),%xmm3
ff
mov    -0x81(%rbp),%al
movss  -0x7c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movaps 0xd5c(%rip),%xmm1
movq   -0x40(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xd5b(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x40(%rbp),%rcx
mov    %rcx,-0x60(%rbp)
test   %rcx,%rcx
sets   %cl
movzbl %cl,%ecx
mov    %ecx,%edx
fildll -0x60(%rbp)
lea    0xd0a(%rip),%rcx
flds   (%rcx,%rdx,4)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movaps %xmm0,%xmm1
subss  %xmm3,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rsi
mov    %rsi,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rsi
movsd  -0x10(%rbp),%xmm0
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rdx
mov    %rdx,%rdi
sar    $0x3f,%rdi
and    %rdi,%rcx
or     %rcx,%rdx
fldt   -0x20(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xd01(%rip),%rdi
call   1030 <printf@plt>
movss  -0x94(%rbp),%xmm3
ff
movsd  -0x90(%rbp),%xmm2
ff
movss  -0x4(%rbp),%xmm0
movaps %xmm0,%xmm1
subss  %xmm3,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x48(%rbp)
fldt   -0x20(%rbp)
flds   0xc31(%rip)
fucomi %st(1),%st
setbe  %al
fldz
fcmovbe %st(1),%st
fstp   %st(1)
fsubrp %st,%st(1)
fnstcw -0x76(%rbp)
movzwl -0x76(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x78(%rbp)
fldcw  -0x78(%rbp)
fistpll -0x58(%rbp)
fldcw  -0x76(%rbp)
movzbl %al,%eax
mov    %eax,%ecx
shl    $0x3f,%rcx
mov    -0x58(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llfloat>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xef0(%rip),%rdi
movabs $0x1234567812345,%r15
movabs $0xe468acf000000000,%r14
ac 68 e4
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x7edcbb(%r15),%rbx
fldl   0xeb2(%rip)
fstpt  (%rsp)
lea    0xedd(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
fldl   0xe86(%rip)
fstpt  (%rsp)
lea    0xea8(%rip),%rdi
movabs $0xe468ad0000000000,%rbx
ad 68 e4
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r14,%rcx
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"la=%Ld ula=%Lu\0A\00"
@.str.1 = [18 x i8] c"lltof: %f %f %Lf\0A\00"
@.str.2 = [20 x i8] c"ftoll: %Ld %Ld %Ld\0A\00"
@.str.3 = [19 x i8] c"ulltof: %f %f %Lf\0A\00"
@.str.4 = [21 x i8] c"ftoull: %Lu %Lu %Lu\0A\00"
define void @llfloat() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 305419896, i64* %4
store i64 1916032632, i64* %7
%10 = load i64, i64* %4
%11 = shl i64 %10, 20
%12 = or i64 %11, 74565
store i64 %12, i64* %4
%13 = load i64, i64* %7
%14 = shl i64 %13, 33
store i64 %14, i64* %7
%15 = load i64, i64* %4
%16 = load i64, i64* %7
%17 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %15, i64 %16)
%18 = load i64, i64* %4
%19 = sitofp i64 %18 to float
store float %19, float* %1
%20 = load i64, i64* %4
%21 = sitofp i64 %20 to double
store double %21, double* %2
%22 = load i64, i64* %4
%23 = sitofp i64 %22 to x86_fp80
store x86_fp80 %23, x86_fp80* %3
%24 = load float, float* %1
%25 = fptoui float %24 to i64
%26 = load double, double* %2
%27 = fptoui double %26 to i64
%28 = load x86_fp80, x86_fp80* %3
%29 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 %25, i64 %27, x86_fp80 %28)
%30 = load float, float* %1
%31 = fptosi float %30 to i64
store i64 %31, i64* %4
%32 = load double, double* %2
%33 = fptosi double %32 to i64
store i64 %33, i64* %5
%34 = load x86_fp80, x86_fp80* %3
%35 = fptosi x86_fp80 %34 to i64
store i64 %35, i64* %6
%36 = load i64, i64* %4
%37 = load i64, i64* %5
%38 = load i64, i64* %6
%39 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 %36, i64 %37, i64 %38)
%40 = load i64, i64* %7
%41 = uitofp i64 %40 to float
store float %41, float* %1
%42 = load i64, i64* %7
%43 = uitofp i64 %42 to double
store double %43, double* %2
%44 = load i64, i64* %7
%45 = uitofp i64 %44 to x86_fp80
store x86_fp80 %45, x86_fp80* %3
%46 = load float, float* %1
%47 = fptoui float %46 to i64
%48 = load double, double* %2
%49 = fptoui double %48 to i64
%50 = load x86_fp80, x86_fp80* %3
%51 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i64 %47, i64 %49, x86_fp80 %50)
%52 = load float, float* %1
%53 = fptoui float %52 to i64
store i64 %53, i64* %7
%54 = load double, double* %2
%55 = fptoui double %54 to i64
store i64 %55, i64* %8
%56 = load x86_fp80, x86_fp80* %3
%57 = fptoui x86_fp80 %56 to i64
store i64 %57, i64* %9
%58 = load i64, i64* %7
%59 = load i64, i64* %8
%60 = load i64, i64* %9
%61 = call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %58, i64 %59, i64 %60)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"la=%Ld ula=%Lu\0A\00"
@.str.1 = [18 x i8] c"lltof: %f %f %Lf\0A\00"
@.str.2 = [20 x i8] c"ftoll: %Ld %Ld %Ld\0A\00"
@.str.3 = [19 x i8] c"ulltof: %f %f %Lf\0A\00"
@.str.4 = [21 x i8] c"ftoull: %Lu %Lu %Lu\0A\00"
define void @llfloat() {
%1 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 320255972942661, i64 -1988149088691945472)
%2 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 320255981256704, i64 320255972942661, x86_fp80 0xK402F91A2B3C091A28000)
%3 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 320255981256704, i64 320255972942661, i64 320255972942661)
%4 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i64 -1988149019972468736, i64 -1988149088691945472, x86_fp80 0xK403EE468ACF000000000)
%5 = tail call i32 (i8*, i64, i64, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 -1988149019972468736, i64 -1988149088691945472, i64 -1988149088691945472)
ret void
}