#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 ceil(float);
int floor(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int a, b;
  float x;
  printf("Enter a number:\n");
  scanf("%f", &x);
  printf("Smallest integer \t given number\t largest integer");
  a = floor(x);
  b = ceil(x);
  printf("%d \t %f\t %d", a, x, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x10(%rbp),%xmm0
call   1060 <floor@plt>
mov    %eax,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0xc(%rsp),%xmm0
call   1070 <floor@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1040 <ceil@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8b(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [49 x i8] c"Smallest integer \09 given number\09 largest integer\00"
@.str.3 = [12 x i8] c"%d \09 %f\09 %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 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* %4)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%8 = load float, float* %4
%9 = call i32 @floor(float %8)
store i32 %9, i32* %2
%10 = load float, float* %4
%11 = call i32 @ceil(float %10)
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %12, double %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [49 x i8] c"Smallest integer \09 given number\09 largest integer\00"
@.str.3 = [12 x i8] c"%d \09 %f\09 %d\00"
@str = [16 x i8] c"Enter a number:\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%6 = load float, float* %1
%7 = call i32 @floor(float %6)
%8 = load float, float* %1
%9 = call i32 @ceil(float %8)
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %7, double %11, i32 %9)
ret i32 0
}