#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 FormatFastConverge(float, float);
float FormatRange0to2PI(float);
float CompFilterProcess(float compAngle, float accelAngle, float omega,
                        float deltaT, float alpha) {
  float gyroAngle;
  compAngle = FormatFastConverge(compAngle, accelAngle);
  gyroAngle = compAngle + omega * deltaT;
  compAngle = alpha * gyroAngle + (1.0f - alpha) * accelAngle;
  compAngle = FormatRange0to2PI(compAngle);
  return compAngle;
}


x86 assembly (clang, -O0):
<CompFilterProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <FormatFastConverge@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  0xe7d(%rip),%xmm1
subss  -0x14(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <FormatRange0to2PI@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompFilterProcess>:
sub    $0x18,%rsp
movss  %xmm4,0x14(%rsp)
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x10(%rsp)
call   1030 <FormatFastConverge@plt>
movss  0x8(%rsp),%xmm1
mulss  0xc(%rsp),%xmm1
addss  %xmm1,%xmm0
movss  0xea7(%rip),%xmm1
movss  0x14(%rsp),%xmm2
subss  %xmm2,%xmm1
mulss  0x10(%rsp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x18,%rsp
jmp    1040 <FormatRange0to2PI@plt>

LLVM IR (-O0):
define float @CompFilterProcess(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = load float, float* %6
%13 = load float, float* %7
%14 = call float @FormatFastConverge(float %12, float %13)
store float %14, float* %6
%15 = load float, float* %6
%16 = load float, float* %8
%17 = load float, float* %9
%18 = call float @llvm.fmuladd.f32(float %16, float %17, float %15)
store float %18, float* %11
%19 = load float, float* %10
%20 = load float, float* %11
%21 = load float, float* %10
%22 = fsub float 1.000000e+00, %21
%23 = load float, float* %7
%24 = fmul float %22, %23
%25 = call float @llvm.fmuladd.f32(float %19, float %20, float %24)
store float %25, float* %6
%26 = load float, float* %6
%27 = call float @FormatRange0to2PI(float %26)
store float %27, float* %6
%28 = load float, float* %6
ret float %28
}

LLVM IR (-O2):
define float @CompFilterProcess(float %0, float %1, float %2, float %3, float %4) {
%6 = tail call float @FormatFastConverge(float %0, float %1)
%7 = tail call float @llvm.fmuladd.f32(float %2, float %3, float %6)
%8 = fsub float 1.000000e+00, %4
%9 = fmul float %8, %1
%10 = tail call float @llvm.fmuladd.f32(float %4, float %7, float %9)
%11 = tail call float @FormatRange0to2PI(float %10)
ret float %11
}