; LLVM IR from liaojing/MorphLib :: MorphLib/Morph.ll (ZN8MorphLib6CMorph14upsample_levelEii)

; 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.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [2 x float] }
%"class.MorphLib::CMorph" = type <{ ptr, ptr, i32, i32, i32, i32, i32, [4 x i8], ptr, i8, [7 x i8] }>
%class.CPyramid = type { %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<CPyramidLevel, std::allocator<CPyramidLevel>>::_Vector_impl" }
%"struct.std::_Vector_base<CPyramidLevel, std::allocator<CPyramidLevel>>::_Vector_impl" = type { %"struct.std::_Vector_base<CPyramidLevel, std::allocator<CPyramidLevel>>::_Vector_impl_data" }
%"struct.std::_Vector_base<CPyramidLevel, std::allocator<CPyramidLevel>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.CPyramidLevel = type { i32, i32, float, i32, i32, i32, ptr, ptr, ptr, ptr }
%"struct.MorphLib::CData" = type { %struct.anon, %struct.anon.5, %struct.anon.6, ptr, ptr, ptr, ptr, i32 }
%struct.anon = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.5 = type { ptr, ptr, ptr }
%struct.anon.6 = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8MorphLib6CMorph14upsample_levelEii(ptr noundef nonnull align 8 dereferenceable(49) %0, i32 noundef %1, i32 noundef %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %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 float, align 4
  %17 = alloca float, align 4
  %18 = alloca %"class.Eigen::Matrix", align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"class.Eigen::Matrix", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %26 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %27 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %class.CPyramid, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %31) #8
  %33 = getelementptr inbounds %class.CPyramidLevel, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !14
  %35 = sitofp i32 %34 to float
  %36 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %class.CPyramid, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef %40) #8
  %42 = getelementptr inbounds %class.CPyramidLevel, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !14
  %44 = sitofp i32 %43 to float
  %45 = fdiv float %35, %44
  store float %45, ptr %7, align 4, !tbaa !17
  %46 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds %class.CPyramid, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %50) #8
  %52 = getelementptr inbounds %class.CPyramidLevel, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !18
  %54 = sitofp i32 %53 to float
  %55 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds %class.CPyramid, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59) #8
  %61 = getelementptr inbounds %class.CPyramidLevel, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !18
  %63 = sitofp i32 %62 to float
  %64 = fdiv float %54, %63
  store float %64, ptr %8, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %65 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = getelementptr inbounds %class.CPyramid, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %5, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %69) #8
  %71 = getelementptr inbounds %class.CPyramidLevel, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !14
  %73 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = getelementptr inbounds %class.CPyramid, ptr %74, i32 0, i32 0
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77) #8
  %79 = getelementptr inbounds %class.CPyramidLevel, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !18
  %81 = mul nsw i32 %72, %80
  %82 = sext i32 %81 to i64
  %83 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %82, i64 8)
  %84 = extractvalue { i64, i1 } %83, 1
  %85 = extractvalue { i64, i1 } %83, 0
  %86 = select i1 %84, i64 -1, i64 %85
  %87 = call noundef ptr @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEnaEm(i64 noundef %86)
  %88 = icmp eq i64 %82, 0
  br i1 %88, label %96, label %89

89:                                               ; preds = %3
  %90 = getelementptr inbounds %"class.Eigen::Matrix", ptr %87, i64 %82
  br label %91

91:                                               ; preds = %93, %89
  %92 = phi ptr [ %87, %89 ], [ %94, %93 ]
  invoke void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %92)
          to label %93 unwind label %109

93:                                               ; preds = %91
  %94 = getelementptr inbounds %"class.Eigen::Matrix", ptr %92, i64 1
  %95 = icmp eq ptr %94, %90
  br i1 %95, label %96, label %91

96:                                               ; preds = %93, %3
  store ptr %87, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %177, %96
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds %class.CPyramid, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %5, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %103) #8
  %105 = getelementptr inbounds %class.CPyramidLevel, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !18
  %107 = icmp slt i32 %98, %106
  br i1 %107, label %113, label %108

108:                                              ; preds = %97
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %180

109:                                              ; preds = %91
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %10, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %11, align 4
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEdaEPv(ptr noundef %87) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %326

113:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %173, %113
  %115 = load i32, ptr %14, align 4, !tbaa !9
  %116 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  %118 = getelementptr inbounds %class.CPyramid, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %120) #8
  %122 = getelementptr inbounds %class.CPyramidLevel, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !14
  %124 = icmp slt i32 %115, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %114
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %176

126:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = load i32, ptr %12, align 4, !tbaa !9
  %129 = load i32, ptr %5, align 4, !tbaa !9
  %130 = call noundef i32 @_ZN8MorphLib6CMorph9mem_indexEiii(ptr noundef nonnull align 8 dereferenceable(49) %26, i32 noundef %127, i32 noundef %128, i32 noundef %129)
  store i32 %130, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %131 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %132 = load ptr, ptr %131, align 8, !tbaa !19
  %133 = load i32, ptr %5, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %"struct.MorphLib::CData", ptr %132, i64 %134
  %136 = getelementptr inbounds %"struct.MorphLib::CData", ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !20
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds float, ptr %137, i64 %139
  %141 = load float, ptr %140, align 4, !tbaa !17
  %142 = load float, ptr %7, align 4, !tbaa !17
  %143 = fmul float %141, %142
  store float %143, ptr %16, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %144 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %145 = load ptr, ptr %144, align 8, !tbaa !19
  %146 = load i32, ptr %5, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds %"struct.MorphLib::CData", ptr %145, i64 %147
  %149 = getelementptr inbounds %"struct.MorphLib::CData", ptr %148, i32 0, i32 5
  %150 = load ptr, ptr %149, align 8, !tbaa !25
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds float, ptr %150, i64 %152
  %154 = load float, ptr %153, align 4, !tbaa !17
  %155 = load float, ptr %8, align 4, !tbaa !17
  %156 = fmul float %154, %155
  store float %156, ptr %17, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2IffEERKT_RKT0_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %157 = load ptr, ptr %9, align 8, !tbaa !5
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %160 = load ptr, ptr %159, align 8, !tbaa !11
  %161 = getelementptr inbounds %class.CPyramid, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %5, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %161, i64 noundef %163) #8
  %165 = getelementptr inbounds %class.CPyramidLevel, ptr %164, i32 0, i32 0
  %166 = load i32, ptr %165, align 8, !tbaa !14
  %167 = mul nsw i32 %158, %166
  %168 = load i32, ptr %14, align 4, !tbaa !9
  %169 = add nsw i32 %167, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %"class.Eigen::Matrix", ptr %157, i64 %170
  %172 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %171, ptr noundef nonnull align 4 dereferenceable(8) %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %173

173:                                              ; preds = %126
  %174 = load i32, ptr %14, align 4, !tbaa !9
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %14, align 4, !tbaa !9
  br label %114, !llvm.loop !26

176:                                              ; preds = %125
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %12, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %12, align 4, !tbaa !9
  br label %97, !llvm.loop !28

180:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %181 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %182 = load ptr, ptr %181, align 8, !tbaa !11
  %183 = getelementptr inbounds %class.CPyramid, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %6, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %183, i64 noundef %185) #8
  %187 = getelementptr inbounds %class.CPyramidLevel, ptr %186, i32 0, i32 5
  %188 = load i32, ptr %187, align 4, !tbaa !29
  %189 = mul nsw i32 %188, 25
  %190 = sext i32 %189 to i64
  %191 = mul i64 %190, 4
  %192 = trunc i64 %191 to i32
  store i32 %192, ptr %19, align 4, !tbaa !9
  %193 = load i32, ptr %19, align 4, !tbaa !9
  %194 = sext i32 %193 to i64
  %195 = call noalias ptr @malloc(i64 noundef %194) #9
  %196 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %197 = load ptr, ptr %196, align 8, !tbaa !19
  %198 = load i32, ptr %6, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds %"struct.MorphLib::CData", ptr %197, i64 %199
  %201 = getelementptr inbounds %"struct.MorphLib::CData", ptr %200, i32 0, i32 4
  store ptr %195, ptr %201, align 8, !tbaa !20
  %202 = load i32, ptr %19, align 4, !tbaa !9
  %203 = sext i32 %202 to i64
  %204 = call noalias ptr @malloc(i64 noundef %203) #9
  %205 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %206 = load ptr, ptr %205, align 8, !tbaa !19
  %207 = load i32, ptr %6, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds %"struct.MorphLib::CData", ptr %206, i64 %208
  %210 = getelementptr inbounds %"struct.MorphLib::CData", ptr %209, i32 0, i32 5
  store ptr %204, ptr %210, align 8, !tbaa !25
  %211 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %212 = load ptr, ptr %211, align 8, !tbaa !19
  %213 = load i32, ptr %6, align 4, !tbaa !9
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds %"struct.MorphLib::CData", ptr %212, i64 %214
  %216 = getelementptr inbounds %"struct.MorphLib::CData", ptr %215, i32 0, i32 4
  %217 = load ptr, ptr %216, align 8, !tbaa !20
  %218 = load i32, ptr %19, align 4, !tbaa !9
  %219 = sext i32 %218 to i64
  call void @llvm.memset.p0.i64(ptr align 4 %217, i8 0, i64 %219, i1 false)
  %220 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %221 = load ptr, ptr %220, align 8, !tbaa !19
  %222 = load i32, ptr %6, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds %"struct.MorphLib::CData", ptr %221, i64 %223
  %225 = getelementptr inbounds %"struct.MorphLib::CData", ptr %224, i32 0, i32 5
  %226 = load ptr, ptr %225, align 8, !tbaa !25
  %227 = load i32, ptr %19, align 4, !tbaa !9
  %228 = sext i32 %227 to i64
  call void @llvm.memset.p0.i64(ptr align 4 %226, i8 0, i64 %228, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %229

229:                                              ; preds = %318, %180
  %230 = load i32, ptr %20, align 4, !tbaa !9
  %231 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %232 = load ptr, ptr %231, align 8, !tbaa !11
  %233 = getelementptr inbounds %class.CPyramid, ptr %232, i32 0, i32 0
  %234 = load i32, ptr %6, align 4, !tbaa !9
  %235 = sext i32 %234 to i64
  %236 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %233, i64 noundef %235) #8
  %237 = getelementptr inbounds %class.CPyramidLevel, ptr %236, i32 0, i32 1
  %238 = load i32, ptr %237, align 4, !tbaa !18
  %239 = icmp slt i32 %230, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %229
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %321

241:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %242

242:                                              ; preds = %314, %241
  %243 = load i32, ptr %21, align 4, !tbaa !9
  %244 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %245 = load ptr, ptr %244, align 8, !tbaa !11
  %246 = getelementptr inbounds %class.CPyramid, ptr %245, i32 0, i32 0
  %247 = load i32, ptr %6, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %246, i64 noundef %248) #8
  %250 = getelementptr inbounds %class.CPyramidLevel, ptr %249, i32 0, i32 0
  %251 = load i32, ptr %250, align 8, !tbaa !14
  %252 = icmp slt i32 %243, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %242
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %317

254:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %255 = load i32, ptr %21, align 4, !tbaa !9
  %256 = sitofp i32 %255 to float
  %257 = fadd float %256, 5.000000e-01
  %258 = load float, ptr %7, align 4, !tbaa !17
  %259 = fdiv float %257, %258
  %260 = fsub float %259, 5.000000e-01
  store float %260, ptr %22, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %261 = load i32, ptr %20, align 4, !tbaa !9
  %262 = sitofp i32 %261 to float
  %263 = fadd float %262, 5.000000e-01
  %264 = load float, ptr %8, align 4, !tbaa !17
  %265 = fdiv float %263, %264
  %266 = fsub float %265, 5.000000e-01
  store float %266, ptr %23, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %267 = load i32, ptr %21, align 4, !tbaa !9
  %268 = load i32, ptr %20, align 4, !tbaa !9
  %269 = load i32, ptr %6, align 4, !tbaa !9
  %270 = call noundef i32 @_ZN8MorphLib6CMorph9mem_indexEiii(ptr noundef nonnull align 8 dereferenceable(49) %26, i32 noundef %267, i32 noundef %268, i32 noundef %269)
  store i32 %270, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %273 = load ptr, ptr %272, align 8, !tbaa !11
  %274 = getelementptr inbounds %class.CPyramid, ptr %273, i32 0, i32 0
  %275 = load i32, ptr %5, align 4, !tbaa !9
  %276 = sext i32 %275 to i64
  %277 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %274, i64 noundef %276) #8
  %278 = getelementptr inbounds %class.CPyramidLevel, ptr %277, i32 0, i32 0
  %279 = load i32, ptr %278, align 8, !tbaa !14
  %280 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 1
  %281 = load ptr, ptr %280, align 8, !tbaa !11
  %282 = getelementptr inbounds %class.CPyramid, ptr %281, i32 0, i32 0
  %283 = load i32, ptr %5, align 4, !tbaa !9
  %284 = sext i32 %283 to i64
  %285 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %282, i64 noundef %284) #8
  %286 = getelementptr inbounds %class.CPyramidLevel, ptr %285, i32 0, i32 1
  %287 = load i32, ptr %286, align 4, !tbaa !18
  %288 = load float, ptr %22, align 4, !tbaa !17
  %289 = load float, ptr %23, align 4, !tbaa !17
  call void @_ZN8MorphLib6CMorph21BilineaGetColor_clampIN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEET_PS5_iiff(ptr dead_on_unwind writable sret(%"class.Eigen::Matrix") align 4 %25, ptr noundef nonnull align 8 dereferenceable(49) %26, ptr noundef %271, i32 noundef %279, i32 noundef %287, float noundef %288, float noundef %289)
  %290 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1) %25)
  %291 = load float, ptr %290, align 4, !tbaa !17
  %292 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %293 = load ptr, ptr %292, align 8, !tbaa !19
  %294 = load i32, ptr %6, align 4, !tbaa !9
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds %"struct.MorphLib::CData", ptr %293, i64 %295
  %297 = getelementptr inbounds %"struct.MorphLib::CData", ptr %296, i32 0, i32 4
  %298 = load ptr, ptr %297, align 8, !tbaa !20
  %299 = load i32, ptr %24, align 4, !tbaa !9
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds float, ptr %298, i64 %300
  store float %291, ptr %301, align 4, !tbaa !17
  %302 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1) %25)
  %303 = load float, ptr %302, align 4, !tbaa !17
  %304 = getelementptr inbounds %"class.MorphLib::CMorph", ptr %26, i32 0, i32 8
  %305 = load ptr, ptr %304, align 8, !tbaa !19
  %306 = load i32, ptr %6, align 4, !tbaa !9
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds %"struct.MorphLib::CData", ptr %305, i64 %307
  %309 = getelementptr inbounds %"struct.MorphLib::CData", ptr %308, i32 0, i32 5
  %310 = load ptr, ptr %309, align 8, !tbaa !25
  %311 = load i32, ptr %24, align 4, !tbaa !9
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds float, ptr %310, i64 %312
  store float %303, ptr %313, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %314

314:                                              ; preds = %254
  %315 = load i32, ptr %21, align 4, !tbaa !9
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %21, align 4, !tbaa !9
  br label %242, !llvm.loop !30

317:                                              ; preds = %253
  br label %318

318:                                              ; preds = %317
  %319 = load i32, ptr %20, align 4, !tbaa !9
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr %20, align 4, !tbaa !9
  br label %229, !llvm.loop !31

321:                                              ; preds = %240
  %322 = load ptr, ptr %9, align 8, !tbaa !5
  %323 = icmp eq ptr %322, null
  br i1 %323, label %325, label %324

324:                                              ; preds = %321
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEdaEPv(ptr noundef %322) #8
  br label %325

325:                                              ; preds = %324, %321
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret void

326:                                              ; preds = %109
  %327 = load ptr, ptr %10, align 8
  %328 = load i32, ptr %11, align 4
  %329 = insertvalue { ptr, i32 } poison, ptr %327, 0
  %330 = insertvalue { ptr, i32 } %329, i32 %328, 1
  resume { ptr, i32 } %330
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN8MorphLib6CMorph9mem_indexEiii(ptr noundef nonnull align 8 dereferenceable(49), i32 noundef, i32 noundef, i32 noundef) #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEnaEm(i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #7 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEdaEPv(ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2IffEERKT_RKT0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8MorphLib6CMorph21BilineaGetColor_clampIN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEET_PS5_iiff(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Matrix") align 4, ptr noundef nonnull align 8 dereferenceable(49), ptr noundef, i32 noundef, i32 noundef, float noundef, float noundef) #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1)) #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1)) #7 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nounwind allocsize(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 = { inlinehint 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN8MorphLib6CMorphE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !13, i64 48}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_ZTS13CPyramidLevel", !10, i64 0, !10, i64 4, !16, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!16 = !{!"float", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!15, !10, i64 4}
!19 = !{!12, !6, i64 40}
!20 = !{!21, !6, i64 128}
!21 = !{!"_ZTSN8MorphLib5CDataE", !22, i64 0, !23, i64 72, !24, i64 96, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !10, i64 152}
!22 = !{!"_ZTSN8MorphLib5CDataUt_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!23 = !{!"_ZTSN8MorphLib5CDataUt0_E", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSN8MorphLib5CDataUt1_E", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!21, !6, i64 136}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!15, !10, i64 20}
!30 = distinct !{!30, !27}
!31 = distinct !{!31, !27}


; 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.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { %"struct.Eigen::internal::plain_array" }
%"struct.Eigen::internal::plain_array" = type { [2 x float] }
%"struct.MorphLib::CData" = type { %struct.anon, %struct.anon.5, %struct.anon.6, ptr, ptr, ptr, ptr, i32 }
%struct.anon = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.5 = type { ptr, ptr, ptr }
%struct.anon.6 = type { ptr, ptr, 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8MorphLib6CMorph14upsample_levelEii(ptr noundef nonnull align 8 dereferenceable(49) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca %"class.Eigen::Matrix", align 4
  %7 = alloca %"class.Eigen::Matrix", align 4
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = sext i32 %2 to i64
  %11 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %10) #6
  %12 = load i32, ptr %11, align 8, !tbaa !12
  %13 = sitofp i32 %12 to float
  %14 = load ptr, ptr %8, align 8, !tbaa !5
  %15 = sext i32 %1 to i64
  %16 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %15) #6
  %17 = load i32, ptr %16, align 8, !tbaa !12
  %18 = sitofp i32 %17 to float
  %19 = fdiv float %13, %18
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %10) #6
  %22 = getelementptr inbounds i8, ptr %21, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = sitofp i32 %23 to float
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %15) #6
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !15
  %29 = sitofp i32 %28 to float
  %30 = fdiv float %24, %29
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %15) #6
  %33 = load i32, ptr %32, align 8, !tbaa !12
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %15) #6
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !15
  %38 = mul nsw i32 %37, %33
  %39 = sext i32 %38 to i64
  %40 = icmp slt i32 %38, 0
  %41 = shl nsw i64 %39, 3
  %42 = select i1 %40, i64 -1, i64 %41
  %43 = tail call noundef ptr @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEnaEm(i64 noundef %42)
  %44 = icmp eq i32 %38, 0
  br i1 %44, label %.loopexit, label %45

45:                                               ; preds = %3
  %46 = getelementptr inbounds %"class.Eigen::Matrix", ptr %43, i64 %39
  br label %47

47:                                               ; preds = %49, %45
  %48 = phi ptr [ %43, %45 ], [ %50, %49 ]
  invoke void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %48)
          to label %49 unwind label %77

49:                                               ; preds = %47
  %50 = getelementptr inbounds i8, ptr %48, i64 8
  %51 = icmp eq ptr %50, %46
  br i1 %51, label %.loopexit, label %47

.loopexit:                                        ; preds = %49, %3
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %15) #6
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.preheader65.lr.ph, label %._crit_edge68

.preheader65.lr.ph:                               ; preds = %.loopexit
  %57 = getelementptr inbounds i8, ptr %0, i64 40
  br label %.preheader65

.preheader65:                                     ; preds = %.preheader65.lr.ph, %._crit_edge
  %.067 = phi i32 [ 0, %.preheader65.lr.ph ], [ %79, %._crit_edge ]
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %15) #6
  %60 = load i32, ptr %59, align 8, !tbaa !12
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.lr.ph, label %._crit_edge

._crit_edge68:                                    ; preds = %._crit_edge, %.loopexit
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %10) #6
  %64 = getelementptr inbounds i8, ptr %63, i64 20
  %65 = load i32, ptr %64, align 4, !tbaa !16
  %66 = mul i32 %65, 100
  %67 = sext i32 %66 to i64
  %calloc = call ptr @calloc(i64 1, i64 %67)
  %68 = getelementptr inbounds i8, ptr %0, i64 40
  %69 = load ptr, ptr %68, align 8, !tbaa !17
  %70 = getelementptr inbounds %"struct.MorphLib::CData", ptr %69, i64 %10, i32 4
  store ptr %calloc, ptr %70, align 8, !tbaa !18
  %calloc74 = call ptr @calloc(i64 1, i64 %67)
  %71 = getelementptr inbounds %"struct.MorphLib::CData", ptr %69, i64 %10, i32 5
  store ptr %calloc74, ptr %71, align 8, !tbaa !23
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %10) #6
  %74 = getelementptr inbounds i8, ptr %73, i64 4
  %75 = load i32, ptr %74, align 4, !tbaa !15
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.preheader, label %._crit_edge73

77:                                               ; preds = %47
  %78 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEdaEPv(ptr noundef %43) #6
  resume { ptr, i32 } %78

._crit_edge:                                      ; preds = %.lr.ph, %.preheader65
  %79 = add nuw nsw i32 %.067, 1
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %80, i64 noundef %15) #6
  %82 = getelementptr inbounds i8, ptr %81, i64 4
  %83 = load i32, ptr %82, align 4, !tbaa !15
  %84 = icmp slt i32 %79, %83
  br i1 %84, label %.preheader65, label %._crit_edge68, !llvm.loop !24

.lr.ph:                                           ; preds = %.preheader65, %.lr.ph
  %.05966 = phi i32 [ %106, %.lr.ph ], [ 0, %.preheader65 ]
  %85 = call noundef i32 @_ZN8MorphLib6CMorph9mem_indexEiii(ptr noundef nonnull align 8 dereferenceable(49) %0, i32 noundef %.05966, i32 noundef %.067, i32 noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %86 = load ptr, ptr %57, align 8, !tbaa !17
  %87 = getelementptr inbounds %"struct.MorphLib::CData", ptr %86, i64 %15, i32 4
  %88 = load ptr, ptr %87, align 8, !tbaa !18
  %89 = sext i32 %85 to i64
  %90 = getelementptr inbounds float, ptr %88, i64 %89
  %91 = load float, ptr %90, align 4, !tbaa !26
  %92 = fmul float %19, %91
  store float %92, ptr %4, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %93 = getelementptr inbounds %"struct.MorphLib::CData", ptr %86, i64 %15, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !23
  %95 = getelementptr inbounds float, ptr %94, i64 %89
  %96 = load float, ptr %95, align 4, !tbaa !26
  %97 = fmul float %30, %96
  store float %97, ptr %5, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2IffEERKT_RKT0_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %15) #6
  %100 = load i32, ptr %99, align 8, !tbaa !12
  %101 = mul nsw i32 %100, %.067
  %102 = add nsw i32 %101, %.05966
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %"class.Eigen::Matrix", ptr %43, i64 %103
  %105 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %104, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %106 = add nuw nsw i32 %.05966, 1
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %107, i64 noundef %15) #6
  %109 = load i32, ptr %108, align 8, !tbaa !12
  %110 = icmp slt i32 %106, %109
  br i1 %110, label %.lr.ph, label %._crit_edge, !llvm.loop !27

.preheader:                                       ; preds = %._crit_edge68, %._crit_edge71
  %.06172 = phi i32 [ %120, %._crit_edge71 ], [ 0, %._crit_edge68 ]
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %10) #6
  %113 = load i32, ptr %112, align 8, !tbaa !12
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %.lr.ph70, label %._crit_edge71

.lr.ph70:                                         ; preds = %.preheader
  %115 = uitofp nneg i32 %.06172 to float
  %116 = fadd float %115, 5.000000e-01
  %117 = fdiv float %116, %30
  %118 = fadd float %117, -5.000000e-01
  br label %126

._crit_edge73:                                    ; preds = %._crit_edge71, %._crit_edge68
  %119 = icmp eq ptr %43, null
  br i1 %119, label %158, label %157

._crit_edge71:                                    ; preds = %126, %.preheader
  %120 = add nuw nsw i32 %.06172, 1
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %10) #6
  %123 = getelementptr inbounds i8, ptr %122, i64 4
  %124 = load i32, ptr %123, align 4, !tbaa !15
  %125 = icmp slt i32 %120, %124
  br i1 %125, label %.preheader, label %._crit_edge73, !llvm.loop !28

126:                                              ; preds = %.lr.ph70, %126
  %.06069 = phi i32 [ 0, %.lr.ph70 ], [ %152, %126 ]
  %127 = uitofp nneg i32 %.06069 to float
  %128 = fadd float %127, 5.000000e-01
  %129 = fdiv float %128, %19
  %130 = fadd float %129, -5.000000e-01
  %131 = call noundef i32 @_ZN8MorphLib6CMorph9mem_indexEiii(ptr noundef nonnull align 8 dereferenceable(49) %0, i32 noundef %.06069, i32 noundef %.06172, i32 noundef %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %132, i64 noundef %15) #6
  %134 = load i32, ptr %133, align 8, !tbaa !12
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %135, i64 noundef %15) #6
  %137 = getelementptr inbounds i8, ptr %136, i64 4
  %138 = load i32, ptr %137, align 4, !tbaa !15
  call void @_ZN8MorphLib6CMorph21BilineaGetColor_clampIN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEET_PS5_iiff(ptr dead_on_unwind nonnull writable sret(%"class.Eigen::Matrix") align 4 %7, ptr noundef nonnull align 8 dereferenceable(49) %0, ptr noundef %43, i32 noundef %134, i32 noundef %138, float noundef %130, float noundef %118)
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %140 = load float, ptr %139, align 4, !tbaa !26
  %141 = load ptr, ptr %68, align 8, !tbaa !17
  %142 = getelementptr inbounds %"struct.MorphLib::CData", ptr %141, i64 %10, i32 4
  %143 = load ptr, ptr %142, align 8, !tbaa !18
  %144 = sext i32 %131 to i64
  %145 = getelementptr inbounds float, ptr %143, i64 %144
  store float %140, ptr %145, align 4, !tbaa !26
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  %147 = load float, ptr %146, align 4, !tbaa !26
  %148 = load ptr, ptr %68, align 8, !tbaa !17
  %149 = getelementptr inbounds %"struct.MorphLib::CData", ptr %148, i64 %10, i32 5
  %150 = load ptr, ptr %149, align 8, !tbaa !23
  %151 = getelementptr inbounds float, ptr %150, i64 %144
  store float %147, ptr %151, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %152 = add nuw nsw i32 %.06069, 1
  %153 = load ptr, ptr %8, align 8, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNSt6vectorI13CPyramidLevelSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %153, i64 noundef %10) #6
  %155 = load i32, ptr %154, align 8, !tbaa !12
  %156 = icmp slt i32 %152, %155
  br i1 %156, label %126, label %._crit_edge71, !llvm.loop !29

157:                                              ; preds = %._crit_edge73
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEdaEPv(ptr noundef nonnull %43) #6
  br label %158

158:                                              ; preds = %157, %._crit_edge73
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEnaEm(i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEdaEPv(ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEC2IffEERKT_RKT0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8MorphLib6CMorph21BilineaGetColor_clampIN5Eigen6MatrixIfLi2ELi1ELi0ELi2ELi1EEEEET_PS5_iiff(ptr dead_on_unwind noalias writable sret(%"class.Eigen::Matrix") align 4, ptr noundef nonnull align 8 dereferenceable(49), ptr noundef, i32 noundef, i32 noundef, float noundef, float noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1xEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLi2ELi1ELi0ELi2ELi1EEELi1EE1yEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { inlinehint 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 = { inlinehint 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 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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, !7, i64 8}
!6 = !{!"_ZTSN8MorphLib6CMorphE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 40, !11, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"_ZTS13CPyramidLevel", !10, i64 0, !10, i64 4, !14, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!14 = !{!"float", !8, i64 0}
!15 = !{!13, !10, i64 4}
!16 = !{!13, !10, i64 20}
!17 = !{!6, !7, i64 40}
!18 = !{!19, !7, i64 128}
!19 = !{!"_ZTSN8MorphLib5CDataE", !20, i64 0, !21, i64 72, !22, i64 96, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !10, i64 152}
!20 = !{!"_ZTSN8MorphLib5CDataUt_E", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64}
!21 = !{!"_ZTSN8MorphLib5CDataUt0_E", !7, i64 0, !7, i64 8, !7, i64 16}
!22 = !{!"_ZTSN8MorphLib5CDataUt1_E", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{!19, !7, i64 136}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!14, !14, i64 0}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}
!29 = distinct !{!29, !25}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass