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

; 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_convection_s = type { [2 x double], [2 x double], [2 x double] }
%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_affine_transformation(ptr noundef, ptr noundef, ptr noundef nonnull align 8, ptr noundef nonnull align 8) #0

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

; 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: nounwind uwtable
declare dso_local void @cf_supg_test_function_value(ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 8) #0

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

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

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

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) #5

; Function Attrs: nounwind uwtable
define dso_local i32 @cf_local_convection(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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca %struct.cf_convection_s, align 8
  %24 = alloca i32, align 4
  %25 = alloca %struct.cf_convection_s, align 8
  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
  %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
  %29 = call i32 @ipow(i32 noundef %28, i32 noundef 2)
  %30 = zext i32 %29 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !13
  store i32 %33, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 4, !tbaa !9
  store i32 %36, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %37 = load i32, ptr %10, align 4, !tbaa !14
  %38 = load i32, ptr %11, align 4, !tbaa !14
  %39 = mul nsw i32 %37, %38
  store i32 %39, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %40 = load i32, ptr %12, align 4, !tbaa !14
  %41 = zext i32 %40 to i64
  %42 = call ptr @llvm.stacksave.p0()
  store ptr %42, ptr %16, align 8
  %43 = alloca double, i64 %41, align 16
  store i64 %41, ptr %17, 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 %18, align 8
  %47 = load i32, ptr %12, align 4, !tbaa !14
  %48 = zext i32 %47 to i64
  %49 = alloca double, i64 %48, align 16
  store i64 %48, ptr %19, align 8
  %50 = load i32, ptr %12, align 4, !tbaa !14
  %51 = zext i32 %50 to i64
  %52 = alloca double, i64 %51, align 16
  store i64 %51, ptr %20, align 8
  %53 = load i32, ptr %12, align 4, !tbaa !14
  %54 = zext i32 %53 to i64
  %55 = alloca double, i64 %54, align 16
  store i64 %54, ptr %21, align 8
  %56 = load i32, ptr %10, align 4, !tbaa !14
  %57 = zext i32 %56 to i64
  %58 = alloca double, i64 %57, align 16
  store i64 %57, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !14
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  call void @cf_affine_transformation(ptr noundef %59, ptr noundef %60, ptr noundef %49, ptr noundef %52)
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  call void @cf_physical_gradients(ptr noundef %61, ptr noundef %62, ptr noundef %43, ptr noundef %46)
  store i32 0, ptr %9, align 4, !tbaa !14
  br label %63

63:                                               ; preds = %82, %4
  %64 = load i32, ptr %9, align 4, !tbaa !14
  %65 = load i32, ptr %10, align 4, !tbaa !14
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %85

67:                                               ; preds = %63
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %68, i32 0, i32 4
  %70 = load ptr, ptr %69, align 8, !tbaa !15
  %71 = load i32, ptr %9, align 4, !tbaa !14
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds double, ptr %70, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !16
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.cf_local_element_s, ptr %75, i32 0, i32 4
  %77 = load double, ptr %76, align 8, !tbaa !17
  %78 = fmul double %74, %77
  %79 = load i32, ptr %9, align 4, !tbaa !14
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %58, i64 %80
  store double %78, ptr %81, align 8, !tbaa !16
  br label %82

82:                                               ; preds = %67
  %83 = load i32, ptr %9, align 4, !tbaa !14
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %9, align 4, !tbaa !14
  br label %63, !llvm.loop !19

85:                                               ; preds = %63
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = icmp eq ptr %86, null
  br i1 %87, label %93, label %88

88:                                               ; preds = %85
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.cf_local_element_s, ptr %89, i32 0, i32 5
  %91 = load double, ptr %90, align 8, !tbaa !21
  %92 = fcmp oeq double %91, 0.000000e+00
  br i1 %92, label %93, label %100

93:                                               ; preds = %88, %85
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %94, i32 0, i32 5
  %96 = load ptr, ptr %95, align 8, !tbaa !22
  %97 = load i32, ptr %12, align 4, !tbaa !14
  %98 = sext i32 %97 to i64
  %99 = mul i64 8, %98
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %55, ptr align 8 %96, i64 %99, i1 false)
  br label %104

100:                                              ; preds = %88
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  call void @cf_supg_test_function_value(ptr noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %55)
  br label %104

