#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 *);
int /*<<< orphan*/ roundToHundreths(float);
int /*<<< orphan*/ roundToInteger(float);
int /*<<< orphan*/ roundToTenths(float);
int /*<<< orphan*/ roundToThousandths(float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int i;
  float num;
  for (i = 0; i < 4; i++) {
    printf("Enter the value of x: ");
    scanf("%f", &num);
    roundToInteger(num);
    roundToTenths(num);
    roundToHundreths(num);
    roundToThousandths(num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    11d2 <main+0x72>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1060 <roundToInteger@plt>
movss  -0xc(%rbp),%xmm0
call   1050 <roundToTenths@plt>
movss  -0xc(%rbp),%xmm0
call   1080 <roundToHundreths@plt>
movss  -0xc(%rbp),%xmm0
call   1040 <roundToThousandths@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Enter the value of x: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = load float, float* %3
%11 = call i32 @roundToInteger(float %10)
%12 = load float, float* %3
%13 = call i32 @roundToTenths(float %12)
%14 = load float, float* %3
%15 = call i32 @roundToHundreths(float %14)
%16 = load float, float* %3
%17 = call i32 @roundToThousandths(float %16)
br label %18
18: ; preds = %7
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter the value of x: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @roundToInteger(float %5)
%7 = load float, float* %1
%8 = call i32 @roundToTenths(float %7)
%9 = load float, float* %1
%10 = call i32 @roundToHundreths(float %9)
%11 = load float, float* %1
%12 = call i32 @roundToThousandths(float %11)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%15 = load float, float* %1
%16 = call i32 @roundToInteger(float %15)
%17 = load float, float* %1
%18 = call i32 @roundToTenths(float %17)
%19 = load float, float* %1
%20 = call i32 @roundToHundreths(float %19)
%21 = load float, float* %1
%22 = call i32 @roundToThousandths(float %21)
%23 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%25 = load float, float* %1
%26 = call i32 @roundToInteger(float %25)
%27 = load float, float* %1
%28 = call i32 @roundToTenths(float %27)
%29 = load float, float* %1
%30 = call i32 @roundToHundreths(float %29)
%31 = load float, float* %1
%32 = call i32 @roundToThousandths(float %31)
%33 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%35 = load float, float* %1
%36 = call i32 @roundToInteger(float %35)
%37 = load float, float* %1
%38 = call i32 @roundToTenths(float %37)
%39 = load float, float* %1
%40 = call i32 @roundToHundreths(float %39)
%41 = load float, float* %1
%42 = call i32 @roundToThousandths(float %41)
ret i32 0
}