; LLVM IR from aap/librw :: src/lodepng/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 { %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32 }
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, 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: 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 nounwind uwtable
declare dso_local noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef, i64 noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef, ptr 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 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 3
  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 4
  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 %233

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 4
  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 %233

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 4
  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 %233

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 4
  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 %233

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 4
  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 %233

103:                                              ; preds = %95
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = call noundef i32 @_ZL20lodepng_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 @_ZL20lodepng_read32bitIntPKh(ptr noundef %108)
  store i32 %109, ptr %13, align 4, !tbaa !24
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %115

112:                                              ; preds = %103
  %113 = load i32, ptr %12, align 4, !tbaa !24
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %113, ptr %114, align 4, !tbaa !24
  br label %115

115:                                              ; preds = %112, %103
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %121

118:                                              ; preds = %115
  %119 = load i32, ptr %13, align 4, !tbaa !24
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %119, ptr %120, align 4, !tbaa !24
  br label %121

121:                                              ; preds = %118, %115
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i64 24
  %124 = load i8, ptr %123, align 1, !tbaa !23
  %125 = zext i8 %124 to i32
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.LodePNGInfo, ptr %126, i32 0, i32 3
  %128 = getelementptr inbounds %struct.LodePNGColorMode, ptr %127, i32 0, i32 1
  store i32 %125, ptr %128, align 4, !tbaa !25
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %129, i64 25
  %131 = load i8, ptr %130, align 1, !tbaa !23
  %132 = zext i8 %131 to i32
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.LodePNGInfo, ptr %133, i32 0, i32 3
  %135 = getelementptr inbounds %struct.LodePNGColorMode, ptr %134, i32 0, i32 0
  store i32 %132, ptr %135, align 8, !tbaa !26
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i64 26
  %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 0
  store i32 %139, ptr %141, align 8, !tbaa !27
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 27
  %144 = load i8, ptr %143, align 1, !tbaa !23
  %145 = zext i8 %144 to i32
  %146 = load ptr, ptr %14, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.LodePNGInfo, ptr %146, i32 0, i32 1
  store i32 %145, ptr %147, align 4, !tbaa !28
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = getelementptr inbounds i8, ptr %148, i64 28
  %150 = load i8, ptr %149, align 1, !tbaa !23
  %151 = zext i8 %150 to i32
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.LodePNGInfo, ptr %152, i32 0, i32 2
  store i32 %151, ptr %153, align 8, !tbaa !29
  %154 = load i32, ptr %12, align 4, !tbaa !24
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %159, label %156

156:                                              ; preds = %121
  %157 = load i32, ptr %13, align 4, !tbaa !24
  %158 = icmp eq i32 %157, 0
  br i1 %158, label %159, label %162

159:                                              ; preds = %156, %121
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.LodePNGState, ptr %160, i32 0, i32 4
  store i32 93, ptr %161, align 8, !tbaa !11
  store i32 93, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %233

162:                                              ; preds = %156
  %163 = load ptr, ptr %14, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.LodePNGInfo, ptr %163, i32 0, i32 3
  %165 = getelementptr inbounds %struct.LodePNGColorMode, ptr %164, i32 0, i32 0
  %166 = load i32, ptr %165, align 8, !tbaa !26
  %167 = load ptr, ptr %14, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.LodePNGInfo, ptr %167, i32 0, i32 3
  %169 = getelementptr inbounds %struct.LodePNGColorMode, ptr %168, i32 0, i32 1
  %170 = load i32, ptr %169, align 4, !tbaa !25
  %171 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %166, i32 noundef %170)
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.LodePNGState, ptr %172, i32 0, i32 4
  store i32 %171, ptr %173, align 8, !tbaa !11
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.LodePNGState, ptr %174, i32 0, i32 4
  %176 = load i32, ptr %175, align 8, !tbaa !11
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %182

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

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

187:                                              ; preds = %182
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.LodePNGState, ptr %188, i32 0, i32 4
  store i32 32, ptr %189, align 8, !tbaa !11
  store i32 32, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %233

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

195:                                              ; preds = %190
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.LodePNGState, ptr %196, i32 0, i32 4
  store i32 33, ptr %197, align 8, !tbaa !11
  store i32 33, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %233

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

203:                                              ; preds = %198
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.LodePNGState, ptr %204, i32 0, i32 4
  store i32 34, ptr %205, align 8, !tbaa !11
  store i32 34, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %233

206:                                              ; preds = %198
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.LodePNGState, ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 8, !tbaa !30
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %229, label %212

212:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  %214 = getelementptr inbounds i8, ptr %213, i64 29
  %215 = call noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef %214)
  store i32 %215, ptr %16, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %216 = load ptr, ptr %10, align 8, !tbaa !5
  %217 = getelementptr inbounds i8, ptr %216, i64 12
  %218 = call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef %217, i64 noundef 17)
  store i32 %218, ptr %17, align 4, !tbaa !24
  %219 = load i32, ptr %16, align 4, !tbaa !24
  %220 = load i32, ptr %17, align 4, !tbaa !24
  %221 = icmp ne i32 %219, %220
  br i1 %221, label %222, label %225

222:                                              ; preds = %212
  %223 = load ptr, ptr %9, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.LodePNGState, ptr %223, i32 0, i32 4
  store i32 57, ptr %224, align 8, !tbaa !11
  store i32 57, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %226

225:                                              ; preds = %212
  store i32 0, ptr %15, align 4
  br label %226

226:                                              ; preds = %225, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  %227 = load i32, ptr %15, align 4
  switch i32 %227, label %233 [
    i32 0, label %228
  ]

228:                                              ; preds = %226
  br label %229

229:                                              ; preds = %228, %206
  %230 = load ptr, ptr %9, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.LodePNGState, ptr %230, i32 0, i32 4
  %232 = load i32, ptr %231, align 8, !tbaa !11
  store i32 %232, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %233

233:                                              ; preds = %229, %226, %203, %195, %187, %178, %159, %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
  %234 = load i32, ptr %6, align 4
  ret i32 %234
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 496}
!12 = !{!"_ZTS12LodePNGState", !13, i64 0, !16, i64 56, !19, i64 144, !21, i64 184, !15, i64 496}
!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, !15, i64 4, !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 32}


; 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 @_Z13lodepng_crc32PKhm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef, ptr 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 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 184
  %7 = icmp eq i64 %4, 0
  %8 = icmp eq ptr %3, null
  %or.cond = or i1 %8, %7
  br i1 %or.cond, label %9, label %11

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 48, ptr %10, align 8, !tbaa !5
  br label %.critedge

11:                                               ; preds = %5
  %12 = icmp ult i64 %4, 33
  br i1 %12, label %13, label %15

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 27, ptr %14, align 8, !tbaa !5
  br label %.critedge

15:                                               ; preds = %11
  tail call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef nonnull %6)
  tail call void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef nonnull %6)
  %16 = load i8, ptr %3, align 1, !tbaa !21
  %.not = icmp eq i8 %16, -119
  br i1 %.not, label %17, label %38

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %3, i64 1
  %19 = load i8, ptr %18, align 1, !tbaa !21
  %.not69 = icmp eq i8 %19, 80
  br i1 %.not69, label %20, label %38

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %3, i64 2
  %22 = load i8, ptr %21, align 1, !tbaa !21
  %.not70 = icmp eq i8 %22, 78
  br i1 %.not70, label %23, label %38

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %3, i64 3
  %25 = load i8, ptr %24, align 1, !tbaa !21
  %.not71 = icmp eq i8 %25, 71
  br i1 %.not71, label %26, label %38

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %3, i64 4
  %28 = load i8, ptr %27, align 1, !tbaa !21
  %.not72 = icmp eq i8 %28, 13
  br i1 %.not72, label %29, label %38

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %3, i64 5
  %31 = load i8, ptr %30, align 1, !tbaa !21
  %.not73 = icmp eq i8 %31, 10
  br i1 %.not73, label %32, label %38

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %3, i64 6
  %34 = load i8, ptr %33, align 1, !tbaa !21
  %.not74 = icmp eq i8 %34, 26
  br i1 %.not74, label %35, label %38

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %3, i64 7
  %37 = load i8, ptr %36, align 1, !tbaa !21
  %.not75 = icmp eq i8 %37, 10
  br i1 %.not75, label %40, label %38

38:                                               ; preds = %35, %32, %29, %26, %23, %20, %17, %15
  %39 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 28, ptr %39, align 8, !tbaa !5
  br label %.critedge

40:                                               ; preds = %35
  %41 = getelementptr inbounds i8, ptr %3, i64 8
  %42 = tail call noundef i32 @_Z20lodepng_chunk_lengthPKh(ptr noundef nonnull %41)
  %.not76 = icmp eq i32 %42, 13
  br i1 %.not76, label %45, label %43

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 94, ptr %44, align 8, !tbaa !5
  br label %.critedge

45:                                               ; preds = %40
  %46 = tail call noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef nonnull %41, ptr noundef nonnull @.str.2)
  %.not77 = icmp eq i8 %46, 0
  br i1 %.not77, label %47, label %49

47:                                               ; preds = %45
  %48 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 29, ptr %48, align 8, !tbaa !5
  br label %.critedge

49:                                               ; preds = %45
  %50 = getelementptr inbounds i8, ptr %3, i64 16
  %51 = tail call noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef nonnull %50)
  %52 = getelementptr inbounds i8, ptr %3, i64 20
  %53 = tail call noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef nonnull %52)
  %.not78 = icmp eq ptr %0, null
  br i1 %.not78, label %55, label %54

54:                                               ; preds = %49
  store i32 %51, ptr %0, align 4, !tbaa !22
  br label %55

55:                                               ; preds = %54, %49
  %.not79 = icmp eq ptr %1, null
  br i1 %.not79, label %57, label %56

56:                                               ; preds = %55
  store i32 %53, ptr %1, align 4, !tbaa !22
  br label %57

57:                                               ; preds = %56, %55
  %58 = getelementptr inbounds i8, ptr %3, i64 24
  %59 = load i8, ptr %58, align 1, !tbaa !21
  %60 = zext i8 %59 to i32
  %61 = getelementptr inbounds i8, ptr %2, i64 200
  %62 = getelementptr inbounds i8, ptr %2, i64 204
  store i32 %60, ptr %62, align 4, !tbaa !23
  %63 = getelementptr inbounds i8, ptr %3, i64 25
  %64 = load i8, ptr %63, align 1, !tbaa !21
  %65 = zext i8 %64 to i32
  store i32 %65, ptr %61, align 8, !tbaa !24
  %66 = getelementptr inbounds i8, ptr %3, i64 26
  %67 = load i8, ptr %66, align 1, !tbaa !21
  %68 = zext i8 %67 to i32
  store i32 %68, ptr %6, align 8, !tbaa !25
  %69 = getelementptr inbounds i8, ptr %3, i64 27
  %70 = load i8, ptr %69, align 1, !tbaa !21
  %71 = zext i8 %70 to i32
  %72 = getelementptr inbounds i8, ptr %2, i64 188
  store i32 %71, ptr %72, align 4, !tbaa !26
  %73 = getelementptr inbounds i8, ptr %3, i64 28
  %74 = load i8, ptr %73, align 1, !tbaa !21
  %75 = zext i8 %74 to i32
  %76 = getelementptr inbounds i8, ptr %2, i64 192
  store i32 %75, ptr %76, align 8, !tbaa !27
  %77 = icmp eq i32 %51, 0
  %78 = icmp eq i32 %53, 0
  %or.cond3 = or i1 %77, %78
  br i1 %or.cond3, label %79, label %81

79:                                               ; preds = %57
  %80 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 93, ptr %80, align 8, !tbaa !5
  br label %.critedge

81:                                               ; preds = %57
  %82 = tail call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %65, i32 noundef %60)
  %83 = getelementptr inbounds i8, ptr %2, i64 496
  store i32 %82, ptr %83, align 8, !tbaa !5
  %.not80 = icmp eq i32 %82, 0
  br i1 %.not80, label %84, label %.critedge

84:                                               ; preds = %81
  %85 = load i32, ptr %6, align 8, !tbaa !25
  %.not81 = icmp eq i32 %85, 0
  br i1 %.not81, label %87, label %86

86:                                               ; preds = %84
  store i32 32, ptr %83, align 8, !tbaa !5
  br label %.critedge

87:                                               ; preds = %84
  %88 = load i32, ptr %72, align 4, !tbaa !26
  %.not82 = icmp eq i32 %88, 0
  br i1 %.not82, label %90, label %89

89:                                               ; preds = %87
  store i32 33, ptr %83, align 8, !tbaa !5
  br label %.critedge

90:                                               ; preds = %87
  %91 = load i32, ptr %76, align 8, !tbaa !27
  %92 = icmp ugt i32 %91, 1
  br i1 %92, label %93, label %94

93:                                               ; preds = %90
  store i32 34, ptr %83, align 8, !tbaa !5
  br label %.critedge

94:                                               ; preds = %90
  %95 = getelementptr inbounds i8, ptr %2, i64 32
  %96 = load i32, ptr %95, align 8, !tbaa !28
  %.not83 = icmp eq i32 %96, 0
  br i1 %.not83, label %97, label %.critedge

97:                                               ; preds = %94
  %98 = getelementptr inbounds i8, ptr %3, i64 29
  %99 = tail call noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef nonnull %98)
  %100 = getelementptr inbounds i8, ptr %3, i64 12
  %101 = tail call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef nonnull %100, i64 noundef 17)
  %.not84 = icmp eq i32 %99, %101
  br i1 %.not84, label %..critedge_crit_edge, label %102

..critedge_crit_edge:                             ; preds = %97
  %.pre = load i32, ptr %83, align 8, !tbaa !5
  br label %.critedge

102:                                              ; preds = %97
  store i32 57, ptr %83, align 8, !tbaa !5
  br label %.critedge

.critedge:                                        ; preds = %94, %..critedge_crit_edge, %102, %81, %93, %89, %86, %79, %47, %43, %38, %13, %9
  %.1 = phi i32 [ 48, %9 ], [ 27, %13 ], [ 28, %38 ], [ 94, %43 ], [ 93, %79 ], [ 32, %86 ], [ 33, %89 ], [ 34, %93 ], [ 57, %102 ], [ 29, %47 ], [ %82, %81 ], [ %.pre, %..critedge_crit_edge ], [ 0, %94 ]
  ret i32 %.1
}

; 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, !9, i64 496}
!6 = !{!"_ZTS12LodePNGState", !7, i64 0, !13, i64 56, !16, i64 144, !19, i64 184, !9, i64 496}
!7 = !{!"_ZTS22LodePNGDecoderSettings", !8, i64 0, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44, !9, i64 48, !9, i64 52}
!8 = !{!"_ZTS25LodePNGDecompressSettings", !9, i64 0, !9, i64 4, !12, i64 8, !12, i64 16, !12, i64 24}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"_ZTS22LodePNGEncoderSettings", !14, i64 0, !9, i64 48, !9, i64 52, !15, i64 56, !12, i64 64, !9, i64 72, !9, i64 76, !9, i64 80}
!14 = !{!"_ZTS23LodePNGCompressSettings", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !12, i64 24, !12, i64 32, !12, i64 40}
!15 = !{!"_ZTS21LodePNGFilterStrategy", !10, i64 0}
!16 = !{!"_ZTS16LodePNGColorMode", !17, i64 0, !9, i64 4, !12, i64 8, !18, i64 16, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36}
!17 = !{!"_ZTS16LodePNGColorType", !10, i64 0}
!18 = !{!"long", !10, i64 0}
!19 = !{!"_ZTS11LodePNGInfo", !9, i64 0, !9, i64 4, !9, i64 8, !16, i64 16, !9, i64 56, !9, i64 60, !9, i64 64, !9, i64 68, !18, i64 72, !12, i64 80, !12, i64 88, !18, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !9, i64 136, !20, i64 140, !9, i64 164, !9, i64 168, !9, i64 172, !9, i64 176, !9, i64 180, !9, i64 184, !9, i64 188, !9, i64 192, !9, i64 196, !9, i64 200, !9, i64 204, !9, i64 208, !9, i64 212, !9, i64 216, !9, i64 220, !9, i64 224, !9, i64 228, !9, i64 232, !12, i64 240, !12, i64 248, !9, i64 256, !10, i64 264, !10, i64 288}
!20 = !{!"_ZTS11LodePNGTime", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
!21 = !{!10, !10, i64 0}
!22 = !{!9, !9, i64 0}
!23 = !{!19, !9, i64 20}
!24 = !{!19, !17, i64 16}
!25 = !{!19, !9, i64 0}
!26 = !{!19, !9, i64 4}
!27 = !{!19, !9, i64 8}
!28 = !{!6, !9, i64 32}


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