#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 */
float floorf(float);
float onsetsds_phase_rewrap(float phase) {
  return (phase > -3.1415926535898f && phase < 3.1415926535898f)
             ? phase
             : phase + 6.28318530717952646f *
                           (1.f + floorf((-3.1415926535898f - phase) *
                                         0.1591549430919f));
}


x86 assembly (clang, -O0):
<onsetsds_phase_rewrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1154 <onsetsds_phase_rewrap+0x44>
movss  0xec9(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1154 <onsetsds_phase_rewrap+0x44>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11a5 <onsetsds_phase_rewrap+0x95>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe9a(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xe9d(%rip),%xmm1
mulss  %xmm1,%xmm0
call   1030 <floorf@plt>
movss  -0xc(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  0xe80(%rip),%xmm0
addss  %xmm2,%xmm0
movss  0xe70(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onsetsds_phase_rewrap>:
push   %rax
movaps %xmm0,%xmm1
ucomiss 0xee5(%rip),%xmm0
jbe    112f <onsetsds_phase_rewrap+0x1f>
movss  0xedf(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    112f <onsetsds_phase_rewrap+0x1f>
movaps %xmm1,%xmm0
pop    %rax
ret
movss  0xec9(%rip),%xmm0
subss  %xmm1,%xmm0
mulss  0xec5(%rip),%xmm0
movss  %xmm1,0x4(%rsp)
call   1030 <floorf@plt>
addss  0xeb6(%rip),%xmm0
mulss  0xeb2(%rip),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @onsetsds_phase_rewrap(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0xC00921FB60000000
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load float, float* %2
%7 = fcmp olt float %6, 0x400921FB60000000
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load float, float* %2
br label %18
10: ; preds = %5, %1
%11 = load float, float* %2
%12 = load float, float* %2
%13 = fsub float 0xC00921FB60000000, %12
%14 = fmul float %13, 0x3FC45F3060000000
%15 = call float @llvm.floor.f32(float %14)
%16 = fadd float 1.000000e+00, %15
%17 = call float @llvm.fmuladd.f32(float 0x401921FB60000000, float %16, float %11)
br label %18
18: ; preds = %10, %8
%19 = phi float [ %9, %8 ], [ %17, %10 ]
ret float %19
}

LLVM IR (-O2):
define float @onsetsds_phase_rewrap(float %0) {
%2 = fcmp ogt float %0, 0xC00921FB60000000
%3 = fcmp olt float %0, 0x400921FB60000000
%4 = and i1 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = fsub float 0xC00921FB60000000, %0
%7 = fmul float %6, 0x3FC45F3060000000
%8 = tail call float @llvm.floor.f32(float %7)
%9 = fadd float %8, 1.000000e+00
%10 = tail call float @llvm.fmuladd.f32(float %9, float 0x401921FB60000000, float %0)
br label %11
11: ; preds = %1, %5
%12 = phi float [ %10, %5 ], [ %0, %1 ]
ret float %12
}