; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseImageLoadPng.ll (ZN4Simd4Base14ImagePngLoader11CreateImageEPKhm)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.Simd::Array" = type { ptr, i64 }
%"class.Simd::Base::ImagePngLoader" = type { %"class.Simd::ImageLoader", [7 x ptr], ptr, ptr, i8, i8, i8, i32, i32, i32, i32, [3 x i16], i8, i8, i8, i8, [3 x i8], %"struct.Simd::Array", %"struct.Simd::Array", %"struct.Simd::Array", %"class.std::vector" }
%"class.Simd::ImageLoader" = type { ptr, %"struct.Simd::ImageLoaderParam", %"class.Simd::InputMemoryStream", %"struct.Simd::View" }
%"struct.Simd::ImageLoaderParam" = type { ptr, i64, i32, i32 }
%"class.Simd::InputMemoryStream" = type { ptr, i64, i64, i64, i64 }
%"struct.Simd::View" = type <{ i64, i64, i64, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl" }
%"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl" = type { %"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5xorig = external hidden constant [7 x i32], align 16
@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5yorig = external hidden constant [7 x i32], align 16
@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4xspc = external hidden constant [7 x i32], align 16
@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4yspc = external hidden constant [7 x i32], align 16

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext, i64 noundef) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CreateImageEPKhm(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef %1, i64 noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.Simd::Array", 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 i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  %21 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %22 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 10
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 12
  %25 = load i8, ptr %24, align 2, !tbaa !27
  %26 = zext i8 %25 to i32
  %27 = icmp eq i32 %26, 16
  %28 = zext i1 %27 to i64
  %29 = select i1 %27, i32 2, i32 1
  %30 = mul i32 %23, %29
  store i32 %30, ptr %8, align 4, !tbaa !28
  %31 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 14
  %32 = load i8, ptr %31, align 4, !tbaa !29
  %33 = icmp ne i8 %32, 0
  br i1 %33, label %43, label %34

34:                                               ; preds = %3
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load i64, ptr %7, align 8, !tbaa !9
  %37 = trunc i64 %36 to i32
  %38 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 7
  %39 = load i32, ptr %38, align 4, !tbaa !30
  %40 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 8
  %41 = load i32, ptr %40, align 8, !tbaa !31
  %42 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader14CreateImageRawEPKhjjj(ptr noundef nonnull align 8 dereferenceable(304) %21, ptr noundef %35, i32 noundef %37, i32 noundef %39, i32 noundef %41)
  store i1 %42, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %223

43:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %44 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 7
  %45 = load i32, ptr %44, align 4, !tbaa !30
  %46 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 8
  %47 = load i32, ptr %46, align 8, !tbaa !31
  %48 = mul i32 %45, %47
  %49 = load i32, ptr %8, align 4, !tbaa !28
  %50 = mul i32 %48, %49
  %51 = zext i32 %50 to i64
  call void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %51, i1 noundef zeroext false, i64 noundef 8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !28
  br label %52

52:                                               ; preds = %209, %43
  %53 = load i32, ptr %11, align 4, !tbaa !28
  %54 = icmp slt i32 %53, 7
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 2, ptr %9, align 4
  br label %212

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %57 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 7
  %58 = load i32, ptr %57, align 4, !tbaa !30
  %59 = load i32, ptr %11, align 4, !tbaa !28
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5xorig, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !28
  %63 = sub i32 %58, %62
  %64 = load i32, ptr %11, align 4, !tbaa !28
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4xspc, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !28
  %68 = add i32 %63, %67
  %69 = sub i32 %68, 1
  %70 = load i32, ptr %11, align 4, !tbaa !28
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4xspc, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !28
  %74 = udiv i32 %69, %73
  store i32 %74, ptr %14, align 4, !tbaa !28
  %75 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 8
  %76 = load i32, ptr %75, align 8, !tbaa !31
  %77 = load i32, ptr %11, align 4, !tbaa !28
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5yorig, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !28
  %81 = sub i32 %76, %80
  %82 = load i32, ptr %11, align 4, !tbaa !28
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4yspc, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !28
  %86 = add i32 %81, %85
  %87 = sub i32 %86, 1
  %88 = load i32, ptr %11, align 4, !tbaa !28
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4yspc, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !28
  %92 = udiv i32 %87, %91
  store i32 %92, ptr %15, align 4, !tbaa !28
  %93 = load i32, ptr %14, align 4, !tbaa !28
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %205

95:                                               ; preds = %56
  %96 = load i32, ptr %15, align 4, !tbaa !28
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %205

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %99 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 9
  %100 = load i32, ptr %99, align 4, !tbaa !32
  %101 = load i32, ptr %14, align 4, !tbaa !28
  %102 = mul i32 %100, %101
  %103 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 12
  %104 = load i8, ptr %103, align 2, !tbaa !27
  %105 = zext i8 %104 to i32
  %106 = mul i32 %102, %105
  %107 = add i32 %106, 7
  %108 = lshr i32 %107, 3
  %109 = add i32 %108, 1
  %110 = load i32, ptr %15, align 4, !tbaa !28
  %111 = mul i32 %109, %110
  store i32 %111, ptr %16, align 4, !tbaa !28
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = load i64, ptr %7, align 8, !tbaa !9
  %114 = trunc i64 %113 to i32
  %115 = load i32, ptr %14, align 4, !tbaa !28
  %116 = load i32, ptr %15, align 4, !tbaa !28
  %117 = invoke noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader14CreateImageRawEPKhjjj(ptr noundef nonnull align 8 dereferenceable(304) %21, ptr noundef %112, i32 noundef %114, i32 noundef %115, i32 noundef %116)
          to label %118 unwind label %120

118:                                              ; preds = %98
  br i1 %117, label %124, label %119

119:                                              ; preds = %118
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %202

120:                                              ; preds = %98
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %17, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %222

124:                                              ; preds = %118
  store i32 0, ptr %13, align 4, !tbaa !28
  br label %125

125:                                              ; preds = %190, %124
  %126 = load i32, ptr %13, align 4, !tbaa !28
  %127 = load i32, ptr %15, align 4, !tbaa !28
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %193

129:                                              ; preds = %125
  store i32 0, ptr %12, align 4, !tbaa !28
  br label %130

130:                                              ; preds = %186, %129
  %131 = load i32, ptr %12, align 4, !tbaa !28
  %132 = load i32, ptr %14, align 4, !tbaa !28
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %189

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %135 = load i32, ptr %13, align 4, !tbaa !28
  %136 = load i32, ptr %11, align 4, !tbaa !28
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4yspc, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !28
  %140 = mul nsw i32 %135, %139
  %141 = load i32, ptr %11, align 4, !tbaa !28
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5yorig, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !28
  %145 = add nsw i32 %140, %144
  store i32 %145, ptr %19, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %146 = load i32, ptr %12, align 4, !tbaa !28
  %147 = load i32, ptr %11, align 4, !tbaa !28
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4xspc, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !28
  %151 = mul nsw i32 %146, %150
  %152 = load i32, ptr %11, align 4, !tbaa !28
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5xorig, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !28
  %156 = add nsw i32 %151, %155
  store i32 %156, ptr %20, align 4, !tbaa !28
  %157 = getelementptr inbounds %"struct.Simd::Array", ptr %10, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !33
  %159 = load i32, ptr %19, align 4, !tbaa !28
  %160 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 7
  %161 = load i32, ptr %160, align 4, !tbaa !30
  %162 = mul i32 %159, %161
  %163 = load i32, ptr %8, align 4, !tbaa !28
  %164 = mul i32 %162, %163
  %165 = zext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %158, i64 %165
  %167 = load i32, ptr %20, align 4, !tbaa !28
  %168 = load i32, ptr %8, align 4, !tbaa !28
  %169 = mul nsw i32 %167, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i8, ptr %166, i64 %170
  %172 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 19
  %173 = getelementptr inbounds %"struct.Simd::Array", ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !34
  %175 = load i32, ptr %13, align 4, !tbaa !28
  %176 = load i32, ptr %14, align 4, !tbaa !28
  %177 = mul nsw i32 %175, %176
  %178 = load i32, ptr %12, align 4, !tbaa !28
  %179 = add nsw i32 %177, %178
  %180 = load i32, ptr %8, align 4, !tbaa !28
  %181 = mul nsw i32 %179, %180
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i8, ptr %174, i64 %182
  %184 = load i32, ptr %8, align 4, !tbaa !28
  %185 = sext i32 %184 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %171, ptr align 1 %183, i64 %185, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %186

186:                                              ; preds = %134
  %187 = load i32, ptr %12, align 4, !tbaa !28
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %12, align 4, !tbaa !28
  br label %130, !llvm.loop !35

189:                                              ; preds = %130
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %13, align 4, !tbaa !28
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %13, align 4, !tbaa !28
  br label %125, !llvm.loop !37

193:                                              ; preds = %125
  %194 = load i32, ptr %16, align 4, !tbaa !28
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = zext i32 %194 to i64
  %197 = getelementptr inbounds i8, ptr %195, i64 %196
  store ptr %197, ptr %6, align 8, !tbaa !5
  %198 = load i32, ptr %16, align 4, !tbaa !28
  %199 = zext i32 %198 to i64
  %200 = load i64, ptr %7, align 8, !tbaa !9
  %201 = sub i64 %200, %199
  store i64 %201, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %9, align 4
  br label %202

202:                                              ; preds = %193, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %203 = load i32, ptr %9, align 4
  switch i32 %203, label %206 [
    i32 0, label %204
  ]

204:                                              ; preds = %202
  br label %205

205:                                              ; preds = %204, %95, %56
  store i32 0, ptr %9, align 4
  br label %206

206:                                              ; preds = %205, %202
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %207 = load i32, ptr %9, align 4
  switch i32 %207, label %212 [
    i32 0, label %208
  ]

208:                                              ; preds = %206
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %11, align 4, !tbaa !28
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %11, align 4, !tbaa !28
  br label %52, !llvm.loop !38

212:                                              ; preds = %206, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %213 = load i32, ptr %9, align 4
  switch i32 %213, label %221 [
    i32 2, label %214
  ]

214:                                              ; preds = %212
  %215 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %21, i32 0, i32 19
  invoke void @_ZN4Simd5ArrayIhE4SwapERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %215, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %216 unwind label %217

216:                                              ; preds = %214
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %221

217:                                              ; preds = %214
  %218 = landingpad { ptr, i32 }
          cleanup
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %17, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %18, align 4
  br label %222

221:                                              ; preds = %216, %212
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %223

222:                                              ; preds = %217, %120
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %225

223:                                              ; preds = %221, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %224 = load i1, ptr %4, align 1
  ret i1 %224

225:                                              ; preds = %222
  %226 = load ptr, ptr %17, align 8
  %227 = load i32, ptr %18, align 4
  %228 = insertvalue { ptr, i32 } poison, ptr %226, 0
  %229 = insertvalue { ptr, i32 } %228, i32 %227, 1
  resume { ptr, i32 } %229
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader14CreateImageRawEPKhjjj(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhE4SwapERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 #2 = { alwaysinline 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!11 = !{!12, !21, i64 208}
!12 = !{!"_ZTSN4Simd4Base14ImagePngLoaderE", !13, i64 0, !7, i64 120, !6, i64 176, !6, i64 184, !20, i64 192, !20, i64 193, !20, i64 194, !21, i64 196, !21, i64 200, !21, i64 204, !21, i64 208, !7, i64 212, !7, i64 218, !7, i64 219, !7, i64 220, !7, i64 221, !7, i64 222, !22, i64 232, !22, i64 248, !22, i64 264, !23, i64 280}
!13 = !{!"_ZTSN4Simd11ImageLoaderE", !14, i64 8, !17, i64 32, !18, i64 72}
!14 = !{!"_ZTSN4Simd16ImageLoaderParamE", !6, i64 0, !10, i64 8, !15, i64 16, !16, i64 20}
!15 = !{!"_ZTS17SimdImageFileType", !7, i64 0}
!16 = !{!"_ZTS19SimdPixelFormatType", !7, i64 0}
!17 = !{!"_ZTSN4Simd17InputMemoryStreamE", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!18 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !10, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !6, i64 32, !20, i64 40}
!19 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_ZTSN4Simd5ArrayIhEE", !6, i64 0, !10, i64 8}
!23 = !{!"_ZTSSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!12, !7, i64 218}
!28 = !{!21, !21, i64 0}
!29 = !{!12, !7, i64 220}
!30 = !{!12, !21, i64 196}
!31 = !{!12, !21, i64 200}
!32 = !{!12, !21, i64 204}
!33 = !{!22, !6, i64 0}
!34 = !{!12, !6, i64 264}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = distinct !{!37, !36}
!38 = distinct !{!38, !36}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.Simd::Array" = type { ptr, i64 }

@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5xorig = external hidden local_unnamed_addr constant [7 x i32], align 16
@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5yorig = external hidden local_unnamed_addr constant [7 x i32], align 16
@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4xspc = external hidden local_unnamed_addr constant [7 x i32], align 16
@_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4yspc = external hidden local_unnamed_addr constant [7 x i32], align 16

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext, i64 noundef) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CreateImageEPKhm(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.Simd::Array", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 208
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 218
  %8 = load i8, ptr %7, align 2, !tbaa !25
  %9 = icmp eq i8 %8, 16
  %10 = zext i1 %9 to i32
  %11 = shl i32 %6, %10
  %12 = getelementptr inbounds i8, ptr %0, i64 220
  %13 = load i8, ptr %12, align 4, !tbaa !26
  %.not = icmp eq i8 %13, 0
  %14 = getelementptr inbounds i8, ptr %0, i64 196
  %15 = getelementptr inbounds i8, ptr %0, i64 200
  br i1 %.not, label %16, label %21

16:                                               ; preds = %3
  %17 = trunc i64 %2 to i32
  %18 = load i32, ptr %14, align 4, !tbaa !27
  %19 = load i32, ptr %15, align 8, !tbaa !28
  %20 = tail call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader14CreateImageRawEPKhjjj(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef %1, i32 noundef %17, i32 noundef %18, i32 noundef %19)
  br label %102

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %22 = load i32, ptr %14, align 4, !tbaa !27
  %23 = load i32, ptr %15, align 8, !tbaa !28
  %24 = mul i32 %22, %11
  %25 = mul i32 %24, %23
  %26 = zext i32 %25 to i64
  call void @_ZN4Simd5ArrayIhEC2Embm(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %26, i1 noundef zeroext false, i64 noundef 8)
  %27 = getelementptr inbounds i8, ptr %0, i64 204
  %28 = getelementptr inbounds i8, ptr %0, i64 264
  %29 = sext i32 %11 to i64
  br label %30

30:                                               ; preds = %21, %.thread
  %indvars.iv99 = phi i64 [ 0, %21 ], [ %indvars.iv.next100, %.thread ]
  %31 = phi i1 [ false, %21 ], [ %97, %.thread ]
  %.05390 = phi ptr [ %1, %21 ], [ %.35676, %.thread ]
  %.05989 = phi i64 [ %2, %21 ], [ %.36275, %.thread ]
  %32 = load i32, ptr %14, align 4, !tbaa !27
  %33 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5xorig, i64 0, i64 %indvars.iv99
  %34 = load i32, ptr %33, align 4, !tbaa !29
  %35 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4xspc, i64 0, i64 %indvars.iv99
  %36 = load i32, ptr %35, align 4, !tbaa !29
  %37 = xor i32 %34, -1
  %38 = add i32 %32, %37
  %39 = add i32 %38, %36
  %40 = udiv i32 %39, %36
  %41 = load i32, ptr %15, align 8, !tbaa !28
  %42 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE5yorig, i64 0, i64 %indvars.iv99
  %43 = load i32, ptr %42, align 4, !tbaa !29
  %44 = getelementptr inbounds [7 x i32], ptr @_ZZN4Simd4Base14ImagePngLoader11CreateImageEPKhmE4yspc, i64 0, i64 %indvars.iv99
  %45 = load i32, ptr %44, align 4, !tbaa !29
  %46 = xor i32 %43, -1
  %47 = add i32 %41, %46
  %48 = add i32 %47, %45
  %49 = udiv i32 %48, %45
  %50 = icmp ule i32 %36, %39
  %51 = icmp ule i32 %45, %48
  %or.cond = select i1 %50, i1 %51, i1 false
  br i1 %or.cond, label %52, label %.thread

52:                                               ; preds = %30
  %53 = load i32, ptr %27, align 4, !tbaa !30
  %54 = mul i32 %53, %40
  %55 = load i8, ptr %7, align 2, !tbaa !25
  %56 = zext i8 %55 to i32
  %57 = mul i32 %54, %56
  %58 = add i32 %57, 7
  %59 = lshr i32 %58, 3
  %60 = add nuw nsw i32 %59, 1
  %61 = mul i32 %60, %49
  %62 = trunc i64 %.05989 to i32
  %63 = invoke noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader14CreateImageRawEPKhjjj(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef %.05390, i32 noundef %62, i32 noundef %40, i32 noundef %49)
          to label %64 unwind label %92

64:                                               ; preds = %52
  br i1 %63, label %.preheader82, label %.thread77

.preheader82:                                     ; preds = %64
  %65 = icmp sgt i32 %49, 0
  %66 = icmp sgt i32 %40, 0
  %or.cond104 = and i1 %65, %66
  br i1 %or.cond104, label %.preheader.us.preheader, label %._crit_edge87

.preheader.us.preheader:                          ; preds = %.preheader82
  %67 = sext i32 %36 to i64
  %68 = sext i32 %34 to i64
  %69 = zext nneg i32 %40 to i64
  %70 = zext nneg i32 %49 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv96 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next97, %._crit_edge.us ]
  %71 = trunc i64 %indvars.iv96 to i32
  %72 = mul i32 %45, %71
  %73 = add i32 %72, %43
  %74 = mul i32 %73, %11
  %75 = mul nuw nsw i64 %indvars.iv96, %69
  br label %76

76:                                               ; preds = %.preheader.us, %76
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %76 ]
  %77 = mul nsw i64 %indvars.iv, %67
  %78 = add nsw i64 %77, %68
  %79 = load ptr, ptr %4, align 8, !tbaa !31
  %80 = load i32, ptr %14, align 4, !tbaa !27
  %81 = mul i32 %74, %80
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %79, i64 %82
  %84 = mul nsw i64 %78, %29
  %85 = getelementptr inbounds i8, ptr %83, i64 %84
  %86 = load ptr, ptr %28, align 8, !tbaa !32
  %87 = add nuw nsw i64 %indvars.iv, %75
  %88 = mul nsw i64 %87, %29
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %85, ptr align 1 %89, i64 %29, i1 false)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %90 = icmp ult i64 %indvars.iv.next, %69
  br i1 %90, label %76, label %._crit_edge.us, !llvm.loop !33

._crit_edge.us:                                   ; preds = %76
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %91 = icmp ult i64 %indvars.iv.next97, %70
  br i1 %91, label %.preheader.us, label %._crit_edge87, !llvm.loop !35

92:                                               ; preds = %52
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %101

._crit_edge87:                                    ; preds = %._crit_edge.us, %.preheader82
  %94 = zext i32 %61 to i64
  %95 = getelementptr inbounds i8, ptr %.05390, i64 %94
  %96 = sub i64 %.05989, %94
  br label %.thread

.thread:                                          ; preds = %._crit_edge87, %30
  %.35676 = phi ptr [ %95, %._crit_edge87 ], [ %.05390, %30 ]
  %.36275 = phi i64 [ %96, %._crit_edge87 ], [ %.05989, %30 ]
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %97 = icmp ugt i64 %indvars.iv99, 5
  %exitcond = icmp eq i64 %indvars.iv.next100, 7
  br i1 %exitcond, label %.critedge, label %30, !llvm.loop !36

.critedge:                                        ; preds = %.thread
  invoke void @_ZN4Simd5ArrayIhE4SwapERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %.thread77 unwind label %98

98:                                               ; preds = %.critedge
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %101

.thread77:                                        ; preds = %64, %.critedge
  %100 = phi i1 [ %97, %.critedge ], [ %31, %64 ]
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %102

101:                                              ; preds = %98, %92
  %.pn = phi { ptr, i32 } [ %99, %98 ], [ %93, %92 ]
  call void @_ZN4Simd5ArrayIhED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn

102:                                              ; preds = %.thread77, %16
  %.6 = phi i1 [ %100, %.thread77 ], [ %20, %16 ]
  ret i1 %.6
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader14CreateImageRawEPKhjjj(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhE4SwapERKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 #2 = { alwaysinline 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !19, i64 208}
!6 = !{!"_ZTSN4Simd4Base14ImagePngLoaderE", !7, i64 0, !10, i64 120, !9, i64 176, !9, i64 184, !18, i64 192, !18, i64 193, !18, i64 194, !19, i64 196, !19, i64 200, !19, i64 204, !19, i64 208, !10, i64 212, !10, i64 218, !10, i64 219, !10, i64 220, !10, i64 221, !10, i64 222, !20, i64 232, !20, i64 248, !20, i64 264, !21, i64 280}
!7 = !{!"_ZTSN4Simd11ImageLoaderE", !8, i64 8, !15, i64 32, !16, i64 72}
!8 = !{!"_ZTSN4Simd16ImageLoaderParamE", !9, i64 0, !12, i64 8, !13, i64 16, !14, i64 20}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"_ZTS17SimdImageFileType", !10, i64 0}
!14 = !{!"_ZTS19SimdPixelFormatType", !10, i64 0}
!15 = !{!"_ZTSN4Simd17InputMemoryStreamE", !9, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!16 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !12, i64 0, !12, i64 8, !12, i64 16, !17, i64 24, !9, i64 32, !18, i64 40}
!17 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !10, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!"int", !10, i64 0}
!20 = !{!"_ZTSN4Simd5ArrayIhEE", !9, i64 0, !12, i64 8}
!21 = !{!"_ZTSSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!25 = !{!6, !10, i64 218}
!26 = !{!6, !10, i64 220}
!27 = !{!6, !19, i64 196}
!28 = !{!6, !19, i64 200}
!29 = !{!19, !19, i64 0}
!30 = !{!6, !19, i64 204}
!31 = !{!20, !9, i64 0}
!32 = !{!6, !9, i64 264}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = distinct !{!36, !34}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass