#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 printf(char *, long double, long double, long double, long double);
int test_cast_unsigned(void) {
  unsigned char c1 = 'a';
  unsigned short c2 = 0xF768u;
  unsigned int c3 = 0xF6959876u;
  unsigned long c4 = 0xF976589757652309ul;
  long double d1 = c1, d2 = c2, d3 = c3, d4 = c4;
  return printf("unsigned: %Lf, %Lf, %Lf, %Lf\n", d1, d2, d3, d4);
}


x86 assembly (clang, -O0):
<test_cast_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movb   $0x61,-0x1(%rbp)
movw   $0xf768,-0x4(%rbp)
movl   $0xf6959876,-0x8(%rbp)
movabs $0xf976589757652309,%rax
58 76 f9
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    %ax,-0x5a(%rbp)
filds  -0x5a(%rbp)
fstpt  -0x20(%rbp)
movzwl -0x4(%rbp),%eax
mov    %eax,-0x60(%rbp)
fildl  -0x60(%rbp)
fstpt  -0x30(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x68(%rbp)
fildll -0x68(%rbp)
fstpt  -0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
test   %rax,%rax
sets   %al
movzbl %al,%eax
mov    %eax,%ecx
fildll -0x58(%rbp)
lea    0xe81(%rip),%rax
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
mov    %rsp,%rax
fstpt  0x30(%rax)
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cast_unsigned>:
sub    $0x48,%rsp
fldt   0xee6(%rip)
fstpt  0x30(%rsp)
fldl   0xeec(%rip)
fstpt  0x20(%rsp)
flds   0xeea(%rip)
fstpt  0x10(%rsp)
flds   0xee4(%rip)
fstpt  (%rsp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"unsigned: %Lf, %Lf, %Lf, %Lf\0A\00"
define i32 @test_cast_unsigned() {
%1 = alloca i8
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
store i8 97, i8* %1
store i16 -2200, i16* %2
store i32 -157968266, i32* %3
store i64 -471091703984086263, i64* %4
%9 = load i8, i8* %1
%10 = uitofp i8 %9 to x86_fp80
store x86_fp80 %10, x86_fp80* %5
%11 = load i16, i16* %2
%12 = uitofp i16 %11 to x86_fp80
store x86_fp80 %12, x86_fp80* %6
%13 = load i32, i32* %3
%14 = uitofp i32 %13 to x86_fp80
store x86_fp80 %14, x86_fp80* %7
%15 = load i64, i64* %4
%16 = uitofp i64 %15 to x86_fp80
store x86_fp80 %16, x86_fp80* %8
%17 = load x86_fp80, x86_fp80* %5
%18 = load x86_fp80, x86_fp80* %6
%19 = load x86_fp80, x86_fp80* %7
%20 = load x86_fp80, x86_fp80* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), x86_fp80 %17, x86_fp80 %18, x86_fp80 %19, x86_fp80 %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [30 x i8] c"unsigned: %Lf, %Lf, %Lf, %Lf\0A\00"
define i32 @test_cast_unsigned() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK4005C200000000000000, x86_fp80 0xK400EF768000000000000, x86_fp80 0xK401EF695987600000000, x86_fp80 0xK403EF976589757652309)
ret i32 %1
}