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

; 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::Base::ImagePngLoader::Chunk" = type { i32, i32, i32 }
%"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] }>
%"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: 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ParseFileEv(ptr noundef nonnull align 8 dereferenceable(304) %0) #1 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca %"struct.Simd::Base::ImagePngLoader::Chunk", align 4
  %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 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 4
  store i8 1, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 6
  store i8 0, ptr %11, align 2, !tbaa !26
  %12 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 5
  store i8 0, ptr %12, align 1, !tbaa !27
  %13 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CheckHeaderEv(ptr noundef nonnull align 8 dereferenceable(304) %9)
  br i1 %13, label %15, label %14

14:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %162

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  store i8 1, ptr %4, align 1, !tbaa !28
  br label %16

16:                                               ; preds = %111, %15
  %17 = load i8, ptr %4, align 1, !tbaa !28, !range !29, !noundef !30
  %18 = trunc i8 %17 to i1
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 2, ptr %5, align 4
  br label %112

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #5
  %21 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ReadChunkERNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %9, ptr noundef nonnull align 4 dereferenceable(12) %6)
  br i1 %21, label %23, label %22

22:                                               ; preds = %20
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

23:                                               ; preds = %20
  %24 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !31
  %26 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 67, i8 noundef signext 103, i8 noundef signext 66, i8 noundef signext 73)
  %27 = icmp eq i32 %25, %26
  br i1 %27, label %28, label %35

28:                                               ; preds = %23
  %29 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 6
  store i8 1, ptr %29, align 2, !tbaa !26
  %30 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %9, i32 0, i32 2
  %31 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 0
  %32 = load i32, ptr %31, align 4, !tbaa !33
  %33 = zext i32 %32 to i64
  %34 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40) %30, i64 noundef %33)
  br label %103

35:                                               ; preds = %23
  %36 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !31
  %38 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 73, i8 noundef signext 72, i8 noundef signext 68, i8 noundef signext 82)
  %39 = icmp eq i32 %37, %38
  br i1 %39, label %40, label %44

40:                                               ; preds = %35
  %41 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader10ReadHeaderERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %9, ptr noundef nonnull align 4 dereferenceable(12) %6)
  br i1 %41, label %43, label %42

42:                                               ; preds = %40
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

43:                                               ; preds = %40
  br label %102

44:                                               ; preds = %35
  %45 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !31
  %47 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 80, i8 noundef signext 76, i8 noundef signext 84, i8 noundef signext 69)
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %49, label %53

49:                                               ; preds = %44
  %50 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11ReadPaletteERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %9, ptr noundef nonnull align 4 dereferenceable(12) %6)
  br i1 %50, label %52, label %51

51:                                               ; preds = %49
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

52:                                               ; preds = %49
  br label %101

53:                                               ; preds = %44
  %54 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !31
  %56 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 116, i8 noundef signext 82, i8 noundef signext 78, i8 noundef signext 83)
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %58, label %62

58:                                               ; preds = %53
  %59 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader16ReadTransparencyERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %9, ptr noundef nonnull align 4 dereferenceable(12) %6)
  br i1 %59, label %61, label %60

60:                                               ; preds = %58
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

61:                                               ; preds = %58
  br label %100

62:                                               ; preds = %53
  %63 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !31
  %65 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 73, i8 noundef signext 68, i8 noundef signext 65, i8 noundef signext 84)
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %67, label %71

67:                                               ; preds = %62
  %68 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader8ReadDataERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %9, ptr noundef nonnull align 4 dereferenceable(12) %6)
  br i1 %68, label %70, label %69

69:                                               ; preds = %67
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

70:                                               ; preds = %67
  br label %99

71:                                               ; preds = %62
  %72 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !31
  %74 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 73, i8 noundef signext 69, i8 noundef signext 78, i8 noundef signext 68)
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %82

76:                                               ; preds = %71
  %77 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 4
  %78 = load i8, ptr %77, align 8, !tbaa !9, !range !29, !noundef !30
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %81

80:                                               ; preds = %76
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

81:                                               ; preds = %76
  store i8 0, ptr %4, align 1, !tbaa !28
  br label %98

