; LLVM IR from fhanau/Efficient-Compression-Tool :: 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, %struct.LodePNGColorMode, i32, i32, i32 }
%struct.LodePNGDecoderSettings = type { i32, i32, i32 }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i16, i32 }
%struct.LodePNGCompressSettings = type { ptr, ptr }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, [3 x ptr], [3 x i64] }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, 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 uwtable
declare dso_local noundef i32 @_Z20lodepng_chunk_lengthPKh(ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef, 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) #1 {
  %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) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %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 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 %225

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 %225

34:                                               ; preds = %28
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL20lodepng_info_cleanupP11LodePNGInfo(ptr noundef %35)
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL17lodepng_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 !22
  %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 !22
  %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 !22
  %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 !22
  %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 !22
  %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 !22
  %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 !22
  %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 !22
  %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 %225

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 %225

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 %225

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 !23
  %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 !23
  %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 !23
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %113, ptr %114, align 4, !tbaa !23
  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 !23
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %119, ptr %120, align 4, !tbaa !23
  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 !22
  %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 !24
  %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 !22
  %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 !25
  %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 !22
  %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 !26
  %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 !22
  %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 !27
  %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 !22
  %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 !28
  %154 = load i32, ptr %12, align 4, !tbaa !23
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %159, label %156

156:                                              ; preds = %121
  %157 = load i32, ptr %13, align 4, !tbaa !23
  %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 5
  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 %225

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 !25
  %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 !24
  %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 5
  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 5
  %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 5
  %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 %225

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 !26
  %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 5
  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 %225

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 !27
  %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 5
  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 %225

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 !28
  %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 5
  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 %225

206:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = getelementptr inbounds i8, ptr %207, i64 29
  %209 = call noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef %208)
  store i32 %209, ptr %16, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = getelementptr inbounds i8, ptr %210, i64 12
  %212 = call i64 @crc32(i64 noundef 0, ptr noundef %211, i32 noundef 17)
  %213 = trunc i64 %212 to i32
  store i32 %213, ptr %17, align 4, !tbaa !23
  %214 = load i32, ptr %16, align 4, !tbaa !23
  %215 = load i32, ptr %17, align 4, !tbaa !23
  %216 = icmp ne i32 %214, %215
  br i1 %216, label %217, label %220

217:                                              ; preds = %206
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.LodePNGState, ptr %218, i32 0, i32 5
  store i32 57, ptr %219, align 8, !tbaa !11
  store i32 57, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %224

220:                                              ; preds = %206
  %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 = %220, %217
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %225

225:                                              ; preds = %224, %203, %195, %187, %178, %159, %100, %92, %84, %31, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %226 = load i32, ptr %6, align 4
  ret i32 %226
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL20lodepng_info_cleanupP11LodePNGInfo(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL17lodepng_info_initP11LodePNGInfo(ptr noundef) #1

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

declare i64 @crc32(i64 noundef, ptr noundef, i32 noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !14, i64 336}
!12 = !{!"_ZTS12LodePNGState", !13, i64 0, !15, i64 16, !19, i64 72, !21, i64 112, !19, i64 296, !14, i64 336, !14, i64 340, !14, i64 344}
!13 = !{!"_ZTS22LodePNGDecoderSettings", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS22LodePNGEncoderSettings", !16, i64 0, !14, i64 16, !14, i64 20, !17, i64 24, !6, i64 32, !14, i64 40, !14, i64 44, !18, i64 48, !14, i64 52}
!16 = !{!"_ZTS23LodePNGCompressSettings", !6, i64 0, !6, i64 8}
!17 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTS16LodePNGColorMode", !20, i64 0, !14, i64 4, !6, i64 8, !10, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36}
!20 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!21 = !{!"_ZTS11LodePNGInfo", !14, i64 0, !14, i64 4, !14, i64 8, !19, i64 16, !14, i64 56, !14, i64 60, !14, i64 64, !14, 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, !7, i64 136, !7, i64 160}
!22 = !{!7, !7, i64 0}
!23 = !{!14, !14, i64 0}
!24 = !{!21, !14, i64 20}
!25 = !{!21, !20, i64 16}
!26 = !{!21, !14, i64 0}
!27 = !{!21, !14, i64 4}
!28 = !{!21, !14, i64 8}


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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z25lodepng_chunk_type_equalsPKhPKc(ptr noundef, 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 #0 {
  %6 = getelementptr inbounds i8, ptr %2, i64 112
  %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 336
  store i32 48, ptr %10, align 8, !tbaa !5
  br label %103

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 336
  store i32 27, ptr %14, align 8, !tbaa !5
  br label %103

15:                                               ; preds = %11
  tail call void @_ZL20lodepng_info_cleanupP11LodePNGInfo(ptr noundef nonnull %6)
  tail call void @_ZL17lodepng_info_initP11LodePNGInfo(ptr noundef nonnull %6)
  %16 = load i8, ptr %3, align 1, !tbaa !20
  %.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 !20
  %.not67 = icmp eq i8 %19, 80
  br i1 %.not67, label %20, label %38

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

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

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

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

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

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

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

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

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

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

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

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)
  %.not76 = icmp eq ptr %0, null
  br i1 %.not76, label %55, label %54

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

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

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

57:                                               ; preds = %56, %55
  %58 = getelementptr inbounds i8, ptr %3, i64 24
  %59 = load i8, ptr %58, align 1, !tbaa !20
  %60 = zext i8 %59 to i32
  %61 = getelementptr inbounds i8, ptr %2, i64 128
  %62 = getelementptr inbounds i8, ptr %2, i64 132
  store i32 %60, ptr %62, align 4, !tbaa !22
  %63 = getelementptr inbounds i8, ptr %3, i64 25
  %64 = load i8, ptr %63, align 1, !tbaa !20
  %65 = zext i8 %64 to i32
  store i32 %65, ptr %61, align 8, !tbaa !23
  %66 = getelementptr inbounds i8, ptr %3, i64 26
  %67 = load i8, ptr %66, align 1, !tbaa !20
  %68 = zext i8 %67 to i32
  store i32 %68, ptr %6, align 8, !tbaa !24
  %69 = getelementptr inbounds i8, ptr %3, i64 27
  %70 = load i8, ptr %69, align 1, !tbaa !20
  %71 = zext i8 %70 to i32
  %72 = getelementptr inbounds i8, ptr %2, i64 116
  store i32 %71, ptr %72, align 4, !tbaa !25
  %73 = getelementptr inbounds i8, ptr %3, i64 28
  %74 = load i8, ptr %73, align 1, !tbaa !20
  %75 = zext i8 %74 to i32
  %76 = getelementptr inbounds i8, ptr %2, i64 120
  store i32 %75, ptr %76, align 8, !tbaa !26
  %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 336
  store i32 93, ptr %80, align 8, !tbaa !5
  br label %103

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

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

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

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

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

90:                                               ; preds = %87
  %91 = load i32, ptr %76, align 8, !tbaa !26
  %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 %103

94:                                               ; preds = %90
  %95 = getelementptr inbounds i8, ptr %3, i64 29
  %96 = tail call noundef i32 @_ZL20lodepng_read32bitIntPKh(ptr noundef nonnull %95)
  %97 = getelementptr inbounds i8, ptr %3, i64 12
  %98 = tail call i64 @crc32(i64 noundef 0, ptr noundef nonnull %97, i32 noundef 17)
  %99 = trunc i64 %98 to i32
  %.not81 = icmp eq i32 %96, %99
  br i1 %.not81, label %101, label %100

100:                                              ; preds = %94
  store i32 57, ptr %83, align 8, !tbaa !5
  br label %103

101:                                              ; preds = %94
  %102 = load i32, ptr %83, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %100, %101, %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 ], [ 29, %47 ], [ %82, %81 ], [ 57, %100 ], [ %102, %101 ]
  ret i32 %.1
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL20lodepng_info_cleanupP11LodePNGInfo(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL17lodepng_info_initP11LodePNGInfo(ptr noundef) local_unnamed_addr #0

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

declare i64 @crc32(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { "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, !8, i64 336}
!6 = !{!"_ZTS12LodePNGState", !7, i64 0, !11, i64 16, !16, i64 72, !19, i64 112, !16, i64 296, !8, i64 336, !8, i64 340, !8, i64 344}
!7 = !{!"_ZTS22LodePNGDecoderSettings", !8, i64 0, !8, i64 4, !8, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTS22LodePNGEncoderSettings", !12, i64 0, !8, i64 16, !8, i64 20, !14, i64 24, !13, i64 32, !8, i64 40, !8, i64 44, !15, i64 48, !8, i64 52}
!12 = !{!"_ZTS23LodePNGCompressSettings", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!"_ZTS21LodePNGFilterStrategy", !9, i64 0}
!15 = !{!"short", !9, i64 0}
!16 = !{!"_ZTS16LodePNGColorMode", !17, i64 0, !8, i64 4, !13, i64 8, !18, i64 16, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36}
!17 = !{!"_ZTS16LodePNGColorType", !9, i64 0}
!18 = !{!"long", !9, i64 0}
!19 = !{!"_ZTS11LodePNGInfo", !8, i64 0, !8, i64 4, !8, i64 8, !16, i64 16, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68, !18, i64 72, !13, i64 80, !13, i64 88, !18, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !9, i64 136, !9, i64 160}
!20 = !{!9, !9, i64 0}
!21 = !{!8, !8, i64 0}
!22 = !{!19, !8, i64 20}
!23 = !{!19, !17, i64 16}
!24 = !{!19, !8, i64 0}
!25 = !{!19, !8, i64 4}
!26 = !{!19, !8, i64 8}


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