#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);
float WrapAngle(float angle) {
  assert(-6.0f * 3.1415927f <= angle && angle < 6.0f * 3.1415927f);
  while (angle >= 3.1415927f) {
    angle -= 2.0f * 3.1415927f;
  }
  while (angle < -3.1415927f) {
    angle += 2.0f * 3.1415927f;
  }
  return angle;
}


x86 assembly (clang, -O0):
<WrapAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
movss  0xed4(%rip),%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jb     114a <WrapAngle+0x3a>
movss  0xec4(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm0
movss  0xea4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1188 <WrapAngle+0x78>
movss  -0x4(%rbp),%xmm0
movss  0xe96(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1157 <WrapAngle+0x47>
jmp    118d <WrapAngle+0x7d>
movss  0xe77(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    11b6 <WrapAngle+0xa6>
movss  0xe69(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118d <WrapAngle+0x7d>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WrapAngle>:
push   %rax
movss  %xmm0,0x4(%rsp)
ucomiss 0xee2(%rip),%xmm0
setae  %al
movss  0xedb(%rip),%xmm1
ucomiss %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xec2(%rip),%xmm0
jb     1169 <WrapAngle+0x59>
movss  0xebc(%rip),%xmm2
movss  0xeb0(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
addss  %xmm2,%xmm0
ucomiss %xmm1,%xmm0
jae    1160 <WrapAngle+0x50>
movss  0xe9f(%rip),%xmm2
ucomiss %xmm0,%xmm2
jbe    1189 <WrapAngle+0x79>
movss  0xe96(%rip),%xmm1
xchg   %ax,%ax
addss  %xmm1,%xmm0
ucomiss %xmm0,%xmm2
ja     1180 <WrapAngle+0x70>
pop    %rax
ret

LLVM IR (-O0):
define float @WrapAngle(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float 0xC032D97C80000000, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fcmp olt float %6, 0x4032D97C80000000
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
br label %12
12: ; preds = %15, %8
%13 = load float, float* %2
%14 = fcmp oge float %13, 0x400921FB60000000
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load float, float* %2
%17 = fsub float %16, 0x401921FB60000000
store float %17, float* %2
br label %12
18: ; preds = %12
br label %19
19: ; preds = %22, %18
%20 = load float, float* %2
%21 = fcmp olt float %20, 0xC00921FB60000000
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load float, float* %2
%24 = fadd float %23, 0x401921FB60000000
store float %24, float* %2
br label %19
25: ; preds = %19
%26 = load float, float* %2
ret float %26
}

LLVM IR (-O2):
define float @WrapAngle(float %0) {
%2 = fcmp oge float %0, 0xC032D97C80000000
%3 = fcmp olt float %0, 0x4032D97C80000000
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp ult float %0, 0x400921FB60000000
br i1 %7, label %8, label %11
8: ; preds = %11, %1
%9 = phi float [ %0, %1 ], [ %13, %11 ]
%10 = fcmp olt float %9, 0xC00921FB60000000
br i1 %10, label %15, label %19
11: ; preds = %1, %11
%12 = phi float [ %13, %11 ], [ %0, %1 ]
%13 = fadd float %12, 0xC01921FB60000000
%14 = fcmp ult float %13, 0x400921FB60000000
br i1 %14, label %8, label %11
15: ; preds = %8, %15
%16 = phi float [ %17, %15 ], [ %9, %8 ]
%17 = fadd float %16, 0x401921FB60000000
%18 = fcmp olt float %17, 0xC00921FB60000000
br i1 %18, label %15, label %19
19: ; preds = %15, %8
%20 = phi float [ %9, %8 ], [ %17, %15 ]
ret float %20
}