; LLVM IR from venumb/ZSPACE :: cpp/depends/spa (spa)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
declare dso_local double @rad2deg(double noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local double @deg2rad(double noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: nounwind
declare double @sin(double noundef) #3

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #3

; Function Attrs: nounwind
declare double @tan(double noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @right_ascension_parallax_and_topocentric_dec(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  store double %0, ptr %8, align 8, !tbaa !5
  store double %1, ptr %9, align 8, !tbaa !5
  store double %2, ptr %10, align 8, !tbaa !5
  store double %3, ptr %11, align 8, !tbaa !5
  store double %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !9
  store ptr %6, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %23 = load double, ptr %8, align 8, !tbaa !5
  %24 = call double @deg2rad(double noundef %23)
  store double %24, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %25 = load double, ptr %10, align 8, !tbaa !5
  %26 = call double @deg2rad(double noundef %25)
  store double %26, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %27 = load double, ptr %11, align 8, !tbaa !5
  %28 = call double @deg2rad(double noundef %27)
  store double %28, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %29 = load double, ptr %12, align 8, !tbaa !5
  %30 = call double @deg2rad(double noundef %29)
  store double %30, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %31 = load double, ptr %16, align 8, !tbaa !5
  %32 = call double @tan(double noundef %31) #4
  %33 = fmul double 0x3FEFE488A5D668D8, %32
  %34 = call double @atan(double noundef %33) #4
  store double %34, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %35 = load double, ptr %20, align 8, !tbaa !5
  %36 = call double @sin(double noundef %35) #4
  %37 = load double, ptr %9, align 8, !tbaa !5
  %38 = load double, ptr %16, align 8, !tbaa !5
  %39 = call double @sin(double noundef %38) #4
  %40 = fmul double %37, %39
  %41 = fdiv double %40, 6.378140e+06
  %42 = call double @llvm.fmuladd.f64(double 0x3FEFE488A5D668D8, double %36, double %41)
  store double %42, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %43 = load double, ptr %20, align 8, !tbaa !5
  %44 = call double @cos(double noundef %43) #4
  %45 = load double, ptr %9, align 8, !tbaa !5
  %46 = load double, ptr %16, align 8, !tbaa !5
  %47 = call double @cos(double noundef %46) #4
  %48 = fmul double %45, %47
  %49 = fdiv double %48, 6.378140e+06
  %50 = fadd double %44, %49
  store double %50, ptr %22, align 8, !tbaa !5
  %51 = load double, ptr %22, align 8, !tbaa !5
  %52 = fneg double %51
  %53 = load double, ptr %17, align 8, !tbaa !5
  %54 = call double @sin(double noundef %53) #4
  %55 = fmul double %52, %54
  %56 = load double, ptr %18, align 8, !tbaa !5
  %57 = call double @sin(double noundef %56) #4
  %58 = fmul double %55, %57
  %59 = load double, ptr %19, align 8, !tbaa !5
  %60 = call double @cos(double noundef %59) #4
  %61 = load double, ptr %22, align 8, !tbaa !5
  %62 = load double, ptr %17, align 8, !tbaa !5
  %63 = call double @sin(double noundef %62) #4
  %64 = fmul double %61, %63
  %65 = load double, ptr %18, align 8, !tbaa !5
  %66 = call double @cos(double noundef %65) #4
  %67 = fneg double %64
  %68 = call double @llvm.fmuladd.f64(double %67, double %66, double %60)
  %69 = call double @atan2(double noundef %58, double noundef %68) #4
  store double %69, ptr %15, align 8, !tbaa !5
  %70 = load double, ptr %19, align 8, !tbaa !5
  %71 = call double @sin(double noundef %70) #4
  %72 = load double, ptr %21, align 8, !tbaa !5
  %73 = load double, ptr %17, align 8, !tbaa !5
  %74 = call double @sin(double noundef %73) #4
  %75 = fneg double %72
  %76 = call double @llvm.fmuladd.f64(double %75, double %74, double %71)
  %77 = load double, ptr %15, align 8, !tbaa !5
  %78 = call double @cos(double noundef %77) #4
  %79 = fmul double %76, %78
  %80 = load double, ptr %19, align 8, !tbaa !5
  %81 = call double @cos(double noundef %80) #4
  %82 = load double, ptr %22, align 8, !tbaa !5
  %83 = load double, ptr %17, align 8, !tbaa !5
  %84 = call double @sin(double noundef %83) #4
  %85 = fmul double %82, %84
  %86 = load double, ptr %18, align 8, !tbaa !5
  %87 = call double @cos(double noundef %86) #4
  %88 = fneg double %85
  %89 = call double @llvm.fmuladd.f64(double %88, double %87, double %81)
  %90 = call double @atan2(double noundef %79, double noundef %89) #4
  %91 = call double @rad2deg(double noundef %90)
  %92 = load ptr, ptr %14, align 8, !tbaa !9
  store double %91, ptr %92, align 8, !tbaa !5
  %93 = load double, ptr %15, align 8, !tbaa !5
  %94 = call double @rad2deg(double noundef %93)
  %95 = load ptr, ptr %13, align 8, !tbaa !9
  store double %94, ptr %95, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret void
}

; Function Attrs: nounwind
declare double @atan(double noundef) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
declare dso_local double @rad2deg(double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @deg2rad(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @tan(double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @right_ascension_parallax_and_topocentric_dec(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #0 {
  %8 = tail call double @deg2rad(double noundef %0)
  %9 = tail call double @deg2rad(double noundef %2)
  %10 = tail call double @deg2rad(double noundef %3)
  %11 = tail call double @deg2rad(double noundef %4)
  %12 = tail call double @tan(double noundef %8) #3
  %13 = fmul double %12, 0x3FEFE488A5D668D8
  %14 = tail call double @atan(double noundef %13) #3
  %15 = tail call double @sin(double noundef %14) #3
  %16 = tail call double @sin(double noundef %8) #3
  %17 = fmul double %16, %1
  %18 = fdiv double %17, 6.378140e+06
  %19 = tail call double @llvm.fmuladd.f64(double %15, double 0x3FEFE488A5D668D8, double %18)
  %20 = tail call double @cos(double noundef %14) #3
  %21 = tail call double @cos(double noundef %8) #3
  %22 = fmul double %21, %1
  %23 = fdiv double %22, 6.378140e+06
  %24 = fadd double %20, %23
  %25 = fneg double %24
  %26 = tail call double @sin(double noundef %9) #3
  %27 = fmul double %26, %25
  %28 = tail call double @sin(double noundef %10) #3
  %29 = fmul double %28, %27
  %30 = tail call double @cos(double noundef %11) #3
  %31 = tail call double @sin(double noundef %9) #3
  %32 = tail call double @cos(double noundef %10) #3
  %33 = fmul double %31, %25
  %34 = tail call double @llvm.fmuladd.f64(double %33, double %32, double %30)
  %35 = tail call double @atan2(double noundef %29, double noundef %34) #3
  %36 = tail call double @sin(double noundef %11) #3
  %37 = tail call double @sin(double noundef %9) #3
  %38 = fneg double %19
  %39 = tail call double @llvm.fmuladd.f64(double %38, double %37, double %36)
  %40 = tail call double @cos(double noundef %35) #3
  %41 = fmul double %39, %40
  %42 = tail call double @cos(double noundef %11) #3
  %43 = tail call double @sin(double noundef %9) #3
  %44 = tail call double @cos(double noundef %10) #3
  %45 = fmul double %43, %25
  %46 = tail call double @llvm.fmuladd.f64(double %45, double %44, double %42)
  %47 = tail call double @atan2(double noundef %41, double noundef %46) #3
  %48 = tail call double @rad2deg(double noundef %47)
  store double %48, ptr %6, align 8, !tbaa !5
  %49 = tail call double @rad2deg(double noundef %35)
  store double %49, ptr %5, align 8, !tbaa !5
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan(double noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass