; LLVM IR from AlgoGenesis/C :: Machine_Learning_Algorithms/Logistic Regression (program)

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: nounwind uwtable
declare dso_local double @predict(ptr noundef, ptr noundef, i32 noundef) #2

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

24:                                               ; preds = %108, %7
  %25 = load i32, ptr %15, align 4, !tbaa !9
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %111

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = call noalias ptr @calloc(i64 noundef %31, i64 noundef 8) #6
  store ptr %32, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %77, %29
  %34 = load i32, ptr %18, align 4, !tbaa !9
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %80

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load i32, ptr %18, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds ptr, ptr %39, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  store ptr %43, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %19, align 8, !tbaa !5
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = call double @predict(ptr noundef %44, ptr noundef %45, i32 noundef %46)
  store double %47, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %48 = load double, ptr %20, align 8, !tbaa !11
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = load i32, ptr %18, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %49, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = fsub double %48, %53
  store double %54, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %73, %38
  %56 = load i32, ptr %22, align 4, !tbaa !9
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %76

60:                                               ; preds = %55
  %61 = load double, ptr %21, align 8, !tbaa !11
  %62 = load ptr, ptr %19, align 8, !tbaa !5
  %63 = load i32, ptr %22, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = load i32, ptr %22, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !11
  %72 = call double @llvm.fmuladd.f64(double %61, double %66, double %71)
  store double %72, ptr %70, align 8, !tbaa !11
  br label %73

73:                                               ; preds = %60
  %74 = load i32, ptr %22, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %22, align 4, !tbaa !9
  br label %55, !llvm.loop !13

76:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %18, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %18, align 4, !tbaa !9
  br label %33, !llvm.loop !15

80:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %103, %80
  %82 = load i32, ptr %23, align 4, !tbaa !9
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %106

86:                                               ; preds = %81
  %87 = load double, ptr %13, align 8, !tbaa !11
  %88 = load ptr, ptr %17, align 8, !tbaa !5
  %89 = load i32, ptr %23, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds double, ptr %88, i64 %90
  %92 = load double, ptr %91, align 8, !tbaa !11
  %93 = fmul double %87, %92
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = sitofp i32 %94 to double
  %96 = fdiv double %93, %95
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load i32, ptr %23, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds double, ptr %97, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !11
  %102 = fsub double %101, %96
  store double %102, ptr %100, align 8, !tbaa !11
  br label %103

103:                                              ; preds = %86
  %104 = load i32, ptr %23, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %23, align 4, !tbaa !9
  br label %81, !llvm.loop !16

106:                                              ; preds = %85
  %107 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %107) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %108

108:                                              ; preds = %106
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %15, align 4, !tbaa !9
  br label %24, !llvm.loop !17

111:                                              ; preds = %28
  ret void
}

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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 allocsize(0,1) "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 "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 = { nounwind allocsize(0,1) }

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

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

; Function Attrs: nounwind uwtable
declare dso_local double @predict(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @train_logistic_regression(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, double noundef %5, i32 noundef %6) local_unnamed_addr #1 {
  %8 = icmp sgt i32 %6, 0
  br i1 %8, label %.lr.ph43, label %._crit_edge44

.lr.ph43:                                         ; preds = %7
  %9 = sext i32 %4 to i64
  %10 = icmp sgt i32 %3, 0
  %11 = icmp sgt i32 %4, 0
  %12 = sitofp i32 %3 to double
  br i1 %10, label %.lr.ph43.split.us, label %.lr.ph43.split

.lr.ph43.split.us:                                ; preds = %.lr.ph43
  %wide.trip.count77 = zext nneg i32 %3 to i64
  br i1 %11, label %.lr.ph39.us.us.preheader, label %.lr.ph39.us

.lr.ph39.us.us.preheader:                         ; preds = %.lr.ph43.split.us
  %wide.trip.count72 = zext nneg i32 %4 to i64
  %min.iters.check111 = icmp ult i32 %4, 4
  %n.vec114 = and i64 %wide.trip.count72, 2147483644
  %cmp.n125 = icmp eq i64 %n.vec114, %wide.trip.count72
  %min.iters.check94 = icmp eq i32 %4, 1
  %n.vec97 = and i64 %wide.trip.count72, 2147483646
  %broadcast.splatinsert102 = insertelement <2 x double> poison, double %5, i64 0
  %broadcast.splat103 = shufflevector <2 x double> %broadcast.splatinsert102, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert104 = insertelement <2 x double> poison, double %12, i64 0
  %broadcast.splat105 = shufflevector <2 x double> %broadcast.splatinsert104, <2 x double> poison, <2 x i32> zeroinitializer
  %cmp.n108 = icmp eq i64 %n.vec97, %wide.trip.count72
  br label %.lr.ph39.us.us

.lr.ph39.us.us:                                   ; preds = %.lr.ph39.us.us.preheader, %._crit_edge.us49.us
  %.03341.us.us = phi i32 [ %14, %._crit_edge.us49.us ], [ 0, %.lr.ph39.us.us.preheader ]
  %13 = tail call noalias ptr @calloc(i64 noundef %9, i64 noundef 8) #5
  br label %.lr.ph.us.us.us

._crit_edge.us49.us:                              ; preds = %.lr.ph.us48.us, %middle.block92
  tail call void @free(ptr noundef nonnull %13) #6
  %14 = add nuw nsw i32 %.03341.us.us, 1
  %exitcond84.not = icmp eq i32 %14, %6
  br i1 %exitcond84.not, label %._crit_edge44, label %.lr.ph39.us.us, !llvm.loop !5

.lr.ph.us48.us:                                   ; preds = %.lr.ph.us48.us.preheader126, %.lr.ph.us48.us
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph.us48.us ], [ %indvars.iv79.ph, %.lr.ph.us48.us.preheader126 ]
  %15 = getelementptr inbounds double, ptr %13, i64 %indvars.iv79
  %16 = load double, ptr %15, align 8, !tbaa !7
  %17 = fmul double %16, %5
  %18 = fdiv double %17, %12
  %19 = getelementptr inbounds double, ptr %2, i64 %indvars.iv79
  %20 = load double, ptr %19, align 8, !tbaa !7
  %21 = fsub double %20, %18
  store double %21, ptr %19, align 8, !tbaa !7
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count72
  br i1 %exitcond83.not, label %._crit_edge.us49.us, label %.lr.ph.us48.us, !llvm.loop !11

.lr.ph.us.us.us:                                  ; preds = %._crit_edge.us.us.us, %.lr.ph39.us.us
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %._crit_edge.us.us.us ], [ 0, %.lr.ph39.us.us ]
  %22 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv74
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  %24 = tail call double @predict(ptr noundef %2, ptr noundef %23, i32 noundef %4)
  %25 = getelementptr inbounds double, ptr %1, i64 %indvars.iv74
  %26 = load double, ptr %25, align 8, !tbaa !7
  %27 = fsub double %24, %26
  br i1 %min.iters.check111, label %scalar.ph110.preheader, label %vector.ph112

vector.ph112:                                     ; preds = %.lr.ph.us.us.us
  %broadcast.splatinsert122 = insertelement <2 x double> poison, double %27, i64 0
  %broadcast.splat123 = shufflevector <2 x double> %broadcast.splatinsert122, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body116

vector.body116:                                   ; preds = %vector.body116, %vector.ph112
  %index117 = phi i64 [ 0, %vector.ph112 ], [ %index.next124, %vector.body116 ]
  %28 = getelementptr inbounds double, ptr %23, i64 %index117
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %wide.load118 = load <2 x double>, ptr %28, align 8, !tbaa !7
  %wide.load119 = load <2 x double>, ptr %29, align 8, !tbaa !7
  %30 = getelementptr inbounds double, ptr %13, i64 %index117
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %wide.load120 = load <2 x double>, ptr %30, align 8, !tbaa !7
  %wide.load121 = load <2 x double>, ptr %31, align 8, !tbaa !7
  %32 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat123, <2 x double> %wide.load118, <2 x double> %wide.load120)
  %33 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat123, <2 x double> %wide.load119, <2 x double> %wide.load121)
  store <2 x double> %32, ptr %30, align 8, !tbaa !7
  store <2 x double> %33, ptr %31, align 8, !tbaa !7
  %index.next124 = add nuw i64 %index117, 4
  %34 = icmp eq i64 %index.next124, %n.vec114
  br i1 %34, label %middle.block109, label %vector.body116, !llvm.loop !16

middle.block109:                                  ; preds = %vector.body116
  br i1 %cmp.n125, label %._crit_edge.us.us.us, label %scalar.ph110.preheader

scalar.ph110.preheader:                           ; preds = %middle.block109, %.lr.ph.us.us.us
  %indvars.iv69.ph = phi i64 [ 0, %.lr.ph.us.us.us ], [ %n.vec114, %middle.block109 ]
  br label %scalar.ph110

scalar.ph110:                                     ; preds = %scalar.ph110.preheader, %scalar.ph110
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %scalar.ph110 ], [ %indvars.iv69.ph, %scalar.ph110.preheader ]
  %35 = getelementptr inbounds double, ptr %23, i64 %indvars.iv69
  %36 = load double, ptr %35, align 8, !tbaa !7
  %37 = getelementptr inbounds double, ptr %13, i64 %indvars.iv69
  %38 = load double, ptr %37, align 8, !tbaa !7
  %39 = tail call double @llvm.fmuladd.f64(double %27, double %36, double %38)
  store double %39, ptr %37, align 8, !tbaa !7
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %._crit_edge.us.us.us, label %scalar.ph110, !llvm.loop !17

._crit_edge.us.us.us:                             ; preds = %scalar.ph110, %middle.block109
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %.lr.ph.us48.us.preheader, label %.lr.ph.us.us.us, !llvm.loop !18

.lr.ph.us48.us.preheader:                         ; preds = %._crit_edge.us.us.us
  br i1 %min.iters.check94, label %.lr.ph.us48.us.preheader126, label %vector.body99

.lr.ph.us48.us.preheader126:                      ; preds = %middle.block92, %.lr.ph.us48.us.preheader
  %indvars.iv79.ph = phi i64 [ 0, %.lr.ph.us48.us.preheader ], [ %n.vec97, %middle.block92 ]
  br label %.lr.ph.us48.us

vector.body99:                                    ; preds = %.lr.ph.us48.us.preheader, %vector.body99
  %index100 = phi i64 [ %index.next107, %vector.body99 ], [ 0, %.lr.ph.us48.us.preheader ]
  %40 = getelementptr inbounds double, ptr %13, i64 %index100
  %wide.load101 = load <2 x double>, ptr %40, align 8, !tbaa !7
  %41 = fmul <2 x double> %wide.load101, %broadcast.splat103
  %42 = fdiv <2 x double> %41, %broadcast.splat105
  %43 = getelementptr inbounds double, ptr %2, i64 %index100
  %wide.load106 = load <2 x double>, ptr %43, align 8, !tbaa !7
  %44 = fsub <2 x double> %wide.load106, %42
  store <2 x double> %44, ptr %43, align 8, !tbaa !7
  %index.next107 = add nuw i64 %index100, 2
  %45 = icmp eq i64 %index.next107, %n.vec97
  br i1 %45, label %middle.block92, label %vector.body99, !llvm.loop !19

middle.block92:                                   ; preds = %vector.body99
  br i1 %cmp.n108, label %._crit_edge.us49.us, label %.lr.ph.us48.us.preheader126

.lr.ph39.us:                                      ; preds = %.lr.ph43.split.us, %..preheader_crit_edge.split.us46
  %.03341.us = phi i32 [ %50, %..preheader_crit_edge.split.us46 ], [ 0, %.lr.ph43.split.us ]
  br label %46

46:                                               ; preds = %.lr.ph39.us, %46
  %indvars.iv63 = phi i64 [ 0, %.lr.ph39.us ], [ %indvars.iv.next64, %46 ]
  %47 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv63
  %48 = load ptr, ptr %47, align 8, !tbaa !14
  %49 = tail call double @predict(ptr noundef %2, ptr noundef %48, i32 noundef %4)
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count77
  br i1 %exitcond67.not, label %..preheader_crit_edge.split.us46, label %46, !llvm.loop !18

..preheader_crit_edge.split.us46:                 ; preds = %46
  %50 = add nuw nsw i32 %.03341.us, 1
  %exitcond68.not = icmp eq i32 %50, %6
  br i1 %exitcond68.not, label %._crit_edge44, label %.lr.ph39.us, !llvm.loop !5

.lr.ph43.split:                                   ; preds = %.lr.ph43
  br i1 %11, label %.preheader.us50.preheader, label %._crit_edge44

.preheader.us50.preheader:                        ; preds = %.lr.ph43.split
  %wide.trip.count = zext nneg i32 %4 to i64
  %min.iters.check = icmp eq i32 %4, 1
  %n.vec = and i64 %wide.trip.count, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %5, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert89 = insertelement <2 x double> poison, double %12, i64 0
  %broadcast.splat90 = shufflevector <2 x double> %broadcast.splatinsert89, <2 x double> poison, <2 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.preheader.us50

.preheader.us50:                                  ; preds = %.preheader.us50.preheader, %._crit_edge.us
  %.03341.us51 = phi i32 [ %65, %._crit_edge.us ], [ 0, %.preheader.us50.preheader ]
  %51 = tail call noalias ptr @calloc(i64 noundef %9, i64 noundef 8) #5
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader.us50, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader.us50 ]
  %52 = getelementptr inbounds double, ptr %51, i64 %index
  %wide.load = load <2 x double>, ptr %52, align 8, !tbaa !7
  %53 = fmul <2 x double> %wide.load, %broadcast.splat
  %54 = fdiv <2 x double> %53, %broadcast.splat90
  %55 = getelementptr inbounds double, ptr %2, i64 %index
  %wide.load91 = load <2 x double>, ptr %55, align 8, !tbaa !7
  %56 = fsub <2 x double> %wide.load91, %54
  store <2 x double> %56, ptr %55, align 8, !tbaa !7
  %index.next = add nuw i64 %index, 2
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us50
  %indvars.iv.ph = phi i64 [ 0, %.preheader.us50 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %58 = getelementptr inbounds double, ptr %51, i64 %indvars.iv
  %59 = load double, ptr %58, align 8, !tbaa !7
  %60 = fmul double %59, %5
  %61 = fdiv double %60, %12
  %62 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  %63 = load double, ptr %62, align 8, !tbaa !7
  %64 = fsub double %63, %61
  store double %64, ptr %62, align 8, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !21

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  tail call void @free(ptr noundef nonnull %51) #6
  %65 = add nuw nsw i32 %.03341.us51, 1
  %exitcond62.not = icmp eq i32 %65, %6
  br i1 %exitcond62.not, label %._crit_edge44, label %.preheader.us50, !llvm.loop !5

._crit_edge44:                                    ; preds = %._crit_edge.us, %..preheader_crit_edge.split.us46, %._crit_edge.us49.us, %.lr.ph43.split, %7
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind allocsize(0,1) }
attributes #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6, !12, !13}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !9, i64 0}
!16 = distinct !{!16, !6, !13, !12}
!17 = distinct !{!17, !6, !12, !13}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6, !13, !12}
!20 = distinct !{!20, !6, !13, !12}
!21 = distinct !{!21, !6, !12, !13}


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