; LLVM IR from VT-ICAM/cfem :: cfem (cf_local_hessian)

; 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"

%struct.cf_ref_arrays_s = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double }
%struct.cf_local_element_s = type { [3 x double], [3 x double], [4 x double], [2 x double], double, double, ptr }

@__c_N = external dso_local global i8, align 1
@__c_T = external dso_local global i8, align 1
@__d_zero = external dso_local global double, align 8
@__d_one = external dso_local global double, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @cf_diagonal_multiply(i32 noundef, i32 noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ipow(i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @cf_physical_hessian(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8, ptr noundef nonnull align 8) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; 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) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

declare void @dgemm_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @cf_local_hessian(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = call i32 @ipow(i32 noundef %20, i32 noundef 2)
  %22 = zext i32 %21 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !13
  store i32 %25, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !9
  store i32 %28, ptr %11, align 4, !tbaa !14
  %29 = load i32, ptr %11, align 4, !tbaa !14
  %30 = load i32, ptr %10, align 4, !tbaa !14
  %31 = mul nsw i32 %29, %30
  %32 = zext i32 %31 to i64
  %33 = call ptr @llvm.stacksave.p0()
  store ptr %33, ptr %12, align 8
  %34 = alloca double, i64 %32, align 16
  store i64 %32, ptr %13, align 8
  %35 = load i32, ptr %11, align 4, !tbaa !14
  %36 = load i32, ptr %10, align 4, !tbaa !14
  %37 = mul nsw i32 %35, %36
  %38 = zext i32 %37 to i64
  %39 = alloca double, i64 %38, align 16
  store i64 %38, ptr %14, align 8
  %40 = load i32, ptr %11, align 4, !tbaa !14
  %41 = load i32, ptr %10, align 4, !tbaa !14
  %42 = mul nsw i32 %40, %41
  %43 = zext i32 %42 to i64
  %44 = alloca double, i64 %43, align 16
  store i64 %43, ptr %15, align 8
  %45 = load i32, ptr %10, align 4, !tbaa !14
  %46 = zext i32 %45 to i64
  %47 = alloca double, i64 %46, align 16
  store i64 %46, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !14
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  call void @cf_physical_hessian(ptr noundef %48, ptr noundef %49, ptr noundef %34, ptr noundef %39, ptr noundef %44)
  store i32 0, ptr %9, align 4, !tbaa !14
  br label %50

50:                                               ; preds = %69, %4
  %51 = load i32, ptr %9, align 4, !tbaa !14
  %52 = load i32, ptr %10, align 4, !tbaa !14
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %72

54:                                               ; preds = %50
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %55, i32 0, i32 4
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = load i32, ptr %9, align 4, !tbaa !14
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %57, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !16
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.cf_local_element_s, ptr %62, i32 0, i32 4
  %64 = load double, ptr %63, align 8, !tbaa !17
  %65 = fmul double %61, %64
  %66 = load i32, ptr %9, align 4, !tbaa !14
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %47, i64 %67
  store double %65, ptr %68, align 8, !tbaa !16
  br label %69

69:                                               ; preds = %54
  %70 = load i32, ptr %9, align 4, !tbaa !14
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %9, align 4, !tbaa !14
  br label %50, !llvm.loop !19

72:                                               ; preds = %50
  store i32 0, ptr %9, align 4, !tbaa !14
  br label %73

73:                                               ; preds = %89, %72
  %74 = load i32, ptr %9, align 4, !tbaa !14
  %75 = load i32, ptr %11, align 4, !tbaa !14
  %76 = load i32, ptr %10, align 4, !tbaa !14
  %77 = mul nsw i32 %75, %76
  %78 = icmp slt i32 %74, %77
  br i1 %78, label %79, label %92

79:                                               ; preds = %73
  %80 = load i32, ptr %9, align 4, !tbaa !14
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %44, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !16
  %84 = load i32, ptr %9, align 4, !tbaa !14
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %34, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !16
  %88 = fadd double %87, %83
  store double %88, ptr %86, align 8, !tbaa !16
  br label %89

89:                                               ; preds = %79
  %90 = load i32, ptr %9, align 4, !tbaa !14
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !14
  br label %73, !llvm.loop !21

92:                                               ; preds = %73
  %93 = load i32, ptr %11, align 4, !tbaa !14
  %94 = load i32, ptr %10, align 4, !tbaa !14
  %95 = mul nsw i32 %93, %94
  %96 = sext i32 %95 to i64
  %97 = mul i64 8, %96
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %44, ptr align 16 %34, i64 %97, i1 false)
  %98 = load i32, ptr %11, align 4, !tbaa !14
  %99 = load i32, ptr %10, align 4, !tbaa !14
  call void @cf_diagonal_multiply(i32 noundef %98, i32 noundef %99, ptr noundef %34, ptr noundef %47)
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  call void @dgemm_(ptr noundef @__c_T, ptr noundef @__c_N, ptr noundef %11, ptr noundef %11, ptr noundef %10, ptr noundef @__d_one, ptr noundef %44, ptr noundef %10, ptr noundef %34, ptr noundef %10, ptr noundef @__d_zero, ptr noundef %100, ptr noundef %11)
  %101 = load i32, ptr %17, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %102 = load ptr, ptr %12, align 8
  call void @llvm.stackrestore.p0(ptr %102)
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret i32 %101
}

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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, !11, i64 4}
!10 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !12, i64 80}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 24}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !12, i64 96}
!18 = !{!"", !7, i64 0, !7, i64 24, !7, i64 48, !7, i64 80, !12, i64 96, !12, i64 104, !6, i64 112}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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"

@__c_N = external dso_local global i8, align 1
@__c_T = external dso_local global i8, align 1
@__d_zero = external dso_local global double, align 8
@__d_one = external dso_local global double, align 8

; Function Attrs: nounwind uwtable
declare dso_local void @cf_diagonal_multiply(i32 noundef, i32 noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ipow(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @cf_physical_hessian(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8, ptr noundef nonnull align 8) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; 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) #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

declare void @dgemm_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @cf_local_hessian(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readnone %2, ptr noundef nonnull align 8 %3) local_unnamed_addr #0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = tail call i32 @ipow(i32 noundef %8, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %10 = load i32, ptr %0, align 8, !tbaa !12
  store i32 %10, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %11 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %11, ptr %6, align 4, !tbaa !13
  %12 = mul i32 %11, %10
  %13 = zext i32 %12 to i64
  %14 = tail call ptr @llvm.stacksave.p0()
  %15 = alloca double, i64 %13, align 16
  %16 = alloca double, i64 %13, align 16
  %17 = alloca double, i64 %13, align 16
  %18 = zext i32 %10 to i64
  %19 = alloca double, i64 %18, align 16
  call void @cf_physical_hessian(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  %20 = icmp sgt i32 %10, 0
  br i1 %20, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %4
  %21 = ptrtoint ptr %19 to i64
  %22 = getelementptr inbounds i8, ptr %0, i64 24
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %1, i64 96
  %25 = load double, ptr %24, align 8, !tbaa !15
  %min.iters.check = icmp ult i32 %10, 4
  %26 = ptrtoint ptr %23 to i64
  %27 = sub i64 %21, %26
  %diff.check = icmp ult i64 %27, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %18, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %28 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.prol
  %29 = load double, ptr %28, align 8, !tbaa !17
  %30 = fmul double %29, %25
  %31 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.prol
  store double %30, ptr %31, align 8, !tbaa !17
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !18

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %32 = sub nsw i64 %indvars.iv.ph, %18
  %33 = icmp ugt i64 %32, -4
  br i1 %33, label %.preheader, label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %18, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %25, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %34 = getelementptr inbounds double, ptr %23, i64 %index
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %wide.load = load <2 x double>, ptr %34, align 8, !tbaa !17
  %wide.load31 = load <2 x double>, ptr %35, align 8, !tbaa !17
  %36 = fmul <2 x double> %wide.load, %broadcast.splat
  %37 = fmul <2 x double> %wide.load31, %broadcast.splat
  %38 = getelementptr inbounds double, ptr %19, i64 %index
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  store <2 x double> %36, ptr %38, align 16, !tbaa !17
  store <2 x double> %37, ptr %39, align 16, !tbaa !17
  %index.next = add nuw i64 %index, 4
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %18
  br i1 %cmp.n, label %.preheader, label %scalar.ph.preheader

.preheader:                                       ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %4
  %41 = icmp sgt i32 %12, 0
  br i1 %41, label %.lr.ph22.preheader, label %._crit_edge

.lr.ph22.preheader:                               ; preds = %.preheader
  %min.iters.check34 = icmp ult i32 %12, 4
  br i1 %min.iters.check34, label %.lr.ph22.preheader48, label %vector.ph35

.lr.ph22.preheader48:                             ; preds = %middle.block32, %.lr.ph22.preheader
  %indvars.iv26.ph = phi i64 [ 0, %.lr.ph22.preheader ], [ %n.vec37, %middle.block32 ]
  br label %.lr.ph22

vector.ph35:                                      ; preds = %.lr.ph22.preheader
  %n.vec37 = and i64 %13, 2147483644
  br label %vector.body39

vector.body39:                                    ; preds = %vector.body39, %vector.ph35
  %index40 = phi i64 [ 0, %vector.ph35 ], [ %index.next45, %vector.body39 ]
  %42 = getelementptr inbounds double, ptr %17, i64 %index40
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %wide.load41 = load <2 x double>, ptr %42, align 16, !tbaa !17
  %wide.load42 = load <2 x double>, ptr %43, align 16, !tbaa !17
  %44 = getelementptr inbounds double, ptr %15, i64 %index40
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %wide.load43 = load <2 x double>, ptr %44, align 16, !tbaa !17
  %wide.load44 = load <2 x double>, ptr %45, align 16, !tbaa !17
  %46 = fadd <2 x double> %wide.load41, %wide.load43
  %47 = fadd <2 x double> %wide.load42, %wide.load44
  store <2 x double> %46, ptr %44, align 16, !tbaa !17
  store <2 x double> %47, ptr %45, align 16, !tbaa !17
  %index.next45 = add nuw i64 %index40, 4
  %48 = icmp eq i64 %index.next45, %n.vec37
  br i1 %48, label %middle.block32, label %vector.body39, !llvm.loop !24

middle.block32:                                   ; preds = %vector.body39
  %cmp.n46 = icmp eq i64 %n.vec37, %13
  br i1 %cmp.n46, label %._crit_edge, label %.lr.ph22.preheader48

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %49 = getelementptr inbounds double, ptr %23, i64 %indvars.iv
  %50 = load double, ptr %49, align 8, !tbaa !17
  %51 = fmul double %50, %25
  %52 = getelementptr inbounds double, ptr %19, i64 %indvars.iv
  store double %51, ptr %52, align 8, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next
  %54 = load double, ptr %53, align 8, !tbaa !17
  %55 = fmul double %54, %25
  %56 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next
  store double %55, ptr %56, align 8, !tbaa !17
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %57 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next.1
  %58 = load double, ptr %57, align 8, !tbaa !17
  %59 = fmul double %58, %25
  %60 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next.1
  store double %59, ptr %60, align 8, !tbaa !17
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %61 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next.2
  %62 = load double, ptr %61, align 8, !tbaa !17
  %63 = fmul double %62, %25
  %64 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next.2
  store double %63, ptr %64, align 8, !tbaa !17
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %18
  br i1 %exitcond.not.3, label %.preheader, label %scalar.ph, !llvm.loop !25

.lr.ph22:                                         ; preds = %.lr.ph22.preheader48, %.lr.ph22
  %indvars.iv26 = phi i64 [ %indvars.iv.next27, %.lr.ph22 ], [ %indvars.iv26.ph, %.lr.ph22.preheader48 ]
  %65 = getelementptr inbounds double, ptr %17, i64 %indvars.iv26
  %66 = load double, ptr %65, align 8, !tbaa !17
  %67 = getelementptr inbounds double, ptr %15, i64 %indvars.iv26
  %68 = load double, ptr %67, align 8, !tbaa !17
  %69 = fadd double %66, %68
  store double %69, ptr %67, align 8, !tbaa !17
  %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
  %exitcond30.not = icmp eq i64 %indvars.iv.next27, %13
  br i1 %exitcond30.not, label %._crit_edge, label %.lr.ph22, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph22, %middle.block32, %.preheader
  %70 = sext i32 %12 to i64
  %71 = shl nsw i64 %70, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %17, ptr nonnull align 16 %15, i64 %71, i1 false)
  call void @cf_diagonal_multiply(i32 noundef %11, i32 noundef %10, ptr noundef %15, ptr noundef %19)
  call void @dgemm_(ptr noundef nonnull @__c_T, ptr noundef nonnull @__c_N, ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %5, ptr noundef nonnull @__d_one, ptr noundef nonnull %17, ptr noundef nonnull %5, ptr noundef nonnull %15, ptr noundef nonnull %5, ptr noundef nonnull @__d_zero, ptr noundef nonnull %3, ptr noundef nonnull %6) #5
  call void @llvm.stackrestore.p0(ptr %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  ret i32 0
}

attributes #0 = { 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !11, i64 80}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !10, i64 24}
!15 = !{!16, !11, i64 96}
!16 = !{!"", !8, i64 0, !8, i64 24, !8, i64 48, !8, i64 80, !11, i64 96, !11, i64 104, !10, i64 112}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !21, !22, !23}
!25 = distinct !{!25, !21, !22}
!26 = distinct !{!26, !21, !23, !22}


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