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

; 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.Simd::InputMemoryStream" = type { ptr, i64, i64, i64, i64 }
%"class.Simd::OutputMemoryStream" = type { i64, ptr, i64, i64, i64, i64, 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 }
%"struct.Simd::View" = type <{ i64, i64, i64, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"struct.Simd::Array" = type { ptr, i64 }
%"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 }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base4Zlib6DecodeERNS_17InputMemoryStreamERNS_18OutputMemoryStreamEb(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(56), i1 noundef zeroext) #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 i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader10FromStreamEv(ptr noundef nonnull align 8 dereferenceable(304) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca %"class.Simd::InputMemoryStream", align 8
  %5 = alloca %"class.Simd::OutputMemoryStream", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ParseFileEv(ptr noundef nonnull align 8 dereferenceable(304) %9)
  br i1 %10, label %12, label %11

11:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %98

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 40, ptr %4) #5
  call void @_ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv(ptr dead_on_unwind writable sret(%"class.Simd::InputMemoryStream") align 8 %4, ptr noundef nonnull align 8 dereferenceable(304) %9)
  call void @llvm.lifetime.start.p0(i64 56, ptr %5) #5
  %13 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 7
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = zext i32 %14 to i64
  %16 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 12
  %17 = load i8, ptr %16, align 2, !tbaa !26
  %18 = zext i8 %17 to i64
  %19 = mul i64 %15, %18
  %20 = call noundef i64 @_ZN4Simd7AlignHiEmm(i64 noundef %19, i64 noundef 8)
  %21 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 8
  %22 = load i32, ptr %21, align 8, !tbaa !27
  %23 = zext i32 %22 to i64
  %24 = mul i64 %20, %23
  %25 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 9
  %26 = load i32, ptr %25, align 4, !tbaa !28
  %27 = zext i32 %26 to i64
  %28 = mul i64 %24, %27
  %29 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 8
  %30 = load i32, ptr %29, align 8, !tbaa !27
  %31 = zext i32 %30 to i64
  %32 = add i64 %28, %31
  call void @_ZN4Simd18OutputMemoryStreamC2Em(ptr noundef nonnull align 8 dereferenceable(56) %5, i64 noundef %32)
  %33 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 6
  %34 = load i8, ptr %33, align 2, !tbaa !29, !range !30, !noundef !31
  %35 = trunc i8 %34 to i1
  %36 = xor i1 %35, true
  %37 = invoke noundef zeroext i1 @_ZN4Simd4Base4Zlib6DecodeERNS_17InputMemoryStreamERNS_18OutputMemoryStreamEb(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(56) %5, i1 noundef zeroext %36)
          to label %38 unwind label %40

38:                                               ; preds = %12
  br i1 %37, label %44, label %39

39:                                               ; preds = %38
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %97

40:                                               ; preds = %95, %94, %77, %61, %48, %46, %44, %12
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %6, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %7, align 4
  call void @_ZN4Simd18OutputMemoryStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #5
  br label %100

44:                                               ; preds = %38
  %45 = invoke noundef ptr @_ZN4Simd18OutputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %46 unwind label %40

46:                                               ; preds = %44
  %47 = invoke noundef i64 @_ZNK4Simd18OutputMemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(56) %5)
          to label %48 unwind label %40

48:                                               ; preds = %46
  %49 = invoke noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CreateImageEPKhm(ptr noundef nonnull align 8 dereferenceable(304) %9, ptr noundef %45, i64 noundef %47)
          to label %50 unwind label %40

50:                                               ; preds = %48
  br i1 %49, label %52, label %51

51:                                               ; preds = %50
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %97

52:                                               ; preds = %50
  %53 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 5
  %54 = load i8, ptr %53, align 1, !tbaa !32, !range !30, !noundef !31
  %55 = trunc i8 %54 to i1
  br i1 %55, label %56, label %94

56:                                               ; preds = %52
  %57 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 12
  %58 = load i8, ptr %57, align 2, !tbaa !26
  %59 = zext i8 %58 to i32
  %60 = icmp eq i32 %59, 16
  br i1 %60, label %61, label %77

61:                                               ; preds = %56
  %62 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 19
  %63 = getelementptr inbounds %"struct.Simd::Array", ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !33
  %65 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 7
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 8
  %68 = load i32, ptr %67, align 8, !tbaa !27
  %69 = mul i32 %66, %68
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 10
  %72 = load i32, ptr %71, align 8, !tbaa !34
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 11
  %75 = getelementptr inbounds [3 x i16], ptr %74, i64 0, i64 0
  invoke void @_ZN4Simd4Base19ComputeTransparencyItEEvPT_mmS3_(ptr noundef %64, i64 noundef %70, i64 noundef %73, ptr noundef %75)
          to label %76 unwind label %40

76:                                               ; preds = %61
  br label %93

77:                                               ; preds = %56
  %78 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 19
  %79 = getelementptr inbounds %"struct.Simd::Array", ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !33
  %81 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 7
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 8
  %84 = load i32, ptr %83, align 8, !tbaa !27
  %85 = mul i32 %82, %84
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 10
  %88 = load i32, ptr %87, align 8, !tbaa !34
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 16
  %91 = getelementptr inbounds [3 x i8], ptr %90, i64 0, i64 0
  invoke void @_ZN4Simd4Base19ComputeTransparencyIhEEvPT_mmS3_(ptr noundef %80, i64 noundef %86, i64 noundef %89, ptr noundef %91)
          to label %92 unwind label %40

92:                                               ; preds = %77
  br label %93

93:                                               ; preds = %92, %76
  br label %94

94:                                               ; preds = %93, %52
  invoke void @_ZN4Simd4Base14ImagePngLoader13ExpandPaletteEv(ptr noundef nonnull align 8 dereferenceable(304) %9)
          to label %95 unwind label %40

95:                                               ; preds = %94
  invoke void @_ZN4Simd4Base14ImagePngLoader12ConvertImageEv(ptr noundef nonnull align 8 dereferenceable(304) %9)
          to label %96 unwind label %40

96:                                               ; preds = %95
  store i1 true, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %97

97:                                               ; preds = %96, %51, %39
  call void @_ZN4Simd18OutputMemoryStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #5
  br label %98

98:                                               ; preds = %97, %11
  %99 = load i1, ptr %2, align 1
  ret i1 %99

100:                                              ; preds = %40
  %101 = load ptr, ptr %6, align 8
  %102 = load i32, ptr %7, align 4
  %103 = insertvalue { ptr, i32 } poison, ptr %101, 0
  %104 = insertvalue { ptr, i32 } %103, i32 %102, 1
  resume { ptr, i32 } %104
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ParseFileEv(ptr noundef nonnull align 8 dereferenceable(304)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv(ptr dead_on_unwind noalias writable sret(%"class.Simd::InputMemoryStream") align 8, ptr noundef nonnull align 8 dereferenceable(304)) #0 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Simd7AlignHiEmm(i64 noundef, i64 noundef) #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd18OutputMemoryStreamC2Em(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CreateImageEPKhm(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef, i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Simd4Base19ComputeTransparencyItEEvPT_mmS3_(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Simd4Base19ComputeTransparencyIhEEvPT_mmS3_(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Simd4Base14ImagePngLoader13ExpandPaletteEv(ptr noundef nonnull align 8 dereferenceable(304)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Simd4Base14ImagePngLoader12ConvertImageEv(ptr noundef nonnull align 8 dereferenceable(304)) #0 align 2

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

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


; 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.Simd::InputMemoryStream" = type { ptr, i64, i64, i64, i64 }
%"class.Simd::OutputMemoryStream" = type { i64, ptr, i64, i64, i64, i64, i64 }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base4Zlib6DecodeERNS_17InputMemoryStreamERNS_18OutputMemoryStreamEb(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(56), i1 noundef zeroext) 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 i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader10FromStreamEv(ptr noundef nonnull align 8 dereferenceable(304) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.Simd::InputMemoryStream", align 8
  %3 = alloca %"class.Simd::OutputMemoryStream", align 8
  %4 = tail call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ParseFileEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  br i1 %4, label %5, label %59

5:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #5
  call void @_ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv(ptr dead_on_unwind nonnull writable sret(%"class.Simd::InputMemoryStream") align 8 %2, ptr noundef nonnull align 8 dereferenceable(304) %0)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 196
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = getelementptr inbounds i8, ptr %0, i64 218
  %10 = load i8, ptr %9, align 2, !tbaa !25
  %11 = zext i8 %10 to i64
  %12 = mul nuw nsw i64 %11, %8
  %13 = call noundef i64 @_ZN4Simd7AlignHiEmm(i64 noundef %12, i64 noundef 8)
  %14 = getelementptr inbounds i8, ptr %0, i64 200
  %15 = load i32, ptr %14, align 8, !tbaa !26
  %16 = zext i32 %15 to i64
  %17 = mul i64 %13, %16
  %18 = getelementptr inbounds i8, ptr %0, i64 204
  %19 = load i32, ptr %18, align 4, !tbaa !27
  %20 = zext i32 %19 to i64
  %21 = mul i64 %17, %20
  %22 = add i64 %21, %16
  call void @_ZN4Simd18OutputMemoryStreamC2Em(ptr noundef nonnull align 8 dereferenceable(56) %3, i64 noundef %22)
  %23 = getelementptr inbounds i8, ptr %0, i64 194
  %24 = load i8, ptr %23, align 2, !tbaa !28, !range !29, !noundef !30
  %25 = trunc nuw i8 %24 to i1
  %26 = xor i1 %25, true
  %27 = invoke noundef zeroext i1 @_ZN4Simd4Base4Zlib6DecodeERNS_17InputMemoryStreamERNS_18OutputMemoryStreamEb(ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(56) %3, i1 noundef zeroext %26)
          to label %28 unwind label %29

28:                                               ; preds = %5
  br i1 %27, label %31, label %58

29:                                               ; preds = %57, %56, %31, %5
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4Simd18OutputMemoryStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  resume { ptr, i32 } %30

31:                                               ; preds = %28
  %32 = call noundef ptr @_ZN4Simd18OutputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(56) %3)
  %33 = call noundef i64 @_ZNK4Simd18OutputMemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(56) %3)
  %34 = invoke noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CreateImageEPKhm(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef %32, i64 noundef %33)
          to label %35 unwind label %29

35:                                               ; preds = %31
  br i1 %34, label %36, label %58

36:                                               ; preds = %35
  %37 = getelementptr inbounds i8, ptr %0, i64 193
  %38 = load i8, ptr %37, align 1, !tbaa !31, !range !29, !noundef !30
  %39 = trunc nuw i8 %38 to i1
  br i1 %39, label %40, label %56

40:                                               ; preds = %36
  %41 = load i8, ptr %9, align 2, !tbaa !25
  %42 = icmp eq i8 %41, 16
  %43 = getelementptr inbounds i8, ptr %0, i64 264
  %44 = load ptr, ptr %43, align 8, !tbaa !32
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = load i32, ptr %14, align 8, !tbaa !26
  %47 = mul i32 %46, %45
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %0, i64 208
  %50 = load i32, ptr %49, align 8, !tbaa !33
  %51 = zext i32 %50 to i64
  br i1 %42, label %52, label %54

52:                                               ; preds = %40
  %53 = getelementptr inbounds i8, ptr %0, i64 212
  call void @_ZN4Simd4Base19ComputeTransparencyItEEvPT_mmS3_(ptr noundef %44, i64 noundef %48, i64 noundef %51, ptr noundef nonnull %53)
  br label %56

54:                                               ; preds = %40
  %55 = getelementptr inbounds i8, ptr %0, i64 222
  call void @_ZN4Simd4Base19ComputeTransparencyIhEEvPT_mmS3_(ptr noundef %44, i64 noundef %48, i64 noundef %51, ptr noundef nonnull %55)
  br label %56

56:                                               ; preds = %52, %54, %36
  invoke void @_ZN4Simd4Base14ImagePngLoader13ExpandPaletteEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
          to label %57 unwind label %29

57:                                               ; preds = %56
  invoke void @_ZN4Simd4Base14ImagePngLoader12ConvertImageEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
          to label %58 unwind label %29

58:                                               ; preds = %57, %35, %28
  %.0 = phi i1 [ false, %28 ], [ false, %35 ], [ true, %57 ]
  call void @_ZN4Simd18OutputMemoryStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #5
  br label %59

59:                                               ; preds = %1, %58
  %.1 = phi i1 [ %.0, %58 ], [ false, %1 ]
  ret i1 %.1
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ParseFileEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv(ptr dead_on_unwind noalias writable sret(%"class.Simd::InputMemoryStream") align 8, ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #0 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Simd7AlignHiEmm(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd18OutputMemoryStreamC2Em(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) unnamed_addr #3 align 2

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK4Simd18OutputMemoryStream4SizeEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Simd4Base19ComputeTransparencyItEEvPT_mmS3_(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4Simd4Base19ComputeTransparencyIhEEvPT_mmS3_(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Simd4Base14ImagePngLoader13ExpandPaletteEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Simd4Base14ImagePngLoader12ConvertImageEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #0 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #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 196}
!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, !19, i64 200}
!27 = !{!6, !19, i64 204}
!28 = !{!6, !18, i64 194}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!6, !18, i64 193}
!32 = !{!6, !9, i64 264}
!33 = !{!6, !19, i64 208}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass