double fix_asc_polar(double asc, double armc, double eps, double geolat) {
  double demc = (atan(sin((armc) * (3.14159265358979323846 / 180.0)) *
                      tan((eps) * (3.14159265358979323846 / 180.0))) *
                 (180.0 / 3.14159265358979323846));
  if (geolat >= 0 && 90 - geolat + demc < 0)
    asc = swe_degnorm(asc + 180);
  if (geolat < 0 && -90 - geolat + demc > 0)
    asc = swe_degnorm(asc + 180);
  return asc;
}


x86 assembly (clang, -O0):
<fix_asc_polar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xea4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1060 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <atan@plt>
movsd  0xe62(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11f5 <fix_asc_polar+0xb5>
movsd  0xe4f(%rip),%xmm1
subsd  -0x20(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11f5 <fix_asc_polar+0xb5>
movsd  0xe38(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <swe_degnorm@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    123f <fix_asc_polar+0xff>
movsd  0xe15(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    123f <fix_asc_polar+0xff>
movsd  0xdee(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <swe_degnorm@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_asc_polar>:
sub    $0x28,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm0,0x8(%rsp)
mulsd  0xea2(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xe85(%rip),%xmm0
call   1060 <tan@plt>
mulsd  0x18(%rsp),%xmm0
call   1050 <atan@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm3
mulsd  0xe6b(%rip),%xmm3
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jb     11f7 <fix_asc_polar+0xb7>
movsd  0xe61(%rip),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm2
jbe    11f7 <fix_asc_polar+0xb7>
movsd  0x8(%rsp),%xmm0
addsd  0xe4d(%rip),%xmm0
mov    $0x1,%al
movsd  %xmm3,0x8(%rsp)
call   1030 <swe_degnorm@plt>
xorpd  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm2
ja     1203 <fix_asc_polar+0xc3>
jmp    1238 <fix_asc_polar+0xf8>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm2
jbe    1238 <fix_asc_polar+0xf8>
movsd  0xe15(%rip),%xmm2
subsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jbe    1238 <fix_asc_polar+0xf8>
addsd  0xdf3(%rip),%xmm0
mov    $0x1,%al
call   1030 <swe_degnorm@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x28,%rsp
ret
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @fix_asc_polar(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = fmul double %10, 0x3F91DF46A2529D39
%12 = call double @sin(double %11)
%13 = load double, double* %7
%14 = fmul double %13, 0x3F91DF46A2529D39
%15 = call double @tan(double %14)
%16 = fmul double %12, %15
%17 = call double @atan(double %16)
%18 = fmul double %17, 0x404CA5DC1A63C1F8
store double %18, double* %9
%19 = load double, double* %8
%20 = fcmp oge double %19, 0.000000e+00
br i1 %20, label %21, label %32
21: ; preds = %4
%22 = load double, double* %8
%23 = fsub double 9.000000e+01, %22
%24 = load double, double* %9
%25 = fadd double %23, %24
%26 = fcmp olt double %25, 0.000000e+00
br i1 %26, label %27, label %32
27: ; preds = %21
%28 = load double, double* %5
%29 = fadd double %28, 1.800000e+02
%30 = call i32 (double, ...) bitcast (i32 (...)* @swe_degnorm to i32 (double, ...)*)(double %29)
%31 = sitofp i32 %30 to double
store double %31, double* %5
br label %32
32: ; preds = %27, %21, %4
%33 = load double, double* %8
%34 = fcmp olt double %33, 0.000000e+00
br i1 %34, label %35, label %46
35: ; preds = %32
%36 = load double, double* %8
%37 = fsub double -9.000000e+01, %36
%38 = load double, double* %9
%39 = fadd double %37, %38
%40 = fcmp ogt double %39, 0.000000e+00
br i1 %40, label %41, label %46
41: ; preds = %35
%42 = load double, double* %5
%43 = fadd double %42, 1.800000e+02
%44 = call i32 (double, ...) bitcast (i32 (...)* @swe_degnorm to i32 (double, ...)*)(double %43)
%45 = sitofp i32 %44 to double
store double %45, double* %5
br label %46
46: ; preds = %41, %35, %32
%47 = load double, double* %5
ret double %47
}

LLVM IR (-O2):
define double @fix_asc_polar(double %0, double %1, double %2, double %3) {
%5 = fmul double %1, 0x3F91DF46A2529D39
%6 = tail call double @sin(double %5)
%7 = fmul double %2, 0x3F91DF46A2529D39
%8 = tail call double @tan(double %7)
%9 = fmul double %6, %8
%10 = tail call double @atan(double %9)
%11 = fmul double %10, 0x404CA5DC1A63C1F8
%12 = fcmp ult double %3, 0.000000e+00
br i1 %12, label %21, label %13
13: ; preds = %4
%14 = fsub double 9.000000e+01, %3
%15 = fadd double %14, %11
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = fadd double %0, 1.800000e+02
%19 = tail call i32 (double, ...) bitcast (i32 (...)* @swe_degnorm to i32 (double, ...)*)(double %18)
%20 = sitofp i32 %19 to double
br label %21
21: ; preds = %17, %13, %4
%22 = phi double [ %20, %17 ], [ %0, %13 ], [ %0, %4 ]
%23 = fcmp olt double %3, 0.000000e+00
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = fsub double -9.000000e+01, %3
%26 = fadd double %25, %11
%27 = fcmp ogt double %26, 0.000000e+00
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = fadd double %22, 1.800000e+02
%30 = tail call i32 (double, ...) bitcast (i32 (...)* @swe_degnorm to i32 (double, ...)*)(double %29)
%31 = sitofp i32 %30 to double
br label %32
32: ; preds = %28, %24, %21
%33 = phi double [ %31, %28 ], [ %22, %24 ], [ %22, %21 ]
ret double %33
}