#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) {
  float aboat = 32000.0;
  double abet = 2.14e9;
  long double dip = 5.32e-5;
  printf("%.2f can be written %.2e\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    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x46fa0000,-0x8(%rbp)
movabs $0x41dfe373c0000000,%rax
e3 df 41
mov    %rax,-0x10(%rbp)
fldl   0xec6(%rip)
fstpt  -0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
flds   -0x24(%rbp)
cvtss2sd %xmm0,%xmm0
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeae(%rip),%rdi
mov    $0x1,%al
mov    %al,-0x31(%rbp)
call   1030 <printf@plt>
flds   -0x8(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x31(%rbp),%al
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
fldl   -0x30(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
fldt   -0x20(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
flds   0xee6(%rip)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
lea    0xef6(%rip),%rdi
movsd  0xed6(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
fldt   0x2c(%rsp)
fstpt  (%rsp)
lea    0xef3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
flds   0xeb0(%rip)
fstpt  (%rsp)
lea    0xf0e(%rip),%rdi
movsd  0xeaa(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
fldl   0xea5(%rip)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xeff(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"%.2f can be written %.2e\0A\00"
@.str.1 = [50 x i8] c"And it's %a in hexadecimal, powers of 2 notation\0A\00"
@.str.2 = [22 x i8] c"%f can be written %e\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 ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK400DFA00000000000000, double 3.200000e+04)
%2 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), x86_fp80 0xK400DFA00000000000000)
%3 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), x86_fp80 0xK401DFF1B9E0000000000, double 2.140000e+09)
%4 = 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
}