; 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"

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@r8_acosh.xmax = external hidden global double, align 8
@.str.25 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1

; 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

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

7:                                                ; preds = %1
  %8 = call double @r8_tiny()
  %9 = call double @sqrt(double noundef %8) #5
  %10 = fdiv double 1.000000e+00, %9
  store double %10, ptr @r8_acosh.xmax, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %7, %1
  %12 = load double, ptr %2, align 8, !tbaa !5
  %13 = fcmp olt double %12, 1.000000e+00
  br i1 %13, label %14, label %21

14:                                               ; preds = %11
  %15 = load ptr, ptr @stderr, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef @.str) #5
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.25) #5
  %19 = load ptr, ptr @stderr, align 8, !tbaa !9
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.26) #5
  call void @exit(i32 noundef 1) #6
  unreachable

21:                                               ; preds = %11
  %22 = load double, ptr %2, align 8, !tbaa !5
  %23 = load double, ptr @r8_acosh.xmax, align 8, !tbaa !5
  %24 = fcmp olt double %22, %23
  br i1 %24, label %25, label %33

25:                                               ; preds = %21
  %26 = load double, ptr %2, align 8, !tbaa !5
  %27 = load double, ptr %2, align 8, !tbaa !5
  %28 = load double, ptr %2, align 8, !tbaa !5
  %29 = call double @llvm.fmuladd.f64(double %27, double %28, double -1.000000e+00)
  %30 = call double @sqrt(double noundef %29) #5
  %31 = fadd double %26, %30
  %32 = call double @log(double noundef %31) #5
  store double %32, ptr %4, align 8, !tbaa !5
  br label %37

33:                                               ; preds = %21
  %34 = load double, ptr %2, align 8, !tbaa !5
  %35 = call double @log(double noundef %34) #5
  %36 = fadd double 0x3FE62E42FEFA39EF, %35
  store double %36, ptr %4, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %33, %25
  br label %38

38:                                               ; preds = %37
  %39 = load double, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret double %39
}

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @r8_tiny() #4

; Function Attrs: nounwind
declare double @log(double noundef) #1

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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@r8_acosh.xmax = external hidden local_unnamed_addr global double, align 8
@.str.25 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local double @r8_acosh(double noundef %0) local_unnamed_addr #3 {
  %2 = load double, ptr @r8_acosh.xmax, align 8, !tbaa !5
  %3 = fcmp oeq double %2, 0.000000e+00
  br i1 %3, label %4, label %8

4:                                                ; preds = %1
  %5 = tail call double @r8_tiny()
  %6 = tail call double @sqrt(double noundef %5) #5
  %7 = fdiv double 1.000000e+00, %6
  store double %7, ptr @r8_acosh.xmax, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %4, %1
  %9 = phi double [ %7, %4 ], [ %2, %1 ]
  %10 = fcmp olt double %0, 1.000000e+00
  br i1 %10, label %11, label %18

11:                                               ; preds = %8
  %12 = load ptr, ptr @stderr, align 8, !tbaa !9
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str) #6
  %14 = load ptr, ptr @stderr, align 8, !tbaa !9
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.25) #6
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.26) #6
  tail call void @exit(i32 noundef 1) #7
  unreachable

18:                                               ; preds = %8
  %19 = fcmp ogt double %9, %0
  br i1 %19, label %20, label %25

20:                                               ; preds = %18
  %21 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -1.000000e+00)
  %22 = tail call double @sqrt(double noundef %21) #5
  %23 = fadd double %22, %0
  %24 = tail call double @log(double noundef %23) #5
  br label %28

25:                                               ; preds = %18
  %26 = tail call double @log(double noundef %0) #5
  %27 = fadd double %26, 0x3FE62E42FEFA39EF
  br label %28

28:                                               ; preds = %20, %25
  %.0 = phi double [ %24, %20 ], [ %27, %25 ]
  ret double %.0
}

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

; Function Attrs: nounwind uwtable
declare dso_local double @r8_tiny() local_unnamed_addr #3

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

attributes #0 = { nofree 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 #1 = { noreturn 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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}


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