104:                                              ; preds = %100, %93
  store i32 0, ptr %13, align 4, !tbaa !14
  br label %105

105:                                              ; preds = %153, %104
  %106 = load i32, ptr %13, align 4, !tbaa !14
  %107 = load i32, ptr %10, align 4, !tbaa !14
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %156

109:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 48, ptr %25) #6
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = load i32, ptr %13, align 4, !tbaa !14
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %49, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !16
  %115 = load i32, ptr %13, align 4, !tbaa !14
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds double, ptr %52, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !16
  call void %110(ptr dead_on_unwind writable sret(%struct.cf_convection_s) align 8 %25, double noundef %114, double noundef %118)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %25, i64 48, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 48, ptr %25) #6
  store i32 0, ptr %14, align 4, !tbaa !14
  br label %119

119:                                              ; preds = %149, %109
  %120 = load i32, ptr %14, align 4, !tbaa !14
  %121 = load i32, ptr %11, align 4, !tbaa !14
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %123, label %152

123:                                              ; preds = %119
  %124 = load i32, ptr %14, align 4, !tbaa !14
  %125 = load i32, ptr %10, align 4, !tbaa !14
  %126 = mul nsw i32 %124, %125
  %127 = load i32, ptr %13, align 4, !tbaa !14
  %128 = add nsw i32 %126, %127
  store i32 %128, ptr %15, align 4, !tbaa !14
  %129 = getelementptr inbounds %struct.cf_convection_s, ptr %23, i32 0, i32 0
  %130 = getelementptr inbounds [2 x double], ptr %129, i64 0, i64 0
  %131 = load double, ptr %130, align 8, !tbaa !16
  %132 = load i32, ptr %15, align 4, !tbaa !14
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds double, ptr %43, i64 %133
  %135 = load double, ptr %134, align 8, !tbaa !16
  %136 = fmul double %135, %131
  store double %136, ptr %134, align 8, !tbaa !16
  %137 = getelementptr inbounds %struct.cf_convection_s, ptr %23, i32 0, i32 0
  %138 = getelementptr inbounds [2 x double], ptr %137, i64 0, i64 1
  %139 = load double, ptr %138, align 8, !tbaa !16
  %140 = load i32, ptr %15, align 4, !tbaa !14
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds double, ptr %46, i64 %141
  %143 = load double, ptr %142, align 8, !tbaa !16
  %144 = load i32, ptr %15, align 4, !tbaa !14
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %43, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !16
  %148 = call double @llvm.fmuladd.f64(double %139, double %143, double %147)
  store double %148, ptr %146, align 8, !tbaa !16
  br label %149

149:                                              ; preds = %123
  %150 = load i32, ptr %14, align 4, !tbaa !14
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %14, align 4, !tbaa !14
  br label %119, !llvm.loop !25

152:                                              ; preds = %119
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %13, align 4, !tbaa !14
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %13, align 4, !tbaa !14
  br label %105, !llvm.loop !26

156:                                              ; preds = %105
  %157 = load i32, ptr %11, align 4, !tbaa !14
  %158 = load i32, ptr %10, align 4, !tbaa !14
  call void @cf_diagonal_multiply(i32 noundef %157, i32 noundef %158, ptr noundef %43, ptr noundef %58)
  %159 = 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 %43, ptr noundef %10, ptr noundef %55, ptr noundef %10, ptr noundef @__d_zero, ptr noundef %159, ptr noundef %11)
  %160 = load i32, ptr %24, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %23) #6
  %161 = load ptr, ptr %16, align 8
  call void @llvm.stackrestore.p0(ptr %161)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret i32 %160
}

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 speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 #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 = !{!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}
!22 = !{!10, !6, i64 32}
!23 = !{i64 0, i64 16, !24, i64 16, i64 16, !24, i64 32, i64 16, !24}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !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"

%struct.cf_convection_s = type { [2 x double], [2 x double], [2 x double] }

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

; 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: nounwind uwtable
declare dso_local void @cf_supg_test_function_value(ptr noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 8) local_unnamed_addr #0

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

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

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

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 #5

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @cf_local_convection(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 = alloca %struct.cf_convection_s, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = tail call i32 @ipow(i32 noundef %9, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %11 = load i32, ptr %0, align 8, !tbaa !12
  store i32 %11, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %12 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %12, ptr %6, align 4, !tbaa !13
  %13 = mul nsw i32 %12, %11
  %14 = zext i32 %13 to i64
  %15 = tail call ptr @llvm.stacksave.p0()
  %16 = alloca double, i64 %14, align 16
  %17 = alloca double, i64 %14, align 16
  %18 = alloca double, i64 %14, align 16
  %19 = alloca double, i64 %14, align 16
  %20 = alloca double, i64 %14, align 16
  %21 = zext i32 %11 to i64
  %22 = alloca double, i64 %21, align 16
  call void @cf_affine_transformation(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %18, ptr noundef %19)
  call void @cf_physical_gradients(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %16, ptr noundef %17)
  %23 = icmp sgt i32 %11, 0
  br i1 %23, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %4
  %24 = ptrtoint ptr %22 to i64
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  %26 = load ptr, ptr %25, align 8, !tbaa !14
  %27 = getelementptr inbounds i8, ptr %1, i64 96
  %28 = load double, ptr %27, align 8, !tbaa !15
  %min.iters.check = icmp ult i32 %11, 4
  %29 = ptrtoint ptr %26 to i64
  %30 = sub i64 %24, %29
  %diff.check = icmp ult i64 %30, 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 %21, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %28, 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 ]
  %31 = getelementptr inbounds double, ptr %26, i64 %index
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %wide.load = load <2 x double>, ptr %31, align 8, !tbaa !17
  %wide.load62 = load <2 x double>, ptr %32, align 8, !tbaa !17
  %33 = fmul <2 x double> %wide.load, %broadcast.splat
  %34 = fmul <2 x double> %wide.load62, %broadcast.splat
  %35 = getelementptr inbounds double, ptr %22, i64 %index
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store <2 x double> %33, ptr %35, align 16, !tbaa !17
  store <2 x double> %34, ptr %36, align 16, !tbaa !17
  %index.next = add nuw i64 %index, 4
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %21
  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 %21, 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 ]
  %38 = getelementptr inbounds double, ptr %26, i64 %indvars.iv.prol
  %39 = load double, ptr %38, align 8, !tbaa !17
  %40 = fmul double %39, %28
  %41 = getelementptr inbounds double, ptr %22, i64 %indvars.iv.prol
  store double %40, ptr %41, 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 ]
  %42 = sub nsw i64 %indvars.iv.ph, %21
  %43 = icmp ugt i64 %42, -4
  br i1 %43, 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 ]
  %44 = getelementptr inbounds double, ptr %26, i64 %indvars.iv
  %45 = load double, ptr %44, align 8, !tbaa !17
  %46 = fmul double %45, %28
  %47 = getelementptr inbounds double, ptr %22, i64 %indvars.iv
  store double %46, ptr %47, align 8, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = getelementptr inbounds double, ptr %26, i64 %indvars.iv.next
  %49 = load double, ptr %48, align 8, !tbaa !17
  %50 = fmul double %49, %28
  %51 = getelementptr inbounds double, ptr %22, i64 %indvars.iv.next
  store double %50, ptr %51, align 8, !tbaa !17
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %52 = getelementptr inbounds double, ptr %26, i64 %indvars.iv.next.1
  %53 = load double, ptr %52, align 8, !tbaa !17
  %54 = fmul double %53, %28
  %55 = getelementptr inbounds double, ptr %22, i64 %indvars.iv.next.1
  store double %54, ptr %55, align 8, !tbaa !17
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %56 = getelementptr inbounds double, ptr %26, i64 %indvars.iv.next.2
  %57 = load double, ptr %56, align 8, !tbaa !17
  %58 = fmul double %57, %28
  %59 = getelementptr inbounds double, ptr %22, i64 %indvars.iv.next.2
  store double %58, ptr %59, 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, %21
  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
  %60 = icmp eq ptr %2, null
  br i1 %60, label %65, label %61

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

65:                                               ; preds = %61, %._crit_edge
  %66 = getelementptr inbounds i8, ptr %0, i64 32
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = sext i32 %13 to i64
  %69 = shl nsw i64 %68, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %20, ptr align 8 %67, i64 %69, i1 false)
  br label %71

70:                                               ; preds = %61
  call void @cf_supg_test_function_value(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef %20)
  br label %71

71:                                               ; preds = %70, %65
  br i1 %23, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %71
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %72 = icmp sgt i32 %12, 0
  %.pre = zext nneg i32 %11 to i64
  %73 = zext nneg i32 %11 to i64
  %wide.trip.count57 = zext i32 %12 to i64
  %min.iters.check65 = icmp ugt i32 %12, 3
  %ident.check.not = icmp eq i32 %11, 1
  %or.cond83 = select i1 %min.iters.check65, i1 %ident.check.not, i1 false
  %n.vec68 = and i64 %wide.trip.count57, 2147483644
  %cmp.n81 = icmp eq i64 %n.vec68, %wide.trip.count57
  %xtraiter85 = and i64 %wide.trip.count57, 1
  %lcmp.mod86.not = icmp eq i64 %xtraiter85, 0
  %74 = add nsw i64 %wide.trip.count57, -1
  br label %75

75:                                               ; preds = %.lr.ph50, %._crit_edge47
  %indvars.iv59 = phi i64 [ 0, %.lr.ph50 ], [ %indvars.iv.next60, %._crit_edge47 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #7
  %76 = getelementptr inbounds double, ptr %18, i64 %indvars.iv59
  %77 = load double, ptr %76, align 8, !tbaa !17
  %78 = getelementptr inbounds double, ptr %19, i64 %indvars.iv59
  %79 = load double, ptr %78, align 8, !tbaa !17
  call void %2(ptr dead_on_unwind nonnull writable sret(%struct.cf_convection_s) align 8 %7, double noundef %77, double noundef %79) #7
  %.sroa.0.0.copyload = load double, ptr %7, align 8
  %.sroa.4.0.copyload = load double, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #7
  br i1 %72, label %.lr.ph46.preheader, label %._crit_edge47

.lr.ph46.preheader:                               ; preds = %75
  br i1 %or.cond83, label %vector.ph66, label %.lr.ph46.preheader84

vector.ph66:                                      ; preds = %.lr.ph46.preheader
  %broadcast.splatinsert74 = insertelement <2 x double> poison, double %.sroa.0.0.copyload, i64 0
  %broadcast.splat75 = shufflevector <2 x double> %broadcast.splatinsert74, <2 x double> poison, <2 x i32> zeroinitializer
  %broadcast.splatinsert78 = insertelement <2 x double> poison, double %.sroa.4.0.copyload, i64 0
  %broadcast.splat79 = shufflevector <2 x double> %broadcast.splatinsert78, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body70

vector.body70:                                    ; preds = %vector.body70, %vector.ph66
  %index71 = phi i64 [ 0, %vector.ph66 ], [ %index.next80, %vector.body70 ]
  %80 = add nuw nsw i64 %index71, %indvars.iv59
  %81 = getelementptr inbounds double, ptr %16, i64 %80
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %wide.load72 = load <2 x double>, ptr %81, align 8, !tbaa !17
  %wide.load73 = load <2 x double>, ptr %82, align 8, !tbaa !17
  %83 = fmul <2 x double> %broadcast.splat75, %wide.load72
  %84 = fmul <2 x double> %broadcast.splat75, %wide.load73
  %85 = getelementptr inbounds double, ptr %17, i64 %80
  %86 = getelementptr inbounds i8, ptr %85, i64 16
  %wide.load76 = load <2 x double>, ptr %85, align 8, !tbaa !17
  %wide.load77 = load <2 x double>, ptr %86, align 8, !tbaa !17
  %87 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat79, <2 x double> %wide.load76, <2 x double> %83)
  %88 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat79, <2 x double> %wide.load77, <2 x double> %84)
  store <2 x double> %87, ptr %81, align 8, !tbaa !17
  store <2 x double> %88, ptr %82, align 8, !tbaa !17
  %index.next80 = add nuw i64 %index71, 4
  %89 = icmp eq i64 %index.next80, %n.vec68
  br i1 %89, label %middle.block63, label %vector.body70, !llvm.loop !28

middle.block63:                                   ; preds = %vector.body70
  br i1 %cmp.n81, label %._crit_edge47, label %.lr.ph46.preheader84

.lr.ph46.preheader84:                             ; preds = %middle.block63, %.lr.ph46.preheader
  %indvars.iv54.ph = phi i64 [ 0, %.lr.ph46.preheader ], [ %n.vec68, %middle.block63 ]
  br i1 %lcmp.mod86.not, label %.lr.ph46.prol.loopexit, label %.lr.ph46.prol

.lr.ph46.prol:                                    ; preds = %.lr.ph46.preheader84
  %90 = mul nuw nsw i64 %indvars.iv54.ph, %73
  %91 = add nuw nsw i64 %90, %indvars.iv59
  %92 = getelementptr inbounds double, ptr %16, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !17
  %94 = fmul double %.sroa.0.0.copyload, %93
  %95 = getelementptr inbounds double, ptr %17, i64 %91
  %96 = load double, ptr %95, align 8, !tbaa !17
  %97 = call double @llvm.fmuladd.f64(double %.sroa.4.0.copyload, double %96, double %94)
  store double %97, ptr %92, align 8, !tbaa !17
  %indvars.iv.next55.prol = or disjoint i64 %indvars.iv54.ph, 1
  br label %.lr.ph46.prol.loopexit

.lr.ph46.prol.loopexit:                           ; preds = %.lr.ph46.prol, %.lr.ph46.preheader84
  %indvars.iv54.unr = phi i64 [ %indvars.iv54.ph, %.lr.ph46.preheader84 ], [ %indvars.iv.next55.prol, %.lr.ph46.prol ]
  %98 = icmp eq i64 %indvars.iv54.ph, %74
  br i1 %98, label %._crit_edge47, label %.lr.ph46

.lr.ph46:                                         ; preds = %.lr.ph46.prol.loopexit, %.lr.ph46
  %indvars.iv54 = phi i64 [ %indvars.iv.next55.1, %.lr.ph46 ], [ %indvars.iv54.unr, %.lr.ph46.prol.loopexit ]
  %99 = mul nuw nsw i64 %indvars.iv54, %73
  %100 = add nuw nsw i64 %99, %indvars.iv59
  %101 = getelementptr inbounds double, ptr %16, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !17
  %103 = fmul double %.sroa.0.0.copyload, %102
  %104 = getelementptr inbounds double, ptr %17, i64 %100
  %105 = load double, ptr %104, align 8, !tbaa !17
  %106 = call double @llvm.fmuladd.f64(double %.sroa.4.0.copyload, double %105, double %103)
  store double %106, ptr %101, align 8, !tbaa !17
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %107 = mul nuw nsw i64 %indvars.iv.next55, %73
  %108 = add nuw nsw i64 %107, %indvars.iv59
  %109 = getelementptr inbounds double, ptr %16, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !17
  %111 = fmul double %.sroa.0.0.copyload, %110
  %112 = getelementptr inbounds double, ptr %17, i64 %108
  %113 = load double, ptr %112, align 8, !tbaa !17
  %114 = call double @llvm.fmuladd.f64(double %.sroa.4.0.copyload, double %113, double %111)
  store double %114, ptr %109, align 8, !tbaa !17
  %indvars.iv.next55.1 = add nuw nsw i64 %indvars.iv54, 2
  %exitcond58.not.1 = icmp eq i64 %indvars.iv.next55.1, %wide.trip.count57
  br i1 %exitcond58.not.1, label %._crit_edge47, label %.lr.ph46, !llvm.loop !29

._crit_edge47:                                    ; preds = %.lr.ph46.prol.loopexit, %.lr.ph46, %middle.block63, %75
  %.pre-phi = phi i64 [ %.pre, %75 ], [ %73, %middle.block63 ], [ %73, %.lr.ph46 ], [ %73, %.lr.ph46.prol.loopexit ]
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %115 = icmp ult i64 %indvars.iv.next60, %.pre-phi
  br i1 %115, label %75, label %._crit_edge51, !llvm.loop !30

._crit_edge51:                                    ; preds = %._crit_edge47, %71
  call void @cf_diagonal_multiply(i32 noundef %12, i32 noundef %11, ptr noundef %16, ptr noundef %22)
  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 %20, ptr noundef nonnull %5, ptr noundef nonnull @__d_zero, ptr noundef nonnull %3, ptr noundef nonnull %6) #7
  call void @llvm.stackrestore.p0(ptr %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  ret i32 0
}

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

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 speculatable willreturn memory(none) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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}
!26 = !{!6, !10, i64 32}
!27 = !{!8, !8, i64 0}
!28 = distinct !{!28, !19, !20, !21}
!29 = distinct !{!29, !19, !20}
!30 = distinct !{!30, !19}


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