#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*/ analogWrite(int, int);
int round(float);
void wheel(int f, int b, float n) {
  if (n < 0.0) {
    analogWrite(f, 0);
    analogWrite(b, n > -216 ? round(-n - 40) : 255);
  } else {
    analogWrite(f, n < 216 ? round(n + 40) : 255);
    analogWrite(b, 0);
  }
}


x86 assembly (clang, -O0):
<wheel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11b7 <wheel+0x97>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <analogWrite@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xea2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    119a <wheel+0x7a>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe7b(%rip),%xmm1
subss  %xmm1,%xmm0
call   1040 <round@plt>
mov    %eax,-0x14(%rbp)
jmp    11a7 <wheel+0x87>
mov    $0xff,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <wheel+0x87>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <analogWrite@plt>
jmp    120b <wheel+0xeb>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movss  0xe3b(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11e9 <wheel+0xc9>
movss  0xe2d(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
call   1040 <round@plt>
mov    %eax,-0x1c(%rbp)
jmp    11f6 <wheel+0xd6>
mov    $0xff,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f6 <wheel+0xd6>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <analogWrite@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <analogWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wheel>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1167 <wheel+0x47>
mov    %ebp,%edi
xor    %esi,%esi
movss  %xmm0,0x4(%rsp)
call   1030 <analogWrite@plt>
movss  0x4(%rsp),%xmm1
mov    $0xff,%esi
ucomiss 0xeb8(%rip),%xmm1
jbe    1191 <wheel+0x71>
movss  0xeb2(%rip),%xmm0
subss  %xmm1,%xmm0
call   1040 <round@plt>
mov    %eax,%esi
jmp    1191 <wheel+0x71>
mov    $0xff,%esi
movss  0xe8c(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1188 <wheel+0x68>
addss  0xe83(%rip),%xmm0
call   1040 <round@plt>
mov    %eax,%esi
mov    %ebp,%edi
call   1030 <analogWrite@plt>
xor    %esi,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <analogWrite@plt>

LLVM IR (-O0):
define void @wheel(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %25
10: ; preds = %3
%11 = load i32, i32* %4
%12 = call i32 @analogWrite(i32 %11, i32 0)
%13 = load i32, i32* %5
%14 = load float, float* %6
%15 = fcmp ogt float %14, -2.160000e+02
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load float, float* %6
%18 = fneg float %17
%19 = fsub float %18, 4.000000e+01
%20 = call i32 @round(float %19)
br label %22
21: ; preds = %10
br label %22
22: ; preds = %21, %16
%23 = phi i32 [ %20, %16 ], [ 255, %21 ]
%24 = call i32 @analogWrite(i32 %13, i32 %23)
br label %39
25: ; preds = %3
%26 = load i32, i32* %4
%27 = load float, float* %6
%28 = fcmp olt float %27, 2.160000e+02
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load float, float* %6
%31 = fadd float %30, 4.000000e+01
%32 = call i32 @round(float %31)
br label %34
33: ; preds = %25
br label %34
34: ; preds = %33, %29
%35 = phi i32 [ %32, %29 ], [ 255, %33 ]
%36 = call i32 @analogWrite(i32 %26, i32 %35)
%37 = load i32, i32* %5
%38 = call i32 @analogWrite(i32 %37, i32 0)
br label %39
39: ; preds = %34, %22
ret void
}

LLVM IR (-O2):
define void @wheel(i32 %0, i32 %1, float %2) {
%4 = fcmp olt float %2, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = tail call i32 @analogWrite(i32 %0, i32 0)
%7 = fcmp ogt float %2, -2.160000e+02
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = fsub float -4.000000e+01, %2
%10 = tail call i32 @round(float %9)
br label %19
11: ; preds = %3
%12 = fcmp olt float %2, 2.160000e+02
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = fadd float %2, 4.000000e+01
%15 = tail call i32 @round(float %14)
br label %16
16: ; preds = %11, %13
%17 = phi i32 [ %15, %13 ], [ 255, %11 ]
%18 = tail call i32 @analogWrite(i32 %0, i32 %17)
br label %19
19: ; preds = %8, %5, %16
%20 = phi i32 [ 0, %16 ], [ %10, %8 ], [ 255, %5 ]
%21 = tail call i32 @analogWrite(i32 %1, i32 %20)
ret void
}