; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (r8lib)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local double @r8_atan(double noundef %0, double noundef %1) #2 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  store double %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store double 0x400921FB54442D18, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %10 = load double, ptr %4, align 8, !tbaa !5
  %11 = fcmp oeq double %10, 0.000000e+00
  br i1 %11, label %12, label %27

12:                                               ; preds = %2
  %13 = load double, ptr %3, align 8, !tbaa !5
  %14 = fcmp olt double 0.000000e+00, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  store double 0x3FF921FB54442D18, ptr %8, align 8, !tbaa !5
  br label %26

16:                                               ; preds = %12
  %17 = load double, ptr %3, align 8, !tbaa !5
  %18 = fcmp olt double %17, 0.000000e+00
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  store double 0x4012D97C7F3321D2, ptr %8, align 8, !tbaa !5
  br label %25

20:                                               ; preds = %16
  %21 = load double, ptr %3, align 8, !tbaa !5
  %22 = fcmp oeq double %21, 0.000000e+00
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %23, %20
  br label %25

25:                                               ; preds = %24, %19
  br label %26

26:                                               ; preds = %25, %15
  br label %87

27:                                               ; preds = %2
  %28 = load double, ptr %3, align 8, !tbaa !5
  %29 = fcmp oeq double %28, 0.000000e+00
  br i1 %29, label %30, label %40

30:                                               ; preds = %27
  %31 = load double, ptr %4, align 8, !tbaa !5
  %32 = fcmp olt double 0.000000e+00, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  br label %39

34:                                               ; preds = %30
  %35 = load double, ptr %4, align 8, !tbaa !5
  %36 = fcmp olt double %35, 0.000000e+00
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  store double 0x400921FB54442D18, ptr %8, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %37, %34
  br label %39

39:                                               ; preds = %38, %33
  br label %86

40:                                               ; preds = %27
  %41 = load double, ptr %3, align 8, !tbaa !5
  %42 = call double @llvm.fabs.f64(double %41)
  store double %42, ptr %6, align 8, !tbaa !5
  %43 = load double, ptr %4, align 8, !tbaa !5
  %44 = call double @llvm.fabs.f64(double %43)
  store double %44, ptr %5, align 8, !tbaa !5
  %45 = load double, ptr %6, align 8, !tbaa !5
  %46 = load double, ptr %5, align 8, !tbaa !5
  %47 = call double @atan2(double noundef %45, double noundef %46) #4
  store double %47, ptr %9, align 8, !tbaa !5
  %48 = load double, ptr %4, align 8, !tbaa !5
  %49 = fcmp olt double 0.000000e+00, %48
  br i1 %49, label %50, label %55

50:                                               ; preds = %40
  %51 = load double, ptr %3, align 8, !tbaa !5
  %52 = fcmp olt double 0.000000e+00, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %50
  %54 = load double, ptr %9, align 8, !tbaa !5
  store double %54, ptr %8, align 8, !tbaa !5
  br label %85

55:                                               ; preds = %50, %40
  %56 = load double, ptr %4, align 8, !tbaa !5
  %57 = fcmp olt double %56, 0.000000e+00
  br i1 %57, label %58, label %64

58:                                               ; preds = %55
  %59 = load double, ptr %3, align 8, !tbaa !5
  %60 = fcmp olt double 0.000000e+00, %59
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  %62 = load double, ptr %9, align 8, !tbaa !5
  %63 = fsub double 0x400921FB54442D18, %62
  store double %63, ptr %8, align 8, !tbaa !5
  br label %84

64:                                               ; preds = %58, %55
  %65 = load double, ptr %4, align 8, !tbaa !5
  %66 = fcmp olt double %65, 0.000000e+00
  br i1 %66, label %67, label %73

67:                                               ; preds = %64
  %68 = load double, ptr %3, align 8, !tbaa !5
  %69 = fcmp olt double %68, 0.000000e+00
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load double, ptr %9, align 8, !tbaa !5
  %72 = fadd double 0x400921FB54442D18, %71
  store double %72, ptr %8, align 8, !tbaa !5
  br label %83

73:                                               ; preds = %67, %64
  %74 = load double, ptr %4, align 8, !tbaa !5
  %75 = fcmp olt double 0.000000e+00, %74
  br i1 %75, label %76, label %82

76:                                               ; preds = %73
  %77 = load double, ptr %3, align 8, !tbaa !5
  %78 = fcmp olt double %77, 0.000000e+00
  br i1 %78, label %79, label %82

79:                                               ; preds = %76
  %80 = load double, ptr %9, align 8, !tbaa !5
  %81 = fsub double 0x401921FB54442D18, %80
  store double %81, ptr %8, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %79, %76, %73
  br label %83

83:                                               ; preds = %82, %70
  br label %84

84:                                               ; preds = %83, %61
  br label %85

85:                                               ; preds = %84, %53
  br label %86

86:                                               ; preds = %85, %39
  br label %87

87:                                               ; preds = %86, %26
  %88 = load double, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret double %88
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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"}


; 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local double @r8_atan(double noundef %0, double noundef %1) local_unnamed_addr #1 {
  %3 = fcmp oeq double %1, 0.000000e+00
  br i1 %3, label %4, label %9

4:                                                ; preds = %2
  %5 = fcmp ogt double %0, 0.000000e+00
  br i1 %5, label %31, label %6

6:                                                ; preds = %4
  %7 = fcmp olt double %0, 0.000000e+00
  br i1 %7, label %31, label %8

8:                                                ; preds = %6
  br label %31

9:                                                ; preds = %2
  %10 = fcmp oeq double %0, 0.000000e+00
  br i1 %10, label %11, label %14

11:                                               ; preds = %9
  %12 = fcmp ogt double %1, 0.000000e+00
  br i1 %12, label %31, label %13

13:                                               ; preds = %11
  br label %31

14:                                               ; preds = %9
  %15 = tail call double @llvm.fabs.f64(double %0)
  %16 = tail call double @llvm.fabs.f64(double %1)
  %17 = tail call double @atan2(double noundef %15, double noundef %16) #3
  %18 = fcmp ogt double %1, 0.000000e+00
  %19 = fcmp ogt double %0, 0.000000e+00
  %or.cond = and i1 %19, %18
  br i1 %or.cond, label %31, label %20

20:                                               ; preds = %14
  %21 = fcmp olt double %1, 0.000000e+00
  %or.cond3 = and i1 %19, %21
  br i1 %or.cond3, label %22, label %24

22:                                               ; preds = %20
  %23 = fsub double 0x400921FB54442D18, %17
  br label %31

24:                                               ; preds = %20
  %25 = fcmp olt double %0, 0.000000e+00
  %or.cond5 = and i1 %25, %21
  br i1 %or.cond5, label %26, label %28

26:                                               ; preds = %24
  %27 = fadd double %17, 0x400921FB54442D18
  br label %31

28:                                               ; preds = %24
  %or.cond7 = and i1 %25, %18
  br i1 %or.cond7, label %29, label %31

29:                                               ; preds = %28
  %30 = fsub double 0x401921FB54442D18, %17
  br label %31

31:                                               ; preds = %13, %8, %14, %11, %6, %4, %22, %28, %29, %26
  %.0 = phi double [ %23, %22 ], [ %27, %26 ], [ %30, %29 ], [ undef, %28 ], [ 0x3FF921FB54442D18, %4 ], [ 0x4012D97C7F3321D2, %6 ], [ 0.000000e+00, %8 ], [ 0.000000e+00, %11 ], [ 0x400921FB54442D18, %13 ], [ %17, %14 ]
  ret double %.0
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) 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 #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)"}


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