; LLVM IR from StanfordVL/GibsonEnv :: gibson/core/channels/external/lodepng (lodepng)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.LodePNGState = type <{ ptr, %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32, [4 x i8] }>
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, %struct.LodePNGTime, i32, i32, i32, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

90:                                               ; preds = %85
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.LodePNGState, ptr %91, i32 0, i32 5
  store i32 94, ptr %92, align 8, !tbaa !11
  store i32 94, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

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

98:                                               ; preds = %93
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.LodePNGState, ptr %99, i32 0, i32 5
  store i32 29, ptr %100, align 8, !tbaa !11
  store i32 29, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

101:                                              ; preds = %93
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 16
  %104 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %103)
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %104, ptr %105, align 4, !tbaa !24
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 20
  %108 = call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef %107)
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %108, ptr %109, 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 %12, 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 %12, 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 %12, 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 %12, 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 %12, 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 ptr, ptr %7, align 8, !tbaa !5
  %143 = load i32, ptr %142, align 4, !tbaa !24
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %149, label %145

145:                                              ; preds = %101
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = load i32, ptr %146, align 4, !tbaa !24
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %149, label %152

149:                                              ; preds = %145, %101
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.LodePNGState, ptr %150, i32 0, i32 5
  store i32 93, ptr %151, align 8, !tbaa !11
  store i32 93, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %214

152:                                              ; preds = %145
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.LodePNGState, ptr %153, i32 0, i32 1
  %155 = getelementptr inbounds %struct.LodePNGDecoderSettings, ptr %154, i32 0, i32 1
  %156 = load i32, ptr %155, align 8, !tbaa !30
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %175, label %158

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

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

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

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

174:                                              ; preds = %172
  br label %175

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !15, i64 416}
!12 = !{!"_ZTS12LodePNGState", !13, i64 8, !16, i64 56, !19, i64 144, !21, i64 184, !15, i64 416}
!13 = !{!"_ZTS22LodePNGDecoderSettings", !14, i64 0, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44}
!14 = !{!"_ZTS25LodePNGDecompressSettings", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS22LodePNGEncoderSettings", !17, i64 0, !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, !7, i64 184, !7, i64 208}
!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 nocapture noundef %0, ptr nocapture noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #1 {
  %6 = getelementptr inbounds i8, ptr %2, i64 184
  %7 = icmp eq i64 %4, 0
  %8 = icmp eq ptr %3, null
  %or.cond = or i1 %8, %7
  br i1 %or.cond, label %86, label %9

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

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

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

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

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

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

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

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

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

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

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

39:                                               ; preds = %37
  %40 = getelementptr inbounds i8, ptr %3, i64 16
  %41 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %40)
  store i32 %41, ptr %0, align 4, !tbaa !8
  %42 = getelementptr inbounds i8, ptr %3, i64 20
  %43 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %42)
  store i32 %43, ptr %1, align 4, !tbaa !8
  %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 200
  %48 = getelementptr inbounds i8, ptr %2, i64 204
  store i32 %46, ptr %48, align 4, !tbaa !10
  %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 !17
  %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 !18
  %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 188
  store i32 %57, ptr %58, align 4, !tbaa !19
  %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 192
  store i32 %61, ptr %62, align 8, !tbaa !20
  %63 = load i32, ptr %0, align 4, !tbaa !8
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %86, label %65

65:                                               ; preds = %39
  %66 = load i32, ptr %1, align 4, !tbaa !8
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %86, label %68

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

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

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

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

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

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

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

86:                                               ; preds = %79, %77, %.critedge, %71, %39, %65, %37, %34, %11, %13, %16, %19, %22, %25, %28, %31, %9, %5, %82
  %.sink = phi i32 [ %85, %82 ], [ 48, %5 ], [ 27, %9 ], [ 28, %31 ], [ 28, %28 ], [ 28, %25 ], [ 28, %22 ], [ 28, %19 ], [ 28, %16 ], [ 28, %13 ], [ 28, %11 ], [ 94, %34 ], [ 29, %37 ], [ 93, %65 ], [ 93, %39 ], [ 57, %71 ], [ 32, %.critedge ], [ 33, %77 ], [ 34, %79 ]
  %87 = getelementptr inbounds i8, ptr %2, i64 416
  store i32 %.sink, ptr %87, 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, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !9, i64 20}
!11 = !{!"_ZTS11LodePNGInfo", !9, i64 0, !9, i64 4, !9, i64 8, !12, i64 16, !9, i64 56, !9, i64 60, !9, i64 64, !9, i64 68, !15, i64 72, !14, i64 80, !14, i64 88, !15, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !9, i64 136, !16, i64 140, !9, i64 164, !9, i64 168, !9, i64 172, !9, i64 176, !6, i64 184, !6, i64 208}
!12 = !{!"_ZTS16LodePNGColorMode", !13, i64 0, !9, i64 4, !14, i64 8, !15, i64 16, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36}
!13 = !{!"_ZTS16LodePNGColorType", !6, i64 0}
!14 = !{!"any pointer", !6, i64 0}
!15 = !{!"long", !6, i64 0}
!16 = !{!"_ZTS11LodePNGTime", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20}
!17 = !{!11, !13, i64 16}
!18 = !{!11, !9, i64 0}
!19 = !{!11, !9, i64 4}
!20 = !{!11, !9, i64 8}
!21 = !{!22, !9, i64 40}
!22 = !{!"_ZTS12LodePNGState", !23, i64 8, !25, i64 56, !12, i64 144, !11, i64 184, !9, i64 416}
!23 = !{!"_ZTS22LodePNGDecoderSettings", !24, i64 0, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44}
!24 = !{!"_ZTS25LodePNGDecompressSettings", !9, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!25 = !{!"_ZTS22LodePNGEncoderSettings", !26, i64 0, !9, i64 48, !9, i64 52, !27, i64 56, !14, i64 64, !9, i64 72, !9, i64 76, !9, i64 80}
!26 = !{!"_ZTS23LodePNGCompressSettings", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !14, i64 24, !14, i64 32, !14, i64 40}
!27 = !{!"_ZTS21LodePNGFilterStrategy", !6, i64 0}
!28 = !{!22, !9, i64 416}


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