#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 *, float);
int main() {
  double doubleOne = 34.567839023;
  float floatOne = 12.345;
  double doubleTwo = 8923.1234857;
  float floatTwo = 3456.091;
  printf("%.9f\n", doubleOne);
  printf("%.3f\n", floatOne);
  printf("%.7f\n", doubleTwo);
  printf("%.3f\n", floatTwo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeea(%rip),%rbx
movss  0xed0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
movss  0xebd(%rip),%xmm0
call   1030 <printf@plt>
movss  0xeb4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.9f\0A\00"
@.str.1 = [6 x i8] c"%.3f\0A\00"
@.str.2 = [6 x i8] c"%.7f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 0x404148AF00000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float 0x4028B0A3E0000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float 0x40C16D8FC0000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float 0x40AB002EA0000000)
ret i32 0
}