void ProfilePosition(x, z, prof_rot, prof_dim, pos_vect) double x, z;
double prof_rot, prof_dim, pos_vect[2];
{
  double rot_mat[2][2];
  rot_mat[0][0] = sin(prof_rot * 3.1415927 / 180.0);
  rot_mat[0][1] = -cos(prof_rot * 3.1415927 / 180.0);
  rot_mat[1][0] = -rot_mat[0][1];
  rot_mat[1][1] = rot_mat[0][0];
  pos_vect[0] = (rot_mat[0][0] * x) + (rot_mat[0][1] * z);
  pos_vect[1] = (rot_mat[1][0] * x) + (rot_mat[1][1] * z);
  pos_vect[0] = pos_vect[0] + (prof_dim);
}


x86 assembly (clang, -O0):
<ProfilePosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  0xec0(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xe9d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProfilePosition>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
movsd  %xmm3,0x28(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
movapd %xmm2,%xmm0
mulsd  0xeba(%rip),%xmm0
divsd  0xeba(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movapd %xmm0,%xmm1
movsd  0x18(%rsp),%xmm4
mulsd  %xmm4,%xmm1
movsd  0x10(%rsp),%xmm5
movapd %xmm5,%xmm2
movsd  0x20(%rsp),%xmm3
mulsd  %xmm3,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm4,%xmm5
mulsd  %xmm3,%xmm0
addsd  %xmm5,%xmm0
movsd  %xmm0,0x8(%rbx)
addsd  0x28(%rsp),%xmm2
movsd  %xmm2,(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ProfilePosition(double %0, double %1, double %2, double %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca [2 x [2 x double]]
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double* %4, double** %10
%12 = load double, double* %8
%13 = fmul double %12, 0x400921FB5A7ED197
%14 = fdiv double %13, 1.800000e+02
%15 = call double @sin(double %14)
%16 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 0
%17 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
store double %15, double* %17
%18 = load double, double* %8
%19 = fmul double %18, 0x400921FB5A7ED197
%20 = fdiv double %19, 1.800000e+02
%21 = call double @cos(double %20)
%22 = fneg double %21
%23 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 0
%24 = getelementptr inbounds [2 x double], [2 x double]* %23, i64 0, i64 1
store double %22, double* %24
%25 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 0
%26 = getelementptr inbounds [2 x double], [2 x double]* %25, i64 0, i64 1
%27 = load double, double* %26
%28 = fneg double %27
%29 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 1
%30 = getelementptr inbounds [2 x double], [2 x double]* %29, i64 0, i64 0
store double %28, double* %30
%31 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 0
%32 = getelementptr inbounds [2 x double], [2 x double]* %31, i64 0, i64 0
%33 = load double, double* %32
%34 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 1
%35 = getelementptr inbounds [2 x double], [2 x double]* %34, i64 0, i64 1
store double %33, double* %35
%36 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 0
%37 = getelementptr inbounds [2 x double], [2 x double]* %36, i64 0, i64 0
%38 = load double, double* %37
%39 = load double, double* %6
%40 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 0
%41 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0, i64 1
%42 = load double, double* %41
%43 = load double, double* %7
%44 = fmul double %42, %43
%45 = call double @llvm.fmuladd.f64(double %38, double %39, double %44)
%46 = load double*, double** %10
%47 = getelementptr inbounds double, double* %46, i64 0
store double %45, double* %47
%48 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 1
%49 = getelementptr inbounds [2 x double], [2 x double]* %48, i64 0, i64 0
%50 = load double, double* %49
%51 = load double, double* %6
%52 = getelementptr inbounds [2 x [2 x double]], [2 x [2 x double]]* %11, i64 0, i64 1
%53 = getelementptr inbounds [2 x double], [2 x double]* %52, i64 0, i64 1
%54 = load double, double* %53
%55 = load double, double* %7
%56 = fmul double %54, %55
%57 = call double @llvm.fmuladd.f64(double %50, double %51, double %56)
%58 = load double*, double** %10
%59 = getelementptr inbounds double, double* %58, i64 1
store double %57, double* %59
%60 = load double*, double** %10
%61 = getelementptr inbounds double, double* %60, i64 0
%62 = load double, double* %61
%63 = load double, double* %9
%64 = fadd double %62, %63
%65 = load double*, double** %10
%66 = getelementptr inbounds double, double* %65, i64 0
store double %64, double* %66
ret void
}

LLVM IR (-O2):
define void @ProfilePosition(double %0, double %1, double %2, double %3, double* nocapture writeonly %4) {
%6 = fmul double %2, 0x400921FB5A7ED197
%7 = fdiv double %6, 1.800000e+02
%8 = tail call double @sin(double %7)
%9 = tail call double @cos(double %7)
%10 = fneg double %9
%11 = fmul double %10, %1
%12 = tail call double @llvm.fmuladd.f64(double %8, double %0, double %11)
%13 = fmul double %8, %1
%14 = tail call double @llvm.fmuladd.f64(double %9, double %0, double %13)
%15 = getelementptr inbounds double, double* %4, i64 1
store double %14, double* %15
%16 = fadd double %12, %3
store double %16, double* %4
ret void
}