double getAssr(double lat, double dec, int mathhab) {
  double part1, part2, part3, part4, ndec;
  double rlat = ((lat) * (3.1415926535898 / 180.0));
  ndec = dec;
  if (lat < 0.0)
    ndec = -dec;
  part1 = mathhab + tan(rlat - ndec);
  if (part1 < 1.0)
    part1 = mathhab - tan(rlat - ndec);
  part2 = (3.1415926535898 / 2.0) - atan(part1);
  part3 = sin(part2) - (sin(rlat) * sin(ndec));
  part4 = (part3 / (cos(rlat) * cos(ndec)));
  if (part4 < -1 || part4 > 1)
    return 99;
  return 1 / 15.0 * ((acos(part4)) / (3.1415926535898 / 180.0));
}


x86 assembly (clang, -O0):
<getAssr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  0xe90(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11b3 <getAssr+0x63>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe23(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    121a <getAssr+0xca>
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xde9(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd3a(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
ja     12f8 <getAssr+0x1a8>
movsd  -0x40(%rbp),%xmm0
movsd  0xd1a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    130a <getAssr+0x1ba>
movsd  0xd28(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1334 <getAssr+0x1e4>
movsd  -0x40(%rbp),%xmm0
call   1030 <acos@plt>
movaps %xmm0,%xmm1
movsd  0xce1(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xcf5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAssr>:
sub    $0x38,%rsp
movsd  0xea4(%rip),%xmm4
mulsd  %xmm0,%xmm4
movapd 0xec8(%rip),%xmm3
xorpd  %xmm1,%xmm3
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm4,0x10(%rsp)
movapd %xmm0,0x20(%rsp)
subsd  %xmm0,%xmm4
movsd  %xmm4,0x18(%rsp)
movapd %xmm4,%xmm0
call   1060 <tan@plt>
addsd  0x8(%rsp),%xmm0
movsd  0xe4d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11da <getAssr+0x8a>
movsd  0x18(%rsp),%xmm0
call   1060 <tan@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <atan@plt>
movsd  0xe29(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x18(%rsp)
movapd 0x20(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x20(%rsp),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xdb8(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  0xdb4(%rip),%xmm0
ja     1291 <getAssr+0x141>
ucomisd 0xd92(%rip),%xmm1
ja     1291 <getAssr+0x141>
movapd %xmm1,%xmm0
call   1030 <acos@plt>
divsd  0xd77(%rip),%xmm0
mulsd  0xd97(%rip),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @getAssr(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%14 = load double, double* %5
%15 = fmul double %14, 0x3F91DF46A2529D44
store double %15, double* %13
%16 = load double, double* %6
store double %16, double* %12
%17 = load double, double* %5
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load double, double* %6
%21 = fneg double %20
store double %21, double* %12
br label %22
22: ; preds = %19, %3
%23 = load i32, i32* %7
%24 = sitofp i32 %23 to double
%25 = load double, double* %13
%26 = load double, double* %12
%27 = fsub double %25, %26
%28 = call double @tan(double %27)
%29 = fadd double %24, %28
store double %29, double* %8
%30 = load double, double* %8
%31 = fcmp olt double %30, 1.000000e+00
br i1 %31, label %32, label %40
32: ; preds = %22
%33 = load i32, i32* %7
%34 = sitofp i32 %33 to double
%35 = load double, double* %13
%36 = load double, double* %12
%37 = fsub double %35, %36
%38 = call double @tan(double %37)
%39 = fsub double %34, %38
store double %39, double* %8
br label %40
40: ; preds = %32, %22
%41 = load double, double* %8
%42 = call double @atan(double %41)
%43 = fsub double 0x3FF921FB54442D28, %42
store double %43, double* %9
%44 = load double, double* %9
%45 = call double @sin(double %44)
%46 = load double, double* %13
%47 = call double @sin(double %46)
%48 = load double, double* %12
%49 = call double @sin(double %48)
%50 = fneg double %47
%51 = call double @llvm.fmuladd.f64(double %50, double %49, double %45)
store double %51, double* %10
%52 = load double, double* %10
%53 = load double, double* %13
%54 = call double @cos(double %53)
%55 = load double, double* %12
%56 = call double @cos(double %55)
%57 = fmul double %54, %56
%58 = fdiv double %52, %57
store double %58, double* %11
%59 = load double, double* %11
%60 = fcmp olt double %59, -1.000000e+00
br i1 %60, label %64, label %61
61: ; preds = %40
%62 = load double, double* %11
%63 = fcmp ogt double %62, 1.000000e+00
br i1 %63, label %64, label %65
64: ; preds = %61, %40
store double 9.900000e+01, double* %4
br label %70
65: ; preds = %61
%66 = load double, double* %11
%67 = call double @acos(double %66)
%68 = fdiv double %67, 0x3F91DF46A2529D44
%69 = fmul double 0x3FB1111111111111, %68
store double %69, double* %4
br label %70
70: ; preds = %65, %64
%71 = load double, double* %4
ret double %71
}

LLVM IR (-O2):
define double @getAssr(double %0, double %1, i32 %2) {
%4 = fmul double %0, 0x3F91DF46A2529D44
%5 = fcmp olt double %0, 0.000000e+00
%6 = fneg double %1
%7 = select i1 %5, double %6, double %1
%8 = sitofp i32 %2 to double
%9 = fsub double %4, %7
%10 = tail call double @tan(double %9)
%11 = fadd double %10, %8
%12 = fcmp olt double %11, 1.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = tail call double @tan(double %9)
%15 = fsub double %8, %14
br label %16
16: ; preds = %13, %3
%17 = phi double [ %15, %13 ], [ %11, %3 ]
%18 = tail call double @atan(double %17)
%19 = fsub double 0x3FF921FB54442D28, %18
%20 = tail call double @sin(double %19)
%21 = tail call double @sin(double %4)
%22 = tail call double @sin(double %7)
%23 = fneg double %21
%24 = tail call double @llvm.fmuladd.f64(double %23, double %22, double %20)
%25 = tail call double @cos(double %4)
%26 = tail call double @cos(double %7)
%27 = fmul double %25, %26
%28 = fdiv double %24, %27
%29 = fcmp olt double %28, -1.000000e+00
%30 = fcmp ogt double %28, 1.000000e+00
%31 = or i1 %29, %30
br i1 %31, label %36, label %32
32: ; preds = %16
%33 = tail call double @acos(double %28)
%34 = fdiv double %33, 0x3F91DF46A2529D44
%35 = fmul double %34, 0x3FB1111111111111
br label %36
36: ; preds = %16, %32
%37 = phi double [ %35, %32 ], [ 9.900000e+01, %16 ]
ret double %37
}