#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  float first = 12.345;
  float second = 3456.091;
  double third = 34.567839023;
  double fourth = 8923.1234857;
  printf("%f\n", first);
  printf("%f\n", second);
  printf("%.9f\n", third);
  printf("%.7f\n", fourth);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf08(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
movsd  0xec9(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
movsd  0xebd(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [6 x i8] c"%.9f\0A\00"
@.str.2 = [6 x i8] c"%.7f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x4028B0A3E0000000, float* %6
store float 0x40AB002EA0000000, float* %7
store double 0x404148AEF2F896BB, double* %8
store double 0x40C16D8FCE612183, double* %9
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load float, float* %7
%14 = fpext float %13 to double
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %14)
%16 = load double, double* %8
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = load double, double* %9
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [6 x i8] c"%.9f\0A\00"
@.str.2 = [6 x i8] c"%.7f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x4028B0A3E0000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x40AB002EA0000000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double 0x404148AEF2F896BB)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double 0x40C16D8FCE612183)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}