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

; 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(...)

declare noundef i64 @_ZNK6Matrix15get_numElementsEv(ptr noundef nonnull align 8 dereferenceable(49)) #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

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

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

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

; 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)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16CPU_ElementsData16applyConstraintsEv(ptr noundef nonnull align 8 dereferenceable(336) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::unique_ptr", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %204, %1
  %15 = load i64, ptr %3, align 8, !tbaa !9
  %16 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 2
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = icmp ult i64 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %208

20:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %21 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 20
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = load i64, ptr %3, align 8, !tbaa !9
  call void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %5, ptr noundef nonnull align 8 dereferenceable(49) %22, i64 noundef %23)
  %24 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %25 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %26 = load i64, ptr %25, align 8, !tbaa !16
  %27 = sub i64 %26, 1
  %28 = mul i64 6, %27
  %29 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %30 = load i64, ptr %29, align 8, !tbaa !16
  %31 = sub i64 %30, 1
  %32 = mul i64 6, %31
  %33 = load ptr, ptr %24, align 8, !tbaa !17
  %34 = getelementptr inbounds ptr, ptr %33, i64 26
  %35 = load ptr, ptr %34, align 8
  invoke void %35(ptr noundef nonnull align 8 dereferenceable(49) %24, i64 noundef %28, i64 noundef %32)
          to label %36 unwind label %45

36:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %199, %36
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 9
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = invoke noundef i64 @_ZNK6Matrix15get_numElementsEv(ptr noundef nonnull align 8 dereferenceable(49) %40)
          to label %42 unwind label %49

42:                                               ; preds = %37
  %43 = icmp ult i64 %38, %41
  br i1 %43, label %53, label %44

44:                                               ; preds = %42
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %203

45:                                               ; preds = %20
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %6, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %7, align 4
  br label %207

49:                                               ; preds = %37
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %6, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %7, align 4
  br label %202

53:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %195, %53
  %55 = load i64, ptr %9, align 8, !tbaa !9
  %56 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !16
  %58 = add i64 %57, 1
  %59 = icmp ult i64 %55, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %54
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %198

61:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %191, %61
  %63 = load i64, ptr %10, align 8, !tbaa !9
  %64 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !16
  %66 = add i64 %65, 1
  %67 = icmp ult i64 %63, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %194

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %187, %69
  %71 = load i64, ptr %11, align 8, !tbaa !9
  %72 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !16
  %74 = icmp ult i64 %71, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %190

76:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %77

77:                                               ; preds = %183, %76
  %78 = load i64, ptr %12, align 8, !tbaa !9
  %79 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %80 = load i64, ptr %79, align 8, !tbaa !16
  %81 = icmp ult i64 %78, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %77
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %186

83:                                               ; preds = %77
  %84 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %85 = load i64, ptr %84, align 8, !tbaa !16
  %86 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 7
  %87 = load ptr, ptr %86, align 8, !tbaa !20
  %88 = load i64, ptr %3, align 8, !tbaa !9
  %89 = load i64, ptr %9, align 8, !tbaa !9
  %90 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %87, i64 noundef %88, i64 noundef %89)
          to label %91 unwind label %177

91:                                               ; preds = %83
  %92 = load float, ptr %90, align 4, !tbaa !21
  %93 = fptosi float %92 to i32
  %94 = sext i32 %93 to i64
  %95 = mul i64 %85, %94
  %96 = load i64, ptr %11, align 8, !tbaa !9
  %97 = add i64 %95, %96
  %98 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 9
  %99 = load ptr, ptr %98, align 8, !tbaa !19
  %100 = load i64, ptr %8, align 8, !tbaa !9
  %101 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %99, i64 noundef %100)
          to label %102 unwind label %177

102:                                              ; preds = %91
  %103 = load float, ptr %101, align 4, !tbaa !21
  %104 = fptosi float %103 to i32
  %105 = sext i32 %104 to i64
  %106 = icmp eq i64 %97, %105
  br i1 %106, label %131, label %107

107:                                              ; preds = %102
  %108 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %109 = load i64, ptr %108, align 8, !tbaa !16
  %110 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 7
  %111 = load ptr, ptr %110, align 8, !tbaa !20
  %112 = load i64, ptr %3, align 8, !tbaa !9
  %113 = load i64, ptr %10, align 8, !tbaa !9
  %114 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %111, i64 noundef %112, i64 noundef %113)
          to label %115 unwind label %177

115:                                              ; preds = %107
  %116 = load float, ptr %114, align 4, !tbaa !21
  %117 = fptosi float %116 to i32
  %118 = sext i32 %117 to i64
  %119 = mul i64 %109, %118
  %120 = load i64, ptr %12, align 8, !tbaa !9
  %121 = add i64 %119, %120
  %122 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 9
  %123 = load ptr, ptr %122, align 8, !tbaa !19
  %124 = load i64, ptr %8, align 8, !tbaa !9
  %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 %177

126:                                              ; preds = %115
  %127 = load float, ptr %125, align 4, !tbaa !21
  %128 = fptosi float %127 to i32
  %129 = sext i32 %128 to i64
  %130 = icmp eq i64 %121, %129
  br i1 %130, label %131, label %182

131:                                              ; preds = %126, %102
  %132 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %133 = load i64, ptr %132, align 8, !tbaa !16
  %134 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 7
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  %136 = load i64, ptr %3, align 8, !tbaa !9
  %137 = load i64, ptr %9, align 8, !tbaa !9
  %138 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %135, i64 noundef %136, i64 noundef %137)
          to label %139 unwind label %177

139:                                              ; preds = %131
  %140 = load float, ptr %138, align 4, !tbaa !21
  %141 = fptosi float %140 to i32
  %142 = sext i32 %141 to i64
  %143 = mul i64 %133, %142
  %144 = load i64, ptr %11, align 8, !tbaa !9
  %145 = add i64 %143, %144
  %146 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %147 = load i64, ptr %146, align 8, !tbaa !16
  %148 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 7
  %149 = load ptr, ptr %148, align 8, !tbaa !20
  %150 = load i64, ptr %3, align 8, !tbaa !9
  %151 = load i64, ptr %10, align 8, !tbaa !9
  %152 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %149, i64 noundef %150, i64 noundef %151)
          to label %153 unwind label %177

153:                                              ; preds = %139
  %154 = load float, ptr %152, align 4, !tbaa !21
  %155 = fptosi float %154 to i32
  %156 = sext i32 %155 to i64
  %157 = mul i64 %147, %156
  %158 = load i64, ptr %12, align 8, !tbaa !9
  %159 = add i64 %157, %158
  %160 = icmp ne i64 %145, %159
  br i1 %160, label %161, label %181

161:                                              ; preds = %153
  %162 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  %163 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %164 = load i64, ptr %163, align 8, !tbaa !16
  %165 = load i64, ptr %9, align 8, !tbaa !9
  %166 = mul i64 %164, %165
  %167 = load i64, ptr %11, align 8, !tbaa !9
  %168 = add i64 %166, %167
  %169 = getelementptr inbounds %class.ElementsData, ptr %13, i32 0, i32 1
  %170 = load i64, ptr %169, align 8, !tbaa !16
  %171 = load i64, ptr %10, align 8, !tbaa !9
  %172 = mul i64 %170, %171
  %173 = load i64, ptr %12, align 8, !tbaa !9
  %174 = add i64 %172, %173
  %175 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %162, i64 noundef %168, i64 noundef %174)
          to label %176 unwind label %177

176:                                              ; preds = %161
  store float 0.000000e+00, ptr %175, align 4, !tbaa !21
  br label %181

177:                                              ; preds = %161, %139, %131, %115, %107, %91, %83
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %6, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %202

181:                                              ; preds = %176, %153
  br label %182

182:                                              ; preds = %181, %126
  br label %183

183:                                              ; preds = %182
  %184 = load i64, ptr %12, align 8, !tbaa !9
  %185 = add i64 %184, 1
  store i64 %185, ptr %12, align 8, !tbaa !9
  br label %77, !llvm.loop !23

186:                                              ; preds = %82
  br label %187

187:                                              ; preds = %186
  %188 = load i64, ptr %11, align 8, !tbaa !9
  %189 = add i64 %188, 1
  store i64 %189, ptr %11, align 8, !tbaa !9
  br label %70, !llvm.loop !25

190:                                              ; preds = %75
  br label %191

191:                                              ; preds = %190
  %192 = load i64, ptr %10, align 8, !tbaa !9
  %193 = add i64 %192, 1
  store i64 %193, ptr %10, align 8, !tbaa !9
  br label %62, !llvm.loop !26

194:                                              ; preds = %68
  br label %195

195:                                              ; preds = %194
  %196 = load i64, ptr %9, align 8, !tbaa !9
  %197 = add i64 %196, 1
  store i64 %197, ptr %9, align 8, !tbaa !9
  br label %54, !llvm.loop !27

198:                                              ; preds = %60
  br label %199

199:                                              ; preds = %198
  %200 = load i64, ptr %8, align 8, !tbaa !9
  %201 = add i64 %200, 1
  store i64 %201, ptr %8, align 8, !tbaa !9
  br label %37, !llvm.loop !28

202:                                              ; preds = %177, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %207

203:                                              ; preds = %44
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %204

204:                                              ; preds = %203
  %205 = load i64, ptr %3, align 8, !tbaa !9
  %206 = add i64 %205, 1
  store i64 %206, ptr %3, align 8, !tbaa !9
  br label %14, !llvm.loop !29

207:                                              ; preds = %202, %45
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %209

208:                                              ; preds = %19
  ret void

209:                                              ; preds = %207
  %210 = load ptr, ptr %6, align 8
  %211 = load i32, ptr %7, align 4
  %212 = insertvalue { ptr, i32 } poison, ptr %210, 0
  %213 = insertvalue { ptr, i32 } %212, i32 %211, 1
  resume { ptr, i32 } %213
}

attributes #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 = { 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 #3 = { 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 #4 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS12ElementsData", !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !13, 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, !14, i64 256, !6, i64 312, !6, i64 320, !6, i64 328}
!13 = !{!"_ZTS11DEVICE_NAME", !7, i64 0}
!14 = !{!"_ZTS7CGMData", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!12, !6, i64 160}
!16 = !{!12, !10, i64 8}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!12, !6, i64 72}
!20 = !{!12, !6, i64 56}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = distinct !{!29, !24}


; 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(...)

declare noundef i64 @_ZNK6Matrix15get_numElementsEv(ptr noundef nonnull align 8 dereferenceable(49)) 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 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 #0

; 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 #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16CPU_ElementsData16applyConstraintsEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(336) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::unique_ptr", align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %.not61 = icmp eq i64 %4, 0
  br i1 %.not61, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = getelementptr inbounds i8, ptr %0, i64 72
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  br label %9

._crit_edge60:                                    ; preds = %23, %1
  ret void

9:                                                ; preds = %.lr.ph59, %23
  %.04057 = phi i64 [ 0, %.lr.ph59 ], [ %24, %23 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %10 = load ptr, ptr %5, align 8, !tbaa !13
  call void @_ZNK6Matrix6getRowEm(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %2, ptr noundef nonnull align 8 dereferenceable(49) %10, i64 noundef %.04057)
  %11 = call noundef ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %12 = load i64, ptr %6, align 8, !tbaa !14
  %13 = mul i64 %12, 6
  %14 = add i64 %13, -6
  %15 = load ptr, ptr %11, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %15, i64 208
  %17 = load ptr, ptr %16, align 8
  invoke void %17(ptr noundef nonnull align 8 dereferenceable(49) %11, i64 noundef %14, i64 noundef %14)
          to label %.preheader47 unwind label %27

.preheader47:                                     ; preds = %9, %._crit_edge56
  %.036 = phi i64 [ %32, %._crit_edge56 ], [ 0, %9 ]
  %18 = load ptr, ptr %7, align 8, !tbaa !17
  %19 = invoke noundef i64 @_ZNK6Matrix15get_numElementsEv(ptr noundef nonnull align 8 dereferenceable(49) %18)
          to label %20 unwind label %29

20:                                               ; preds = %.preheader47
  %21 = icmp ult i64 %.036, %19
  br i1 %21, label %.preheader46, label %23

.preheader46:                                     ; preds = %20
  %22 = load i64, ptr %6, align 8, !tbaa !14
  %.not62 = icmp eq i64 %22, -1
  br i1 %.not62, label %._crit_edge56, label %.preheader44.lr.ph

23:                                               ; preds = %20
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %24 = add nuw i64 %.04057, 1
  %25 = load i64, ptr %3, align 8, !tbaa !5
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %9, label %._crit_edge60, !llvm.loop !18

27:                                               ; preds = %9
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %111

29:                                               ; preds = %.preheader47
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %111

.preheader44.lr.ph:                               ; preds = %.preheader46, %._crit_edge53
  %31 = phi i64 [ %34, %._crit_edge53 ], [ %22, %.preheader46 ]
  %.03554 = phi i64 [ %35, %._crit_edge53 ], [ 0, %.preheader46 ]
  %.not64 = icmp eq i64 %31, 0
  br i1 %.not64, label %._crit_edge53, label %.preheader.preheader

._crit_edge56:                                    ; preds = %._crit_edge53, %.preheader46
  %32 = add i64 %.036, 1
  br label %.preheader47, !llvm.loop !20

.preheader.preheader:                             ; preds = %.preheader44.lr.ph, %._crit_edge50
  %33 = phi i64 [ %109, %._crit_edge50 ], [ %31, %.preheader44.lr.ph ]
  %.03451 = phi i64 [ %39, %._crit_edge50 ], [ 0, %.preheader44.lr.ph ]
  br label %.lr.ph.preheader

._crit_edge53:                                    ; preds = %._crit_edge50, %.preheader44.lr.ph
  %34 = phi i64 [ 0, %.preheader44.lr.ph ], [ %109, %._crit_edge50 ]
  %35 = add nuw i64 %.03554, 1
  %36 = add i64 %34, 1
  %37 = icmp ult i64 %35, %36
  br i1 %37, label %.preheader44.lr.ph, label %._crit_edge56, !llvm.loop !21

.lr.ph.preheader:                                 ; preds = %._crit_edge, %.preheader.preheader
  %38 = phi i64 [ %109, %._crit_edge ], [ %33, %.preheader.preheader ]
  %.03349 = phi i64 [ %42, %._crit_edge ], [ 0, %.preheader.preheader ]
  br label %.lr.ph

._crit_edge50:                                    ; preds = %._crit_edge
  %39 = add nuw i64 %.03451, 1
  %40 = add i64 %109, 1
  %41 = icmp ult i64 %39, %40
  br i1 %41, label %.preheader.preheader, label %._crit_edge53, !llvm.loop !22

._crit_edge:                                      ; preds = %107
  %42 = add nuw i64 %.03349, 1
  %43 = icmp ult i64 %42, %109
  br i1 %43, label %.lr.ph.preheader, label %._crit_edge50, !llvm.loop !24

.lr.ph:                                           ; preds = %.lr.ph.preheader, %107
  %44 = phi i64 [ %109, %107 ], [ %38, %.lr.ph.preheader ]
  %.048 = phi i64 [ %108, %107 ], [ 0, %.lr.ph.preheader ]
  %45 = load ptr, ptr %8, align 8, !tbaa !25
  %46 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %45, i64 noundef %.04057, i64 noundef %.03554)
          to label %47 unwind label %105

47:                                               ; preds = %.lr.ph
  %48 = load float, ptr %46, align 4, !tbaa !26
  %49 = load ptr, ptr %7, align 8, !tbaa !17
  %50 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %49, i64 noundef %.036)
          to label %51 unwind label %105

51:                                               ; preds = %47
  %52 = fptosi float %48 to i32
  %53 = sext i32 %52 to i64
  %54 = mul i64 %44, %53
  %55 = add i64 %54, %.03349
  %56 = load float, ptr %50, align 4, !tbaa !26
  %57 = fptosi float %56 to i32
  %58 = sext i32 %57 to i64
  %59 = icmp eq i64 %55, %58
  br i1 %59, label %77, label %60

60:                                               ; preds = %51
  %61 = load i64, ptr %6, align 8, !tbaa !14
  %62 = load ptr, ptr %8, align 8, !tbaa !25
  %63 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %62, i64 noundef %.04057, i64 noundef %.03451)
          to label %64 unwind label %105

64:                                               ; preds = %60
  %65 = load float, ptr %63, align 4, !tbaa !26
  %66 = load ptr, ptr %7, align 8, !tbaa !17
  %67 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixixEm(ptr noundef nonnull align 8 dereferenceable(49) %66, i64 noundef %.036)
          to label %68 unwind label %105

68:                                               ; preds = %64
  %69 = fptosi float %65 to i32
  %70 = sext i32 %69 to i64
  %71 = mul i64 %61, %70
  %72 = add i64 %71, %.048
  %73 = load float, ptr %67, align 4, !tbaa !26
  %74 = fptosi float %73 to i32
  %75 = sext i32 %74 to i64
  %76 = icmp eq i64 %72, %75
  br i1 %76, label %77, label %107

77:                                               ; preds = %68, %51
  %78 = load i64, ptr %6, align 8, !tbaa !14
  %79 = load ptr, ptr %8, align 8, !tbaa !25
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %79, i64 noundef %.04057, i64 noundef %.03554)
          to label %81 unwind label %105

81:                                               ; preds = %77
  %82 = load float, ptr %80, align 4, !tbaa !26
  %83 = load i64, ptr %6, align 8, !tbaa !14
  %84 = load ptr, ptr %8, align 8, !tbaa !25
  %85 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %84, i64 noundef %.04057, i64 noundef %.03451)
          to label %86 unwind label %105

86:                                               ; preds = %81
  %87 = fptosi float %82 to i32
  %88 = sext i32 %87 to i64
  %89 = mul i64 %78, %88
  %90 = add i64 %89, %.03349
  %91 = load float, ptr %85, align 4, !tbaa !26
  %92 = fptosi float %91 to i32
  %93 = sext i32 %92 to i64
  %94 = mul i64 %83, %93
  %95 = add i64 %94, %.048
  %.not = icmp eq i64 %90, %95
  br i1 %.not, label %107, label %96

96:                                               ; preds = %86
  %97 = call noundef nonnull align 8 dereferenceable(49) ptr @_ZNKSt10unique_ptrI6MatrixSt14default_deleteIS0_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %98 = load i64, ptr %6, align 8, !tbaa !14
  %99 = mul i64 %98, %.03554
  %100 = add i64 %99, %.03349
  %101 = mul i64 %98, %.03451
  %102 = add i64 %101, %.048
  %103 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN6MatrixclEmm(ptr noundef nonnull align 8 dereferenceable(49) %97, i64 noundef %100, i64 noundef %102)
          to label %104 unwind label %105

104:                                              ; preds = %96
  store float 0.000000e+00, ptr %103, align 4, !tbaa !26
  br label %107

105:                                              ; preds = %96, %81, %77, %64, %60, %47, %.lr.ph
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %111

107:                                              ; preds = %68, %104, %86
  %108 = add nuw i64 %.048, 1
  %109 = load i64, ptr %6, align 8, !tbaa !14
  %110 = icmp ult i64 %108, %109
  br i1 %110, label %.lr.ph, label %._crit_edge, !llvm.loop !28

111:                                              ; preds = %29, %105, %27
  %.pn.pn = phi { ptr, i32 } [ %28, %27 ], [ %106, %105 ], [ %30, %29 ]
  call void @_ZNSt10unique_ptrI6MatrixSt14default_deleteIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn.pn
}

attributes #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 72}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19, !23}
!23 = !{!"llvm.loop.unswitch.partial.disable"}
!24 = distinct !{!24, !19, !23}
!25 = !{!6, !11, i64 56}
!26 = !{!27, !27, i64 0}
!27 = !{!"float", !8, i64 0}
!28 = distinct !{!28, !19}


; Effective O3 passes: ADCEPass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass