#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);
double roundToHundreths(float);
double roundToInteger(float);
double roundToTenths(float);
double roundToThousandths(float);
int /*<<< orphan*/ scanf(char *, float *);
void main(void) {
  float number;
  scanf("%f", &number);
  printf("%.3f\n", roundToInteger(number));
  printf("%.3f\n", roundToTenths(number));
  printf("%.3f\n", roundToHundreths(number));
  printf("%.3f\n", roundToThousandths(number));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1060 <roundToInteger@plt>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
call   1050 <roundToTenths@plt>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
call   1080 <roundToHundreths@plt>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <roundToThousandths@plt>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xe94(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1060 <roundToInteger@plt>
lea    0xe7b(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
call   1050 <roundToTenths@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
call   1080 <roundToHundreths@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
call   1040 <roundToThousandths@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [6 x i8] c"%.3f\0A\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call double @roundToInteger(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = load float, float* %1
%8 = call double @roundToTenths(float %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = load float, float* %1
%11 = call double @roundToHundreths(float %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = load float, float* %1
%14 = call double @roundToThousandths(float %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %14)
ret void
}