#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 */
double ceil(double);
double floor(double);
int /*<<< orphan*/ printf(char *, ...);
double rint(double);
int main(void) {
  double d;
  double arrondi_inf;
  double arrondi_sup;
  double arrondi_proche;
  int converti;
  printf("réel    floor() ceil()  rint()  (int)\n");
  for (d = -1.8; d < 1.9; d += 0.1) {
    arrondi_inf = floor(d);
    arrondi_sup = ceil(d);
    arrondi_proche = rint(d);
    converti = (int)d;
    printf("% 4.1f    % 4.1f    % 4.1f    % 4.1f    % 2d\n", d, arrondi_inf,
           arrondi_sup, arrondi_proche, converti);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe96(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11ee <main+0xae>
movsd  -0x10(%rbp),%xmm0
call   1060 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <rint@plt>
movsd  %xmm0,-0x28(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x2c(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0xe31(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116a <main+0x2a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe97(%rip),%xmm0
lea    0xea8(%rip),%rbx
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <floor@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <ceil@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <rint@plt>
movaps %xmm0,%xmm3
cvttsd2si 0x8(%rsp),%esi
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    $0x4,%al
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe32(%rip),%xmm0
movsd  0xe32(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1170 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"r\C3\A9el floor() ceil() rint() (int)\0A\00"
@.str.1 = [46 x i8] c"% 4.1f % 4.1f % 4.1f % 4.1f % 2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store double -1.800000e+00, double* %2
br label %8
8: ; preds = %26, %0
%9 = load double, double* %2
%10 = fcmp olt double %9, 1.900000e+00
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load double, double* %2
%13 = call double @llvm.floor.f64(double %12)
store double %13, double* %3
%14 = load double, double* %2
%15 = call double @llvm.ceil.f64(double %14)
store double %15, double* %4
%16 = load double, double* %2
%17 = call double @llvm.rint.f64(double %16)
store double %17, double* %5
%18 = load double, double* %2
%19 = fptosi double %18 to i32
store i32 %19, i32* %6
%20 = load double, double* %2
%21 = load double, double* %3
%22 = load double, double* %4
%23 = load double, double* %5
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), double %20, double %21, double %22, double %23, i32 %24)
br label %26
26: ; preds = %11
%27 = load double, double* %2
%28 = fadd double %27, 1.000000e-01
store double %28, double* %2
br label %8
29: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [46 x i8] c"% 4.1f % 4.1f % 4.1f % 4.1f % 2d\0A\00"
@str = [39 x i8] c"r\C3\A9el floor() ceil() rint() (int)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi double [ -1.800000e+00, %0 ], [ %9, %2 ]
%4 = tail call double @llvm.floor.f64(double %3)
%5 = tail call double @llvm.ceil.f64(double %3)
%6 = tail call double @llvm.rint.f64(double %3)
%7 = fptosi double %3 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), double %3, double %4, double %5, double %6, i32 %7)
%9 = fadd double %3, 1.000000e-01
%10 = fcmp olt double %9, 1.900000e+00
br i1 %10, label %2, label %11
11: ; preds = %2
ret i32 0
}