82:                                               ; preds = %71
  %83 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 4
  %84 = load i8, ptr %83, align 8, !tbaa !9, !range !29, !noundef !30
  %85 = trunc i8 %84 to i1
  br i1 %85, label %91, label %86

86:                                               ; preds = %82
  %87 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !31
  %89 = and i32 %88, 536870912
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %86, %82
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %109

92:                                               ; preds = %86
  %93 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %9, i32 0, i32 2
  %94 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %6, i32 0, i32 0
  %95 = load i32, ptr %94, align 4, !tbaa !33
  %96 = zext i32 %95 to i64
  %97 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40) %93, i64 noundef %96)
  br label %98

98:                                               ; preds = %92, %81
  br label %99

99:                                               ; preds = %98, %70
  br label %100

100:                                              ; preds = %99, %61
  br label %101

101:                                              ; preds = %100, %52
  br label %102

102:                                              ; preds = %101, %43
  br label %103

103:                                              ; preds = %102, %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %104 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %9, i32 0, i32 2
  %105 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %104, ptr noundef nonnull align 4 dereferenceable(4) %7)
  br i1 %105, label %107, label %106

106:                                              ; preds = %103
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %108

107:                                              ; preds = %103
  store i32 0, ptr %5, align 4
  br label %108

108:                                              ; preds = %107, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %109

109:                                              ; preds = %108, %91, %80, %69, %60, %51, %42, %22
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #5
  %110 = load i32, ptr %5, align 4
  switch i32 %110, label %112 [
    i32 0, label %111
  ]

111:                                              ; preds = %109
  br label %16, !llvm.loop !34

112:                                              ; preds = %109, %19
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  %113 = load i32, ptr %5, align 4
  switch i32 %113, label %164 [
    i32 2, label %114
    i32 1, label %162
  ]

114:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 4, ptr %8, align 4, !tbaa !36
  %115 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %9, i32 0, i32 1
  %116 = getelementptr inbounds %"struct.Simd::ImageLoaderParam", ptr %115, i32 0, i32 3
  %117 = load i32, ptr %116, align 4, !tbaa !37
  %118 = call noundef i64 @_ZN4Simd4ViewINS_9AllocatorEE12ChannelCountENS2_6FormatE(i32 noundef %117)
  %119 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 9
  %120 = load i32, ptr %119, align 4, !tbaa !38
  %121 = zext i32 %120 to i64
  %122 = icmp eq i64 %118, %121
  br i1 %122, label %123, label %131

123:                                              ; preds = %114
  %124 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 12
  %125 = load i8, ptr %124, align 2, !tbaa !39
  %126 = zext i8 %125 to i32
  %127 = icmp ne i32 %126, 16
  br i1 %127, label %128, label %131

128:                                              ; preds = %123
  %129 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 9
  %130 = load i32, ptr %129, align 4, !tbaa !38
  store i32 %130, ptr %8, align 4, !tbaa !36
  br label %132

131:                                              ; preds = %123, %114
  store i32 4, ptr %8, align 4, !tbaa !36
  br label %132

132:                                              ; preds = %131, %128
  %133 = load i32, ptr %8, align 4, !tbaa !36
  %134 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 9
  %135 = load i32, ptr %134, align 4, !tbaa !38
  %136 = add i32 %135, 1
  %137 = icmp eq i32 %133, %136
  br i1 %137, label %138, label %145

138:                                              ; preds = %132
  %139 = load i32, ptr %8, align 4, !tbaa !36
  %140 = icmp ne i32 %139, 3
  br i1 %140, label %141, label %145

141:                                              ; preds = %138
  %142 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 15
  %143 = load i8, ptr %142, align 1, !tbaa !40
  %144 = icmp ne i8 %143, 0
  br i1 %144, label %145, label %149

145:                                              ; preds = %141, %138, %132
  %146 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 5
  %147 = load i8, ptr %146, align 1, !tbaa !27, !range !29, !noundef !30
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %154

149:                                              ; preds = %145, %141
  %150 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 9
  %151 = load i32, ptr %150, align 4, !tbaa !38
  %152 = add i32 %151, 1
  %153 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 10
  store i32 %152, ptr %153, align 8, !tbaa !41
  br label %158

154:                                              ; preds = %145
  %155 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 9
  %156 = load i32, ptr %155, align 4, !tbaa !38
  %157 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 10
  store i32 %156, ptr %157, align 8, !tbaa !41
  br label %158

158:                                              ; preds = %154, %149
  %159 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %9, i32 0, i32 20
  %160 = call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %159) #5
  %161 = icmp ne i64 %160, 0
  store i1 %161, ptr %2, align 1
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %162

162:                                              ; preds = %158, %112, %14
  %163 = load i1, ptr %2, align 1
  ret i1 %163

164:                                              ; preds = %112
  unreachable
}

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ReadChunkERNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext, i8 noundef signext, i8 noundef signext, i8 noundef signext) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader10ReadHeaderERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11ReadPaletteERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader16ReadTransparencyERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader8ReadDataERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Simd4ViewINS_9AllocatorEE12ChannelCountENS2_6FormatE(i32 noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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, !19, i64 192}
!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, !19, i64 194}
!27 = !{!10, !19, i64 193}
!28 = !{!19, !19, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!32, !20, i64 4}
!32 = !{!"_ZTSN4Simd4Base14ImagePngLoader5ChunkE", !20, i64 0, !20, i64 4, !20, i64 8}
!33 = !{!32, !20, i64 0}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!20, !20, i64 0}
!37 = !{!11, !15, i64 28}
!38 = !{!10, !20, i64 204}
!39 = !{!10, !7, i64 218}
!40 = !{!10, !7, i64 221}
!41 = !{!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"

%"struct.Simd::Base::ImagePngLoader::Chunk" = type { i32, i32, i32 }

; 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ParseFileEv(ptr noundef nonnull align 8 dereferenceable(304) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.Simd::Base::ImagePngLoader::Chunk", align 4
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 192
  store i8 1, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 194
  store i8 0, ptr %5, align 2, !tbaa !25
  %6 = getelementptr inbounds i8, ptr %0, i64 193
  store i8 0, ptr %6, align 1, !tbaa !26
  %7 = tail call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11CheckHeaderEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  br i1 %7, label %.preheader, label %80

.preheader:                                       ; preds = %1
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %10 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ReadChunkERNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br i1 %10, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %56
  %11 = load i32, ptr %8, align 4, !tbaa !27
  %12 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 67, i8 noundef signext 103, i8 noundef signext 66, i8 noundef signext 73)
  %13 = icmp eq i32 %11, %12
  br i1 %13, label %14, label %15

14:                                               ; preds = %.lr.ph
  store i8 1, ptr %5, align 2, !tbaa !25
  br label %.sink.split

15:                                               ; preds = %.lr.ph
  %16 = load i32, ptr %8, align 4, !tbaa !27
  %17 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 73, i8 noundef signext 72, i8 noundef signext 68, i8 noundef signext 82)
  %18 = icmp eq i32 %16, %17
  br i1 %18, label %19, label %21

19:                                               ; preds = %15
  %20 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader10ReadHeaderERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br i1 %20, label %53, label %.loopexit

21:                                               ; preds = %15
  %22 = load i32, ptr %8, align 4, !tbaa !27
  %23 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 80, i8 noundef signext 76, i8 noundef signext 84, i8 noundef signext 69)
  %24 = icmp eq i32 %22, %23
  br i1 %24, label %25, label %27

25:                                               ; preds = %21
  %26 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11ReadPaletteERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br i1 %26, label %53, label %.loopexit

27:                                               ; preds = %21
  %28 = load i32, ptr %8, align 4, !tbaa !27
  %29 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 116, i8 noundef signext 82, i8 noundef signext 78, i8 noundef signext 83)
  %30 = icmp eq i32 %28, %29
  br i1 %30, label %31, label %33

31:                                               ; preds = %27
  %32 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader16ReadTransparencyERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br i1 %32, label %53, label %.loopexit

33:                                               ; preds = %27
  %34 = load i32, ptr %8, align 4, !tbaa !27
  %35 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 73, i8 noundef signext 68, i8 noundef signext 65, i8 noundef signext 84)
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %37, label %39

37:                                               ; preds = %33
  %38 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader8ReadDataERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br i1 %38, label %53, label %.loopexit

39:                                               ; preds = %33
  %40 = load i32, ptr %8, align 4, !tbaa !27
  %41 = call noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext 73, i8 noundef signext 69, i8 noundef signext 78, i8 noundef signext 68)
  %42 = icmp eq i32 %40, %41
  %43 = load i8, ptr %4, align 8, !tbaa !5, !range !29, !noundef !30
  %44 = trunc nuw i8 %43 to i1
  br i1 %42, label %45, label %46

45:                                               ; preds = %39
  br i1 %44, label %.loopexit, label %.thread

46:                                               ; preds = %39
  br i1 %44, label %.loopexit, label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %8, align 4, !tbaa !27
  %49 = and i32 %48, 536870912
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %.loopexit, label %.sink.split

.sink.split:                                      ; preds = %47, %14
  %.sink31 = load i32, ptr %2, align 4, !tbaa !31
  %51 = zext i32 %.sink31 to i64
  %52 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40) %9, i64 noundef %51)
  br label %53

53:                                               ; preds = %.sink.split, %19, %31, %37, %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %54 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br i1 %54, label %56, label %.loopexit

.thread:                                          ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %55 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br i1 %55, label %58, label %.loopexit

56:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #5
  %57 = call noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ReadChunkERNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %2)
  br i1 %57, label %.lr.ph, label %.loopexit, !llvm.loop !32

.loopexit:                                        ; preds = %46, %47, %37, %31, %25, %19, %56, %53, %.preheader, %.thread, %45
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  br label %80

58:                                               ; preds = %.thread
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #5
  %59 = getelementptr inbounds i8, ptr %0, i64 28
  %60 = load i32, ptr %59, align 4, !tbaa !34
  %61 = call noundef i64 @_ZN4Simd4ViewINS_9AllocatorEE12ChannelCountENS2_6FormatE(i32 noundef %60)
  %62 = getelementptr inbounds i8, ptr %0, i64 204
  %63 = load i32, ptr %62, align 4, !tbaa !35
  %64 = zext i32 %63 to i64
  %65 = icmp ne i64 %61, %64
  %66 = getelementptr inbounds i8, ptr %0, i64 218
  %67 = load i8, ptr %66, align 2
  %.not = icmp eq i8 %67, 16
  %or.cond16 = select i1 %65, i1 true, i1 %.not
  %.0 = select i1 %or.cond16, i32 4, i32 %63
  %68 = add i32 %63, 1
  %69 = icmp eq i32 %.0, %68
  %70 = icmp ne i32 %.0, 3
  %or.cond = and i1 %69, %70
  %71 = getelementptr inbounds i8, ptr %0, i64 221
  %72 = load i8, ptr %71, align 1
  %.not14 = icmp eq i8 %72, 0
  %or.cond18 = select i1 %or.cond, i1 %.not14, i1 false
  %73 = load i8, ptr %6, align 1, !range !29
  %74 = trunc nuw i8 %73 to i1
  %75 = select i1 %or.cond18, i1 true, i1 %74
  %.sink = select i1 %75, i32 %68, i32 %63
  %76 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 %.sink, ptr %76, align 8, !tbaa !36
  %77 = getelementptr inbounds i8, ptr %0, i64 280
  %78 = call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #5
  %79 = icmp ne i64 %78, 0
  br label %80

80:                                               ; preds = %.loopexit, %1, %58
  %.4 = phi i1 [ false, %.loopexit ], [ %79, %58 ], [ false, %1 ]
  ret i1 %.4
}

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader9ReadChunkERNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Simd4Base9ChunkTypeEcccc(i8 noundef signext, i8 noundef signext, i8 noundef signext, i8 noundef signext) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader10ReadHeaderERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader11ReadPaletteERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader16ReadTransparencyERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImagePngLoader8ReadDataERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Simd4ViewINS_9AllocatorEE12ChannelCountENS2_6FormatE(i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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, !18, i64 192}
!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, !18, i64 194}
!26 = !{!6, !18, i64 193}
!27 = !{!28, !19, i64 4}
!28 = !{!"_ZTSN4Simd4Base14ImagePngLoader5ChunkE", !19, i64 0, !19, i64 4, !19, i64 8}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!28, !19, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!7, !14, i64 28}
!35 = !{!6, !19, i64 204}
!36 = !{!6, !19, i64 208}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass