double getAssr(double lat, double dec, int mathhab) {
  double part1, part2, part3, part4;
  double rlat = ((lat) * (3.1415926535898 / 180.0));
  part1 = mathhab + tan(fabs(rlat - dec));
  part2 = atan(1.0 / part1);
  part3 = sin(part2) - (sin(rlat) * sin(dec));
  part4 = (part3 / (cos(rlat) * cos(dec)));
  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    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  0xea3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movaps 0xe9e(%rip),%xmm1
pand   %xmm1,%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe54(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1050 <atan@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%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,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd9f(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
ja     1283 <getAssr+0x133>
movsd  -0x40(%rbp),%xmm0
movsd  0xd8f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1295 <getAssr+0x145>
movsd  0xd95(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12bf <getAssr+0x16f>
movsd  -0x40(%rbp),%xmm0
call   1030 <acos@plt>
movaps %xmm0,%xmm1
movsd  0xd66(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd62(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAssr>:
sub    $0x28,%rsp
mulsd  0xea4(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
cvtsi2sd %edi,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
subsd  %xmm1,%xmm0
andpd  0xeb2(%rip),%xmm0
call   1060 <tan@plt>
addsd  0x8(%rsp),%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <atan@plt>
call   1040 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x20(%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)
movsd  0x18(%rsp),%xmm0
call   1070 <cos@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe01(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  0xdfd(%rip),%xmm0
ja     1240 <getAssr+0xf0>
ucomisd 0xde3(%rip),%xmm1
ja     1240 <getAssr+0xf0>
movapd %xmm1,%xmm0
call   1030 <acos@plt>
divsd  0xdc8(%rip),%xmm0
mulsd  0xde0(%rip),%xmm0
add    $0x28,%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
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%13 = load double, double* %5
%14 = fmul double %13, 0x3F91DF46A2529D44
store double %14, double* %12
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to double
%17 = load double, double* %12
%18 = load double, double* %6
%19 = fsub double %17, %18
%20 = call double @llvm.fabs.f64(double %19)
%21 = call double @tan(double %20)
%22 = fadd double %16, %21
store double %22, double* %8
%23 = load double, double* %8
%24 = fdiv double 1.000000e+00, %23
%25 = call double @atan(double %24)
store double %25, double* %9
%26 = load double, double* %9
%27 = call double @sin(double %26)
%28 = load double, double* %12
%29 = call double @sin(double %28)
%30 = load double, double* %6
%31 = call double @sin(double %30)
%32 = fneg double %29
%33 = call double @llvm.fmuladd.f64(double %32, double %31, double %27)
store double %33, double* %10
%34 = load double, double* %10
%35 = load double, double* %12
%36 = call double @cos(double %35)
%37 = load double, double* %6
%38 = call double @cos(double %37)
%39 = fmul double %36, %38
%40 = fdiv double %34, %39
store double %40, double* %11
%41 = load double, double* %11
%42 = fcmp olt double %41, -1.000000e+00
br i1 %42, label %46, label %43
43: ; preds = %3
%44 = load double, double* %11
%45 = fcmp ogt double %44, 1.000000e+00
br i1 %45, label %46, label %47
46: ; preds = %43, %3
store double 9.900000e+01, double* %4
br label %52
47: ; preds = %43
%48 = load double, double* %11
%49 = call double @acos(double %48)
%50 = fdiv double %49, 0x3F91DF46A2529D44
%51 = fmul double 0x3FB1111111111111, %50
store double %51, double* %4
br label %52
52: ; preds = %47, %46
%53 = load double, double* %4
ret double %53
}

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