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

; 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::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 }
%"struct.Simd::Base::ImagePngLoader::Chunk" = type { i32, i32, i32 }

; 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 @_ZN4Simd4Base14ImagePngLoader10ReadHeaderERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 16777216, ptr %6, align 4, !tbaa !9
  %11 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 4
  %12 = load i8, ptr %11, align 8, !tbaa !11, !range !27, !noundef !28
  %13 = trunc i8 %12 to i1
  br i1 %13, label %15, label %14

14:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %186

15:                                               ; preds = %2
  %16 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 4
  store i8 0, ptr %16, align 8, !tbaa !11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %17, i32 0, i32 0
  %19 = load i32, ptr %18, align 4, !tbaa !29
  %20 = icmp eq i32 %19, 13
  br i1 %20, label %21, label %24

21:                                               ; preds = %15
  %22 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %23 = call noundef zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40) %22, i64 noundef 13)
  br i1 %23, label %25, label %24

24:                                               ; preds = %21, %15
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %186

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  %26 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %27 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 7
  %28 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
  br i1 %28, label %29, label %51

29:                                               ; preds = %25
  %30 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %31 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 8
  %32 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %30, ptr noundef nonnull align 4 dereferenceable(4) %31)
  br i1 %32, label %33, label %51

33:                                               ; preds = %29
  %34 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %35 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %36 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %34, ptr noundef nonnull align 1 dereferenceable(1) %35)
  br i1 %36, label %37, label %51

37:                                               ; preds = %33
  %38 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %39 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %40 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %38, ptr noundef nonnull align 1 dereferenceable(1) %39)
  br i1 %40, label %41, label %51

41:                                               ; preds = %37
  %42 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %43 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %42, ptr noundef nonnull align 1 dereferenceable(1) %8)
  br i1 %43, label %44, label %51

44:                                               ; preds = %41
  %45 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %46 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %45, ptr noundef nonnull align 1 dereferenceable(1) %9)
  br i1 %46, label %47, label %51

47:                                               ; preds = %44
  %48 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %10, i32 0, i32 2
  %49 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 14
  %50 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %48, ptr noundef nonnull align 1 dereferenceable(1) %49)
  br i1 %50, label %52, label %51

51:                                               ; preds = %47, %44, %41, %37, %33, %29, %25
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

52:                                               ; preds = %47
  %53 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 7
  %54 = load i32, ptr %53, align 4, !tbaa !31
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %68, label %56

56:                                               ; preds = %52
  %57 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 7
  %58 = load i32, ptr %57, align 4, !tbaa !31
  %59 = icmp ugt i32 %58, 16777216
  br i1 %59, label %68, label %60

60:                                               ; preds = %56
  %61 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 8
  %62 = load i32, ptr %61, align 8, !tbaa !32
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %68, label %64

64:                                               ; preds = %60
  %65 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 8
  %66 = load i32, ptr %65, align 8, !tbaa !32
  %67 = icmp ugt i32 %66, 16777216
  br i1 %67, label %68, label %69

68:                                               ; preds = %64, %60, %56, %52
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

69:                                               ; preds = %64
  %70 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %71 = load i8, ptr %70, align 2, !tbaa !33
  %72 = zext i8 %71 to i32
  %73 = icmp ne i32 %72, 1
  br i1 %73, label %74, label %95

74:                                               ; preds = %69
  %75 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %76 = load i8, ptr %75, align 2, !tbaa !33
  %77 = zext i8 %76 to i32
  %78 = icmp ne i32 %77, 2
  br i1 %78, label %79, label %95

79:                                               ; preds = %74
  %80 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %81 = load i8, ptr %80, align 2, !tbaa !33
  %82 = zext i8 %81 to i32
  %83 = icmp ne i32 %82, 4
  br i1 %83, label %84, label %95

84:                                               ; preds = %79
  %85 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %86 = load i8, ptr %85, align 2, !tbaa !33
  %87 = zext i8 %86 to i32
  %88 = icmp ne i32 %87, 8
  br i1 %88, label %89, label %95

