#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 *, long double, ...);
int main(void) {
  printf("%hd\n", sizeof(float));
  printf("%hd\n", sizeof(double));
  printf("%hd\n", sizeof(long double));
  float aboat = 32000.0;
  double abet = 2.14e9;
  long double dip = 5.32e-5;
  printf("%f can be written %e\n", aboat, aboat);
  printf("And it's %a in hexadecimal, powers of 2 notation\n", aboat);
  printf("%f can be written %e\n", abet, abet);
  printf("%Lf can be written %Le\n", dip, dip);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
flds   0xed8(%rip)
fstpt  (%rax)
lea    0xee7(%rip),%rdi
mov    %rdi,-0x50(%rbp)
xor    %eax,%eax
mov    %al,-0x41(%rbp)
call   1030 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x41(%rbp),%al
mov    %rsp,%rcx
flds   0xeb5(%rip)
fstpt  (%rcx)
call   1030 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x41(%rbp),%al
mov    %rsp,%rcx
flds   0xea2(%rip)
fstpt  (%rcx)
call   1030 <printf@plt>
movl   $0x46fa0000,-0x8(%rbp)
movabs $0x41dfe373c0000000,%rax
e3 df 41
mov    %rax,-0x10(%rbp)
fldl   0xe88(%rip)
fstpt  -0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
flds   -0x24(%rbp)
cvtss2sd %xmm0,%xmm0
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe75(%rip),%rdi
mov    %rdi,-0x40(%rbp)
mov    $0x1,%al
mov    %al,-0x31(%rbp)
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
flds   -0x8(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x31(%rbp),%al
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
fldl   -0x30(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
call   1030 <printf@plt>
fldt   -0x20(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
flds   0xee5(%rip)
fstpt  (%rsp)
lea    0xf0b(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
flds   0xecf(%rip)
fstpt  (%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
flds   0xec0(%rip)
fstpt  (%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
flds   0xeb1(%rip)
fld    %st(0)
fstpt  0x24(%rsp)
fstpt  (%rsp)
lea    0xeca(%rip),%rbx
movsd  0xea5(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
fldt   0x24(%rsp)
fstpt  (%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
flds   0xe78(%rip)
fstpt  (%rsp)
movsd  0xe7d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
fldl   0xe75(%rip)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%hd\0A\00"
@.str.1 = [22 x i8] c"%f can be written %e\0A\00"
@.str.2 = [50 x i8] c"And it's %a in hexadecimal, powers of 2 notation\0A\00"
@.str.3 = [24 x i8] c"%Lf can be written %Le\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca x86_fp80
store i32 0, i32* %1
%5 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40018000000000000000)
%6 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40028000000000000000)
%7 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40038000000000000000)
store float 3.200000e+04, float* %2
store double 2.140000e+09, double* %3
store x86_fp80 0xK3FF0DF2310A640710800, x86_fp80* %4
%8 = load float, float* %2
%9 = fpext float %8 to x86_fp80
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %9, double %11)
%13 = load float, float* %2
%14 = fpext float %13 to x86_fp80
%15 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %14)
%16 = load double, double* %3
%17 = fpext double %16 to x86_fp80
%18 = load double, double* %3
%19 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %17, double %18)
%20 = load x86_fp80, x86_fp80* %4
%21 = load x86_fp80, x86_fp80* %4
%22 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %20, x86_fp80 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hd\0A\00"
@.str.1 = [22 x i8] c"%f can be written %e\0A\00"
@.str.2 = [50 x i8] c"And it's %a in hexadecimal, powers of 2 notation\0A\00"
@.str.3 = [24 x i8] c"%Lf can be written %Le\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40018000000000000000)
%2 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40028000000000000000)
%3 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40038000000000000000)
%4 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), x86_fp80 0xK400DFA00000000000000, double 3.200000e+04)
%5 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), x86_fp80 0xK400DFA00000000000000)
%6 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), x86_fp80 0xK401DFF1B9E0000000000, double 2.140000e+09)
%7 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), x86_fp80 0xK3FF0DF2310A640710800, x86_fp80 0xK3FF0DF2310A640710800)
ret i32 0
}