double OneYdisplace(pos_vect, profileArray, prof_dim, prof_amp, cyl_index)
double pos_vect[2];
float *profileArray;
double prof_dim, prof_amp, cyl_index;
{
  double Yd, scale_xpos;
  scale_xpos = pos_vect[0] * (3.1415927 / prof_dim);
  if (pos_vect[0] >= 0.0 && pos_vect[0] < prof_dim * 2.0)
    Yd = (calcProfile(profileArray, scale_xpos) * prof_amp *
          exp(-(pos_vect[1] * pos_vect[1]) * cyl_index));
  else
    Yd = 0.0;
  return (Yd);
}


x86 assembly (clang, -O0):
<OneYdisplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11f8 <OneYdisplace+0xd8>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xe86(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f8 <OneYdisplace+0xd8>
mov    -0x10(%rbp),%rdi
movsd  -0x38(%rbp),%xmm0
mov    $0x1,%al
call   1040 <calcProfile@plt>
cvtsi2sd %eax,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1200 <OneYdisplace+0xe0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneYdisplace>:
push   %rbx
sub    $0x10,%rsp
movapd %xmm0,%xmm5
movsd  (%rdi),%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
jb     11a3 <OneYdisplace+0x83>
movapd %xmm5,%xmm3
addsd  %xmm5,%xmm3
ucomisd %xmm4,%xmm3
jbe    11a3 <OneYdisplace+0x83>
mov    %rdi,%rbx
movsd  0xeb0(%rip),%xmm0
divsd  %xmm5,%xmm0
mulsd  %xmm4,%xmm0
mov    %rsi,%rdi
mov    $0x1,%al
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
call   1040 <calcProfile@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rbx),%xmm1
movapd 0xe85(%rip),%xmm0
xorpd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @OneYdisplace(double* %0, float* %1, double %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca float*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double* %0, double** %6
store float* %1, float** %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double, double* %8
%17 = fdiv double 0x400921FB5A7ED197, %16
%18 = fmul double %15, %17
store double %18, double* %12
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = fcmp oge double %21, 0.000000e+00
br i1 %22, label %23, label %49
23: ; preds = %5
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = load double, double* %8
%28 = fmul double %27, 2.000000e+00
%29 = fcmp olt double %26, %28
br i1 %29, label %30, label %49
30: ; preds = %23
%31 = load float*, float** %7
%32 = load double, double* %12
%33 = call i32 (float*, double, ...) bitcast (i32 (...)* @calcProfile to i32 (float*, double, ...)*)(float* %31, double %32)
%34 = sitofp i32 %33 to double
%35 = load double, double* %9
%36 = fmul double %34, %35
%37 = load double*, double** %6
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = load double*, double** %6
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = fmul double %39, %42
%44 = fneg double %43
%45 = load double, double* %10
%46 = fmul double %44, %45
%47 = call double @exp(double %46)
%48 = fmul double %36, %47
store double %48, double* %11
br label %50
49: ; preds = %23, %5
store double 0.000000e+00, double* %11
br label %50
50: ; preds = %49, %30
%51 = load double, double* %11
ret double %51
}

LLVM IR (-O2):
define double @OneYdisplace(double* nocapture %0, float* %1, double %2, double %3, double %4) {
%6 = load double, double* %0
%7 = fcmp oge double %6, 0.000000e+00
%8 = fmul double %2, 2.000000e+00
%9 = fcmp olt double %6, %8
%10 = and i1 %7, %9
br i1 %10, label %11, label %24
11: ; preds = %5
%12 = fdiv double 0x400921FB5A7ED197, %2
%13 = fmul double %12, %6
%14 = tail call i32 (float*, double, ...) bitcast (i32 (...)* @calcProfile to i32 (float*, double, ...)*)(float* %1, double %13)
%15 = sitofp i32 %14 to double
%16 = fmul double %15, %3
%17 = getelementptr inbounds double, double* %0, i64 1
%18 = load double, double* %17
%19 = fneg double %18
%20 = fmul double %18, %19
%21 = fmul double %20, %4
%22 = tail call double @exp(double %21)
%23 = fmul double %16, %22
br label %24
24: ; preds = %5, %11
%25 = phi double [ %23, %11 ], [ 0.000000e+00, %5 ]
ret double %25
}