#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 *, double);
int main() {
  double a = 100.453627;
  printf("%.0f\n", a);
  printf("%.1f\n", a);
  printf("%.2f\n", a);
  printf("%.3f\n", a);
  printf("%.4f\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
movsd  0xecc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
movsd  0xeb8(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
movsd  0xea4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
movsd  0xe90(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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