void CalculateTarget(double xc, double yc, double dt, double dc, double *xt,
                     double *yt, double *zt, double x0, double y0) {
  if (dc != 0) {
    *xt = ((xc * dt) / dc) + x0;
    *yt = ((yc * dt) / dc) + y0;
    *zt = 1 - (*xt) - (*yt);
  } else {
    *xt = xc + x0;
    *yt = yc + y0;
    *zt = 1 - (*xt) - (*yt);
  }
  return;
}


x86 assembly (clang, -O0):
<CalculateTarget>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  %xmm5,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114b <CalculateTarget+0x4b>
jp     114b <CalculateTarget+0x4b>
jmp    11a8 <CalculateTarget+0xa8>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xe71(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11ec <CalculateTarget+0xec>
movsd  -0x8(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xe28(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateTarget>:
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm3
jne    110c <CalculateTarget+0xc>
jnp    1126 <CalculateTarget+0x26>
mulsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,(%rdi)
mulsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
jmp    112e <CalculateTarget+0x2e>
addsd  %xmm4,%xmm0
movsd  %xmm0,(%rdi)
addsd  %xmm5,%xmm1
movsd  %xmm1,(%rsi)
movsd  0xec2(%rip),%xmm0
subsd  (%rdi),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @CalculateTarget(double %0, double %1, double %2, double %3, double* %4, double* %5, double* %6, double %7, double %8) {
%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 double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double* %4, double** %14
store double* %5, double** %15
store double* %6, double** %16
store double %7, double* %17
store double %8, double* %18
%19 = load double, double* %13
%20 = fcmp une double %19, 0.000000e+00
br i1 %20, label %21, label %45
21: ; preds = %9
%22 = load double, double* %10
%23 = load double, double* %12
%24 = fmul double %22, %23
%25 = load double, double* %13
%26 = fdiv double %24, %25
%27 = load double, double* %17
%28 = fadd double %26, %27
%29 = load double*, double** %14
store double %28, double* %29
%30 = load double, double* %11
%31 = load double, double* %12
%32 = fmul double %30, %31
%33 = load double, double* %13
%34 = fdiv double %32, %33
%35 = load double, double* %18
%36 = fadd double %34, %35
%37 = load double*, double** %15
store double %36, double* %37
%38 = load double*, double** %14
%39 = load double, double* %38
%40 = fsub double 1.000000e+00, %39
%41 = load double*, double** %15
%42 = load double, double* %41
%43 = fsub double %40, %42
%44 = load double*, double** %16
store double %43, double* %44
br label %61
45: ; preds = %9
%46 = load double, double* %10
%47 = load double, double* %17
%48 = fadd double %46, %47
%49 = load double*, double** %14
store double %48, double* %49
%50 = load double, double* %11
%51 = load double, double* %18
%52 = fadd double %50, %51
%53 = load double*, double** %15
store double %52, double* %53
%54 = load double*, double** %14
%55 = load double, double* %54
%56 = fsub double 1.000000e+00, %55
%57 = load double*, double** %15
%58 = load double, double* %57
%59 = fsub double %56, %58
%60 = load double*, double** %16
store double %59, double* %60
br label %61
61: ; preds = %45, %21
ret void
}

LLVM IR (-O2):
define void @CalculateTarget(double %0, double %1, double %2, double %3, double* nocapture %4, double* nocapture writeonly %5, double* nocapture writeonly %6, double %7, double %8) {
%10 = fcmp une double %3, 0.000000e+00
br i1 %10, label %11, label %17
11: ; preds = %9
%12 = fmul double %0, %2
%13 = fdiv double %12, %3
%14 = fadd double %13, %7
store double %14, double* %4
%15 = fmul double %1, %2
%16 = fdiv double %15, %3
br label %19
17: ; preds = %9
%18 = fadd double %0, %7
store double %18, double* %4
br label %19
19: ; preds = %17, %11
%20 = phi double [ %1, %17 ], [ %16, %11 ]
%21 = fadd double %20, %8
store double %21, double* %5
%22 = load double, double* %4
%23 = fsub double 1.000000e+00, %22
%24 = fsub double %23, %21
store double %24, double* %6
ret void
}