#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*/ scanf(char *, float *);
int main() {
  float n, up, down;
  printf("Input a pure demical with 3 digits:");
  scanf("%f", &n);
  down = ((int)(n * 10)) / 10.0;
  up = down + 0.099;
  printf("up=%f,down=%f", up, down);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xebb(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe78(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe8a(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeb2(%rip),%xmm0
cvttps2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
divsd  0xeaa(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Input a pure demical with 3 digits:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"up=%f,down=%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = fmul float %7, 1.000000e+01
%9 = fptosi float %8 to i32
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+01
%12 = fptrunc double %11 to float
store float %12, float* %4
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fadd double %14, 9.900000e-02
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %18, double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Input a pure demical with 3 digits:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [14 x i8] c"up=%f,down=%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 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 = fmul float %5, 1.000000e+01
%7 = fptosi float %6 to i32
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+01
%10 = fptrunc double %9 to float
%11 = fpext float %10 to double
%12 = fadd double %11, 9.900000e-02
%13 = fptrunc double %12 to float
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %14, double %11)
ret i32 0
}