; 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.92 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [13 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
declare double @sqrt(double noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @r8mat_cholesky_factor(i32 noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %13 = load ptr, ptr %6, align 8, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !5
  %14 = call double @r8_epsilon()
  %15 = call double @sqrt(double noundef %14) #5
  store double %15, ptr %12, align 8, !tbaa !11
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = call ptr @r8mat_copy_new(i32 noundef %16, i32 noundef %17, ptr noundef %18)
  store ptr %19, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %181, %3
  %21 = load i32, ptr %9, align 4, !tbaa !5
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %184

24:                                               ; preds = %20
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %38, %24
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %41

29:                                               ; preds = %25
  %30 = load ptr, ptr %7, align 8, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = mul nsw i32 %32, %33
  %35 = add nsw i32 %31, %34
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds double, ptr %30, i64 %36
  store double 0.000000e+00, ptr %37, align 8, !tbaa !11
  br label %38

38:                                               ; preds = %29
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %8, align 4, !tbaa !5
  br label %25, !llvm.loop !13

41:                                               ; preds = %25
  %42 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %42, ptr %8, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %177, %41
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %47, label %180

47:                                               ; preds = %43
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = mul nsw i32 %50, %51
  %53 = add nsw i32 %49, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds double, ptr %48, i64 %54
  %56 = load double, ptr %55, align 8, !tbaa !11
  store double %56, ptr %11, align 8, !tbaa !11
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %83, %47
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %61, label %86

61:                                               ; preds = %57
  %62 = load double, ptr %11, align 8, !tbaa !11
  %63 = load ptr, ptr %7, align 8, !tbaa !9
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = load i32, ptr %10, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = mul nsw i32 %65, %66
  %68 = add nsw i32 %64, %67
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %63, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !11
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = mul nsw i32 %74, %75
  %77 = add nsw i32 %73, %76
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds double, ptr %72, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = fneg double %71
  %82 = call double @llvm.fmuladd.f64(double %81, double %80, double %62)
  store double %82, ptr %11, align 8, !tbaa !11
  br label %83

83:                                               ; preds = %61
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %10, align 4, !tbaa !5
  br label %57, !llvm.loop !15

86:                                               ; preds = %57
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = icmp eq i32 %87, %88
  br i1 %89, label %90, label %135

90:                                               ; preds = %86
  %91 = load double, ptr %11, align 8, !tbaa !11
  %92 = fcmp olt double 0.000000e+00, %91
  br i1 %92, label %93, label %104

93:                                               ; preds = %90
  %94 = load double, ptr %11, align 8, !tbaa !11
  %95 = call double @sqrt(double noundef %94) #5
  %96 = load ptr, ptr %7, align 8, !tbaa !9
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = mul nsw i32 %98, %99
  %101 = add nsw i32 %97, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %96, i64 %102
  store double %95, ptr %103, align 8, !tbaa !11
  br label %134

104:                                              ; preds = %90
  %105 = load double, ptr %11, align 8, !tbaa !11
  %106 = load double, ptr %12, align 8, !tbaa !11
  %107 = fneg double %106
  %108 = fcmp olt double %105, %107
  br i1 %108, label %109, label %123

109:                                              ; preds = %104
  %110 = load ptr, ptr %6, align 8, !tbaa !9
  store i32 2, ptr %110, align 4, !tbaa !5
  %111 = load ptr, ptr @stderr, align 8, !tbaa !9
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str) #5
  %113 = load ptr, ptr @stderr, align 8, !tbaa !9
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.92) #5
  %115 = load ptr, ptr @stderr, align 8, !tbaa !9
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.93) #5
  %117 = load ptr, ptr @stderr, align 8, !tbaa !9
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef @.str.94, i32 noundef %118) #5
  %120 = load ptr, ptr @stderr, align 8, !tbaa !9
  %121 = load double, ptr %11, align 8, !tbaa !11
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.95, double noundef %121) #5
  call void @exit(i32 noundef 1) #6
  unreachable

123:                                              ; preds = %104
  %124 = load ptr, ptr %6, align 8, !tbaa !9
  store i32 1, ptr %124, align 4, !tbaa !5
  %125 = load ptr, ptr %7, align 8, !tbaa !9
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = mul nsw i32 %127, %128
  %130 = add nsw i32 %126, %129
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %125, i64 %131
  store double 0.000000e+00, ptr %132, align 8, !tbaa !11
  br label %133

133:                                              ; preds = %123
  br label %134

134:                                              ; preds = %133, %93
  br label %176

135:                                              ; preds = %86
  %136 = load ptr, ptr %7, align 8, !tbaa !9
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = mul nsw i32 %138, %139
  %141 = add nsw i32 %137, %140
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %136, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !11
  %145 = fcmp une double %144, 0.000000e+00
  br i1 %145, label %146, label %166

146:                                              ; preds = %135
  %147 = load double, ptr %11, align 8, !tbaa !11
  %148 = load ptr, ptr %7, align 8, !tbaa !9
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = mul nsw i32 %150, %151
  %153 = add nsw i32 %149, %152
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds double, ptr %148, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !11
  %157 = fdiv double %147, %156
  %158 = load ptr, ptr %7, align 8, !tbaa !9
  %159 = load i32, ptr %8, align 4, !tbaa !5
  %160 = load i32, ptr %9, align 4, !tbaa !5
  %161 = load i32, ptr %4, align 4, !tbaa !5
  %162 = mul nsw i32 %160, %161
  %163 = add nsw i32 %159, %162
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds double, ptr %158, i64 %164
  store double %157, ptr %165, align 8, !tbaa !11
  br label %175

166:                                              ; preds = %135
  %167 = load ptr, ptr %7, align 8, !tbaa !9
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = load i32, ptr %4, align 4, !tbaa !5
  %171 = mul nsw i32 %169, %170
  %172 = add nsw i32 %168, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds double, ptr %167, i64 %173
  store double 0.000000e+00, ptr %174, align 8, !tbaa !11
  br label %175

175:                                              ; preds = %166, %146
  br label %176

176:                                              ; preds = %175, %134
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %8, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %8, align 4, !tbaa !5
  br label %43, !llvm.loop !16

180:                                              ; preds = %43
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %9, align 4, !tbaa !5
  br label %20, !llvm.loop !17

184:                                              ; preds = %20
  %185 = load ptr, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret ptr %185
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @r8mat_copy_new(i32 noundef, i32 noundef, ptr noundef) #4

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 = !{!"int", !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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; 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.92 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.95 = external hidden unnamed_addr constant [13 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: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local ptr @r8mat_cholesky_factor(i32 noundef %0, ptr noundef %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #4 {
  store i32 0, ptr %2, align 4, !tbaa !5
  %4 = tail call double @r8_epsilon()
  %5 = tail call double @sqrt(double noundef %4) #6
  %6 = tail call ptr @r8mat_copy_new(i32 noundef %0, i32 noundef %0, ptr noundef %1)
  %7 = icmp sgt i32 %0, 0
  br i1 %7, label %.preheader74.lr.ph, label %._crit_edge84

.preheader74.lr.ph:                               ; preds = %3
  %8 = fneg double %5
  %9 = zext nneg i32 %0 to i64
  br label %.preheader74

.preheader74:                                     ; preds = %.preheader74.lr.ph, %._crit_edge82
  %indvar = phi i64 [ 0, %.preheader74.lr.ph ], [ %indvar.next, %._crit_edge82 ]
  %indvars95 = trunc i64 %indvar to i32
  %10 = mul i32 %indvars95, %0
  %11 = zext i32 %10 to i64
  %.not = icmp eq i64 %indvar, 0
  br i1 %.not, label %.lr.ph81, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader74
  %12 = shl nuw nsw i64 %indvar, 3
  %13 = shl nuw nsw i64 %11, 3
  %scevgep = getelementptr i8, ptr %6, i64 %13
  tail call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 0, i64 %12, i1 false), !tbaa !9
  br label %.lr.ph81

.lr.ph81:                                         ; preds = %.preheader74, %.lr.ph
  %14 = mul nuw nsw i64 %indvar, %9
  %15 = getelementptr inbounds double, ptr %6, i64 %indvar
  %16 = getelementptr inbounds double, ptr %15, i64 %11
  %invariant.gep102 = getelementptr inbounds double, ptr %6, i64 %indvar
  %invariant.gep = getelementptr inbounds double, ptr %6, i64 %indvar
  %invariant.gep104 = getelementptr inbounds double, ptr %6, i64 %14
  %invariant.gep106 = getelementptr inbounds double, ptr %6, i64 %14
  %17 = getelementptr inbounds double, ptr %6, i64 %indvar
  %18 = getelementptr inbounds double, ptr %17, i64 %14
  %19 = getelementptr inbounds double, ptr %6, i64 %indvar
  %20 = getelementptr inbounds double, ptr %19, i64 %14
  %xtraiter = and i64 %indvar, 1
  %21 = icmp eq i64 %indvar, 1
  %unroll_iter = and i64 %indvar, 9223372036854775806
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %22

22:                                               ; preds = %.lr.ph81, %65
  %indvars.iv90 = phi i64 [ %indvar, %.lr.ph81 ], [ %indvars.iv.next91, %65 ]
  %23 = mul nuw nsw i64 %indvars.iv90, %9
  %gep103 = getelementptr inbounds double, ptr %invariant.gep102, i64 %23
  %24 = load double, ptr %gep103, align 8, !tbaa !9
  br i1 %.not, label %._crit_edge, label %.lr.ph79.preheader

.lr.ph79.preheader:                               ; preds = %22
  %invariant.gep100 = getelementptr inbounds double, ptr %6, i64 %indvars.iv90
  br i1 %21, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph79

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph79 ], [ 0, %.lr.ph79.preheader ]
  %.06978 = phi double [ %34, %.lr.ph79 ], [ %24, %.lr.ph79.preheader ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph79 ], [ 0, %.lr.ph79.preheader ]
  %25 = mul nuw nsw i64 %indvars.iv, %9
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %25
  %26 = load double, ptr %gep, align 8, !tbaa !9
  %gep101 = getelementptr inbounds double, ptr %invariant.gep100, i64 %25
  %27 = load double, ptr %gep101, align 8, !tbaa !9
  %28 = fneg double %26
  %29 = tail call double @llvm.fmuladd.f64(double %28, double %27, double %.06978)
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %30 = mul nuw nsw i64 %indvars.iv.next, %9
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %30
  %31 = load double, ptr %gep.1, align 8, !tbaa !9
  %gep101.1 = getelementptr inbounds double, ptr %invariant.gep100, i64 %30
  %32 = load double, ptr %gep101.1, align 8, !tbaa !9
  %33 = fneg double %31
  %34 = tail call double @llvm.fmuladd.f64(double %33, double %32, double %29)
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph79, !llvm.loop !11

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph79, %.lr.ph79.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph79.preheader ], [ %34, %.lr.ph79 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph79.preheader ], [ %indvars.iv.next.1, %.lr.ph79 ]
  %.06978.unr = phi double [ %24, %.lr.ph79.preheader ], [ %34, %.lr.ph79 ]
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph79.epil

.lr.ph79.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %35 = mul nuw nsw i64 %indvars.iv.unr, %9
  %gep.epil = getelementptr inbounds double, ptr %invariant.gep, i64 %35
  %36 = load double, ptr %gep.epil, align 8, !tbaa !9
  %gep101.epil = getelementptr inbounds double, ptr %invariant.gep100, i64 %35
  %37 = load double, ptr %gep101.epil, align 8, !tbaa !9
  %38 = fneg double %36
  %39 = tail call double @llvm.fmuladd.f64(double %38, double %37, double %.06978.unr)
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph79.epil, %._crit_edge.loopexit.unr-lcssa, %22
  %.069.lcssa = phi double [ %24, %22 ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %39, %.lr.ph79.epil ]
  %40 = icmp eq i64 %indvars.iv90, %indvar
  br i1 %40, label %41, label %59

41:                                               ; preds = %._crit_edge
  %42 = fcmp ogt double %.069.lcssa, 0.000000e+00
  br i1 %42, label %43, label %45

43:                                               ; preds = %41
  %44 = tail call double @sqrt(double noundef %.069.lcssa) #6
  store double %44, ptr %20, align 8, !tbaa !9
  br label %65

45:                                               ; preds = %41
  %46 = fcmp olt double %.069.lcssa, %8
  br i1 %46, label %47, label %58

47:                                               ; preds = %45
  store i32 2, ptr %2, align 4, !tbaa !5
  %48 = load ptr, ptr @stderr, align 8, !tbaa !13
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str) #7
  %50 = load ptr, ptr @stderr, align 8, !tbaa !13
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.92) #7
  %52 = load ptr, ptr @stderr, align 8, !tbaa !13
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.93) #7
  %54 = load ptr, ptr @stderr, align 8, !tbaa !13
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.94, i32 noundef %indvars95) #7
  %56 = load ptr, ptr @stderr, align 8, !tbaa !13
  %57 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.95, double noundef %.069.lcssa) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

58:                                               ; preds = %45
  store i32 1, ptr %2, align 4, !tbaa !5
  store double 0.000000e+00, ptr %18, align 8, !tbaa !9
  br label %65

59:                                               ; preds = %._crit_edge
  %60 = load double, ptr %16, align 8, !tbaa !9
  %61 = fcmp une double %60, 0.000000e+00
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = fdiv double %.069.lcssa, %60
  %gep107 = getelementptr inbounds double, ptr %invariant.gep106, i64 %indvars.iv90
  store double %63, ptr %gep107, align 8, !tbaa !9
  br label %65

64:                                               ; preds = %59
  %gep105 = getelementptr inbounds double, ptr %invariant.gep104, i64 %indvars.iv90
  store double 0.000000e+00, ptr %gep105, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %58, %43, %64, %62
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next91, %9
  br i1 %exitcond94.not, label %._crit_edge82, label %22, !llvm.loop !15

._crit_edge82:                                    ; preds = %65
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond97.not = icmp eq i64 %indvar.next, %9
  br i1 %exitcond97.not, label %._crit_edge84, label %.preheader74, !llvm.loop !16

._crit_edge84:                                    ; preds = %._crit_edge82, %3
  ret ptr %6
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @r8mat_copy_new(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { cold nounwind }
attributes #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass