; 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.fmuladd.f64(double, double, double) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @r8mat_inverse_3d(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @r8poly2_ex2(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10) #2 {
  %12 = alloca i32, align 4
  %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 double, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca [9 x double], align 16
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  store double %0, ptr %13, align 8, !tbaa !5
  store double %1, ptr %14, align 8, !tbaa !5
  store double %2, ptr %15, align 8, !tbaa !5
  store double %3, ptr %16, align 8, !tbaa !5
  store double %4, ptr %17, align 8, !tbaa !5
  store double %5, ptr %18, align 8, !tbaa !5
  store ptr %6, ptr %19, align 8, !tbaa !9
  store ptr %7, ptr %20, align 8, !tbaa !9
  store ptr %8, ptr %21, align 8, !tbaa !9
  store ptr %9, ptr %22, align 8, !tbaa !9
  store ptr %10, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %27 = load ptr, ptr %21, align 8, !tbaa !9
  store double 0.000000e+00, ptr %27, align 8, !tbaa !5
  %28 = load ptr, ptr %22, align 8, !tbaa !9
  store double 0.000000e+00, ptr %28, align 8, !tbaa !5
  %29 = load ptr, ptr %23, align 8, !tbaa !9
  store double 0.000000e+00, ptr %29, align 8, !tbaa !5
  %30 = load ptr, ptr %19, align 8, !tbaa !9
  store double 0.000000e+00, ptr %30, align 8, !tbaa !5
  %31 = load ptr, ptr %20, align 8, !tbaa !9
  store double 0.000000e+00, ptr %31, align 8, !tbaa !5
  %32 = load double, ptr %13, align 8, !tbaa !5
  %33 = load double, ptr %15, align 8, !tbaa !5
  %34 = fcmp oeq double %32, %33
  br i1 %34, label %43, label %35

35:                                               ; preds = %11
  %36 = load double, ptr %15, align 8, !tbaa !5
  %37 = load double, ptr %17, align 8, !tbaa !5
  %38 = fcmp oeq double %36, %37
  br i1 %38, label %43, label %39

39:                                               ; preds = %35
  %40 = load double, ptr %17, align 8, !tbaa !5
  %41 = load double, ptr %13, align 8, !tbaa !5
  %42 = fcmp oeq double %40, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %39, %35, %11
  store i32 1, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %163

44:                                               ; preds = %39
  %45 = load double, ptr %14, align 8, !tbaa !5
  %46 = load double, ptr %16, align 8, !tbaa !5
  %47 = fcmp oeq double %45, %46
  br i1 %47, label %48, label %61

48:                                               ; preds = %44
  %49 = load double, ptr %16, align 8, !tbaa !5
  %50 = load double, ptr %18, align 8, !tbaa !5
  %51 = fcmp oeq double %49, %50
  br i1 %51, label %52, label %61

52:                                               ; preds = %48
  %53 = load double, ptr %18, align 8, !tbaa !5
  %54 = load double, ptr %14, align 8, !tbaa !5
  %55 = fcmp oeq double %53, %54
  br i1 %55, label %56, label %61

56:                                               ; preds = %52
  %57 = load double, ptr %13, align 8, !tbaa !5
  %58 = load ptr, ptr %19, align 8, !tbaa !9
  store double %57, ptr %58, align 8, !tbaa !5
  %59 = load double, ptr %14, align 8, !tbaa !5
  %60 = load ptr, ptr %20, align 8, !tbaa !9
  store double %59, ptr %60, align 8, !tbaa !5
  store i32 3, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %163

61:                                               ; preds = %52, %48, %44
  %62 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 0
  store double 1.000000e+00, ptr %62, align 16, !tbaa !5
  %63 = load double, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 3
  store double %63, ptr %64, align 8, !tbaa !5
  %65 = load double, ptr %13, align 8, !tbaa !5
  %66 = load double, ptr %13, align 8, !tbaa !5
  %67 = fmul double %65, %66
  %68 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 6
  store double %67, ptr %68, align 16, !tbaa !5
  %69 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 1
  store double 1.000000e+00, ptr %69, align 8, !tbaa !5
  %70 = load double, ptr %15, align 8, !tbaa !5
  %71 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 4
  store double %70, ptr %71, align 16, !tbaa !5
  %72 = load double, ptr %15, align 8, !tbaa !5
  %73 = load double, ptr %15, align 8, !tbaa !5
  %74 = fmul double %72, %73
  %75 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 7
  store double %74, ptr %75, align 8, !tbaa !5
  %76 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 2
  store double 1.000000e+00, ptr %76, align 16, !tbaa !5
  %77 = load double, ptr %17, align 8, !tbaa !5
  %78 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 5
  store double %77, ptr %78, align 8, !tbaa !5
  %79 = load double, ptr %17, align 8, !tbaa !5
  %80 = load double, ptr %17, align 8, !tbaa !5
  %81 = fmul double %79, %80
  %82 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 8
  store double %81, ptr %82, align 16, !tbaa !5
  %83 = getelementptr inbounds [9 x double], ptr %24, i64 0, i64 0
  %84 = call ptr @r8mat_inverse_3d(ptr noundef %83)
  store ptr %84, ptr %25, align 8, !tbaa !9
  %85 = load ptr, ptr %25, align 8, !tbaa !9
  %86 = getelementptr inbounds double, ptr %85, i64 0
  %87 = load double, ptr %86, align 8, !tbaa !5
  %88 = load double, ptr %14, align 8, !tbaa !5
  %89 = load ptr, ptr %25, align 8, !tbaa !9
  %90 = getelementptr inbounds double, ptr %89, i64 3
  %91 = load double, ptr %90, align 8, !tbaa !5
  %92 = load double, ptr %16, align 8, !tbaa !5
  %93 = fmul double %91, %92
  %94 = call double @llvm.fmuladd.f64(double %87, double %88, double %93)
  %95 = load ptr, ptr %25, align 8, !tbaa !9
  %96 = getelementptr inbounds double, ptr %95, i64 6
  %97 = load double, ptr %96, align 8, !tbaa !5
  %98 = load double, ptr %18, align 8, !tbaa !5
  %99 = call double @llvm.fmuladd.f64(double %97, double %98, double %94)
  %100 = load ptr, ptr %23, align 8, !tbaa !9
  store double %99, ptr %100, align 8, !tbaa !5
  %101 = load ptr, ptr %25, align 8, !tbaa !9
  %102 = getelementptr inbounds double, ptr %101, i64 1
  %103 = load double, ptr %102, align 8, !tbaa !5
  %104 = load double, ptr %14, align 8, !tbaa !5
  %105 = load ptr, ptr %25, align 8, !tbaa !9
  %106 = getelementptr inbounds double, ptr %105, i64 4
  %107 = load double, ptr %106, align 8, !tbaa !5
  %108 = load double, ptr %16, align 8, !tbaa !5
  %109 = fmul double %107, %108
  %110 = call double @llvm.fmuladd.f64(double %103, double %104, double %109)
  %111 = load ptr, ptr %25, align 8, !tbaa !9
  %112 = getelementptr inbounds double, ptr %111, i64 7
  %113 = load double, ptr %112, align 8, !tbaa !5
  %114 = load double, ptr %18, align 8, !tbaa !5
  %115 = call double @llvm.fmuladd.f64(double %113, double %114, double %110)
  %116 = load ptr, ptr %22, align 8, !tbaa !9
  store double %115, ptr %116, align 8, !tbaa !5
  %117 = load ptr, ptr %25, align 8, !tbaa !9
  %118 = getelementptr inbounds double, ptr %117, i64 2
  %119 = load double, ptr %118, align 8, !tbaa !5
  %120 = load double, ptr %14, align 8, !tbaa !5
  %121 = load ptr, ptr %25, align 8, !tbaa !9
  %122 = getelementptr inbounds double, ptr %121, i64 5
  %123 = load double, ptr %122, align 8, !tbaa !5
  %124 = load double, ptr %16, align 8, !tbaa !5
  %125 = fmul double %123, %124
  %126 = call double @llvm.fmuladd.f64(double %119, double %120, double %125)
  %127 = load ptr, ptr %25, align 8, !tbaa !9
  %128 = getelementptr inbounds double, ptr %127, i64 8
  %129 = load double, ptr %128, align 8, !tbaa !5
  %130 = load double, ptr %18, align 8, !tbaa !5
  %131 = call double @llvm.fmuladd.f64(double %129, double %130, double %126)
  %132 = load ptr, ptr %21, align 8, !tbaa !9
  store double %131, ptr %132, align 8, !tbaa !5
  %133 = load ptr, ptr %21, align 8, !tbaa !9
  %134 = load double, ptr %133, align 8, !tbaa !5
  %135 = fcmp oeq double %134, 0.000000e+00
  br i1 %135, label %136, label %137

136:                                              ; preds = %61
  store i32 2, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %163

137:                                              ; preds = %61
  %138 = load ptr, ptr %22, align 8, !tbaa !9
  %139 = load double, ptr %138, align 8, !tbaa !5
  %140 = fneg double %139
  %141 = load ptr, ptr %21, align 8, !tbaa !9
  %142 = load double, ptr %141, align 8, !tbaa !5
  %143 = fmul double 2.000000e+00, %142
  %144 = fdiv double %140, %143
  %145 = load ptr, ptr %19, align 8, !tbaa !9
  store double %144, ptr %145, align 8, !tbaa !5
  %146 = load ptr, ptr %21, align 8, !tbaa !9
  %147 = load double, ptr %146, align 8, !tbaa !5
  %148 = load ptr, ptr %19, align 8, !tbaa !9
  %149 = load double, ptr %148, align 8, !tbaa !5
  %150 = fmul double %147, %149
  %151 = load ptr, ptr %19, align 8, !tbaa !9
  %152 = load double, ptr %151, align 8, !tbaa !5
  %153 = load ptr, ptr %22, align 8, !tbaa !9
  %154 = load double, ptr %153, align 8, !tbaa !5
  %155 = load ptr, ptr %19, align 8, !tbaa !9
  %156 = load double, ptr %155, align 8, !tbaa !5
  %157 = fmul double %154, %156
  %158 = call double @llvm.fmuladd.f64(double %150, double %152, double %157)
  %159 = load ptr, ptr %23, align 8, !tbaa !9
  %160 = load double, ptr %159, align 8, !tbaa !5
  %161 = fadd double %158, %160
  %162 = load ptr, ptr %20, align 8, !tbaa !9
  store double %161, ptr %162, align 8, !tbaa !5
  store i32 0, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %163

163:                                              ; preds = %137, %136, %56, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 72, ptr %24) #3
  %164 = load i32, ptr %12, align 4
  ret i32 %164
}

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 }

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @r8mat_inverse_3d(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 4) i32 @r8poly2_ex2(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, ptr nocapture noundef writeonly %6, ptr nocapture noundef writeonly %7, ptr nocapture noundef %8, ptr nocapture noundef %9, ptr nocapture noundef %10) local_unnamed_addr #2 {
  %12 = alloca [9 x double], align 16
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %12) #3
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  store double 0.000000e+00, ptr %9, align 8, !tbaa !5
  store double 0.000000e+00, ptr %10, align 8, !tbaa !5
  store double 0.000000e+00, ptr %6, align 8, !tbaa !5
  store double 0.000000e+00, ptr %7, align 8, !tbaa !5
  %13 = fcmp oeq double %0, %2
  %14 = fcmp oeq double %2, %4
  %or.cond = or i1 %13, %14
  %15 = fcmp oeq double %4, %0
  %or.cond69 = or i1 %15, %or.cond
  br i1 %or.cond69, label %72, label %16

16:                                               ; preds = %11
  %17 = fcmp oeq double %1, %3
  %18 = fcmp oeq double %3, %5
  %or.cond70 = and i1 %17, %18
  %19 = fcmp oeq double %5, %1
  %or.cond71 = and i1 %19, %or.cond70
  br i1 %or.cond71, label %20, label %21

20:                                               ; preds = %16
  store double %0, ptr %6, align 8, !tbaa !5
  br label %.sink.split

21:                                               ; preds = %16
  %22 = getelementptr inbounds i8, ptr %12, i64 24
  store double %0, ptr %22, align 8, !tbaa !5
  %23 = insertelement <2 x double> poison, double %0, i64 0
  %24 = insertelement <2 x double> %23, double %2, i64 1
  %25 = fmul <2 x double> %24, %24
  %26 = getelementptr inbounds i8, ptr %12, i64 48
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %12, align 16, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %12, i64 32
  store double %2, ptr %27, align 16, !tbaa !5
  store <2 x double> %25, ptr %26, align 16, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %12, i64 16
  store double 1.000000e+00, ptr %28, align 16, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %12, i64 40
  store double %4, ptr %29, align 8, !tbaa !5
  %30 = fmul double %4, %4
  %31 = getelementptr inbounds i8, ptr %12, i64 64
  store double %30, ptr %31, align 16, !tbaa !5
  %32 = call ptr @r8mat_inverse_3d(ptr noundef nonnull %12)
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %32, i64 24
  %35 = load double, ptr %34, align 8, !tbaa !5
  %36 = fmul double %35, %3
  %37 = call double @llvm.fmuladd.f64(double %33, double %1, double %36)
  %38 = getelementptr inbounds i8, ptr %32, i64 48
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = call double @llvm.fmuladd.f64(double %39, double %5, double %37)
  store double %40, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %32, i64 8
  %42 = load double, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %32, i64 32
  %44 = load double, ptr %43, align 8, !tbaa !5
  %45 = fmul double %44, %3
  %46 = call double @llvm.fmuladd.f64(double %42, double %1, double %45)
  %47 = getelementptr inbounds i8, ptr %32, i64 56
  %48 = load double, ptr %47, align 8, !tbaa !5
  %49 = call double @llvm.fmuladd.f64(double %48, double %5, double %46)
  store double %49, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %32, i64 16
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %32, i64 40
  %53 = load double, ptr %52, align 8, !tbaa !5
  %54 = fmul double %53, %3
  %55 = call double @llvm.fmuladd.f64(double %51, double %1, double %54)
  %56 = getelementptr inbounds i8, ptr %32, i64 64
  %57 = load double, ptr %56, align 8, !tbaa !5
  %58 = call double @llvm.fmuladd.f64(double %57, double %5, double %55)
  store double %58, ptr %8, align 8, !tbaa !5
  %59 = fcmp oeq double %58, 0.000000e+00
  br i1 %59, label %72, label %60

60:                                               ; preds = %21
  %61 = load double, ptr %9, align 8, !tbaa !5
  %62 = fneg double %61
  %63 = fmul double %58, 2.000000e+00
  %64 = fdiv double %62, %63
  store double %64, ptr %6, align 8, !tbaa !5
  %65 = load double, ptr %8, align 8, !tbaa !5
  %66 = fmul double %64, %65
  %67 = load double, ptr %9, align 8, !tbaa !5
  %68 = fmul double %64, %67
  %69 = call double @llvm.fmuladd.f64(double %66, double %64, double %68)
  %70 = load double, ptr %10, align 8, !tbaa !5
  %71 = fadd double %70, %69
  br label %.sink.split

.sink.split:                                      ; preds = %20, %60
  %.sink = phi double [ %71, %60 ], [ %1, %20 ]
  %.0.ph = phi i32 [ 0, %60 ], [ 3, %20 ]
  store double %.sink, ptr %7, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %.sink.split, %21, %11
  %.0 = phi i32 [ 1, %11 ], [ 2, %21 ], [ %.0.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %12) #3
  ret i32 %.0
}

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

!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,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass