; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder/lodepng.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, 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, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }

@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z20lodepng_chunk_lengthPKh(ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef, ptr noundef) #0

; 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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = 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 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.LodePNGState, ptr %18, i32 0, i32 4
  store ptr %19, ptr %14, align 8, !tbaa !5
  %20 = load i64, ptr %11, align 8, !tbaa !9
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %25, label %22

22:                                               ; preds = %5
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %28

25:                                               ; preds = %22, %5
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.LodePNGState, ptr %26, i32 0, i32 5
  store i32 48, ptr %27, align 8, !tbaa !11
  store i32 48, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

28:                                               ; preds = %22
  %29 = load i64, ptr %11, align 8, !tbaa !9
  %30 = icmp ult i64 %29, 33
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.LodePNGState, ptr %32, i32 0, i32 5
  store i32 27, ptr %33, align 8, !tbaa !11
  store i32 27, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

34:                                               ; preds = %28
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef %35)
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef %36)
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 0
  %39 = load i8, ptr %38, align 1, !tbaa !23
  %40 = zext i8 %39 to i32
  %41 = icmp ne i32 %40, 137
  br i1 %41, label %84, label %42

42:                                               ; preds = %34
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = load i8, ptr %44, align 1, !tbaa !23
  %46 = zext i8 %45 to i32
  %47 = icmp ne i32 %46, 80
  br i1 %47, label %84, label %48

48:                                               ; preds = %42
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 2
  %51 = load i8, ptr %50, align 1, !tbaa !23
  %52 = zext i8 %51 to i32
  %53 = icmp ne i32 %52, 78
  br i1 %53, label %84, label %54

54:                                               ; preds = %48
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 3
  %57 = load i8, ptr %56, align 1, !tbaa !23
  %58 = zext i8 %57 to i32
  %59 = icmp ne i32 %58, 71
  br i1 %59, label %84, label %60

60:                                               ; preds = %54
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load i8, ptr %62, align 1, !tbaa !23
  %64 = zext i8 %63 to i32
  %65 = icmp ne i32 %64, 13
  br i1 %65, label %84, label %66

66:                                               ; preds = %60
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 5
  %69 = load i8, ptr %68, align 1, !tbaa !23
  %70 = zext i8 %69 to i32
  %71 = icmp ne i32 %70, 10
  br i1 %71, label %84, label %72

72:                                               ; preds = %66
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 6
  %75 = load i8, ptr %74, align 1, !tbaa !23
  %76 = zext i8 %75 to i32
  %77 = icmp ne i32 %76, 26
  br i1 %77, label %84, label %78

78:                                               ; preds = %72
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 7
  %81 = load i8, ptr %80, align 1, !tbaa !23
  %82 = zext i8 %81 to i32
  %83 = icmp ne i32 %82, 10
  br i1 %83, label %84, label %87

84:                                               ; preds = %78, %72, %66, %60, %54, %48, %42, %34
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.LodePNGState, ptr %85, i32 0, i32 5
  store i32 28, ptr %86, align 8, !tbaa !11
  store i32 28, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

87:                                               ; preds = %78
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 8
  %90 = call noundef i32 @_Z20lodepng_chunk_lengthPKh(ptr noundef %89)
  %91 = icmp ne i32 %90, 13
  br i1 %91, label %92, label %95

92:                                               ; preds = %87
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.LodePNGState, ptr %93, i32 0, i32 5
  store i32 94, ptr %94, align 8, !tbaa !11
  store i32 94, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

95:                                               ; preds = %87
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 8
  %98 = call noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef %97, ptr noundef @.str.2)
  %99 = icmp ne i8 %98, 0
  br i1 %99, label %103, label %100

100:                                              ; preds = %95
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.LodePNGState, ptr %101, i32 0, i32 5
  store i32 29, ptr %102, align 8, !tbaa !11
  store i32 29, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

103:                                              ; preds = %95
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %105)
  store i32 %106, ptr %12, align 4, !tbaa !24
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 20
  %109 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %108)
  store i32 %109, ptr %13, align 4, !tbaa !24
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds i8, ptr %110, i64 24
  %112 = load i8, ptr %111, align 1, !tbaa !23
  %113 = zext i8 %112 to i32
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.LodePNGInfo, ptr %114, i32 0, i32 3
  %116 = getelementptr inbounds %struct.LodePNGColorMode, ptr %115, i32 0, i32 1
  store i32 %113, ptr %116, align 4, !tbaa !25
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i64 25
  %119 = load i8, ptr %118, align 1, !tbaa !23
  %120 = zext i8 %119 to i32
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.LodePNGInfo, ptr %121, i32 0, i32 3
  %123 = getelementptr inbounds %struct.LodePNGColorMode, ptr %122, i32 0, i32 0
  store i32 %120, ptr %123, align 8, !tbaa !26
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  %125 = getelementptr inbounds i8, ptr %124, i64 26
  %126 = load i8, ptr %125, align 1, !tbaa !23
  %127 = zext i8 %126 to i32
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.LodePNGInfo, ptr %128, i32 0, i32 0
  store i32 %127, ptr %129, align 8, !tbaa !27
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %130, i64 27
  %132 = load i8, ptr %131, align 1, !tbaa !23
  %133 = zext i8 %132 to i32
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.LodePNGInfo, ptr %134, i32 0, i32 1
  store i32 %133, ptr %135, align 4, !tbaa !28
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i64 28
  %138 = load i8, ptr %137, align 1, !tbaa !23
  %139 = zext i8 %138 to i32
  %140 = load ptr, ptr %14, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.LodePNGInfo, ptr %140, i32 0, i32 2
  store i32 %139, ptr %141, align 8, !tbaa !29
  %142 = load i32, ptr %12, align 4, !tbaa !24
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %147, label %144

144:                                              ; preds = %103
  %145 = load i32, ptr %13, align 4, !tbaa !24
  %146 = icmp eq i32 %145, 0
  br i1 %146, label %147, label %150

147:                                              ; preds = %144, %103
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.LodePNGState, ptr %148, i32 0, i32 5
  store i32 93, ptr %149, align 8, !tbaa !11
  store i32 93, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

150:                                              ; preds = %144
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %156

153:                                              ; preds = %150
  %154 = load i32, ptr %12, align 4, !tbaa !24
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %154, ptr %155, align 4, !tbaa !24
  br label %156

156:                                              ; preds = %153, %150
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %159, label %162

159:                                              ; preds = %156
  %160 = load i32, ptr %13, align 4, !tbaa !24
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %160, ptr %161, align 4, !tbaa !24
  br label %162

162:                                              ; preds = %159, %156
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.LodePNGState, ptr %163, i32 0, i32 1
  %165 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 8, !tbaa !30
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %185, label %168

168:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %169, i64 29
  %171 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %170)
  store i32 %171, ptr %16, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i64 12
  %174 = call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef %173, i64 noundef 17)
  store i32 %174, ptr %17, align 4, !tbaa !24
  %175 = load i32, ptr %16, align 4, !tbaa !24
  %176 = load i32, ptr %17, align 4, !tbaa !24
  %177 = icmp ne i32 %175, %176
  br i1 %177, label %178, label %181

178:                                              ; preds = %168
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.LodePNGState, ptr %179, i32 0, i32 5
  store i32 57, ptr %180, align 8, !tbaa !11
  store i32 57, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %182

181:                                              ; preds = %168
  store i32 0, ptr %15, align 4
  br label %182

182:                                              ; preds = %181, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %183 = load i32, ptr %15, align 4
  switch i32 %183, label %224 [
    i32 0, label %184
  ]

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184, %162
  %186 = load ptr, ptr %14, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.LodePNGInfo, ptr %186, i32 0, i32 0
  %188 = load i32, ptr %187, align 8, !tbaa !27
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %193

190:                                              ; preds = %185
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.LodePNGState, ptr %191, i32 0, i32 5
  store i32 32, ptr %192, align 8, !tbaa !11
  store i32 32, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

193:                                              ; preds = %185
  %194 = load ptr, ptr %14, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.LodePNGInfo, ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !28
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %201

198:                                              ; preds = %193
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.LodePNGState, ptr %199, i32 0, i32 5
  store i32 33, ptr %200, align 8, !tbaa !11
  store i32 33, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

201:                                              ; preds = %193
  %202 = load ptr, ptr %14, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.LodePNGInfo, ptr %202, i32 0, i32 2
  %204 = load i32, ptr %203, align 8, !tbaa !29
  %205 = icmp ugt i32 %204, 1
  br i1 %205, label %206, label %209

206:                                              ; preds = %201
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.LodePNGState, ptr %207, i32 0, i32 5
  store i32 34, ptr %208, align 8, !tbaa !11
  store i32 34, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

209:                                              ; preds = %201
  %210 = load ptr, ptr %14, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.LodePNGInfo, ptr %210, i32 0, i32 3
  %212 = getelementptr inbounds %struct.LodePNGColorMode, ptr %211, i32 0, i32 0
  %213 = load i32, ptr %212, align 8, !tbaa !26
  %214 = load ptr, ptr %14, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.LodePNGInfo, ptr %214, i32 0, i32 3
  %216 = getelementptr inbounds %struct.LodePNGColorMode, ptr %215, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !25
  %218 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %213, i32 noundef %217)
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.LodePNGState, ptr %219, i32 0, i32 5
  store i32 %218, ptr %220, align 8, !tbaa !11
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.LodePNGState, ptr %221, i32 0, i32 5
  %223 = load i32, ptr %222, align 8, !tbaa !11
  store i32 %223, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

224:                                              ; preds = %209, %206, %198, %190, %182, %147, %100, %92, %84, %31, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %225 = load i32, ptr %6, align 4
  ret i32 %225
}

; 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 504}
!12 = !{!"_ZTS12LodePNGState", !13, i64 8, !16, i64 64, !19, i64 152, !21, i64 192, !15, i64 504}
!13 = !{!"_ZTS22LodePNGDecoderSettings", !14, i64 0, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52}
!14 = !{!"_ZTS25LodePNGDecompressSettings", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS22LodePNGEncoderSettings", !17, i64 0, !15, i64 48, !15, i64 52, !18, 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 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!19 = !{!"_ZTS16LodePNGColorMode", !20, i64 0, !15, i64 4, !6, i64 8, !10, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!20 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!21 = !{!"_ZTS11LodePNGInfo", !15, i64 0, !15, i64 4, !15, i64 8, !19, 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, !22, i64 140, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !15, i64 224, !15, i64 228, !15, i64 232, !6, i64 240, !6, i64 248, !15, i64 256, !7, i64 264, !7, i64 288}
!22 = !{!"_ZTS11LodePNGTime", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!23 = !{!7, !7, i64 0}
!24 = !{!15, !15, i64 0}
!25 = !{!21, !15, i64 20}
!26 = !{!21, !20, i64 16}
!27 = !{!21, !15, i64 0}
!28 = !{!21, !15, i64 4}
!29 = !{!21, !15, i64 8}
!30 = !{!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"

@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z20lodepng_chunk_lengthPKh(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef, ptr noundef) local_unnamed_addr #0

; 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 noundef writeonly %0, ptr noundef writeonly %1, ptr noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %2, i64 192
  %7 = icmp eq i64 %4, 0
  %8 = icmp eq ptr %3, null
  %or.cond = or i1 %8, %7
  br i1 %or.cond, label %87, label %9

9:                                                ; preds = %5
  %10 = icmp ult i64 %4, 33
  br i1 %10, label %87, 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 %87

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

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

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

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

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

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

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

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %3, i64 8
  %36 = tail call noundef i32 @_Z20lodepng_chunk_lengthPKh(ptr noundef nonnull %35)
  %.not75 = icmp eq i32 %36, 13
  br i1 %.not75, label %37, label %87

37:                                               ; preds = %34
  %38 = tail call noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef nonnull %35, ptr noundef nonnull @.str.2)
  %.not76 = icmp eq i8 %38, 0
  br i1 %.not76, label %87, label %39

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %3, i64 16
  %41 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %40)
  %42 = getelementptr inbounds i8, ptr %3, i64 20
  %43 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %42)
  %44 = getelementptr inbounds i8, ptr %3, i64 24
  %45 = load i8, ptr %44, align 1, !tbaa !5
  %46 = zext i8 %45 to i32
  %47 = getelementptr inbounds i8, ptr %2, i64 208
  %48 = getelementptr inbounds i8, ptr %2, i64 212
  store i32 %46, ptr %48, align 4, !tbaa !8
  %49 = getelementptr inbounds i8, ptr %3, i64 25
  %50 = load i8, ptr %49, align 1, !tbaa !5
  %51 = zext i8 %50 to i32
  store i32 %51, ptr %47, align 8, !tbaa !16
  %52 = getelementptr inbounds i8, ptr %3, i64 26
  %53 = load i8, ptr %52, align 1, !tbaa !5
  %54 = zext i8 %53 to i32
  store i32 %54, ptr %6, align 8, !tbaa !17
  %55 = getelementptr inbounds i8, ptr %3, i64 27
  %56 = load i8, ptr %55, align 1, !tbaa !5
  %57 = zext i8 %56 to i32
  %58 = getelementptr inbounds i8, ptr %2, i64 196
  store i32 %57, ptr %58, align 4, !tbaa !18
  %59 = getelementptr inbounds i8, ptr %3, i64 28
  %60 = load i8, ptr %59, align 1, !tbaa !5
  %61 = zext i8 %60 to i32
  %62 = getelementptr inbounds i8, ptr %2, i64 200
  store i32 %61, ptr %62, align 8, !tbaa !19
  %63 = icmp eq i32 %41, 0
  %64 = icmp eq i32 %43, 0
  %or.cond3 = or i1 %63, %64
  br i1 %or.cond3, label %87, label %65

65:                                               ; preds = %39
  %.not77 = icmp eq ptr %0, null
  br i1 %.not77, label %67, label %66

66:                                               ; preds = %65
  store i32 %41, ptr %0, align 4, !tbaa !20
  br label %67

67:                                               ; preds = %66, %65
  %.not78 = icmp eq ptr %1, null
  br i1 %.not78, label %69, label %68

68:                                               ; preds = %67
  store i32 %43, ptr %1, align 4, !tbaa !20
  br label %69

69:                                               ; preds = %68, %67
  %70 = getelementptr inbounds i8, ptr %2, i64 40
  %71 = load i32, ptr %70, align 8, !tbaa !21
  %.not79 = icmp eq i32 %71, 0
  br i1 %.not79, label %72, label %.critedge

72:                                               ; preds = %69
  %73 = getelementptr inbounds i8, ptr %3, i64 29
  %74 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %73)
  %75 = getelementptr inbounds i8, ptr %3, i64 12
  %76 = tail call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef nonnull %75, i64 noundef 17)
  %.not80 = icmp eq i32 %74, %76
  br i1 %.not80, label %.critedge, label %87

.critedge:                                        ; preds = %72, %69
  %77 = load i32, ptr %6, align 8, !tbaa !17
  %.not81 = icmp eq i32 %77, 0
  br i1 %.not81, label %78, label %87

78:                                               ; preds = %.critedge
  %79 = load i32, ptr %58, align 4, !tbaa !18
  %.not82 = icmp eq i32 %79, 0
  br i1 %.not82, label %80, label %87

80:                                               ; preds = %78
  %81 = load i32, ptr %62, align 8, !tbaa !19
  %82 = icmp ugt i32 %81, 1
  br i1 %82, label %87, label %83

83:                                               ; preds = %80
  %84 = load i32, ptr %47, align 8, !tbaa !16
  %85 = load i32, ptr %48, align 4, !tbaa !8
  %86 = tail call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %84, i32 noundef %85)
  br label %87

87:                                               ; preds = %80, %78, %.critedge, %72, %39, %37, %34, %11, %13, %16, %19, %22, %25, %28, %31, %9, %5, %83
  %.sink = phi i32 [ %86, %83 ], [ 48, %5 ], [ 27, %9 ], [ 28, %31 ], [ 28, %28 ], [ 28, %25 ], [ 28, %22 ], [ 28, %19 ], [ 28, %16 ], [ 28, %13 ], [ 28, %11 ], [ 94, %34 ], [ 29, %37 ], [ 93, %39 ], [ 57, %72 ], [ 32, %.critedge ], [ 33, %78 ], [ 34, %80 ]
  %88 = getelementptr inbounds i8, ptr %2, i64 504
  store i32 %.sink, ptr %88, align 8, !tbaa !28
  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, !10, i64 20}
!9 = !{!"_ZTS11LodePNGInfo", !10, i64 0, !10, i64 4, !10, i64 8, !11, i64 16, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !14, i64 72, !13, i64 80, !13, i64 88, !14, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !10, i64 136, !15, i64 140, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !13, i64 240, !13, i64 248, !10, i64 256, !6, i64 264, !6, i64 288}
!10 = !{!"int", !6, i64 0}
!11 = !{!"_ZTS16LodePNGColorMode", !12, i64 0, !10, i64 4, !13, i64 8, !14, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!12 = !{!"_ZTS16LodePNGColorType", !6, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!"long", !6, i64 0}
!15 = !{!"_ZTS11LodePNGTime", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!16 = !{!9, !12, i64 16}
!17 = !{!9, !10, i64 0}
!18 = !{!9, !10, i64 4}
!19 = !{!9, !10, i64 8}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !10, i64 40}
!22 = !{!"_ZTS12LodePNGState", !23, i64 8, !25, i64 64, !11, i64 152, !9, i64 192, !10, i64 504}
!23 = !{!"_ZTS22LodePNGDecoderSettings", !24, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!24 = !{!"_ZTS25LodePNGDecompressSettings", !10, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!25 = !{!"_ZTS22LodePNGEncoderSettings", !26, i64 0, !10, i64 48, !10, i64 52, !27, i64 56, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!26 = !{!"_ZTS23LodePNGCompressSettings", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !13, i64 24, !13, i64 32, !13, i64 40}
!27 = !{!"_ZTS21LodePNGFilterStrategy", !6, i64 0}
!28 = !{!22, !10, i64 504}


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