; LLVM IR from moarseniy/CudaFEMproject :: FEMproject/fem_utils/src (cpu_fem_utils)

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

%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.7" }
%"struct.std::_Head_base.7" = type { ptr }
%class.ElementsData = type { ptr, i64, i64, i64, i64, i64, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.CGMData, ptr, ptr, ptr }
%struct.CGMData = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; 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 float @llvm.fmuladd.f32(float, float, float) #1

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

declare noundef i64 @_ZNK6Matrix11get_numRowsEv(ptr noundef nonnull align 8 dereferenceable(49)) #2

declare void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(49), i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49), i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49), i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16CPU_ElementsData13calculateDiagER6Matrixfffff(ptr noundef nonnull align 8 dereferenceable(336) %0, ptr noundef nonnull align 8 dereferenceable(49) %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::unique_ptr", align 8
  %18 = alloca %"class.std::unique_ptr", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::unique_ptr", align 8
  %22 = alloca %"class.std::unique_ptr", align 8
  %23 = alloca i64, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store float %2, ptr %10, align 4, !tbaa !9
  store float %3, ptr %11, align 4, !tbaa !9
  store float %4, ptr %12, align 4, !tbaa !9
  store float %5, ptr %13, align 4, !tbaa !9
  store float %6, ptr %14, align 4, !tbaa !9
  %24 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %134, %7
  %26 = load i64, ptr %15, align 8, !tbaa !11
  %27 = getelementptr inbounds %class.ElementsData, ptr %24, i32 0, i32 2
  %28 = load i64, ptr %27, align 8, !tbaa !13
  %29 = icmp ult i64 %26, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load i64, ptr %15, align 8, !tbaa !11
  call void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %17, ptr noundef nonnull align 8 dereferenceable(49) %32, i64 noundef %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %34 = getelementptr inbounds %class.ElementsData, ptr %24, i32 0, i32 20
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  %36 = load i64, ptr %15, align 8, !tbaa !11
  invoke void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %18, ptr noundef nonnull align 8 dereferenceable(49) %35, i64 noundef %36)
          to label %37 unwind label %59

37:                                               ; preds = %31
  %38 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %39 = getelementptr inbounds %class.ElementsData, ptr %24, i32 0, i32 1
  %40 = load i64, ptr %39, align 8, !tbaa !18
  %41 = sub i64 %40, 1
  %42 = mul i64 6, %41
  %43 = getelementptr inbounds %class.ElementsData, ptr %24, i32 0, i32 1
  %44 = load i64, ptr %43, align 8, !tbaa !18
  %45 = sub i64 %44, 1
  %46 = mul i64 6, %45
  %47 = load ptr, ptr %38, align 8, !tbaa !19
  %48 = getelementptr inbounds ptr, ptr %47, i64 26
  %49 = load ptr, ptr %48, align 8
  invoke void %49(ptr noundef nonnull align 8 dereferenceable(49) %38, i64 noundef %42, i64 noundef %46)
          to label %50 unwind label %63

50:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %51 = load float, ptr %10, align 4, !tbaa !9
  %52 = fcmp une float %51, 0.000000e+00
  br i1 %52, label %53, label %71

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %54 = getelementptr inbounds %class.ElementsData, ptr %24, i32 0, i32 33
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = load i64, ptr %15, align 8, !tbaa !11
  invoke void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %22, ptr noundef nonnull align 8 dereferenceable(49) %55, i64 noundef %56)
          to label %57 unwind label %67

57:                                               ; preds = %53
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %71

59:                                               ; preds = %31
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %19, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %20, align 4
  br label %139

63:                                               ; preds = %37
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %19, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %20, align 4
  br label %138

67:                                               ; preds = %53
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %19, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %137

71:                                               ; preds = %57, %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store i64 0, ptr %23, align 8, !tbaa !11
  br label %72

72:                                               ; preds = %130, %71
  %73 = load i64, ptr %23, align 8, !tbaa !11
  %74 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %75 = invoke noundef i64 @_ZNK6Matrix11get_numRowsEv(ptr noundef nonnull align 8 dereferenceable(49) %74)
          to label %76 unwind label %79

76:                                               ; preds = %72
  %77 = icmp ult i64 %73, %75
  br i1 %77, label %83, label %78

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

