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

; 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_gradients(ptr noundef, ptr noundef, 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

; Function Attrs: nounwind uwtable
declare dso_local void @cf_supg_test_function_gradient(ptr noundef, ptr noundef, ptr noundef, ptr noalias noundef, ptr noalias noundef) #0

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_stiffness(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 i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = 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
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = call i32 @ipow(i32 noundef %22, i32 noundef 2)
  %24 = zext i32 %23 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !13
  store i32 %27, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %30, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %31 = load i32, ptr %10, align 4, !tbaa !14
  %32 = load i32, ptr %11, align 4, !tbaa !14
  %33 = mul nsw i32 %31, %32
  store i32 %33, ptr %12, align 4, !tbaa !14
  %34 = load i32, ptr %12, align 4, !tbaa !14
  %35 = zext i32 %34 to i64
  %36 = call ptr @llvm.stacksave.p0()
  store ptr %36, ptr %13, align 8
  %37 = alloca double, i64 %35, align 16
  store i64 %35, ptr %14, align 8
  %38 = load i32, ptr %12, align 4, !tbaa !14
  %39 = zext i32 %38 to i64
  %40 = alloca double, i64 %39, align 16
  store i64 %39, ptr %15, align 8
  %41 = load i32, ptr %12, align 4, !tbaa !14
  %42 = zext i32 %41 to i64
  %43 = alloca double, i64 %42, align 16
  store i64 %42, ptr %16, align 8
  %44 = load i32, ptr %12, align 4, !tbaa !14
  %45 = zext i32 %44 to i64
  %46 = alloca double, i64 %45, align 16
  store i64 %45, ptr %17, align 8
  %47 = load i32, ptr %10, align 4, !tbaa !14
  %48 = zext i32 %47 to i64
  %49 = alloca double, i64 %48, align 16
  store i64 %48, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !14
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  call void @cf_physical_gradients(ptr noundef %50, ptr noundef %51, ptr noundef %37, ptr noundef %40)
  store i32 0, ptr %9, align 4, !tbaa !14
  br label %52

52:                                               ; preds = %71, %4
  %53 = load i32, ptr %9, align 4, !tbaa !14
  %54 = load i32, ptr %10, align 4, !tbaa !14
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %56, label %74

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

71:                                               ; preds = %56
  %72 = load i32, ptr %9, align 4, !tbaa !14
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %9, align 4, !tbaa !14
  br label %52, !llvm.loop !19

74:                                               ; preds = %52
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = icmp eq ptr %75, null
  br i1 %76, label %82, label %77

77:                                               ; preds = %74
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.cf_local_element_s, ptr %78, i32 0, i32 5
  %80 = load double, ptr %79, align 8, !tbaa !21
  %81 = fcmp oeq double %80, 0.000000e+00
  br i1 %81, label %82, label %89

82:                                               ; preds = %77, %74
  %83 = load i32, ptr %12, align 4, !tbaa !14
  %84 = sext i32 %83 to i64
  %85 = mul i64 8, %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 16 %37, i64 %85, i1 false)
  %86 = load i32, ptr %12, align 4, !tbaa !14
  %87 = sext i32 %86 to i64
  %88 = mul i64 8, %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %46, ptr align 16 %40, i64 %88, i1 false)
  br label %93

89:                                               ; preds = %77
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  call void @cf_supg_test_function_gradient(ptr noundef %90, ptr noundef %91, ptr noundef %92, ptr noundef %43, ptr noundef %46)
  br label %93

93:                                               ; preds = %89, %82
  %94 = load i32, ptr %11, align 4, !tbaa !14
  %95 = load i32, ptr %10, align 4, !tbaa !14
  call void @cf_diagonal_multiply(i32 noundef %94, i32 noundef %95, ptr noundef %37, ptr noundef %49)
  %96 = load i32, ptr %11, align 4, !tbaa !14
  %97 = load i32, ptr %10, align 4, !tbaa !14
  call void @cf_diagonal_multiply(i32 noundef %96, i32 noundef %97, ptr noundef %40, ptr noundef %49)
  %98 = 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 %37, ptr noundef %10, ptr noundef %43, ptr noundef %10, ptr noundef @__d_zero, ptr noundef %98, ptr noundef %11)
  %99 = 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 %40, ptr noundef %10, ptr noundef %46, ptr noundef %10, ptr noundef @__d_one, ptr noundef %99, ptr noundef %11)
  %100 = load i32, ptr %19, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  %101 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %101)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  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 %100
}

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 = !{!18, !12, i64 104}


; 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_gradients(ptr noundef, ptr noundef, 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

; Function Attrs: nounwind uwtable
declare dso_local void @cf_supg_test_function_gradient(ptr noundef, ptr noundef, ptr noundef, ptr noalias noundef, ptr noalias noundef) local_unnamed_addr #0

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_stiffness(ptr noundef %0, ptr noundef %1, ptr noundef %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 nsw 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 = alloca double, i64 %13, align 16
  %19 = zext i32 %10 to i64
  %20 = alloca double, i64 %19, align 16
  call void @cf_physical_gradients(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %15, ptr noundef %16)
  %21 = icmp sgt i32 %10, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

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

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %19, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %26, 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 ]
  %29 = getelementptr inbounds double, ptr %24, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load = load <2 x double>, ptr %29, align 8, !tbaa !17
  %wide.load28 = load <2 x double>, ptr %30, align 8, !tbaa !17
  %31 = fmul <2 x double> %wide.load, %broadcast.splat
  %32 = fmul <2 x double> %wide.load28, %broadcast.splat
  %33 = getelementptr inbounds double, ptr %20, i64 %index
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  store <2 x double> %31, ptr %33, align 16, !tbaa !17
  store <2 x double> %32, ptr %34, align 16, !tbaa !17
  %index.next = add nuw i64 %index, 4
  %35 = icmp eq i64 %index.next, %n.vec
  br i1 %35, label %middle.block, label %vector.body, !llvm.loop !18

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

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %19, 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 ]
  %36 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.prol
  %37 = load double, ptr %36, align 8, !tbaa !17
  %38 = fmul double %37, %26
  %39 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.prol
  store double %38, ptr %39, 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 !22

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 ]
  %40 = sub nsw i64 %indvars.iv.ph, %19
  %41 = icmp ugt i64 %40, -4
  br i1 %41, label %._crit_edge, label %scalar.ph

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 ]
  %42 = getelementptr inbounds double, ptr %24, i64 %indvars.iv
  %43 = load double, ptr %42, align 8, !tbaa !17
  %44 = fmul double %43, %26
  %45 = getelementptr inbounds double, ptr %20, i64 %indvars.iv
  store double %44, ptr %45, align 8, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.next
  %47 = load double, ptr %46, align 8, !tbaa !17
  %48 = fmul double %47, %26
  %49 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.next
  store double %48, ptr %49, align 8, !tbaa !17
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %50 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.next.1
  %51 = load double, ptr %50, align 8, !tbaa !17
  %52 = fmul double %51, %26
  %53 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.next.1
  store double %52, ptr %53, align 8, !tbaa !17
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %54 = getelementptr inbounds double, ptr %24, i64 %indvars.iv.next.2
  %55 = load double, ptr %54, align 8, !tbaa !17
  %56 = fmul double %55, %26
  %57 = getelementptr inbounds double, ptr %20, i64 %indvars.iv.next.2
  store double %56, ptr %57, 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, %19
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !24

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %4
  %58 = icmp eq ptr %2, null
  br i1 %58, label %63, label %59

59:                                               ; preds = %._crit_edge
  %60 = getelementptr inbounds i8, ptr %1, i64 104
  %61 = load double, ptr %60, align 8, !tbaa !25
  %62 = fcmp oeq double %61, 0.000000e+00
  br i1 %62, label %63, label %66

63:                                               ; preds = %59, %._crit_edge
  %64 = sext i32 %12 to i64
  %65 = shl nsw i64 %64, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %17, ptr nonnull align 16 %15, i64 %65, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %18, ptr nonnull align 16 %16, i64 %65, i1 false)
  br label %67

66:                                               ; preds = %59
  call void @cf_supg_test_function_gradient(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %17, ptr noundef nonnull %18)
  br label %67

67:                                               ; preds = %66, %63
  call void @cf_diagonal_multiply(i32 noundef %11, i32 noundef %10, ptr noundef %15, ptr noundef %20)
  call void @cf_diagonal_multiply(i32 noundef %11, i32 noundef %10, ptr noundef %16, ptr noundef %20)
  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 %15, ptr noundef nonnull %5, ptr noundef nonnull %17, ptr noundef nonnull %5, ptr noundef nonnull @__d_zero, ptr noundef nonnull %3, ptr noundef nonnull %6) #5
  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 %16, ptr noundef nonnull %5, ptr noundef nonnull %18, ptr noundef nonnull %5, ptr noundef nonnull @__d_one, 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, !20, !21}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !19, !20}
!25 = !{!16, !11, i64 104}


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