void get_second_order_tracking_const(int *C1, int *C2, double zeta, double BWn,
                                     double Ts, double Ko, double Kn) {
  double On = ((8.0 * zeta * BWn) / (4.0 * zeta * zeta + 1.0));
  double KoKn = Ko * Kn;
  double OnTs = On * Ts;
  double denom = (4.0 + 4.0 * zeta * OnTs + OnTs * OnTs);
  *C1 = (int)((1.0 / KoKn * 8.0 * zeta * On) / denom + 0.5);
  *C2 = (int)((1.0 / KoKn * 4.0 * OnTs * On) / denom + 0.5);
}


x86 assembly (clang, -O0):
<get_second_order_tracking_const>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xebb(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe80(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe6a(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe4f(%rip),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0xe17(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
movsd  0xe11(%rip),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  0xdfc(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0xdd9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_second_order_tracking_const>:
movsd  0xef8(%rip),%xmm6
movapd %xmm0,%xmm9
mulsd  %xmm6,%xmm9
mulsd  %xmm1,%xmm9
movsd  0xee8(%rip),%xmm8
movapd %xmm0,%xmm7
mulsd  %xmm8,%xmm7
movapd %xmm7,%xmm5
mulsd  %xmm0,%xmm5
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm5
divsd  %xmm5,%xmm9
mulsd  %xmm4,%xmm3
mulsd  %xmm9,%xmm2
mulsd  %xmm2,%xmm7
addsd  %xmm8,%xmm7
movapd %xmm2,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm7,%xmm4
divsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm6
mulsd  %xmm0,%xmm6
mulsd  %xmm9,%xmm6
divsd  %xmm4,%xmm6
movsd  0xe9b(%rip),%xmm0
addsd  %xmm0,%xmm6
cvttsd2si %xmm6,%eax
mulsd  %xmm8,%xmm1
mulsd  %xmm2,%xmm1
mov    %eax,(%rdi)
mulsd  %xmm9,%xmm1
divsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @get_second_order_tracking_const(i32* %0, i32* %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
store i32* %0, i32** %8
store i32* %1, i32** %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%19 = load double, double* %10
%20 = fmul double 8.000000e+00, %19
%21 = load double, double* %11
%22 = fmul double %20, %21
%23 = load double, double* %10
%24 = fmul double 4.000000e+00, %23
%25 = load double, double* %10
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double 1.000000e+00)
%27 = fdiv double %22, %26
store double %27, double* %15
%28 = load double, double* %13
%29 = load double, double* %14
%30 = fmul double %28, %29
store double %30, double* %16
%31 = load double, double* %15
%32 = load double, double* %12
%33 = fmul double %31, %32
store double %33, double* %17
%34 = load double, double* %10
%35 = fmul double 4.000000e+00, %34
%36 = load double, double* %17
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double 4.000000e+00)
%38 = load double, double* %17
%39 = load double, double* %17
%40 = call double @llvm.fmuladd.f64(double %38, double %39, double %37)
store double %40, double* %18
%41 = load double, double* %16
%42 = fdiv double 1.000000e+00, %41
%43 = fmul double %42, 8.000000e+00
%44 = load double, double* %10
%45 = fmul double %43, %44
%46 = load double, double* %15
%47 = fmul double %45, %46
%48 = load double, double* %18
%49 = fdiv double %47, %48
%50 = fadd double %49, 5.000000e-01
%51 = fptosi double %50 to i32
%52 = load i32*, i32** %8
store i32 %51, i32* %52
%53 = load double, double* %16
%54 = fdiv double 1.000000e+00, %53
%55 = fmul double %54, 4.000000e+00
%56 = load double, double* %17
%57 = fmul double %55, %56
%58 = load double, double* %15
%59 = fmul double %57, %58
%60 = load double, double* %18
%61 = fdiv double %59, %60
%62 = fadd double %61, 5.000000e-01
%63 = fptosi double %62 to i32
%64 = load i32*, i32** %9
store i32 %63, i32* %64
ret void
}

LLVM IR (-O2):
define void @get_second_order_tracking_const(i32* nocapture writeonly %0, i32* nocapture writeonly %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fmul double %2, 8.000000e+00
%9 = fmul double %8, %3
%10 = fmul double %2, 4.000000e+00
%11 = tail call double @llvm.fmuladd.f64(double %10, double %2, double 1.000000e+00)
%12 = fdiv double %9, %11
%13 = fmul double %5, %6
%14 = fmul double %12, %4
%15 = tail call double @llvm.fmuladd.f64(double %10, double %14, double 4.000000e+00)
%16 = tail call double @llvm.fmuladd.f64(double %14, double %14, double %15)
%17 = fdiv double 1.000000e+00, %13
%18 = fmul double %17, 8.000000e+00
%19 = fmul double %18, %2
%20 = fmul double %12, %19
%21 = fdiv double %20, %16
%22 = fadd double %21, 5.000000e-01
%23 = fptosi double %22 to i32
store i32 %23, i32* %0
%24 = fmul double %17, 4.000000e+00
%25 = fmul double %14, %24
%26 = fmul double %12, %25
%27 = fdiv double %26, %16
%28 = fadd double %27, 5.000000e-01
%29 = fptosi double %28 to i32
store i32 %29, i32* %1
ret void
}