79:                                               ; preds = %117, %110, %103, %98, %89, %83, %72
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %19, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %137

83:                                               ; preds = %76
  %84 = load float, ptr %11, align 4, !tbaa !9
  %85 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %86 = load i64, ptr %23, align 8, !tbaa !11
  %87 = load i64, ptr %23, align 8, !tbaa !11
  %88 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %85, i64 noundef %86, i64 noundef %87)
          to label %89 unwind label %79

89:                                               ; preds = %83
  %90 = load float, ptr %88, align 4, !tbaa !9
  %91 = fmul float %84, %90
  %92 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %93 = load i64, ptr %23, align 8, !tbaa !11
  %94 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %92, i64 noundef %93)
          to label %95 unwind label %79

95:                                               ; preds = %89
  store float %91, ptr %94, align 4, !tbaa !9
  %96 = load float, ptr %10, align 4, !tbaa !9
  %97 = fcmp une float %96, 0.000000e+00
  br i1 %97, label %98, label %129

98:                                               ; preds = %95
  %99 = load float, ptr %10, align 4, !tbaa !9
  %100 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %101 = load i64, ptr %23, align 8, !tbaa !11
  %102 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %100, i64 noundef %101)
          to label %103 unwind label %79

103:                                              ; preds = %98
  %104 = load float, ptr %102, align 4, !tbaa !9
  %105 = load float, ptr %12, align 4, !tbaa !9
  %106 = load float, ptr %13, align 4, !tbaa !9
  %107 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %108 = load i64, ptr %23, align 8, !tbaa !11
  %109 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %107, i64 noundef %108)
          to label %110 unwind label %79

110:                                              ; preds = %103
  %111 = load float, ptr %109, align 4, !tbaa !9
  %112 = load float, ptr %14, align 4, !tbaa !9
  %113 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %114 = load i64, ptr %23, align 8, !tbaa !11
  %115 = load i64, ptr %23, align 8, !tbaa !11
  %116 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %113, i64 noundef %114, i64 noundef %115)
          to label %117 unwind label %79

117:                                              ; preds = %110
  %118 = load float, ptr %116, align 4, !tbaa !9
  %119 = fmul float %112, %118
  %120 = call float @llvm.fmuladd.f32(float %106, float %111, float %119)
  %121 = fmul float %105, %120
  %122 = call float @llvm.fmuladd.f32(float %99, float %104, float %121)
  %123 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %124 = load i64, ptr %23, align 8, !tbaa !11
  %125 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %123, i64 noundef %124)
          to label %126 unwind label %79

126:                                              ; preds = %117
  %127 = load float, ptr %125, align 4, !tbaa !9
  %128 = fadd float %127, %122
  store float %128, ptr %125, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %126, %95
  br label %130

130:                                              ; preds = %129
  %131 = load i64, ptr %23, align 8, !tbaa !11
  %132 = add i64 %131, 1
  store i64 %132, ptr %23, align 8, !tbaa !11
  br label %72, !llvm.loop !22

133:                                              ; preds = %78
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %134

134:                                              ; preds = %133
  %135 = load i64, ptr %15, align 8, !tbaa !11
  %136 = add i64 %135, 1
  store i64 %136, ptr %15, align 8, !tbaa !11
  br label %25, !llvm.loop !24

137:                                              ; preds = %79, %67
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %138

138:                                              ; preds = %137, %63
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br label %139

139:                                              ; preds = %138, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %141

140:                                              ; preds = %30
  ret void

141:                                              ; preds = %139
  %142 = load ptr, ptr %19, align 8
  %143 = load i32, ptr %20, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"_ZTS12ElementsData", !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !15, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !16, i64 256, !6, i64 312, !6, i64 320, !6, i64 328}
!15 = !{!"_ZTS11DEVICE_NAME", !7, i64 0}
!16 = !{!"_ZTS7CGMData", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!17 = !{!14, !6, i64 160}
!18 = !{!14, !12, i64 8}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !8, i64 0}
!21 = !{!14, !6, i64 312}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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

%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.7" }
%"struct.std::_Head_base.7" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

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

declare noundef i64 @_ZNK6Matrix11get_numRowsEv(ptr noundef nonnull align 8 dereferenceable(49)) local_unnamed_addr #2

declare void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(49), i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49), i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

declare noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49), i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16CPU_ElementsData13calculateDiagER6Matrixfffff(ptr nocapture noundef nonnull readonly align 8 dereferenceable(336) %0, ptr noundef nonnull align 8 dereferenceable(49) %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"class.std::unique_ptr", align 8
  %9 = alloca %"class.std::unique_ptr", align 8
  %10 = alloca %"class.std::unique_ptr", align 8
  %11 = alloca %"class.std::unique_ptr", align 8
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %14 = getelementptr inbounds i8, ptr %0, i64 160
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = fcmp une float %2, 0.000000e+00
  %17 = getelementptr inbounds i8, ptr %0, i64 312
  br i1 %16, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.split37.us.us
  %.02938.us = phi i64 [ %66, %.split37.us.us ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %8, ptr noundef nonnull align 8 dereferenceable(49) %1, i64 noundef %.02938.us)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %18 = load ptr, ptr %14, align 8, !tbaa !13
  invoke void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %9, ptr noundef nonnull align 8 dereferenceable(49) %18, i64 noundef %.02938.us)
          to label %19 unwind label %.split40.us

19:                                               ; preds = %.lr.ph.split.us
  %20 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %21 = load i64, ptr %15, align 8, !tbaa !14
  %22 = mul i64 %21, 6
  %23 = add i64 %22, -6
  %24 = load ptr, ptr %20, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %24, i64 208
  %26 = load ptr, ptr %25, align 8
  invoke void %26(ptr noundef nonnull align 8 dereferenceable(49) %20, i64 noundef %23, i64 noundef %23)
          to label %27 unwind label %.split43.us

27:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %28 = load ptr, ptr %17, align 8, !tbaa !17
  invoke void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %11, ptr noundef nonnull align 8 dereferenceable(49) %28, i64 noundef %.02938.us)
          to label %.split.us.us unwind label %.split46.us

.split.us.us:                                     ; preds = %27
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %30

30:                                               ; preds = %58, %.split.us.us
  %.0.us.us = phi i64 [ 0, %.split.us.us ], [ %65, %58 ]
  %31 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %32 = invoke noundef i64 @_ZNK6Matrix11get_numRowsEv(ptr noundef nonnull align 8 dereferenceable(49) %31)
          to label %33 unwind label %.split35.us.split.us

33:                                               ; preds = %30
  %34 = icmp ult i64 %.0.us.us, %32
  br i1 %34, label %35, label %.split37.us.us

35:                                               ; preds = %33
  %36 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %36, i64 noundef %.0.us.us, i64 noundef %.0.us.us)
          to label %38 unwind label %.split35.us.split.us

38:                                               ; preds = %35
  %39 = load float, ptr %37, align 4, !tbaa !18
  %40 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %41 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %40, i64 noundef %.0.us.us)
          to label %42 unwind label %.split35.us.split.us

42:                                               ; preds = %38
  %43 = fmul float %39, %3
  store float %43, ptr %41, align 4, !tbaa !18
  %44 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %45 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %44, i64 noundef %.0.us.us)
          to label %46 unwind label %.split35.us.split.us

46:                                               ; preds = %42
  %47 = load float, ptr %45, align 4, !tbaa !18
  %48 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %49 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %48, i64 noundef %.0.us.us)
          to label %50 unwind label %.split35.us.split.us

50:                                               ; preds = %46
  %51 = load float, ptr %49, align 4, !tbaa !18
  %52 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %53 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %52, i64 noundef %.0.us.us, i64 noundef %.0.us.us)
          to label %54 unwind label %.split35.us.split.us

54:                                               ; preds = %50
  %55 = load float, ptr %53, align 4, !tbaa !18
  %56 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %57 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %56, i64 noundef %.0.us.us)
          to label %58 unwind label %.split35.us.split.us

58:                                               ; preds = %54
  %59 = fmul float %55, %6
  %60 = call float @llvm.fmuladd.f32(float %5, float %51, float %59)
  %61 = fmul float %60, %4
  %62 = call float @llvm.fmuladd.f32(float %2, float %47, float %61)
  %63 = load float, ptr %57, align 4, !tbaa !18
  %64 = fadd float %62, %63
  store float %64, ptr %57, align 4, !tbaa !18
  %65 = add nuw i64 %.0.us.us, 1
  br label %30, !llvm.loop !20

.split37.us.us:                                   ; preds = %33
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %66 = add nuw i64 %.02938.us, 1
  %67 = load i64, ptr %12, align 8, !tbaa !5
  %68 = icmp ult i64 %66, %67
  br i1 %68, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !22

.split40.us:                                      ; preds = %.lr.ph.split.us
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %105

.split43.us:                                      ; preds = %19
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %104

.split46.us:                                      ; preds = %27
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %103

.split35.us.split.us:                             ; preds = %54, %50, %46, %42, %38, %35, %30
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %103

._crit_edge:                                      ; preds = %.split37, %.split37.us.us, %7
  ret void

.lr.ph.split:                                     ; preds = %.lr.ph, %.split37
  %.02938 = phi i64 [ %89, %.split37 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %8, ptr noundef nonnull align 8 dereferenceable(49) %1, i64 noundef %.02938)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %73 = load ptr, ptr %14, align 8, !tbaa !13
  invoke void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %9, ptr noundef nonnull align 8 dereferenceable(49) %73, i64 noundef %.02938)
          to label %74 unwind label %.split40

74:                                               ; preds = %.lr.ph.split
  %75 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %76 = load i64, ptr %15, align 8, !tbaa !14
  %77 = mul i64 %76, 6
  %78 = add i64 %77, -6
  %79 = load ptr, ptr %75, align 8, !tbaa !15
  %80 = getelementptr inbounds i8, ptr %79, i64 208
  %81 = load ptr, ptr %80, align 8
  invoke void %81(ptr noundef nonnull align 8 dereferenceable(49) %75, i64 noundef %78, i64 noundef %78)
          to label %.split unwind label %.split43

.split:                                           ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br label %84

.split40:                                         ; preds = %.lr.ph.split
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %105

.split43:                                         ; preds = %74
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %104

84:                                               ; preds = %100, %.split
  %.0 = phi i64 [ 0, %.split ], [ %102, %100 ]
  %85 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %86 = invoke noundef i64 @_ZNK6Matrix11get_numRowsEv(ptr noundef nonnull align 8 dereferenceable(49) %85)
          to label %87 unwind label %.split35

87:                                               ; preds = %84
  %88 = icmp ult i64 %.0, %86
  br i1 %88, label %93, label %.split37

.split37:                                         ; preds = %87
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %89 = add nuw i64 %.02938, 1
  %90 = load i64, ptr %12, align 8, !tbaa !5
  %91 = icmp ult i64 %89, %90
  br i1 %91, label %.lr.ph.split, label %._crit_edge, !llvm.loop !22

.split35:                                         ; preds = %96, %93, %84
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %103

93:                                               ; preds = %87
  %94 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %95 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %94, i64 noundef %.0, i64 noundef %.0)
          to label %96 unwind label %.split35

96:                                               ; preds = %93
  %97 = load float, ptr %95, align 4, !tbaa !18
  %98 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %99 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %98, i64 noundef %.0)
          to label %100 unwind label %.split35

100:                                              ; preds = %96
  %101 = fmul float %97, %3
  store float %101, ptr %99, align 4, !tbaa !18
  %102 = add nuw i64 %.0, 1
  br label %84, !llvm.loop !20

103:                                              ; preds = %.split35, %.split35.us.split.us, %.split46.us
  %.pn = phi { ptr, i32 } [ %71, %.split46.us ], [ %92, %.split35 ], [ %72, %.split35.us.split.us ]
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %104

104:                                              ; preds = %.split43, %.split43.us, %103
  %.pn.pn = phi { ptr, i32 } [ %.pn, %103 ], [ %83, %.split43 ], [ %70, %.split43.us ]
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %105

105:                                              ; preds = %.split40, %.split40.us, %104
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %104 ], [ %82, %.split40 ], [ %69, %.split40.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 16}
!6 = !{!"_ZTS12ElementsData", !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !12, i64 256, !11, i64 312, !11, i64 320, !11, i64 328}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS11DEVICE_NAME", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTS7CGMData", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!13 = !{!6, !11, i64 160}
!14 = !{!6, !7, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !9, i64 0}
!17 = !{!6, !11, i64 312}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass