; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src/render/brick_texture_packer/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 }

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

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

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

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

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

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

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

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

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

156:                                              ; preds = %112
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = load i32, ptr %157, align 4, !tbaa !24
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %163

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

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

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

179:                                              ; preds = %169
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.LodePNGState, ptr %180, i32 0, i32 5
  store i32 57, ptr %181, align 8, !tbaa !11
  store i32 57, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %183

182:                                              ; preds = %169
  store i32 0, ptr %13, align 4
  br label %183

183:                                              ; preds = %182, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %184 = load i32, ptr %13, align 4
  switch i32 %184, label %225 [
    i32 0, label %185
  ]

185:                                              ; preds = %183
  br label %186

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

191:                                              ; preds = %186
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.LodePNGState, ptr %192, i32 0, i32 5
  store i32 32, ptr %193, align 8, !tbaa !11
  store i32 32, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %225

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

199:                                              ; preds = %194
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.LodePNGState, ptr %200, i32 0, i32 5
  store i32 33, ptr %201, align 8, !tbaa !11
  store i32 33, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %225

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

207:                                              ; preds = %202
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.LodePNGState, ptr %208, i32 0, i32 5
  store i32 34, ptr %209, align 8, !tbaa !11
  store i32 34, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %225

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

225:                                              ; preds = %210, %207, %199, %191, %183, %160, %109, %82, %29, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %226 = load i32, ptr %6, align 4
  ret i32 %226
}

; 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"

; 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 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 %92, label %9

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

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

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

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

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

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

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

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

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

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

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

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

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

72:                                               ; preds = %46
  %73 = load i32, ptr %1, align 4, !tbaa !8
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %92, label %75

75:                                               ; preds = %72
  %76 = getelementptr inbounds i8, ptr %2, i64 40
  %77 = load i32, ptr %76, align 8, !tbaa !21
  %.not70 = icmp eq i32 %77, 0
  br i1 %.not70, label %78, label %.critedge

78:                                               ; preds = %75
  %79 = getelementptr inbounds i8, ptr %3, i64 29
  %80 = tail call noundef i32 @_Z20lodepng_read32bitIntPKh(ptr noundef nonnull %79)
  %81 = tail call noundef i32 @_Z13lodepng_crc32PKhm(ptr noundef nonnull %35, i64 noundef 17)
  %.not71 = icmp eq i32 %80, %81
  br i1 %.not71, label %..critedge_crit_edge, label %92

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

.critedge:                                        ; preds = %..critedge_crit_edge, %75
  %82 = phi i32 [ %.pre, %..critedge_crit_edge ], [ %61, %75 ]
  %.not72 = icmp eq i32 %82, 0
  br i1 %.not72, label %83, label %92

83:                                               ; preds = %.critedge
  %84 = load i32, ptr %65, align 4, !tbaa !19
  %.not73 = icmp eq i32 %84, 0
  br i1 %.not73, label %85, label %92

85:                                               ; preds = %83
  %86 = load i32, ptr %69, align 8, !tbaa !20
  %87 = icmp ugt i32 %86, 1
  br i1 %87, label %92, label %88

88:                                               ; preds = %85
  %89 = load i32, ptr %54, align 8, !tbaa !17
  %90 = load i32, ptr %55, align 4, !tbaa !10
  %91 = tail call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %89, i32 noundef %90)
  br label %92

92:                                               ; preds = %85, %83, %.critedge, %78, %46, %72, %34, %37, %40, %43, %11, %13, %16, %19, %22, %25, %28, %31, %9, %5, %88
  %.sink = phi i32 [ %91, %88 ], [ 48, %5 ], [ 27, %9 ], [ 28, %31 ], [ 28, %28 ], [ 28, %25 ], [ 28, %22 ], [ 28, %19 ], [ 28, %16 ], [ 28, %13 ], [ 28, %11 ], [ 29, %43 ], [ 29, %40 ], [ 29, %37 ], [ 29, %34 ], [ 93, %72 ], [ 93, %46 ], [ 57, %78 ], [ 32, %.critedge ], [ 33, %83 ], [ 34, %85 ]
  %93 = getelementptr inbounds i8, ptr %2, i64 416
  store i32 %.sink, ptr %93, 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