#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*/ hybrid_gyro_within_threshold(float, int);
int /*<<< orphan*/ pause(int);
int /*<<< orphan*/ set_wheel_pows(float, float);
void hybrid_orient_at(float theta, int direction) {
  float drive_speed = 0.32;
  set_wheel_pows(-drive_speed * direction, drive_speed * direction);
  while (!hybrid_gyro_within_threshold(theta, 10)) {
    pause(5);
  }
  set_wheel_pows(0, 0);
}


x86 assembly (clang, -O0):
<hybrid_orient_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  0xeb8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm1
call   1050 <set_wheel_pows@plt>
movss  -0x4(%rbp),%xmm0
mov    $0xa,%edi
call   1040 <hybrid_gyro_within_threshold@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    119f <hybrid_orient_at+0x6f>
jmp    11ae <hybrid_orient_at+0x7e>
mov    $0x5,%edi
call   1030 <pause@plt>
jmp    117b <hybrid_orient_at+0x4b>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1050 <set_wheel_pows@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hybrid_orient_at>:
push   %rax
movss  %xmm0,0x4(%rsp)
cvtsi2ss %edi,%xmm1
movss  0xebd(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  0xeb5(%rip),%xmm1
call   1050 <set_wheel_pows@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  0x4(%rsp),%xmm0
mov    $0xa,%edi
call   1040 <hybrid_gyro_within_threshold@plt>
test   %eax,%eax
jne    1180 <hybrid_orient_at+0x50>
mov    $0x5,%edi
call   1030 <pause@plt>
jmp    1160 <hybrid_orient_at+0x30>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
pop    %rax
jmp    1050 <set_wheel_pows@plt>

LLVM IR (-O0):
define void @hybrid_orient_at(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
store float %0, float* %3
store i32 %1, i32* %4
store float 0x3FD47AE140000000, float* %5
%6 = load float, float* %5
%7 = fneg float %6
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fmul float %7, %9
%11 = load float, float* %5
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
%15 = call i32 @set_wheel_pows(float %10, float %14)
br label %16
16: ; preds = %21, %2
%17 = load float, float* %3
%18 = call i32 @hybrid_gyro_within_threshold(float %17, i32 10)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @pause(i32 5)
br label %16
23: ; preds = %16
%24 = call i32 @set_wheel_pows(float 0.000000e+00, float 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @hybrid_orient_at(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = fmul float %3, 0xBFD47AE140000000
%5 = fmul float %3, 0x3FD47AE140000000
%6 = tail call i32 @set_wheel_pows(float %4, float %5)
%7 = tail call i32 @hybrid_gyro_within_threshold(float %0, i32 10)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2, %9
%10 = tail call i32 @pause(i32 5)
%11 = tail call i32 @hybrid_gyro_within_threshold(float %0, i32 10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9, %2
%14 = tail call i32 @set_wheel_pows(float 0.000000e+00, float 0.000000e+00)
ret void
}