int MAIN() {
  float num;
  float midp;
  write("Enter number :");
  num = fread();
  write(ceil(num));
  write("\n");
  write(floor(num));
  write("\n");
  midp = (ceil(num) + floor(num)) / 2.0;
  write(midp);
  write("\n");
  return 0;
}


x86 assembly (clang, -O0):
<MAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <fread@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <ceil@plt>
mov    $0x1,%al
call   1040 <write@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <write@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1060 <floor@plt>
mov    $0x1,%al
call   1040 <write@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <write@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1060 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe1f(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <write@plt>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAIN>:
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <fread@plt>
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
call   1050 <ceil@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1040 <write@plt>
lea    0xe97(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <write@plt>
movsd  (%rsp),%xmm0
call   1060 <floor@plt>
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <write@plt>
movsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
mulsd  0xe43(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <write@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter number :\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @MAIN() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @fread()
%5 = sitofp i32 %4 to float
store float %5, float* %1
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = call double @llvm.ceil.f64(double %7)
%9 = call i32 (double, ...) bitcast (i32 (...)* @write to i32 (double, ...)*)(double %8)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = load float, float* %1
%12 = fpext float %11 to double
%13 = call double @llvm.floor.f64(double %12)
%14 = call i32 (double, ...) bitcast (i32 (...)* @write to i32 (double, ...)*)(double %13)
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = load float, float* %1
%17 = fpext float %16 to double
%18 = call double @llvm.ceil.f64(double %17)
%19 = load float, float* %1
%20 = fpext float %19 to double
%21 = call double @llvm.floor.f64(double %20)
%22 = fadd double %18, %21
%23 = fdiv double %22, 2.000000e+00
%24 = fptrunc double %23 to float
store float %24, float* %2
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = call i32 (double, ...) bitcast (i32 (...)* @write to i32 (double, ...)*)(double %26)
%28 = call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number :\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @MAIN() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fread()
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to double
%5 = tail call double @llvm.ceil.f64(double %4)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @write to i32 (double, ...)*)(double %5)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call double @llvm.floor.f64(double %4)
%9 = tail call i32 (double, ...) bitcast (i32 (...)* @write to i32 (double, ...)*)(double %8)
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = fadd double %5, %8
%12 = fmul double %11, 5.000000e-01
%13 = fptrunc double %12 to float
%14 = fpext float %13 to double
%15 = tail call i32 (double, ...) bitcast (i32 (...)* @write to i32 (double, ...)*)(double %14)
%16 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}