#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 ceilf(double n) {
  int x;
  x = (int)(n * 10) / 10;
  if (x < n) {
    if ((x + 1) >= n) {
      return x + 1;
    }
  } else if (x == n) {
    return n;
  }
  return -1;
}


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1167 <ceilf+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1162 <ceilf+0x62>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119e <ceilf+0x9e>
jmp    1191 <ceilf+0x91>
cvtsi2sdl -0x14(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    118c <ceilf+0x8c>
jp     118c <ceilf+0x8c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119e <ceilf+0x9e>
jmp    1191 <ceilf+0x91>
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
ucomisd %xmm1,%xmm0
jbe    1150 <ceilf+0x50>
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jae    114f <ceilf+0x4f>
movsd  0xeb9(%rip),%xmm0
ret
ucomisd %xmm0,%xmm1
jne    1147 <ceilf+0x47>
jnp    114f <ceilf+0x4f>
jmp    1147 <ceilf+0x47>

LLVM IR (-O0):
define double @ceilf(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fmul double %5, 1.000000e+01
%7 = fptosi double %6 to i32
%8 = sdiv i32 %7, 10
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = fcmp olt double %10, %11
br i1 %12, label %13, label %24
13: ; preds = %1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sitofp i32 %15 to double
%17 = load double, double* %3
%18 = fcmp oge double %16, %17
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = sitofp i32 %21 to double
store double %22, double* %2
br label %33
23: ; preds = %13
br label %32
24: ; preds = %1
%25 = load i32, i32* %4
%26 = sitofp i32 %25 to double
%27 = load double, double* %3
%28 = fcmp oeq double %26, %27
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = load double, double* %3
store double %30, double* %2
br label %33
31: ; preds = %24
br label %32
32: ; preds = %31, %23
store double -1.000000e+00, double* %2
br label %33
33: ; preds = %32, %29, %19
%34 = load double, double* %2
ret double %34
}

LLVM IR (-O2):
define double @ceilf(double %0) {
%2 = fmul double %0, 1.000000e+01
%3 = fptosi double %2 to i32
%4 = sdiv i32 %3, 10
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, %0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = add nsw i32 %4, 1
%9 = sitofp i32 %8 to double
%10 = fcmp ult double %9, %0
br i1 %10, label %13, label %14
11: ; preds = %1
%12 = fcmp oeq double %5, %0
br i1 %12, label %14, label %13
13: ; preds = %11, %7
br label %14
14: ; preds = %11, %7, %13
%15 = phi double [ -1.000000e+00, %13 ], [ %9, %7 ], [ %0, %11 ]
ret double %15
}