#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 /*<<< orphan*/ assert(int);
double ceil(double);
void test_ceil() {
  assert(ceil(1.5) == 2.0);
  assert(ceil(-1.5) == -1.0);
  assert(ceil(1.000001) == 2.0);
  assert(ceil(-1.000001) == -1.0);
  assert(ceil(1.0) == 1.0);
  assert(ceil(-1.0) == -1.0);
  assert(ceil(10000.000001) == 10001.0);
  assert(ceil(-10000.000001) == -10000.0);
}


x86 assembly (clang, -O0):
<test_ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf04(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xece(%rip),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xeb8(%rip),%xmm0
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xe82(%rip),%xmm0
movsd  0xe7a(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xe64(%rip),%xmm0
movsd  0xe5c(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xe36(%rip),%xmm0
movsd  0xe2e(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xe08(%rip),%xmm0
movsd  0xe00(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xdda(%rip),%xmm0
movsd  0xdd2(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ceil>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_ceil() {
%1 = call double @llvm.ceil.f64(double 1.500000e+00)
%2 = fcmp oeq double %1, 2.000000e+00
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call double @llvm.ceil.f64(double -1.500000e+00)
%6 = fcmp oeq double %5, -1.000000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call double @llvm.ceil.f64(double 0x3FF000010C6F7A0B)
%10 = fcmp oeq double %9, 2.000000e+00
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call double @llvm.ceil.f64(double 0xBFF000010C6F7A0B)
%14 = fcmp oeq double %13, -1.000000e+00
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call double @llvm.ceil.f64(double 1.000000e+00)
%18 = fcmp oeq double %17, 1.000000e+00
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call double @llvm.ceil.f64(double -1.000000e+00)
%22 = fcmp oeq double %21, -1.000000e+00
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call double @llvm.ceil.f64(double 0x40C388000008637C)
%26 = fcmp oeq double %25, 1.000100e+04
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = call double @llvm.ceil.f64(double 0xC0C388000008637C)
%30 = fcmp oeq double %29, -1.000000e+04
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
ret void
}

LLVM IR (-O2):
define void @test_ceil() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
ret void
}