#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 */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_and_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmpgt_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvtepi32_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvttps_epi32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ss(float *);
int /*<<< orphan*/ _mm_set_ss(float);
int /*<<< orphan*/ _mm_store_ss(float *, int /*<<< orphan*/);
uint32_t determ_ceil_float(uint32_t a) {
  __m128 p = _mm_load_ss((float *)&a);
  __m128 t = _mm_cvtepi32_ps(_mm_cvttps_epi32(p));
  uint32_t r;
  _mm_store_ss((float *)&r,
               _mm_add_ps(t, _mm_and_ps(_mm_cmpgt_ps(p, t), _mm_set_ss(1.0f))));
  return r;
}


x86 assembly (clang, -O0):
<determ_ceil_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   10a0 <_mm_load_ss@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_mm_cvttps_epi32@plt>
mov    %eax,%edi
call   1030 <_mm_cvtepi32_ps@plt>
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <_mm_cmpgt_ps@plt>
mov    %eax,-0x20(%rbp)
movss  0xe33(%rip),%xmm0
call   1060 <_mm_set_ss@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1090 <_mm_and_ps@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1080 <_mm_add_ps@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1070 <_mm_store_ss@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_ceil_float>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   10a0 <_mm_load_ss@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <_mm_cvttps_epi32@plt>
mov    %eax,%edi
call   1030 <_mm_cvtepi32_ps@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <_mm_cmpgt_ps@plt>
mov    %eax,%ebx
movss  0xe4a(%rip),%xmm0
call   1060 <_mm_set_ss@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1090 <_mm_and_ps@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <_mm_add_ps@plt>
mov    %rsp,%rdi
mov    %eax,%esi
call   1070 <_mm_store_ss@plt>
mov    (%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @determ_ceil_float(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = bitcast i32* %2 to float*
%7 = call i32 @_mm_load_ss(float* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @_mm_cvttps_epi32(i32 %8)
%10 = call i32 @_mm_cvtepi32_ps(i32 %9)
store i32 %10, i32* %4
%11 = bitcast i32* %5 to float*
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @_mm_cmpgt_ps(i32 %13, i32 %14)
%16 = call i32 @_mm_set_ss(float 1.000000e+00)
%17 = call i32 @_mm_and_ps(i32 %15, i32 %16)
%18 = call i32 @_mm_add_ps(i32 %12, i32 %17)
%19 = call i32 @_mm_store_ss(float* %11, i32 %18)
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @determ_ceil_float(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %2 to float*
%5 = call i32 @_mm_load_ss(float* %4)
%6 = call i32 @_mm_cvttps_epi32(i32 %5)
%7 = call i32 @_mm_cvtepi32_ps(i32 %6)
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %3 to float*
%10 = call i32 @_mm_cmpgt_ps(i32 %5, i32 %7)
%11 = call i32 @_mm_set_ss(float 1.000000e+00)
%12 = call i32 @_mm_and_ps(i32 %10, i32 %11)
%13 = call i32 @_mm_add_ps(i32 %7, i32 %12)
%14 = call i32 @_mm_store_ss(float* %9, i32 %13)
%15 = load i32, i32* %3
ret i32 %15
}