#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 */
long double LDBL_EPSILON;
long double ceill(long double x) {
  long double y;
  if (x < 0.0L)
    y = -(1.0L / LDBL_EPSILON - x - 1.0 / LDBL_EPSILON);
  else
    y = 1.0L / LDBL_EPSILON + x - 1.0 / LDBL_EPSILON;
  if (y < x)
    return y + 1.0L;
  else
    return y;
}


x86 assembly (clang, -O0):
<ceill>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    113c <ceill+0x3c>
jmp    111e <ceill+0x1e>
mov    0x2eb3(%rip),%rax
fldt   (%rax)
fld1
fdivp  %st,%st(1)
fldt   -0x20(%rbp)
fsubr  %st(1),%st
fsubp  %st,%st(1)
fchs
fstpt  -0x30(%rbp)
jmp    1153 <ceill+0x53>
mov    0x2e95(%rip),%rax
fldt   (%rax)
fld1
fdivp  %st,%st(1)
fldt   -0x20(%rbp)
fadd   %st(1),%st
fsubp  %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    1177 <ceill+0x77>
jmp    1168 <ceill+0x68>
fldt   -0x30(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x10(%rbp)
jmp    117d <ceill+0x7d>
fldt   -0x30(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceill>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
mov    0x2ec9(%rip),%rax
fldt   (%rax)
fld1
fdiv   %st,%st(1)
jbe    1123 <ceill+0x23>
fld    %st(1)
fsub   %st(3),%st
fsubp  %st,%st(2)
fxch   %st(1)
fchs
jmp    112b <ceill+0x2b>
fld    %st(1)
fadd   %st(3),%st
fsubp  %st,%st(2)
fxch   %st(1)
fxch   %st(2)
fucomip %st(2),%st
fadd   %st(1),%st
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
@LDBL_EPSILON = global x86_fp80 0xK00000000000000000000
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = fcmp olt x86_fp80 %5, 0xK00000000000000000000
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%9 = fdiv x86_fp80 0xK3FFF8000000000000000, %8
%10 = load x86_fp80, x86_fp80* %3
%11 = fsub x86_fp80 %9, %10
%12 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%13 = fdiv x86_fp80 0xK3FFF8000000000000000, %12
%14 = fsub x86_fp80 %11, %13
%15 = fneg x86_fp80 %14
store x86_fp80 %15, x86_fp80* %4
br label %24
16: ; preds = %1
%17 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%18 = fdiv x86_fp80 0xK3FFF8000000000000000, %17
%19 = load x86_fp80, x86_fp80* %3
%20 = fadd x86_fp80 %18, %19
%21 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%22 = fdiv x86_fp80 0xK3FFF8000000000000000, %21
%23 = fsub x86_fp80 %20, %22
store x86_fp80 %23, x86_fp80* %4
br label %24
24: ; preds = %16, %7
%25 = load x86_fp80, x86_fp80* %4
%26 = load x86_fp80, x86_fp80* %3
%27 = fcmp olt x86_fp80 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load x86_fp80, x86_fp80* %4
%30 = fadd x86_fp80 %29, 0xK3FFF8000000000000000
store x86_fp80 %30, x86_fp80* %2
br label %33
31: ; preds = %24
%32 = load x86_fp80, x86_fp80* %4
store x86_fp80 %32, x86_fp80* %2
br label %33
33: ; preds = %31, %28
%34 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %34
}

LLVM IR (-O2):
@LDBL_EPSILON = global x86_fp80 0xK00000000000000000000
define x86_fp80 @ceill(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%4 = fdiv x86_fp80 0xK3FFF8000000000000000, %3
br i1 %2, label %5, label %9
5: ; preds = %1
%6 = fsub x86_fp80 %4, %0
%7 = fsub x86_fp80 %6, %4
%8 = fneg x86_fp80 %7
br label %12
9: ; preds = %1
%10 = fadd x86_fp80 %4, %0
%11 = fsub x86_fp80 %10, %4
br label %12
12: ; preds = %9, %5
%13 = phi x86_fp80 [ %8, %5 ], [ %11, %9 ]
%14 = fcmp olt x86_fp80 %13, %0
%15 = fadd x86_fp80 %13, 0xK3FFF8000000000000000
%16 = select i1 %14, x86_fp80 %15, x86_fp80 %13
ret x86_fp80 %16
}