89:                                               ; preds = %84
  %90 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %91 = load i8, ptr %90, align 2, !tbaa !33
  %92 = zext i8 %91 to i32
  %93 = icmp ne i32 %92, 16
  br i1 %93, label %94, label %95

94:                                               ; preds = %89
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

95:                                               ; preds = %89, %84, %79, %74, %69
  %96 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %97 = load i8, ptr %96, align 1, !tbaa !34
  %98 = zext i8 %97 to i32
  %99 = icmp sgt i32 %98, 6
  br i1 %99, label %110, label %100

100:                                              ; preds = %95
  %101 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %102 = load i8, ptr %101, align 1, !tbaa !34
  %103 = zext i8 %102 to i32
  %104 = icmp eq i32 %103, 3
  br i1 %104, label %105, label %111

105:                                              ; preds = %100
  %106 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 12
  %107 = load i8, ptr %106, align 2, !tbaa !33
  %108 = zext i8 %107 to i32
  %109 = icmp eq i32 %108, 16
  br i1 %109, label %110, label %111

110:                                              ; preds = %105, %95
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

111:                                              ; preds = %105, %100
  %112 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 15
  store i8 0, ptr %112, align 1, !tbaa !35
  %113 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %114 = load i8, ptr %113, align 1, !tbaa !34
  %115 = zext i8 %114 to i32
  %116 = icmp eq i32 %115, 3
  br i1 %116, label %117, label %119

117:                                              ; preds = %111
  %118 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 15
  store i8 3, ptr %118, align 1, !tbaa !35
  br label %127

119:                                              ; preds = %111
  %120 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %121 = load i8, ptr %120, align 1, !tbaa !34
  %122 = zext i8 %121 to i32
  %123 = and i32 %122, 1
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %119
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

126:                                              ; preds = %119
  br label %127

127:                                              ; preds = %126, %117
  %128 = load i8, ptr %8, align 1, !tbaa !36
  %129 = zext i8 %128 to i32
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %140, label %131

131:                                              ; preds = %127
  %132 = load i8, ptr %9, align 1, !tbaa !36
  %133 = zext i8 %132 to i32
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %140, label %135

135:                                              ; preds = %131
  %136 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 14
  %137 = load i8, ptr %136, align 4, !tbaa !37
  %138 = zext i8 %137 to i32
  %139 = icmp sgt i32 %138, 1
  br i1 %139, label %140, label %141

140:                                              ; preds = %135, %131, %127
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

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

145:                                              ; preds = %141
  %146 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %147 = load i8, ptr %146, align 1, !tbaa !34
  %148 = zext i8 %147 to i32
  %149 = and i32 %148, 2
  %150 = icmp ne i32 %149, 0
  %151 = zext i1 %150 to i64
  %152 = select i1 %150, i32 3, i32 1
  %153 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 13
  %154 = load i8, ptr %153, align 1, !tbaa !34
  %155 = zext i8 %154 to i32
  %156 = and i32 %155, 4
  %157 = icmp ne i32 %156, 0
  %158 = zext i1 %157 to i64
  %159 = select i1 %157, i32 1, i32 0
  %160 = add nsw i32 %152, %159
  %161 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 9
  store i32 %160, ptr %161, align 4, !tbaa !38
  %162 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 7
  %163 = load i32, ptr %162, align 4, !tbaa !31
  %164 = udiv i32 1073741824, %163
  %165 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 9
  %166 = load i32, ptr %165, align 4, !tbaa !38
  %167 = udiv i32 %164, %166
  %168 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 8
  %169 = load i32, ptr %168, align 8, !tbaa !32
  %170 = icmp ult i32 %167, %169
  br i1 %170, label %171, label %172

171:                                              ; preds = %145
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

172:                                              ; preds = %145
  br label %184

173:                                              ; preds = %141
  %174 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 9
  store i32 1, ptr %174, align 4, !tbaa !38
  %175 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 7
  %176 = load i32, ptr %175, align 4, !tbaa !31
  %177 = udiv i32 1073741824, %176
  %178 = udiv i32 %177, 4
  %179 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %10, i32 0, i32 8
  %180 = load i32, ptr %179, align 8, !tbaa !32
  %181 = icmp ult i32 %178, %180
  br i1 %181, label %182, label %183

182:                                              ; preds = %173
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

183:                                              ; preds = %173
  br label %184

184:                                              ; preds = %183, %172
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %185

185:                                              ; preds = %184, %182, %171, %140, %125, %110, %94, %68, %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  br label %186

186:                                              ; preds = %185, %24, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %187 = load i1, ptr %3, align 1
  ret i1 %187
}

; 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 zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 1 dereferenceable(1)) #3 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !21, i64 192}
!12 = !{!"_ZTSN4Simd4Base14ImagePngLoaderE", !13, i64 0, !7, i64 120, !6, i64 176, !6, i64 184, !21, i64 192, !21, i64 193, !21, i64 194, !10, i64 196, !10, i64 200, !10, i64 204, !10, 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, !18, i64 32, !19, i64 72}
!14 = !{!"_ZTSN4Simd16ImageLoaderParamE", !6, i64 0, !15, i64 8, !16, i64 16, !17, i64 20}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTS17SimdImageFileType", !7, i64 0}
!17 = !{!"_ZTS19SimdPixelFormatType", !7, i64 0}
!18 = !{!"_ZTSN4Simd17InputMemoryStreamE", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!19 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !15, i64 0, !15, i64 8, !15, i64 16, !20, i64 24, !6, i64 32, !21, i64 40}
!20 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSN4Simd5ArrayIhEE", !6, i64 0, !15, 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 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!30, !10, i64 0}
!30 = !{!"_ZTSN4Simd4Base14ImagePngLoader5ChunkE", !10, i64 0, !10, i64 4, !10, i64 8}
!31 = !{!12, !10, i64 196}
!32 = !{!12, !10, i64 200}
!33 = !{!12, !7, i64 218}
!34 = !{!12, !7, i64 219}
!35 = !{!12, !7, i64 221}
!36 = !{!7, !7, i64 0}
!37 = !{!12, !7, i64 220}
!38 = !{!12, !10, i64 204}


; 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"

; 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 @_ZN4Simd4Base14ImagePngLoader10ReadHeaderERKNS1_5ChunkE(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(12) %1) local_unnamed_addr #1 align 2 {
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = getelementptr inbounds i8, ptr %0, i64 192
  %6 = load i8, ptr %5, align 8, !tbaa !5, !range !25, !noundef !26
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %8, label %77

8:                                                ; preds = %2
  store i8 0, ptr %5, align 8, !tbaa !5
  %9 = load i32, ptr %1, align 4, !tbaa !27
  %10 = icmp eq i32 %9, 13
  br i1 %10, label %11, label %77

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = tail call noundef zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40) %12, i64 noundef 13)
  br i1 %13, label %14, label %77

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #4
  %15 = getelementptr inbounds i8, ptr %0, i64 196
  %16 = tail call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 4 dereferenceable(4) %15)
  br i1 %16, label %17, label %76

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %0, i64 200
  %19 = tail call noundef zeroext i1 @_ZN4Simd17InputMemoryStream9ReadBe32uERj(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 4 dereferenceable(4) %18)
  br i1 %19, label %20, label %76

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %0, i64 218
  %22 = tail call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 1 dereferenceable(1) %21)
  br i1 %22, label %23, label %76

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 219
  %25 = tail call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 1 dereferenceable(1) %24)
  br i1 %25, label %26, label %76

26:                                               ; preds = %23
  %27 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 1 dereferenceable(1) %3)
  br i1 %27, label %28, label %76

28:                                               ; preds = %26
  %29 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 1 dereferenceable(1) %4)
  br i1 %29, label %30, label %76

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %0, i64 220
  %32 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull align 1 dereferenceable(1) %31)
  br i1 %32, label %33, label %76

33:                                               ; preds = %30
  %34 = load i32, ptr %15, align 4, !tbaa !29
  %35 = add i32 %34, -16777217
  %or.cond18 = icmp ult i32 %35, -16777216
  br i1 %or.cond18, label %76, label %36

36:                                               ; preds = %33
  %37 = load i32, ptr %18, align 8, !tbaa !30
  %38 = add i32 %37, -16777217
  %or.cond19 = icmp ult i32 %38, -16777216
  br i1 %or.cond19, label %76, label %39

39:                                               ; preds = %36
  %40 = load i8, ptr %21, align 2
  switch i8 %40, label %76 [
    i8 1, label %41
    i8 2, label %41
    i8 4, label %41
    i8 8, label %41
    i8 16, label %41
  ]

41:                                               ; preds = %39, %39, %39, %39, %39
  %42 = load i8, ptr %24, align 1, !tbaa !31
  %43 = icmp ugt i8 %42, 6
  br i1 %43, label %76, label %44

44:                                               ; preds = %41
  %45 = icmp eq i8 %42, 3
  %46 = icmp eq i8 %40, 16
  %or.cond21 = and i1 %46, %45
  br i1 %or.cond21, label %76, label %47

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %0, i64 221
  store i8 0, ptr %48, align 1, !tbaa !32
  br i1 %45, label %49, label %50

49:                                               ; preds = %47
  store i8 3, ptr %48, align 1, !tbaa !32
  br label %52

50:                                               ; preds = %47
  %51 = and i8 %42, 1
  %.not14 = icmp eq i8 %51, 0
  br i1 %.not14, label %52, label %76

52:                                               ; preds = %50, %49
  %53 = load i8, ptr %3, align 1, !tbaa !33
  %54 = icmp ne i8 %53, 0
  %55 = load i8, ptr %4, align 1
  %56 = icmp ne i8 %55, 0
  %or.cond = select i1 %54, i1 true, i1 %56
  %57 = load i8, ptr %31, align 4
  %58 = icmp ugt i8 %57, 1
  %or.cond23 = select i1 %or.cond, i1 true, i1 %58
  br i1 %or.cond23, label %76, label %59

59:                                               ; preds = %52
  br i1 %45, label %70, label %60

60:                                               ; preds = %59
  %61 = zext nneg i8 %42 to i32
  %62 = and i32 %61, 2
  %63 = or disjoint i32 %62, 1
  %64 = lshr i32 %61, 2
  %65 = add nuw nsw i32 %63, %64
  %66 = getelementptr inbounds i8, ptr %0, i64 204
  store i32 %65, ptr %66, align 4, !tbaa !34
  %67 = udiv i32 1073741824, %34
  %68 = udiv i32 %67, %65
  %69 = icmp ult i32 %68, %37
  br i1 %69, label %76, label %75

70:                                               ; preds = %59
  %71 = getelementptr inbounds i8, ptr %0, i64 204
  store i32 1, ptr %71, align 4, !tbaa !34
  %72 = udiv i32 1073741824, %34
  %73 = lshr i32 %72, 2
  %74 = icmp ult i32 %73, %37
  br i1 %74, label %76, label %75

75:                                               ; preds = %70, %60
  br label %76

76:                                               ; preds = %70, %60, %52, %50, %41, %44, %39, %33, %36, %14, %17, %20, %23, %26, %28, %30, %75
  %.0 = phi i1 [ true, %75 ], [ false, %30 ], [ false, %28 ], [ false, %26 ], [ false, %23 ], [ false, %20 ], [ false, %17 ], [ false, %14 ], [ false, %36 ], [ false, %33 ], [ false, %39 ], [ false, %44 ], [ false, %41 ], [ false, %50 ], [ false, %52 ], [ false, %60 ], [ false, %70 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #4
  br label %77

77:                                               ; preds = %8, %11, %2, %76
  %.1 = phi i1 [ %.0, %76 ], [ false, %2 ], [ false, %11 ], [ false, %8 ]
  ret i1 %.1
}

; 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 zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream6Read8uERh(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 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 = { 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 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!28, !19, i64 0}
!28 = !{!"_ZTSN4Simd4Base14ImagePngLoader5ChunkE", !19, i64 0, !19, i64 4, !19, i64 8}
!29 = !{!6, !19, i64 196}
!30 = !{!6, !19, i64 200}
!31 = !{!6, !10, i64 219}
!32 = !{!6, !10, i64 221}
!33 = !{!10, !10, i64 0}
!34 = !{!6, !19, i64 204}


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