#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*/ rotate_degrees_left(float);
int /*<<< orphan*/ rotate_degrees_right(float);
void rotate_degrees(float degrees) {
  while (degrees > 180.0) {
    degrees -= 360;
  }
  while (degrees < -180.0) {
    degrees += 360;
  }
  if (degrees < 0)
    rotate_degrees_right(-degrees);
  else
    rotate_degrees_left(degrees);
}


x86 assembly (clang, -O0):
<rotate_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1163 <rotate_degrees+0x43>
movss  -0x4(%rbp),%xmm0
movss  0xebb(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    112d <rotate_degrees+0xd>
jmp    1168 <rotate_degrees+0x48>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    119a <rotate_degrees+0x7a>
movss  0xe85(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <rotate_degrees+0x48>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    11c3 <rotate_degrees+0xa3>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1040 <rotate_degrees_right@plt>
jmp    11cd <rotate_degrees+0xad>
movss  -0x4(%rbp),%xmm0
call   1030 <rotate_degrees_left@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_degrees>:
ucomiss 0xed9(%rip),%xmm0
jbe    1149 <rotate_degrees+0x29>
movss  0xed3(%rip),%xmm1
movss  0xec7(%rip),%xmm2
nopl   0x0(%rax)
addss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
ja     1140 <rotate_degrees+0x20>
movss  0xeb7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1169 <rotate_degrees+0x49>
movss  0xeae(%rip),%xmm2
xchg   %ax,%ax
addss  %xmm2,%xmm0
ucomiss %xmm0,%xmm1
ja     1160 <rotate_degrees+0x40>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    117d <rotate_degrees+0x5d>
xorps  0xe98(%rip),%xmm0
jmp    1040 <rotate_degrees_right@plt>
jmp    1030 <rotate_degrees_left@plt>

LLVM IR (-O0):
define void @rotate_degrees(float %0) {
%2 = alloca float
store float %0, float* %2
br label %3
3: ; preds = %7, %1
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 1.800000e+02
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load float, float* %2
%9 = fsub float %8, 3.600000e+02
store float %9, float* %2
br label %3
10: ; preds = %3
br label %11
11: ; preds = %15, %10
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fcmp olt double %13, -1.800000e+02
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load float, float* %2
%17 = fadd float %16, 3.600000e+02
store float %17, float* %2
br label %11
18: ; preds = %11
%19 = load float, float* %2
%20 = fcmp olt float %19, 0.000000e+00
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load float, float* %2
%23 = fneg float %22
%24 = call i32 @rotate_degrees_right(float %23)
br label %28
25: ; preds = %18
%26 = load float, float* %2
%27 = call i32 @rotate_degrees_left(float %26)
br label %28
28: ; preds = %25, %21
ret void
}

LLVM IR (-O2):
define void @rotate_degrees(float %0) {
%2 = fcmp ogt float %0, 1.800000e+02
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi float [ %0, %1 ], [ %8, %6 ]
%5 = fcmp olt float %4, -1.800000e+02
br i1 %5, label %10, label %14
6: ; preds = %1, %6
%7 = phi float [ %8, %6 ], [ %0, %1 ]
%8 = fadd float %7, -3.600000e+02
%9 = fcmp ogt float %8, 1.800000e+02
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi float [ %12, %10 ], [ %4, %3 ]
%12 = fadd float %11, 3.600000e+02
%13 = fcmp olt float %12, -1.800000e+02
br i1 %13, label %10, label %14
14: ; preds = %10, %3
%15 = phi float [ %4, %3 ], [ %12, %10 ]
%16 = fcmp olt float %15, 0.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = fneg float %15
%19 = tail call i32 @rotate_degrees_right(float %18)
br label %22
20: ; preds = %14
%21 = tail call i32 @rotate_degrees_left(float %15)
br label %22
22: ; preds = %20, %17
ret void
}