; 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
@.str.145 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [19 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: nounwind uwtable
define dso_local void @r8poly2_val(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #3 {
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  store double %0, ptr %11, align 8, !tbaa !5
  store double %1, ptr %12, align 8, !tbaa !5
  store double %2, ptr %13, align 8, !tbaa !5
  store double %3, ptr %14, align 8, !tbaa !5
  store double %4, ptr %15, align 8, !tbaa !5
  store double %5, ptr %16, align 8, !tbaa !5
  store double %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !9
  store ptr %9, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %26 = load double, ptr %11, align 8, !tbaa !5
  %27 = load double, ptr %13, align 8, !tbaa !5
  %28 = fcmp oeq double %26, %27
  br i1 %28, label %29, label %34

29:                                               ; preds = %10
  %30 = load double, ptr %13, align 8, !tbaa !5
  %31 = load double, ptr %15, align 8, !tbaa !5
  %32 = fcmp oeq double %30, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %29
  store i32 1, ptr %21, align 4, !tbaa !11
  br label %66

34:                                               ; preds = %29, %10
  %35 = load double, ptr %11, align 8, !tbaa !5
  %36 = load double, ptr %13, align 8, !tbaa !5
  %37 = fcmp oeq double %35, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  store i32 2, ptr %21, align 4, !tbaa !11
  br label %65

39:                                               ; preds = %34
  %40 = load double, ptr %11, align 8, !tbaa !5
  %41 = load double, ptr %15, align 8, !tbaa !5
  %42 = fcmp oeq double %40, %41
  br i1 %42, label %43, label %50

43:                                               ; preds = %39
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str) #4
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.145) #4
  %48 = load ptr, ptr @stderr, align 8, !tbaa !9
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.146) #4
  store i32 1, ptr %25, align 4
  br label %153

50:                                               ; preds = %39
  %51 = load double, ptr %13, align 8, !tbaa !5
  %52 = load double, ptr %15, align 8, !tbaa !5
  %53 = fcmp oeq double %51, %52
  br i1 %53, label %54, label %62

54:                                               ; preds = %50
  store i32 2, ptr %21, align 4, !tbaa !11
  %55 = load double, ptr %11, align 8, !tbaa !5
  store double %55, ptr %24, align 8, !tbaa !5
  %56 = load double, ptr %15, align 8, !tbaa !5
  store double %56, ptr %11, align 8, !tbaa !5
  %57 = load double, ptr %24, align 8, !tbaa !5
  store double %57, ptr %15, align 8, !tbaa !5
  %58 = load double, ptr %12, align 8, !tbaa !5
  store double %58, ptr %24, align 8, !tbaa !5
  %59 = load double, ptr %14, align 8, !tbaa !5
  store double %59, ptr %12, align 8, !tbaa !5
  %60 = load double, ptr %16, align 8, !tbaa !5
  store double %60, ptr %14, align 8, !tbaa !5
  %61 = load double, ptr %12, align 8, !tbaa !5
  store double %61, ptr %16, align 8, !tbaa !5
  br label %63

62:                                               ; preds = %50
  store i32 3, ptr %21, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %62, %54
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64, %38
  br label %66

66:                                               ; preds = %65, %33
  %67 = load i32, ptr %21, align 4, !tbaa !11
  %68 = icmp eq i32 %67, 1
  br i1 %68, label %69, label %73

69:                                               ; preds = %66
  %70 = load double, ptr %14, align 8, !tbaa !5
  store double %70, ptr %22, align 8, !tbaa !5
  %71 = load double, ptr %16, align 8, !tbaa !5
  %72 = fmul double 5.000000e-01, %71
  store double %72, ptr %23, align 8, !tbaa !5
  br label %123

73:                                               ; preds = %66
  %74 = load i32, ptr %21, align 4, !tbaa !11
  %75 = icmp eq i32 %74, 2
  br i1 %75, label %76, label %91

76:                                               ; preds = %73
  %77 = load double, ptr %14, align 8, !tbaa !5
  store double %77, ptr %22, align 8, !tbaa !5
  %78 = load double, ptr %16, align 8, !tbaa !5
  %79 = load double, ptr %12, align 8, !tbaa !5
  %80 = fsub double %78, %79
  %81 = load double, ptr %15, align 8, !tbaa !5
  %82 = load double, ptr %11, align 8, !tbaa !5
  %83 = fsub double %81, %82
  %84 = fdiv double %80, %83
  %85 = load double, ptr %14, align 8, !tbaa !5
  %86 = fsub double %84, %85
  %87 = load double, ptr %15, align 8, !tbaa !5
  %88 = load double, ptr %13, align 8, !tbaa !5
  %89 = fsub double %87, %88
  %90 = fdiv double %86, %89
  store double %90, ptr %23, align 8, !tbaa !5
  br label %122

91:                                               ; preds = %73
  %92 = load i32, ptr %21, align 4, !tbaa !11
  %93 = icmp eq i32 %92, 3
  br i1 %93, label %94, label %121

94:                                               ; preds = %91
  %95 = load double, ptr %14, align 8, !tbaa !5
  %96 = load double, ptr %12, align 8, !tbaa !5
  %97 = fsub double %95, %96
  %98 = load double, ptr %13, align 8, !tbaa !5
  %99 = load double, ptr %11, align 8, !tbaa !5
  %100 = fsub double %98, %99
  %101 = fdiv double %97, %100
  store double %101, ptr %22, align 8, !tbaa !5
  %102 = load double, ptr %16, align 8, !tbaa !5
  %103 = load double, ptr %12, align 8, !tbaa !5
  %104 = fsub double %102, %103
  %105 = load double, ptr %15, align 8, !tbaa !5
  %106 = load double, ptr %11, align 8, !tbaa !5
  %107 = fsub double %105, %106
  %108 = fdiv double %104, %107
  %109 = load double, ptr %14, align 8, !tbaa !5
  %110 = load double, ptr %12, align 8, !tbaa !5
  %111 = fsub double %109, %110
  %112 = load double, ptr %13, align 8, !tbaa !5
  %113 = load double, ptr %11, align 8, !tbaa !5
  %114 = fsub double %112, %113
  %115 = fdiv double %111, %114
  %116 = fsub double %108, %115
  %117 = load double, ptr %15, align 8, !tbaa !5
  %118 = load double, ptr %13, align 8, !tbaa !5
  %119 = fsub double %117, %118
  %120 = fdiv double %116, %119
  store double %120, ptr %23, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %94, %91
  br label %122

122:                                              ; preds = %121, %76
  br label %123

123:                                              ; preds = %122, %69
  %124 = load double, ptr %12, align 8, !tbaa !5
  %125 = load double, ptr %17, align 8, !tbaa !5
  %126 = load double, ptr %11, align 8, !tbaa !5
  %127 = fsub double %125, %126
  %128 = load double, ptr %22, align 8, !tbaa !5
  %129 = call double @llvm.fmuladd.f64(double %127, double %128, double %124)
  %130 = load double, ptr %17, align 8, !tbaa !5
  %131 = load double, ptr %11, align 8, !tbaa !5
  %132 = fsub double %130, %131
  %133 = load double, ptr %17, align 8, !tbaa !5
  %134 = load double, ptr %13, align 8, !tbaa !5
  %135 = fsub double %133, %134
  %136 = fmul double %132, %135
  %137 = load double, ptr %23, align 8, !tbaa !5
  %138 = call double @llvm.fmuladd.f64(double %136, double %137, double %129)
  %139 = load ptr, ptr %18, align 8, !tbaa !9
  store double %138, ptr %139, align 8, !tbaa !5
  %140 = load double, ptr %22, align 8, !tbaa !5
  %141 = load double, ptr %17, align 8, !tbaa !5
  %142 = load double, ptr %11, align 8, !tbaa !5
  %143 = fneg double %142
  %144 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %141, double %143)
  %145 = load double, ptr %13, align 8, !tbaa !5
  %146 = fsub double %144, %145
  %147 = load double, ptr %23, align 8, !tbaa !5
  %148 = call double @llvm.fmuladd.f64(double %146, double %147, double %140)
  %149 = load ptr, ptr %19, align 8, !tbaa !9
  store double %148, ptr %149, align 8, !tbaa !5
  %150 = load double, ptr %23, align 8, !tbaa !5
  %151 = fmul double 2.000000e+00, %150
  %152 = load ptr, ptr %20, align 8, !tbaa !9
  store double %151, ptr %152, align 8, !tbaa !5
  store i32 1, ptr %25, align 4
  br label %153

153:                                              ; preds = %123, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  ret void
}

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 = { 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 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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
@.str.145 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [19 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nofree nounwind uwtable
define dso_local void @r8poly2_val(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, ptr nocapture noundef writeonly %7, ptr nocapture noundef writeonly %8, ptr nocapture noundef writeonly %9) local_unnamed_addr #2 {
  %11 = fcmp oeq double %0, %2
  %12 = fcmp oeq double %2, %4
  %or.cond = and i1 %11, %12
  br i1 %or.cond, label %23, label %13

13:                                               ; preds = %10
  br i1 %11, label %.thread90, label %14

14:                                               ; preds = %13
  %15 = fcmp oeq double %0, %4
  br i1 %15, label %16, label %25

16:                                               ; preds = %14
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str) #3
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.145) #3
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.146) #3
  br label %60

23:                                               ; preds = %10
  %24 = fmul double %5, 5.000000e-01
  br label %49

25:                                               ; preds = %14
  br i1 %12, label %.thread90, label %32

.thread90:                                        ; preds = %13, %25
  %.0.ph101 = phi double [ %4, %25 ], [ %0, %13 ]
  %.064.ph100 = phi double [ %3, %25 ], [ %1, %13 ]
  %.065.ph99 = phi double [ %5, %25 ], [ %3, %13 ]
  %.066.ph98 = phi double [ %0, %25 ], [ %4, %13 ]
  %.067.ph97 = phi double [ %3, %25 ], [ %5, %13 ]
  %26 = fsub double %.067.ph97, %.064.ph100
  %27 = fsub double %.066.ph98, %.0.ph101
  %28 = fdiv double %26, %27
  %29 = fsub double %28, %.065.ph99
  %30 = fsub double %.066.ph98, %2
  %31 = fdiv double %29, %30
  br label %49

32:                                               ; preds = %25
  %33 = insertelement <2 x double> poison, double %5, i64 0
  %34 = insertelement <2 x double> %33, double %3, i64 1
  %35 = insertelement <2 x double> poison, double %1, i64 0
  %36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> zeroinitializer
  %37 = fsub <2 x double> %34, %36
  %38 = insertelement <2 x double> poison, double %4, i64 0
  %39 = insertelement <2 x double> %38, double %2, i64 1
  %40 = insertelement <2 x double> poison, double %0, i64 0
  %41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> zeroinitializer
  %42 = fsub <2 x double> %39, %41
  %43 = fdiv <2 x double> %37, %42
  %44 = extractelement <2 x double> %43, i64 0
  %45 = extractelement <2 x double> %43, i64 1
  %46 = fsub double %44, %45
  %47 = fsub double %4, %2
  %48 = fdiv double %46, %47
  br label %49

49:                                               ; preds = %.thread90, %32, %23
  %.088 = phi double [ %0, %23 ], [ %.0.ph101, %.thread90 ], [ %0, %32 ]
  %.06486 = phi double [ %1, %23 ], [ %.064.ph100, %.thread90 ], [ %1, %32 ]
  %.062 = phi double [ %3, %23 ], [ %.065.ph99, %.thread90 ], [ %45, %32 ]
  %.061 = phi double [ %24, %23 ], [ %31, %.thread90 ], [ %48, %32 ]
  %50 = fsub double %6, %.088
  %51 = tail call double @llvm.fmuladd.f64(double %50, double %.062, double %.06486)
  %52 = fsub double %6, %2
  %53 = fmul double %52, %50
  %54 = tail call double @llvm.fmuladd.f64(double %53, double %.061, double %51)
  store double %54, ptr %7, align 8, !tbaa !9
  %55 = fneg double %.088
  %56 = tail call double @llvm.fmuladd.f64(double %6, double 2.000000e+00, double %55)
  %57 = fsub double %56, %2
  %58 = tail call double @llvm.fmuladd.f64(double %57, double %.061, double %.062)
  store double %58, ptr %8, align 8, !tbaa !9
  %59 = fmul double %.061, 2.000000e+00
  store double %59, ptr %9, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %49, %16
  ret void
}

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nofree 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 = { cold 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass