; LLVM IR from qc-tum/chemtensor :: test/algorithm (numerical_gradient)

; 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: inlinehint nounwind uwtable
declare hidden ptr @ct_malloc(i64 noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ct_free(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 void @numerical_gradient_backward_d(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noalias noundef %3, i64 noundef %4, ptr noalias noundef %5, double noundef %6, ptr noalias noundef %7) #4 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i64 %2, ptr %11, align 8, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i64 %4, ptr %13, align 8, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store double %6, ptr %15, align 8, !tbaa !11
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %24 = load i64, ptr %11, align 8, !tbaa !9
  %25 = mul i64 %24, 8
  %26 = call ptr @ct_malloc(i64 noundef %25)
  store ptr %26, ptr %17, align 8, !tbaa !5
  %27 = load ptr, ptr %17, align 8, !tbaa !5
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  %29 = load i64, ptr %11, align 8, !tbaa !9
  %30 = mul i64 %29, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %28, i64 %30, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %31 = load i64, ptr %13, align 8, !tbaa !9
  %32 = mul i64 %31, 8
  %33 = call ptr @ct_malloc(i64 noundef %32)
  store ptr %33, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %130, %8
  %35 = load i64, ptr %19, align 8, !tbaa !9
  %36 = load i64, ptr %11, align 8, !tbaa !9
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 2, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %133

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = load i64, ptr %19, align 8, !tbaa !9
  %42 = getelementptr inbounds double, ptr %40, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = load double, ptr %15, align 8, !tbaa !11
  %45 = fadd double %43, %44
  %46 = load ptr, ptr %17, align 8, !tbaa !5
  %47 = load i64, ptr %19, align 8, !tbaa !9
  %48 = getelementptr inbounds double, ptr %46, i64 %47
  store double %45, ptr %48, align 8, !tbaa !11
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %17, align 8, !tbaa !5
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  call void %49(ptr noundef %50, ptr noundef %51, ptr noundef %52)
  store double 0.000000e+00, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %69, %39
  %54 = load i64, ptr %22, align 8, !tbaa !9
  %55 = load i64, ptr %13, align 8, !tbaa !9
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %72

58:                                               ; preds = %53
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = load i64, ptr %22, align 8, !tbaa !9
  %61 = getelementptr inbounds double, ptr %59, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !11
  %63 = load ptr, ptr %18, align 8, !tbaa !5
  %64 = load i64, ptr %22, align 8, !tbaa !9
  %65 = getelementptr inbounds double, ptr %63, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = load double, ptr %21, align 8, !tbaa !11
  %68 = call double @llvm.fmuladd.f64(double %62, double %66, double %67)
  store double %68, ptr %21, align 8, !tbaa !11
  br label %69

69:                                               ; preds = %58
  %70 = load i64, ptr %22, align 8, !tbaa !9
  %71 = add nsw i64 %70, 1
  store i64 %71, ptr %22, align 8, !tbaa !9
  br label %53, !llvm.loop !13

72:                                               ; preds = %57
  %73 = load double, ptr %21, align 8, !tbaa !11
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load i64, ptr %19, align 8, !tbaa !9
  %76 = getelementptr inbounds double, ptr %74, i64 %75
  store double %73, ptr %76, align 8, !tbaa !11
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i64, ptr %19, align 8, !tbaa !9
  %79 = getelementptr inbounds double, ptr %77, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = load double, ptr %15, align 8, !tbaa !11
  %82 = fsub double %80, %81
  %83 = load ptr, ptr %17, align 8, !tbaa !5
  %84 = load i64, ptr %19, align 8, !tbaa !9
  %85 = getelementptr inbounds double, ptr %83, i64 %84
  store double %82, ptr %85, align 8, !tbaa !11
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  call void %86(ptr noundef %87, ptr noundef %88, ptr noundef %89)
  store double 0.000000e+00, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store i64 0, ptr %23, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %106, %72
  %91 = load i64, ptr %23, align 8, !tbaa !9
  %92 = load i64, ptr %13, align 8, !tbaa !9
  %93 = icmp slt i64 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %109

95:                                               ; preds = %90
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  %97 = load i64, ptr %23, align 8, !tbaa !9
  %98 = getelementptr inbounds double, ptr %96, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !11
  %100 = load ptr, ptr %18, align 8, !tbaa !5
  %101 = load i64, ptr %23, align 8, !tbaa !9
  %102 = getelementptr inbounds double, ptr %100, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !11
  %104 = load double, ptr %21, align 8, !tbaa !11
  %105 = call double @llvm.fmuladd.f64(double %99, double %103, double %104)
  store double %105, ptr %21, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %95
  %107 = load i64, ptr %23, align 8, !tbaa !9
  %108 = add nsw i64 %107, 1
  store i64 %108, ptr %23, align 8, !tbaa !9
  br label %90, !llvm.loop !15

109:                                              ; preds = %94
  %110 = load double, ptr %21, align 8, !tbaa !11
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = load i64, ptr %19, align 8, !tbaa !9
  %113 = getelementptr inbounds double, ptr %111, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !11
  %115 = fsub double %114, %110
  store double %115, ptr %113, align 8, !tbaa !11
  %116 = load double, ptr %15, align 8, !tbaa !11
  %117 = fmul double 2.000000e+00, %116
  %118 = load ptr, ptr %16, align 8, !tbaa !5
  %119 = load i64, ptr %19, align 8, !tbaa !9
  %120 = getelementptr inbounds double, ptr %118, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !11
  %122 = fdiv double %121, %117
  store double %122, ptr %120, align 8, !tbaa !11
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = load i64, ptr %19, align 8, !tbaa !9
  %125 = getelementptr inbounds double, ptr %123, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = load i64, ptr %19, align 8, !tbaa !9
  %129 = getelementptr inbounds double, ptr %127, i64 %128
  store double %126, ptr %129, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %130

130:                                              ; preds = %109
  %131 = load i64, ptr %19, align 8, !tbaa !9
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %19, align 8, !tbaa !9
  br label %34, !llvm.loop !16

133:                                              ; preds = %38
  %134 = load ptr, ptr %18, align 8, !tbaa !5
  call void @ct_free(ptr noundef %134)
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  call void @ct_free(ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  ret void
}

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

!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 = !{!"long", !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}


; 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: inlinehint nounwind uwtable
declare hidden ptr @ct_malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ct_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 void @numerical_gradient_backward_d(ptr nocapture noundef readonly %0, ptr noundef %1, i64 noundef %2, ptr noalias nocapture noundef readonly %3, i64 noundef %4, ptr noalias nocapture noundef readonly %5, double noundef %6, ptr noalias nocapture noundef writeonly %7) local_unnamed_addr #3 {
  %9 = shl i64 %2, 3
  %10 = tail call ptr @ct_malloc(i64 noundef %9)
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %3, i64 %9, i1 false)
  %11 = shl i64 %4, 3
  %12 = tail call ptr @ct_malloc(i64 noundef %11)
  %13 = icmp sgt i64 %2, 0
  br i1 %13, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %8
  %14 = icmp sgt i64 %4, 0
  %15 = fmul double %6, 2.000000e+00
  br i1 %14, label %.lr.ph.us.us.preheader, label %.lr.ph70.split.split

.lr.ph.us.us.preheader:                           ; preds = %.lr.ph70
  %xtraiter = and i64 %4, 3
  %16 = icmp ult i64 %4, 4
  %unroll_iter = and i64 %4, 9223372036854775804
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %xtraiter92 = and i64 %4, 3
  %17 = icmp ult i64 %4, 4
  %unroll_iter96 = and i64 %4, 9223372036854775804
  %lcmp.mod94.not = icmp eq i64 %xtraiter92, 0
  br label %.lr.ph.us.us

.lr.ph.us.us:                                     ; preds = %.lr.ph.us.us.preheader, %._crit_edge66.us.us
  %.05868.us.us = phi i64 [ %86, %._crit_edge66.us.us ], [ 0, %.lr.ph.us.us.preheader ]
  %18 = getelementptr inbounds double, ptr %3, i64 %.05868.us.us
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = fadd double %19, %6
  %21 = getelementptr inbounds double, ptr %10, i64 %.05868.us.us
  store double %20, ptr %21, align 8, !tbaa !5
  tail call void %0(ptr noundef %10, ptr noundef %1, ptr noundef %12) #4
  br i1 %16, label %._crit_edge.us.us.unr-lcssa, label %.lr.ph.us.us.new

._crit_edge.us.us.new:                            ; preds = %._crit_edge.us.us, %._crit_edge.us.us.new
  %.063.us.us = phi i64 [ %45, %._crit_edge.us.us.new ], [ 0, %._crit_edge.us.us ]
  %.162.us.us = phi double [ %44, %._crit_edge.us.us.new ], [ 0.000000e+00, %._crit_edge.us.us ]
  %niter97 = phi i64 [ %niter97.next.3, %._crit_edge.us.us.new ], [ 0, %._crit_edge.us.us ]
  %22 = getelementptr inbounds double, ptr %5, i64 %.063.us.us
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds double, ptr %12, i64 %.063.us.us
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = tail call double @llvm.fmuladd.f64(double %23, double %25, double %.162.us.us)
  %27 = or disjoint i64 %.063.us.us, 1
  %28 = getelementptr inbounds double, ptr %5, i64 %27
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %12, i64 %27
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = tail call double @llvm.fmuladd.f64(double %29, double %31, double %26)
  %33 = or disjoint i64 %.063.us.us, 2
  %34 = getelementptr inbounds double, ptr %5, i64 %33
  %35 = load double, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds double, ptr %12, i64 %33
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = tail call double @llvm.fmuladd.f64(double %35, double %37, double %32)
  %39 = or disjoint i64 %.063.us.us, 3
  %40 = getelementptr inbounds double, ptr %5, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %12, i64 %39
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = tail call double @llvm.fmuladd.f64(double %41, double %43, double %38)
  %45 = add nuw nsw i64 %.063.us.us, 4
  %niter97.next.3 = add i64 %niter97, 4
  %niter97.ncmp.3 = icmp eq i64 %niter97.next.3, %unroll_iter96
  br i1 %niter97.ncmp.3, label %._crit_edge66.us.us.unr-lcssa, label %._crit_edge.us.us.new, !llvm.loop !9

.lr.ph.us.us.new:                                 ; preds = %.lr.ph.us.us, %.lr.ph.us.us.new
  %.05661.us.us = phi i64 [ %69, %.lr.ph.us.us.new ], [ 0, %.lr.ph.us.us ]
  %.05760.us.us = phi double [ %68, %.lr.ph.us.us.new ], [ 0.000000e+00, %.lr.ph.us.us ]
  %niter = phi i64 [ %niter.next.3, %.lr.ph.us.us.new ], [ 0, %.lr.ph.us.us ]
  %46 = getelementptr inbounds double, ptr %5, i64 %.05661.us.us
  %47 = load double, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds double, ptr %12, i64 %.05661.us.us
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = tail call double @llvm.fmuladd.f64(double %47, double %49, double %.05760.us.us)
  %51 = or disjoint i64 %.05661.us.us, 1
  %52 = getelementptr inbounds double, ptr %5, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds double, ptr %12, i64 %51
  %55 = load double, ptr %54, align 8, !tbaa !5
  %56 = tail call double @llvm.fmuladd.f64(double %53, double %55, double %50)
  %57 = or disjoint i64 %.05661.us.us, 2
  %58 = getelementptr inbounds double, ptr %5, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds double, ptr %12, i64 %57
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = tail call double @llvm.fmuladd.f64(double %59, double %61, double %56)
  %63 = or disjoint i64 %.05661.us.us, 3
  %64 = getelementptr inbounds double, ptr %5, i64 %63
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %12, i64 %63
  %67 = load double, ptr %66, align 8, !tbaa !5
  %68 = tail call double @llvm.fmuladd.f64(double %65, double %67, double %62)
  %69 = add nuw nsw i64 %.05661.us.us, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.us.us.unr-lcssa, label %.lr.ph.us.us.new, !llvm.loop !11

._crit_edge.us.us.unr-lcssa:                      ; preds = %.lr.ph.us.us.new, %.lr.ph.us.us
  %.lcssa.ph = phi double [ poison, %.lr.ph.us.us ], [ %68, %.lr.ph.us.us.new ]
  %.05661.us.us.unr = phi i64 [ 0, %.lr.ph.us.us ], [ %69, %.lr.ph.us.us.new ]
  %.05760.us.us.unr = phi double [ 0.000000e+00, %.lr.ph.us.us ], [ %68, %.lr.ph.us.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.us.unr-lcssa, %.epil.preheader
  %.05661.us.us.epil = phi i64 [ %75, %.epil.preheader ], [ %.05661.us.us.unr, %._crit_edge.us.us.unr-lcssa ]
  %.05760.us.us.epil = phi double [ %74, %.epil.preheader ], [ %.05760.us.us.unr, %._crit_edge.us.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.us.unr-lcssa ]
  %70 = getelementptr inbounds double, ptr %5, i64 %.05661.us.us.epil
  %71 = load double, ptr %70, align 8, !tbaa !5
  %72 = getelementptr inbounds double, ptr %12, i64 %.05661.us.us.epil
  %73 = load double, ptr %72, align 8, !tbaa !5
  %74 = tail call double @llvm.fmuladd.f64(double %71, double %73, double %.05760.us.us.epil)
  %75 = add nuw nsw i64 %.05661.us.us.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.us.us, label %.epil.preheader, !llvm.loop !12

._crit_edge.us.us:                                ; preds = %.epil.preheader, %._crit_edge.us.us.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge.us.us.unr-lcssa ], [ %74, %.epil.preheader ]
  %76 = getelementptr inbounds double, ptr %7, i64 %.05868.us.us
  %77 = fsub double %19, %6
  store double %77, ptr %21, align 8, !tbaa !5
  tail call void %0(ptr noundef %10, ptr noundef %1, ptr noundef nonnull %12) #4
  br i1 %17, label %._crit_edge66.us.us.unr-lcssa, label %._crit_edge.us.us.new

._crit_edge66.us.us.unr-lcssa:                    ; preds = %._crit_edge.us.us.new, %._crit_edge.us.us
  %.lcssa88.ph = phi double [ poison, %._crit_edge.us.us ], [ %44, %._crit_edge.us.us.new ]
  %.063.us.us.unr = phi i64 [ 0, %._crit_edge.us.us ], [ %45, %._crit_edge.us.us.new ]
  %.162.us.us.unr = phi double [ 0.000000e+00, %._crit_edge.us.us ], [ %44, %._crit_edge.us.us.new ]
  br i1 %lcmp.mod94.not, label %._crit_edge66.us.us, label %.epil.preheader91

.epil.preheader91:                                ; preds = %._crit_edge66.us.us.unr-lcssa, %.epil.preheader91
  %.063.us.us.epil = phi i64 [ %83, %.epil.preheader91 ], [ %.063.us.us.unr, %._crit_edge66.us.us.unr-lcssa ]
  %.162.us.us.epil = phi double [ %82, %.epil.preheader91 ], [ %.162.us.us.unr, %._crit_edge66.us.us.unr-lcssa ]
  %epil.iter93 = phi i64 [ %epil.iter93.next, %.epil.preheader91 ], [ 0, %._crit_edge66.us.us.unr-lcssa ]
  %78 = getelementptr inbounds double, ptr %5, i64 %.063.us.us.epil
  %79 = load double, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds double, ptr %12, i64 %.063.us.us.epil
  %81 = load double, ptr %80, align 8, !tbaa !5
  %82 = tail call double @llvm.fmuladd.f64(double %79, double %81, double %.162.us.us.epil)
  %83 = add nuw nsw i64 %.063.us.us.epil, 1
  %epil.iter93.next = add i64 %epil.iter93, 1
  %epil.iter93.cmp.not = icmp eq i64 %epil.iter93.next, %xtraiter92
  br i1 %epil.iter93.cmp.not, label %._crit_edge66.us.us, label %.epil.preheader91, !llvm.loop !14

._crit_edge66.us.us:                              ; preds = %.epil.preheader91, %._crit_edge66.us.us.unr-lcssa
  %.lcssa88 = phi double [ %.lcssa88.ph, %._crit_edge66.us.us.unr-lcssa ], [ %82, %.epil.preheader91 ]
  %84 = fsub double %.lcssa, %.lcssa88
  %85 = fdiv double %84, %15
  store double %85, ptr %76, align 8, !tbaa !5
  store double %19, ptr %21, align 8, !tbaa !5
  %86 = add nuw nsw i64 %.05868.us.us, 1
  %exitcond83.not = icmp eq i64 %86, %2
  br i1 %exitcond83.not, label %._crit_edge71, label %.lr.ph.us.us, !llvm.loop !15

.lr.ph70.split.split:                             ; preds = %.lr.ph70
  %87 = fdiv double 0.000000e+00, %15
  br label %88

._crit_edge71:                                    ; preds = %88, %._crit_edge66.us.us, %8
  tail call void @ct_free(ptr noundef %12)
  tail call void @ct_free(ptr noundef %10)
  ret void

88:                                               ; preds = %.lr.ph70.split.split, %88
  %.05868 = phi i64 [ 0, %.lr.ph70.split.split ], [ %95, %88 ]
  %89 = getelementptr inbounds double, ptr %3, i64 %.05868
  %90 = load double, ptr %89, align 8, !tbaa !5
  %91 = fadd double %90, %6
  %92 = getelementptr inbounds double, ptr %10, i64 %.05868
  store double %91, ptr %92, align 8, !tbaa !5
  tail call void %0(ptr noundef %10, ptr noundef %1, ptr noundef %12) #4
  %93 = getelementptr inbounds double, ptr %7, i64 %.05868
  %94 = fsub double %90, %6
  store double %94, ptr %92, align 8, !tbaa !5
  tail call void %0(ptr noundef %10, ptr noundef %1, ptr noundef %12) #4
  store double %87, ptr %93, align 8, !tbaa !5
  store double %90, ptr %92, align 8, !tbaa !5
  %95 = add nuw nsw i64 %.05868, 1
  %exitcond.not = icmp eq i64 %95, %2
  br i1 %exitcond.not, label %._crit_edge71, label %88, !llvm.loop !15
}

attributes #0 = { inlinehint 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !10}


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