#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 atan2(float, float);
float CharDir(float F, float vx, float vy, double T, double a, double b,
              double c, double d) {
  float phi, DTx, DTy;
  float N, D, G;
  double FF;
  DTx = a * T + b;
  DTy = c * T + d;
  FF = F * F;
  G = (1.0 - vx * DTx - vy * DTy);
  N = FF * DTy + vy * G;
  D = FF * DTx + vx * G;
  phi = atan2(N, D);
  return (phi);
}


x86 assembly (clang, -O0):
<CharDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movsd  %xmm3,-0x18(%rbp)
movsd  %xmm4,-0x20(%rbp)
movsd  %xmm5,-0x28(%rbp)
movsd  %xmm6,-0x30(%rbp)
movsd  %xmm7,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe57(%rip),%xmm0
subsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x44(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
movss  -0x44(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x50(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movss  -0x40(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x50(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x48(%rbp),%xmm0
movss  -0x4c(%rbp),%xmm1
call   1030 <atan2@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharDir>:
mulsd  %xmm3,%xmm4
addsd  %xmm5,%xmm4
cvtsd2ss %xmm4,%xmm4
mulsd  %xmm3,%xmm6
addsd  %xmm7,%xmm6
xorps  %xmm3,%xmm3
cvtsd2ss %xmm6,%xmm3
mulss  %xmm0,%xmm0
xorps  %xmm5,%xmm5
cvtss2sd %xmm0,%xmm5
xorps  %xmm6,%xmm6
cvtss2sd %xmm4,%xmm6
mulss  %xmm1,%xmm4
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
movsd  0xeb0(%rip),%xmm4
subsd  %xmm0,%xmm4
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
mulss  %xmm2,%xmm3
cvtss2sd %xmm3,%xmm3
subsd  %xmm3,%xmm4
xorps  %xmm3,%xmm3
cvtsd2ss %xmm4,%xmm3
mulss  %xmm3,%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm5,%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  %xmm1,%xmm3
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
mulsd  %xmm5,%xmm6
addsd  %xmm1,%xmm6
xorps  %xmm1,%xmm1
cvtsd2ss %xmm6,%xmm1
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define float @CharDir(float %0, float %1, float %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca double
store float %0, float* %9
store float %1, float* %10
store float %2, float* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%24 = load double, double* %13
%25 = load double, double* %12
%26 = load double, double* %14
%27 = call double @llvm.fmuladd.f64(double %24, double %25, double %26)
%28 = fptrunc double %27 to float
store float %28, float* %18
%29 = load double, double* %15
%30 = load double, double* %12
%31 = load double, double* %16
%32 = call double @llvm.fmuladd.f64(double %29, double %30, double %31)
%33 = fptrunc double %32 to float
store float %33, float* %19
%34 = load float, float* %9
%35 = load float, float* %9
%36 = fmul float %34, %35
%37 = fpext float %36 to double
store double %37, double* %23
%38 = load float, float* %10
%39 = load float, float* %18
%40 = fmul float %38, %39
%41 = fpext float %40 to double
%42 = fsub double 1.000000e+00, %41
%43 = load float, float* %11
%44 = load float, float* %19
%45 = fmul float %43, %44
%46 = fpext float %45 to double
%47 = fsub double %42, %46
%48 = fptrunc double %47 to float
store float %48, float* %22
%49 = load double, double* %23
%50 = load float, float* %19
%51 = fpext float %50 to double
%52 = load float, float* %11
%53 = load float, float* %22
%54 = fmul float %52, %53
%55 = fpext float %54 to double
%56 = call double @llvm.fmuladd.f64(double %49, double %51, double %55)
%57 = fptrunc double %56 to float
store float %57, float* %20
%58 = load double, double* %23
%59 = load float, float* %18
%60 = fpext float %59 to double
%61 = load float, float* %10
%62 = load float, float* %22
%63 = fmul float %61, %62
%64 = fpext float %63 to double
%65 = call double @llvm.fmuladd.f64(double %58, double %60, double %64)
%66 = fptrunc double %65 to float
store float %66, float* %21
%67 = load float, float* %20
%68 = load float, float* %21
%69 = call float @atan2(float %67, float %68)
store float %69, float* %17
%70 = load float, float* %17
ret float %70
}

LLVM IR (-O2):
define float @CharDir(float %0, float %1, float %2, double %3, double %4, double %5, double %6, double %7) {
%9 = tail call double @llvm.fmuladd.f64(double %4, double %3, double %5)
%10 = fptrunc double %9 to float
%11 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %7)
%12 = fptrunc double %11 to float
%13 = fmul float %0, %0
%14 = fpext float %13 to double
%15 = fmul float %10, %1
%16 = fpext float %15 to double
%17 = fsub double 1.000000e+00, %16
%18 = fmul float %12, %2
%19 = fpext float %18 to double
%20 = fsub double %17, %19
%21 = fptrunc double %20 to float
%22 = fpext float %12 to double
%23 = fmul float %21, %2
%24 = fpext float %23 to double
%25 = tail call double @llvm.fmuladd.f64(double %14, double %22, double %24)
%26 = fptrunc double %25 to float
%27 = fpext float %10 to double
%28 = fmul float %21, %1
%29 = fpext float %28 to double
%30 = tail call double @llvm.fmuladd.f64(double %14, double %27, double %29)
%31 = fptrunc double %30 to float
%32 = tail call float @atan2(float %26, float %31)
ret float %32
}