; LLVM IR from CubbyFlow/RenderFlow :: Extensions/FlowEditor/sample_utils/file_png.ll (Z15lodepng_inspectPjS_P12LodePNGStatePKhm)

; 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.LodePNGState = type <{ ptr, %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32, [4 x i8] }>
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, %struct.LodePNGTime, i32, i32, i32, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef) #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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef, i64 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15lodepng_inspectPjS_P12LodePNGStatePKhm(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.LodePNGState, ptr %16, i32 0, i32 4
  store ptr %17, ptr %12, align 8, !tbaa !5
  %18 = load i64, ptr %11, align 8, !tbaa !9
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %23, label %20

20:                                               ; preds = %5
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %26

23:                                               ; preds = %20, %5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.LodePNGState, ptr %24, i32 0, i32 5
  store i32 48, ptr %25, align 8, !tbaa !11
  store i32 48, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

26:                                               ; preds = %20
  %27 = load i64, ptr %11, align 8, !tbaa !9
  %28 = icmp ult i64 %27, 29
  br i1 %28, label %29, label %32

29:                                               ; preds = %26
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.LodePNGState, ptr %30, i32 0, i32 5
  store i32 27, ptr %31, align 8, !tbaa !11
  store i32 27, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

32:                                               ; preds = %26
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef %33)
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef %34)
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 0
  %37 = load i8, ptr %36, align 1, !tbaa !24
  %38 = zext i8 %37 to i32
  %39 = icmp ne i32 %38, 137
  br i1 %39, label %82, label %40

40:                                               ; preds = %32
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 1
  %43 = load i8, ptr %42, align 1, !tbaa !24
  %44 = zext i8 %43 to i32
  %45 = icmp ne i32 %44, 80
  br i1 %45, label %82, label %46

46:                                               ; preds = %40
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 2
  %49 = load i8, ptr %48, align 1, !tbaa !24
  %50 = zext i8 %49 to i32
  %51 = icmp ne i32 %50, 78
  br i1 %51, label %82, label %52

52:                                               ; preds = %46
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 3
  %55 = load i8, ptr %54, align 1, !tbaa !24
  %56 = zext i8 %55 to i32
  %57 = icmp ne i32 %56, 71
  br i1 %57, label %82, label %58

58:                                               ; preds = %52
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  %61 = load i8, ptr %60, align 1, !tbaa !24
  %62 = zext i8 %61 to i32
  %63 = icmp ne i32 %62, 13
  br i1 %63, label %82, label %64

64:                                               ; preds = %58
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 5
  %67 = load i8, ptr %66, align 1, !tbaa !24
  %68 = zext i8 %67 to i32
  %69 = icmp ne i32 %68, 10
  br i1 %69, label %82, label %70

70:                                               ; preds = %64
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 6
  %73 = load i8, ptr %72, align 1, !tbaa !24
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %74, 26
  br i1 %75, label %82, label %76

76:                                               ; preds = %70
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 7
  %79 = load i8, ptr %78, align 1, !tbaa !24
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 10
  br i1 %81, label %82, label %85

82:                                               ; preds = %76, %70, %64, %58, %52, %46, %40, %32
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.LodePNGState, ptr %83, i32 0, i32 5
  store i32 28, ptr %84, align 8, !tbaa !11
  store i32 28, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

85:                                               ; preds = %76
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i64 12
  %88 = load i8, ptr %87, align 1, !tbaa !24
  %89 = zext i8 %88 to i32
  %90 = icmp ne i32 %89, 73
  br i1 %90, label %109, label %91

91:                                               ; preds = %85
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 13
  %94 = load i8, ptr %93, align 1, !tbaa !24
  %95 = zext i8 %94 to i32
  %96 = icmp ne i32 %95, 72
  br i1 %96, label %109, label %97

97:                                               ; preds = %91
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i64 14
  %100 = load i8, ptr %99, align 1, !tbaa !24
  %101 = zext i8 %100 to i32
  %102 = icmp ne i32 %101, 68
  br i1 %102, label %109, label %103

103:                                              ; preds = %97
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 15
  %106 = load i8, ptr %105, align 1, !tbaa !24
  %107 = zext i8 %106 to i32
  %108 = icmp ne i32 %107, 82
  br i1 %108, label %109, label %112

109:                                              ; preds = %103, %97, %91, %85
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.LodePNGState, ptr %110, i32 0, i32 5
  store i32 29, ptr %111, align 8, !tbaa !11
  store i32 29, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

112:                                              ; preds = %103
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 16
  %115 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %114)
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %115, ptr %116, align 4, !tbaa !25
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i64 20
  %119 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %118)
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %119, ptr %120, align 4, !tbaa !25
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i64 24
  %123 = load i8, ptr %122, align 1, !tbaa !24
  %124 = zext i8 %123 to i32
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.LodePNGInfo, ptr %125, i32 0, i32 3
  %127 = getelementptr inbounds %struct.LodePNGColorMode, ptr %126, i32 0, i32 1
  store i32 %124, ptr %127, align 4, !tbaa !26
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds i8, ptr %128, i64 25
  %130 = load i8, ptr %129, align 1, !tbaa !24
  %131 = zext i8 %130 to i32
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.LodePNGInfo, ptr %132, i32 0, i32 3
  %134 = getelementptr inbounds %struct.LodePNGColorMode, ptr %133, i32 0, i32 0
  store i32 %131, ptr %134, align 8, !tbaa !27
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = getelementptr inbounds i8, ptr %135, i64 26
  %137 = load i8, ptr %136, align 1, !tbaa !24
  %138 = zext i8 %137 to i32
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.LodePNGInfo, ptr %139, i32 0, i32 0
  store i32 %138, ptr %140, align 8, !tbaa !28
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = getelementptr inbounds i8, ptr %141, i64 27
  %143 = load i8, ptr %142, align 1, !tbaa !24
  %144 = zext i8 %143 to i32
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.LodePNGInfo, ptr %145, i32 0, i32 1
  store i32 %144, ptr %146, align 4, !tbaa !29
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = getelementptr inbounds i8, ptr %147, i64 28
  %149 = load i8, ptr %148, align 1, !tbaa !24
  %150 = zext i8 %149 to i32
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.LodePNGInfo, ptr %151, i32 0, i32 2
  store i32 %150, ptr %152, align 8, !tbaa !30
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.LodePNGState, ptr %153, i32 0, i32 1
  %155 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !31
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %175, label %158

158:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = getelementptr inbounds i8, ptr %159, i64 29
  %161 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %160)
  store i32 %161, ptr %14, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  %163 = getelementptr inbounds i8, ptr %162, i64 12
  %164 = call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef %163, i64 noundef 17)
  store i32 %164, ptr %15, align 4, !tbaa !25
  %165 = load i32, ptr %14, align 4, !tbaa !25
  %166 = load i32, ptr %15, align 4, !tbaa !25
  %167 = icmp ne i32 %165, %166
  br i1 %167, label %168, label %171

168:                                              ; preds = %158
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.LodePNGState, ptr %169, i32 0, i32 5
  store i32 57, ptr %170, align 8, !tbaa !11
  store i32 57, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %172

171:                                              ; preds = %158
  store i32 0, ptr %13, align 4
  br label %172

172:                                              ; preds = %171, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %173 = load i32, ptr %13, align 4
  switch i32 %173, label %214 [
    i32 0, label %174
  ]

174:                                              ; preds = %172
  br label %175

175:                                              ; preds = %174, %112
  %176 = load ptr, ptr %12, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.LodePNGInfo, ptr %176, i32 0, i32 0
  %178 = load i32, ptr %177, align 8, !tbaa !28
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %183

180:                                              ; preds = %175
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.LodePNGState, ptr %181, i32 0, i32 5
  store i32 32, ptr %182, align 8, !tbaa !11
  store i32 32, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

183:                                              ; preds = %175
  %184 = load ptr, ptr %12, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.LodePNGInfo, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !29
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %191

188:                                              ; preds = %183
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.LodePNGState, ptr %189, i32 0, i32 5
  store i32 33, ptr %190, align 8, !tbaa !11
  store i32 33, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

191:                                              ; preds = %183
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.LodePNGInfo, ptr %192, i32 0, i32 2
  %194 = load i32, ptr %193, align 8, !tbaa !30
  %195 = icmp ugt i32 %194, 1
  br i1 %195, label %196, label %199

196:                                              ; preds = %191
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.LodePNGState, ptr %197, i32 0, i32 5
  store i32 34, ptr %198, align 8, !tbaa !11
  store i32 34, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

199:                                              ; preds = %191
  %200 = load ptr, ptr %12, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.LodePNGInfo, ptr %200, i32 0, i32 3
  %202 = getelementptr inbounds %struct.LodePNGColorMode, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !27
  %204 = load ptr, ptr %12, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.LodePNGInfo, ptr %204, i32 0, i32 3
  %206 = getelementptr inbounds %struct.LodePNGColorMode, ptr %205, i32 0, i32 1
  %207 = load i32, ptr %206, align 4, !tbaa !26
  %208 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %203, i32 noundef %207)
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.LodePNGState, ptr %209, i32 0, i32 5
  store i32 %208, ptr %210, align 8, !tbaa !11
  %211 = load ptr, ptr %9, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.LodePNGState, ptr %211, i32 0, i32 5
  %213 = load i32, ptr %212, align 8, !tbaa !11
  store i32 %213, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

214:                                              ; preds = %199, %196, %188, %180, %172, %109, %82, %29, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %215 = load i32, ptr %6, align 4
  ret i32 %215
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef, i32 noundef) #0

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !15, i64 416}
!12 = !{!"_ZTS12LodePNGState", !13, i64 8, !16, i64 56, !20, i64 144, !22, i64 184, !15, i64 416}
!13 = !{!"_ZTS22LodePNGDecoderSettings", !14, i64 0, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44}
!14 = !{!"_ZTS25LodePNGDecompressSettings", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS22LodePNGEncoderSettings", !17, i64 0, !18, i64 48, !15, i64 52, !19, i64 56, !6, i64 64, !15, i64 72, !15, i64 76, !15, i64 80}
!17 = !{!"_ZTS23LodePNGCompressSettings", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!18 = !{!"_ZTS18LodePNGAutoConvert", !7, i64 0}
!19 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!20 = !{!"_ZTS16LodePNGColorMode", !21, i64 0, !15, i64 4, !6, i64 8, !10, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!21 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!22 = !{!"_ZTS11LodePNGInfo", !15, i64 0, !15, i64 4, !15, i64 8, !20, i64 16, !15, i64 56, !15, i64 60, !15, i64 64, !15, i64 68, !10, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !23, i64 140, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !7, i64 184, !7, i64 208}
!23 = !{!"_ZTS11LodePNGTime", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!24 = !{!7, !7, i64 0}
!25 = !{!15, !15, i64 0}
!26 = !{!22, !15, i64 20}
!27 = !{!22, !21, i64 16}
!28 = !{!22, !15, i64 0}
!29 = !{!22, !15, i64 4}
!30 = !{!22, !15, i64 8}
!31 = !{!12, !15, i64 40}


; 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 nounwind uwtable
declare dso_local noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15lodepng_inspectPjS_P12LodePNGStatePKhm(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, ptr noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %2, i64 184
  %7 = icmp eq i64 %4, 0
  %8 = icmp eq ptr %3, null
  %or.cond = or i1 %8, %7
  br i1 %or.cond, label %86, label %9

9:                                                ; preds = %5
  %10 = icmp ult i64 %4, 29
  br i1 %10, label %86, label %11

11:                                               ; preds = %9
  tail call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef nonnull %6)
  tail call void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef nonnull %6)
  %12 = load i8, ptr %3, align 1, !tbaa !5
  %.not = icmp eq i8 %12, -119
  br i1 %.not, label %13, label %86

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %3, i64 1
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %.not56 = icmp eq i8 %15, 80
  br i1 %.not56, label %16, label %86

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %3, i64 2
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %.not57 = icmp eq i8 %18, 78
  br i1 %.not57, label %19, label %86

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %3, i64 3
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %.not58 = icmp eq i8 %21, 71
  br i1 %.not58, label %22, label %86

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %3, i64 4
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %.not59 = icmp eq i8 %24, 13
  br i1 %.not59, label %25, label %86

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %3, i64 5
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %.not60 = icmp eq i8 %27, 10
  br i1 %.not60, label %28, label %86

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %3, i64 6
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %.not61 = icmp eq i8 %30, 26
  br i1 %.not61, label %31, label %86

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %3, i64 7
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %.not62 = icmp eq i8 %33, 10
  br i1 %.not62, label %34, label %86

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %3, i64 12
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %.not63 = icmp eq i8 %36, 73
  br i1 %.not63, label %37, label %86

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %3, i64 13
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %.not64 = icmp eq i8 %39, 72
  br i1 %.not64, label %40, label %86

40:                                               ; preds = %37
  %41 = getelementptr inbounds i8, ptr %3, i64 14
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %.not65 = icmp eq i8 %42, 68
  br i1 %.not65, label %43, label %86

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %3, i64 15
  %45 = load i8, ptr %44, align 1, !tbaa !5
  %.not66 = icmp eq i8 %45, 82
  br i1 %.not66, label %46, label %86

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %3, i64 16
  %48 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %47)
  store i32 %48, ptr %0, align 4, !tbaa !8
  %49 = getelementptr inbounds i8, ptr %3, i64 20
  %50 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %49)
  store i32 %50, ptr %1, align 4, !tbaa !8
  %51 = getelementptr inbounds i8, ptr %3, i64 24
  %52 = load i8, ptr %51, align 1, !tbaa !5
  %53 = zext i8 %52 to i32
  %54 = getelementptr inbounds i8, ptr %2, i64 200
  %55 = getelementptr inbounds i8, ptr %2, i64 204
  store i32 %53, ptr %55, align 4, !tbaa !10
  %56 = getelementptr inbounds i8, ptr %3, i64 25
  %57 = load i8, ptr %56, align 1, !tbaa !5
  %58 = zext i8 %57 to i32
  store i32 %58, ptr %54, align 8, !tbaa !17
  %59 = getelementptr inbounds i8, ptr %3, i64 26
  %60 = load i8, ptr %59, align 1, !tbaa !5
  %61 = zext i8 %60 to i32
  store i32 %61, ptr %6, align 8, !tbaa !18
  %62 = getelementptr inbounds i8, ptr %3, i64 27
  %63 = load i8, ptr %62, align 1, !tbaa !5
  %64 = zext i8 %63 to i32
  %65 = getelementptr inbounds i8, ptr %2, i64 188
  store i32 %64, ptr %65, align 4, !tbaa !19
  %66 = getelementptr inbounds i8, ptr %3, i64 28
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %68 = zext i8 %67 to i32
  %69 = getelementptr inbounds i8, ptr %2, i64 192
  store i32 %68, ptr %69, align 8, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %2, i64 40
  %71 = load i32, ptr %70, align 8, !tbaa !21
  %.not67 = icmp eq i32 %71, 0
  br i1 %.not67, label %72, label %.critedge

72:                                               ; preds = %46
  %73 = getelementptr inbounds i8, ptr %3, i64 29
  %74 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %73)
  %75 = tail call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef nonnull %35, i64 noundef 17)
  %.not68 = icmp eq i32 %74, %75
  br i1 %.not68, label %..critedge_crit_edge, label %86

..critedge_crit_edge:                             ; preds = %72
  %.pre = load i32, ptr %6, align 8, !tbaa !18
  br label %.critedge

.critedge:                                        ; preds = %..critedge_crit_edge, %46
  %76 = phi i32 [ %.pre, %..critedge_crit_edge ], [ %61, %46 ]
  %.not69 = icmp eq i32 %76, 0
  br i1 %.not69, label %77, label %86

77:                                               ; preds = %.critedge
  %78 = load i32, ptr %65, align 4, !tbaa !19
  %.not70 = icmp eq i32 %78, 0
  br i1 %.not70, label %79, label %86

79:                                               ; preds = %77
  %80 = load i32, ptr %69, align 8, !tbaa !20
  %81 = icmp ugt i32 %80, 1
  br i1 %81, label %86, label %82

82:                                               ; preds = %79
  %83 = load i32, ptr %54, align 8, !tbaa !17
  %84 = load i32, ptr %55, align 4, !tbaa !10
  %85 = tail call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %83, i32 noundef %84)
  br label %86

86:                                               ; preds = %79, %77, %.critedge, %72, %34, %37, %40, %43, %11, %13, %16, %19, %22, %25, %28, %31, %9, %5, %82
  %.sink = phi i32 [ %85, %82 ], [ 48, %5 ], [ 27, %9 ], [ 28, %31 ], [ 28, %28 ], [ 28, %25 ], [ 28, %22 ], [ 28, %19 ], [ 28, %16 ], [ 28, %13 ], [ 28, %11 ], [ 29, %43 ], [ 29, %40 ], [ 29, %37 ], [ 29, %34 ], [ 57, %72 ], [ 32, %.critedge ], [ 33, %77 ], [ 34, %79 ]
  %87 = getelementptr inbounds i8, ptr %2, i64 416
  store i32 %.sink, ptr %87, align 8, !tbaa !29
  ret i32 %.sink
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef, i32 noundef) local_unnamed_addr #0

attributes #0 = { 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 #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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !9, i64 20}
!11 = !{!"_ZTS11LodePNGInfo", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 16, !9, i64 56, !9, i64 60, !9, i64 64, !9, i64 68, !15, i64 72, !14, i64 80, !14, i64 88, !15, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !9, i64 136, !16, i64 140, !9, i64 164, !9, i64 168, !9, i64 172, !9, i64 176, !6, i64 184, !6, i64 208}
!12 = !{!"_ZTS16LodePNGColorMode", !13, i64 0, !9, i64 4, !14, i64 8, !15, i64 16, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36}
!13 = !{!"_ZTS16LodePNGColorType", !6, i64 0}
!14 = !{!"any pointer", !6, i64 0}
!15 = !{!"long", !6, i64 0}
!16 = !{!"_ZTS11LodePNGTime", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
!17 = !{!11, !13, i64 16}
!18 = !{!11, !9, i64 0}
!19 = !{!11, !9, i64 4}
!20 = !{!11, !9, i64 8}
!21 = !{!22, !9, i64 40}
!22 = !{!"_ZTS12LodePNGState", !23, i64 8, !25, i64 56, !12, i64 144, !11, i64 184, !9, i64 416}
!23 = !{!"_ZTS22LodePNGDecoderSettings", !24, i64 0, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44}
!24 = !{!"_ZTS25LodePNGDecompressSettings", !9, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!25 = !{!"_ZTS22LodePNGEncoderSettings", !26, i64 0, !27, i64 48, !9, i64 52, !28, i64 56, !14, i64 64, !9, i64 72, !9, i64 76, !9, i64 80}
!26 = !{!"_ZTS23LodePNGCompressSettings", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !14, i64 24, !14, i64 32, !14, i64 40}
!27 = !{!"_ZTS18LodePNGAutoConvert", !6, i64 0}
!28 = !{!"_ZTS21LodePNGFilterStrategy", !6, i64 0}
!29 = !{!22, !9, i64 416}


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