void calc_travel_path(float *pacX, float *pacY, float *nacX, float *nacY,
                      float travelVector[2], float slideVector[2],
                      float *pacMuscleWeight) {
  float muscleWeitht = *pacMuscleWeight;
  travelVector[0] = *nacX - *pacX;
  travelVector[1] = *nacY - *pacY;
  slideVector[0] = travelVector[0] / muscleWeitht;
  slideVector[1] = travelVector[1] / muscleWeitht;
}


x86 assembly (clang, -O0):
<calc_travel_path>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
divss  -0x34(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  -0x34(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_travel_path>:
mov    0x8(%rsp),%rax
movss  (%rax),%xmm0
movss  (%rdx),%xmm1
subss  (%rdi),%xmm1
movss  %xmm1,(%r8)
movss  (%rcx),%xmm2
subss  (%rsi),%xmm2
movss  %xmm2,0x4(%r8)
divss  %xmm0,%xmm1
movss  %xmm1,(%r9)
movss  0x4(%r8),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%r9)
ret

LLVM IR (-O0):
define void @calc_travel_path(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5, float* %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
%15 = alloca float
store float* %0, float** %8
store float* %1, float** %9
store float* %2, float** %10
store float* %3, float** %11
store float* %4, float** %12
store float* %5, float** %13
store float* %6, float** %14
%16 = load float*, float** %14
%17 = load float, float* %16
store float %17, float* %15
%18 = load float*, float** %10
%19 = load float, float* %18
%20 = load float*, float** %8
%21 = load float, float* %20
%22 = fsub float %19, %21
%23 = load float*, float** %12
%24 = getelementptr inbounds float, float* %23, i64 0
store float %22, float* %24
%25 = load float*, float** %11
%26 = load float, float* %25
%27 = load float*, float** %9
%28 = load float, float* %27
%29 = fsub float %26, %28
%30 = load float*, float** %12
%31 = getelementptr inbounds float, float* %30, i64 1
store float %29, float* %31
%32 = load float*, float** %12
%33 = getelementptr inbounds float, float* %32, i64 0
%34 = load float, float* %33
%35 = load float, float* %15
%36 = fdiv float %34, %35
%37 = load float*, float** %13
%38 = getelementptr inbounds float, float* %37, i64 0
store float %36, float* %38
%39 = load float*, float** %12
%40 = getelementptr inbounds float, float* %39, i64 1
%41 = load float, float* %40
%42 = load float, float* %15
%43 = fdiv float %41, %42
%44 = load float*, float** %13
%45 = getelementptr inbounds float, float* %44, i64 1
store float %43, float* %45
ret void
}

LLVM IR (-O2):
define void @calc_travel_path(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4, float* nocapture writeonly %5, float* nocapture %6) {
%8 = load float, float* %6
%9 = load float, float* %2
%10 = load float, float* %0
%11 = fsub float %9, %10
store float %11, float* %4
%12 = load float, float* %3
%13 = load float, float* %1
%14 = fsub float %12, %13
%15 = getelementptr inbounds float, float* %4, i64 1
store float %14, float* %15
%16 = fdiv float %11, %8
store float %16, float* %5
%17 = load float, float* %15
%18 = fdiv float %17, %8
%19 = getelementptr inbounds float, float* %5, i64 1
store float %18, float* %19
ret void
}