; 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.BPMLists = type { i32, ptr, i32, i32, ptr, i32, ptr, ptr }
%struct.BPMNode = type { i32, i32, ptr, i32 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

19:                                               ; preds = %4
  store i32 80, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %294

20:                                               ; preds = %4
  %21 = load i32, ptr %9, align 4, !tbaa !11
  %22 = shl i32 1, %21
  %23 = zext i32 %22 to i64
  %24 = load i64, ptr %8, align 8, !tbaa !9
  %25 = icmp ult i64 %23, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %20
  store i32 80, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %294

27:                                               ; preds = %20
  %28 = load i64, ptr %8, align 8, !tbaa !9
  %29 = mul i64 %28, 24
  %30 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %29)
  store ptr %30, ptr %13, align 8, !tbaa !5
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  store i32 83, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %294

34:                                               ; preds = %27
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %35

35:                                               ; preds = %65, %34
  %36 = load i32, ptr %11, align 4, !tbaa !11
  %37 = zext i32 %36 to i64
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = icmp ne i64 %37, %38
  br i1 %39, label %40, label %68

40:                                               ; preds = %35
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %11, align 4, !tbaa !11
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr %41, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = icmp ugt i32 %45, 0
  br i1 %46, label %47, label %64

47:                                               ; preds = %40
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !11
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %48, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.BPMNode, ptr %53, i64 %54
  %56 = getelementptr inbounds %struct.BPMNode, ptr %55, i32 0, i32 0
  store i32 %52, ptr %56, align 8, !tbaa !13
  %57 = load i32, ptr %11, align 4, !tbaa !11
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = load i64, ptr %12, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.BPMNode, ptr %58, i64 %59
  %61 = getelementptr inbounds %struct.BPMNode, ptr %60, i32 0, i32 1
  store i32 %57, ptr %61, align 4, !tbaa !15
  %62 = load i64, ptr %12, align 8, !tbaa !9
  %63 = add i64 %62, 1
  store i64 %63, ptr %12, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %47, %40
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %11, align 4, !tbaa !11
  %67 = add i32 %66, 1
  store i32 %67, ptr %11, align 4, !tbaa !11
  br label %35, !llvm.loop !16

68:                                               ; preds = %35
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %79, %68
  %70 = load i32, ptr %11, align 4, !tbaa !11
  %71 = zext i32 %70 to i64
  %72 = load i64, ptr %8, align 8, !tbaa !9
  %73 = icmp ne i64 %71, %72
  br i1 %73, label %74, label %82

74:                                               ; preds = %69
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i32, ptr %11, align 4, !tbaa !11
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  store i32 0, ptr %78, align 4, !tbaa !11
  br label %79

79:                                               ; preds = %74
  %80 = load i32, ptr %11, align 4, !tbaa !11
  %81 = add i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !11
  br label %69, !llvm.loop !18

82:                                               ; preds = %69
  %83 = load i64, ptr %12, align 8, !tbaa !9
  %84 = icmp eq i64 %83, 0
  br i1 %84, label %85, label %90

85:                                               ; preds = %82
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds i32, ptr %86, i64 1
  store i32 1, ptr %87, align 4, !tbaa !11
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds i32, ptr %88, i64 0
  store i32 1, ptr %89, align 4, !tbaa !11
  br label %291

90:                                               ; preds = %82
  %91 = load i64, ptr %12, align 8, !tbaa !9
  %92 = icmp eq i64 %91, 1
  br i1 %92, label %93, label %111

93:                                               ; preds = %90
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.BPMNode, ptr %95, i64 0
  %97 = getelementptr inbounds %struct.BPMNode, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !15
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %94, i64 %99
  store i32 1, ptr %100, align 4, !tbaa !11
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.BPMNode, ptr %102, i64 0
  %104 = getelementptr inbounds %struct.BPMNode, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !15
  %106 = icmp eq i32 %105, 0
  %107 = zext i1 %106 to i64
  %108 = select i1 %106, i32 1, i32 0
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %101, i64 %109
  store i32 1, ptr %110, align 4, !tbaa !11
  br label %290

111:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 56, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = load i64, ptr %12, align 8, !tbaa !9
  call void @_ZL12bpmnode_sortP7BPMNodem(ptr noundef %112, i64 noundef %113)
  %114 = load i32, ptr %9, align 4, !tbaa !11
  %115 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 5
  store i32 %114, ptr %115, align 8, !tbaa !19
  %116 = load i32, ptr %9, align 4, !tbaa !11
  %117 = mul i32 2, %116
  %118 = load i32, ptr %9, align 4, !tbaa !11
  %119 = add i32 %118, 1
  %120 = mul i32 %117, %119
  %121 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 0
  store i32 %120, ptr %121, align 8, !tbaa !21
  %122 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 3
  store i32 0, ptr %122, align 4, !tbaa !22
  %123 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !21
  %125 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 2
  store i32 %124, ptr %125, align 8, !tbaa !23
  %126 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !21
  %128 = zext i32 %127 to i64
  %129 = mul i64 %128, 24
  %130 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %129)
  %131 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 1
  store ptr %130, ptr %131, align 8, !tbaa !24
  %132 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 0
  %133 = load i32, ptr %132, align 8, !tbaa !21
  %134 = zext i32 %133 to i64
  %135 = mul i64 %134, 8
  %136 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %135)
  %137 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 4
  store ptr %136, ptr %137, align 8, !tbaa !25
  %138 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 5
  %139 = load i32, ptr %138, align 8, !tbaa !19
  %140 = zext i32 %139 to i64
  %141 = mul i64 %140, 8
  %142 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %141)
  %143 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 6
  store ptr %142, ptr %143, align 8, !tbaa !26
  %144 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 5
  %145 = load i32, ptr %144, align 8, !tbaa !19
  %146 = zext i32 %145 to i64
  %147 = mul i64 %146, 8
  %148 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %147)
  %149 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 7
  store ptr %148, ptr %149, align 8, !tbaa !27
  %150 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 1
  %151 = load ptr, ptr %150, align 8, !tbaa !24
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %165

153:                                              ; preds = %111
  %154 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 4
  %155 = load ptr, ptr %154, align 8, !tbaa !25
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %165

157:                                              ; preds = %153
  %158 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 6
  %159 = load ptr, ptr %158, align 8, !tbaa !26
  %160 = icmp ne ptr %159, null
  br i1 %160, label %161, label %165

161:                                              ; preds = %157
  %162 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 7
  %163 = load ptr, ptr %162, align 8, !tbaa !27
  %164 = icmp ne ptr %163, null
  br i1 %164, label %166, label %165

165:                                              ; preds = %161, %157, %153, %111
  store i32 83, ptr %10, align 4, !tbaa !11
  br label %166

166:                                              ; preds = %165, %161
  %167 = load i32, ptr %10, align 4, !tbaa !11
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %281, label %169

169:                                              ; preds = %166
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %170

170:                                              ; preds = %186, %169
  %171 = load i32, ptr %11, align 4, !tbaa !11
  %172 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 0
  %173 = load i32, ptr %172, align 8, !tbaa !21
  %174 = icmp ne i32 %171, %173
  br i1 %174, label %175, label %189

175:                                              ; preds = %170
  %176 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !24
  %178 = load i32, ptr %11, align 4, !tbaa !11
  %179 = zext i32 %178 to i64
  %180 = getelementptr inbounds %struct.BPMNode, ptr %177, i64 %179
  %181 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 4
  %182 = load ptr, ptr %181, align 8, !tbaa !25
  %183 = load i32, ptr %11, align 4, !tbaa !11
  %184 = zext i32 %183 to i64
  %185 = getelementptr inbounds ptr, ptr %182, i64 %184
  store ptr %180, ptr %185, align 8, !tbaa !5
  br label %186

186:                                              ; preds = %175
  %187 = load i32, ptr %11, align 4, !tbaa !11
  %188 = add i32 %187, 1
  store i32 %188, ptr %11, align 4, !tbaa !11
  br label %170, !llvm.loop !28

189:                                              ; preds = %170
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.BPMNode, ptr %190, i64 0
  %192 = getelementptr inbounds %struct.BPMNode, ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 8, !tbaa !13
  %194 = call noundef ptr @_ZL14bpmnode_createP8BPMListsijP7BPMNode(ptr noundef %15, i32 noundef %193, i32 noundef 1, ptr noundef null)
  %195 = load ptr, ptr %13, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.BPMNode, ptr %195, i64 1
  %197 = getelementptr inbounds %struct.BPMNode, ptr %196, i32 0, i32 0
  %198 = load i32, ptr %197, align 8, !tbaa !13
  %199 = call noundef ptr @_ZL14bpmnode_createP8BPMListsijP7BPMNode(ptr noundef %15, i32 noundef %198, i32 noundef 2, ptr noundef null)
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %200

200:                                              ; preds = %222, %189
  %201 = load i32, ptr %11, align 4, !tbaa !11
  %202 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 5
  %203 = load i32, ptr %202, align 8, !tbaa !19
  %204 = icmp ne i32 %201, %203
  br i1 %204, label %205, label %225

205:                                              ; preds = %200
  %206 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 1
  %207 = load ptr, ptr %206, align 8, !tbaa !24
  %208 = getelementptr inbounds %struct.BPMNode, ptr %207, i64 0
  %209 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 6
  %210 = load ptr, ptr %209, align 8, !tbaa !26
  %211 = load i32, ptr %11, align 4, !tbaa !11
  %212 = zext i32 %211 to i64
  %213 = getelementptr inbounds ptr, ptr %210, i64 %212
  store ptr %208, ptr %213, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 1
  %215 = load ptr, ptr %214, align 8, !tbaa !24
  %216 = getelementptr inbounds %struct.BPMNode, ptr %215, i64 1
  %217 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 7
  %218 = load ptr, ptr %217, align 8, !tbaa !27
  %219 = load i32, ptr %11, align 4, !tbaa !11
  %220 = zext i32 %219 to i64
  %221 = getelementptr inbounds ptr, ptr %218, i64 %220
  store ptr %216, ptr %221, align 8, !tbaa !5
  br label %222

222:                                              ; preds = %205
  %223 = load i32, ptr %11, align 4, !tbaa !11
  %224 = add i32 %223, 1
  store i32 %224, ptr %11, align 4, !tbaa !11
  br label %200, !llvm.loop !29

225:                                              ; preds = %200
  store i32 2, ptr %11, align 4, !tbaa !11
  br label %226

226:                                              ; preds = %239, %225
  %227 = load i32, ptr %11, align 4, !tbaa !11
  %228 = zext i32 %227 to i64
  %229 = load i64, ptr %12, align 8, !tbaa !9
  %230 = mul i64 2, %229
  %231 = sub i64 %230, 2
  %232 = icmp ne i64 %228, %231
  br i1 %232, label %233, label %242

233:                                              ; preds = %226
  %234 = load ptr, ptr %13, align 8, !tbaa !5
  %235 = load i64, ptr %12, align 8, !tbaa !9
  %236 = load i32, ptr %9, align 4, !tbaa !11
  %237 = sub nsw i32 %236, 1
  %238 = load i32, ptr %11, align 4, !tbaa !11
  call void @_ZL10boundaryPMP8BPMListsP7BPMNodemii(ptr noundef %15, ptr noundef %234, i64 noundef %235, i32 noundef %237, i32 noundef %238)
  br label %239

239:                                              ; preds = %233
  %240 = load i32, ptr %11, align 4, !tbaa !11
  %241 = add i32 %240, 1
  store i32 %241, ptr %11, align 4, !tbaa !11
  br label %226, !llvm.loop !30

242:                                              ; preds = %226
  %243 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 7
  %244 = load ptr, ptr %243, align 8, !tbaa !27
  %245 = load i32, ptr %9, align 4, !tbaa !11
  %246 = sub i32 %245, 1
  %247 = zext i32 %246 to i64
  %248 = getelementptr inbounds ptr, ptr %244, i64 %247
  %249 = load ptr, ptr %248, align 8, !tbaa !5
  store ptr %249, ptr %16, align 8, !tbaa !5
  br label %250

250:                                              ; preds = %276, %242
  %251 = load ptr, ptr %16, align 8, !tbaa !5
  %252 = icmp ne ptr %251, null
  br i1 %252, label %253, label %280

253:                                              ; preds = %250
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %254

254:                                              ; preds = %272, %253
  %255 = load i32, ptr %11, align 4, !tbaa !11
  %256 = load ptr, ptr %16, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.BPMNode, ptr %256, i32 0, i32 1
  %258 = load i32, ptr %257, align 4, !tbaa !15
  %259 = icmp ne i32 %255, %258
  br i1 %259, label %260, label %275

260:                                              ; preds = %254
  %261 = load ptr, ptr %6, align 8, !tbaa !5
  %262 = load ptr, ptr %13, align 8, !tbaa !5
  %263 = load i32, ptr %11, align 4, !tbaa !11
  %264 = zext i32 %263 to i64
  %265 = getelementptr inbounds %struct.BPMNode, ptr %262, i64 %264
  %266 = getelementptr inbounds %struct.BPMNode, ptr %265, i32 0, i32 1
  %267 = load i32, ptr %266, align 4, !tbaa !15
  %268 = zext i32 %267 to i64
  %269 = getelementptr inbounds i32, ptr %261, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !11
  %271 = add i32 %270, 1
  store i32 %271, ptr %269, align 4, !tbaa !11
  br label %272

272:                                              ; preds = %260
  %273 = load i32, ptr %11, align 4, !tbaa !11
  %274 = add i32 %273, 1
  store i32 %274, ptr %11, align 4, !tbaa !11
  br label %254, !llvm.loop !31

275:                                              ; preds = %254
  br label %276

276:                                              ; preds = %275
  %277 = load ptr, ptr %16, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.BPMNode, ptr %277, i32 0, i32 2
  %279 = load ptr, ptr %278, align 8, !tbaa !32
  store ptr %279, ptr %16, align 8, !tbaa !5
  br label %250, !llvm.loop !33

280:                                              ; preds = %250
  br label %281

281:                                              ; preds = %280, %166
  %282 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 1
  %283 = load ptr, ptr %282, align 8, !tbaa !24
  call void @_ZL12lodepng_freePv(ptr noundef %283)
  %284 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 4
  %285 = load ptr, ptr %284, align 8, !tbaa !25
  call void @_ZL12lodepng_freePv(ptr noundef %285)
  %286 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 6
  %287 = load ptr, ptr %286, align 8, !tbaa !26
  call void @_ZL12lodepng_freePv(ptr noundef %287)
  %288 = getelementptr inbounds %struct.BPMLists, ptr %15, i32 0, i32 7
  %289 = load ptr, ptr %288, align 8, !tbaa !27
  call void @_ZL12lodepng_freePv(ptr noundef %289)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 56, ptr %15) #3
  br label %290

290:                                              ; preds = %281, %93
  br label %291

291:                                              ; preds = %290, %85
  %292 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %292)
  %293 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %293, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %294

294:                                              ; preds = %291, %33, %26, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %295 = load i32, ptr %5, align 4
  ret i32 %295
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL12bpmnode_sortP7BPMNodem(ptr noundef, i64 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL10boundaryPMP8BPMListsP7BPMNodemii(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS7BPMNode", !12, i64 0, !12, i64 4, !6, i64 8, !12, i64 16}
!15 = !{!14, !12, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !12, i64 32}
!20 = !{!"_ZTS8BPMLists", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !12, i64 32, !6, i64 40, !6, i64 48}
!21 = !{!20, !12, i64 0}
!22 = !{!20, !12, i64 20}
!23 = !{!20, !12, i64 16}
!24 = !{!20, !6, i64 8}
!25 = !{!20, !6, i64 24}
!26 = !{!20, !6, i64 40}
!27 = !{!20, !6, i64 48}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}
!30 = distinct !{!30, !17}
!31 = distinct !{!31, !17}
!32 = !{!14, !6, i64 8}
!33 = distinct !{!33, !17}


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

%struct.BPMLists = type { i32, ptr, i32, i32, ptr, i32, ptr, ptr }
%struct.BPMNode = type { i32, i32, ptr, i32 }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 84) i32 @_Z28lodepng_huffman_code_lengthsPjPKjmj(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca %struct.BPMLists, align 8
  %6 = shl nuw i32 1, %3
  %.fr = freeze i32 %6
  %7 = zext i32 %.fr to i64
  %8 = add i64 %2, -1
  %or.cond95.not = icmp ult i64 %8, %7
  br i1 %or.cond95.not, label %9, label %128

9:                                                ; preds = %4
  %10 = mul nuw nsw i64 %2, 24
  %11 = tail call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %10)
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %128, label %.lr.ph

.lr.ph105.preheader:                              ; preds = %26
  %min.iters.check = icmp ult i64 %2, 16
  br i1 %min.iters.check, label %.lr.ph105.preheader143, label %vector.scevcheck

.lr.ph105.preheader143:                           ; preds = %middle.block, %vector.scevcheck, %.lr.ph105.preheader
  %.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %.lr.ph105.preheader ], [ %n.vec, %middle.block ]
  %.176104.ph = phi i32 [ 0, %vector.scevcheck ], [ 0, %.lr.ph105.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph105

vector.scevcheck:                                 ; preds = %.lr.ph105.preheader
  %12 = and i64 %8, 4294967295
  %13 = icmp eq i64 %12, 4294967295
  %14 = icmp ugt i64 %8, 4294967295
  %15 = or i1 %13, %14
  br i1 %15, label %.lr.ph105.preheader143, label %vector.ph

vector.ph:                                        ; preds = %vector.scevcheck
  %n.vec = and i64 %2, 8589934584
  %ind.end = trunc i64 %n.vec to i32
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %16 = getelementptr inbounds i32, ptr %0, i64 %index
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  store <4 x i32> zeroinitializer, ptr %16, align 4, !tbaa !5
  store <4 x i32> zeroinitializer, ptr %17, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %18 = icmp eq i64 %index.next, %n.vec
  br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %2
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph105.preheader143

.lr.ph:                                           ; preds = %9, %26
  %19 = phi i64 [ %28, %26 ], [ 0, %9 ]
  %.074102 = phi i64 [ %.1, %26 ], [ 0, %9 ]
  %.075101 = phi i32 [ %27, %26 ], [ 0, %9 ]
  %20 = getelementptr inbounds i32, ptr %1, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %.not92 = icmp eq i32 %21, 0
  br i1 %.not92, label %26, label %22

22:                                               ; preds = %.lr.ph
  %23 = getelementptr inbounds %struct.BPMNode, ptr %11, i64 %.074102
  store i32 %21, ptr %23, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  store i32 %.075101, ptr %24, align 4, !tbaa !16
  %25 = add i64 %.074102, 1
  br label %26

26:                                               ; preds = %.lr.ph, %22
  %.1 = phi i64 [ %25, %22 ], [ %.074102, %.lr.ph ]
  %27 = add i32 %.075101, 1
  %28 = zext i32 %27 to i64
  %.not84 = icmp eq i64 %28, %2
  br i1 %.not84, label %.lr.ph105.preheader, label %.lr.ph, !llvm.loop !17

.lr.ph105:                                        ; preds = %.lr.ph105.preheader143, %.lr.ph105
  %29 = phi i64 [ %32, %.lr.ph105 ], [ %.ph, %.lr.ph105.preheader143 ]
  %.176104 = phi i32 [ %31, %.lr.ph105 ], [ %.176104.ph, %.lr.ph105.preheader143 ]
  %30 = getelementptr inbounds i32, ptr %0, i64 %29
  store i32 0, ptr %30, align 4, !tbaa !5
  %31 = add i32 %.176104, 1
  %32 = zext i32 %31 to i64
  %.not85 = icmp eq i64 %32, %2
  br i1 %.not85, label %._crit_edge, label %.lr.ph105, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph105, %middle.block
  switch i64 %.1, label %44 [
    i64 0, label %33
    i64 1, label %35
  ]

33:                                               ; preds = %._crit_edge
  %34 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 1, ptr %34, align 4, !tbaa !5
  store i32 1, ptr %0, align 4, !tbaa !5
  br label %127

35:                                               ; preds = %._crit_edge
  %36 = getelementptr inbounds i8, ptr %11, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %0, i64 %38
  store i32 1, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %36, align 4, !tbaa !16
  %41 = icmp eq i32 %40, 0
  %42 = zext i1 %41 to i64
  %43 = getelementptr inbounds i32, ptr %0, i64 %42
  store i32 1, ptr %43, align 4, !tbaa !5
  br label %127

44:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %5) #3
  tail call void @_ZL12bpmnode_sortP7BPMNodem(ptr noundef nonnull %11, i64 noundef %.1)
  %45 = getelementptr inbounds i8, ptr %5, i64 32
  store i32 %3, ptr %45, align 8, !tbaa !19
  %46 = shl i32 %3, 1
  %47 = add i32 %3, 1
  %48 = mul i32 %46, %47
  store i32 %48, ptr %5, align 8, !tbaa !21
  %49 = getelementptr inbounds i8, ptr %5, i64 20
  store i32 0, ptr %49, align 4, !tbaa !22
  %50 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 %48, ptr %50, align 8, !tbaa !23
  %51 = zext i32 %48 to i64
  %52 = mul nuw nsw i64 %51, 24
  %53 = tail call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %52)
  %54 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %53, ptr %54, align 8, !tbaa !24
  %55 = shl nuw nsw i64 %51, 3
  %56 = tail call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %55)
  %57 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %56, ptr %57, align 8, !tbaa !25
  %58 = zext i32 %3 to i64
  %59 = shl nuw nsw i64 %58, 3
  %60 = tail call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %59)
  %61 = getelementptr inbounds i8, ptr %5, i64 40
  store ptr %60, ptr %61, align 8, !tbaa !26
  %62 = tail call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %59)
  %63 = getelementptr inbounds i8, ptr %5, i64 48
  store ptr %62, ptr %63, align 8, !tbaa !27
  %64 = insertelement <4 x ptr> poison, ptr %53, i64 0
  %65 = insertelement <4 x ptr> %64, ptr %56, i64 1
  %66 = insertelement <4 x ptr> %65, ptr %60, i64 2
  %67 = insertelement <4 x ptr> %66, ptr %62, i64 3
  %68 = icmp eq <4 x ptr> %67, zeroinitializer
  %69 = bitcast <4 x i1> %68 to i4
  %70 = icmp eq i4 %69, 0
  %spec.select = select i1 %70, i32 0, i32 83
  br i1 %70, label %.preheader97, label %.loopexit

.preheader97:                                     ; preds = %44
  %.not87106 = icmp eq i32 %48, 0
  br i1 %.not87106, label %._crit_edge109, label %.lr.ph108.preheader

.lr.ph108.preheader:                              ; preds = %.preheader97
  %min.iters.check132 = icmp ult i32 %48, 4
  br i1 %min.iters.check132, label %.lr.ph108.preheader142, label %vector.ph133

vector.ph133:                                     ; preds = %.lr.ph108.preheader
  %n.vec135 = and i64 %51, 4294967292
  br label %vector.body137

vector.body137:                                   ; preds = %vector.body137, %vector.ph133
  %index138 = phi i64 [ 0, %vector.ph133 ], [ %index.next140, %vector.body137 ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph133 ], [ %vec.ind.next, %vector.body137 ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %71 = getelementptr inbounds %struct.BPMNode, ptr %53, <2 x i64> %vec.ind
  %72 = getelementptr inbounds %struct.BPMNode, ptr %53, <2 x i64> %step.add
  %73 = getelementptr inbounds ptr, ptr %56, i64 %index138
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  store <2 x ptr> %71, ptr %73, align 8, !tbaa !28
  store <2 x ptr> %72, ptr %74, align 8, !tbaa !28
  %index.next140 = add nuw i64 %index138, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %75 = icmp eq i64 %index.next140, %n.vec135
  br i1 %75, label %middle.block130, label %vector.body137, !llvm.loop !29

middle.block130:                                  ; preds = %vector.body137
  %cmp.n141 = icmp eq i64 %n.vec135, %51
  br i1 %cmp.n141, label %._crit_edge109, label %.lr.ph108.preheader142

.lr.ph108.preheader142:                           ; preds = %middle.block130, %.lr.ph108.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph108.preheader ], [ %n.vec135, %middle.block130 ]
  br label %.lr.ph108

.lr.ph108:                                        ; preds = %.lr.ph108.preheader142, %.lr.ph108
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph108 ], [ %indvars.iv.ph, %.lr.ph108.preheader142 ]
  %76 = getelementptr inbounds %struct.BPMNode, ptr %53, i64 %indvars.iv
  %77 = getelementptr inbounds ptr, ptr %56, i64 %indvars.iv
  store ptr %76, ptr %77, align 8, !tbaa !28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not87 = icmp eq i64 %indvars.iv.next, %51
  br i1 %.not87, label %._crit_edge109, label %.lr.ph108, !llvm.loop !30

._crit_edge109:                                   ; preds = %.lr.ph108, %middle.block130, %.preheader97
  %78 = load i32, ptr %11, align 8, !tbaa !13
  %79 = call noundef ptr @_ZL14bpmnode_createP8BPMListsijP7BPMNode(ptr noundef nonnull %5, i32 noundef %78, i32 noundef 1, ptr noundef null)
  %80 = getelementptr inbounds i8, ptr %11, i64 24
  %81 = load i32, ptr %80, align 8, !tbaa !13
  %82 = call noundef ptr @_ZL14bpmnode_createP8BPMListsijP7BPMNode(ptr noundef nonnull %5, i32 noundef %81, i32 noundef 2, ptr noundef null)
  %83 = load i32, ptr %45, align 8, !tbaa !19
  %.not88110 = icmp eq i32 %83, 0
  br i1 %.not88110, label %.preheader96, label %.lr.ph113.preheader

.lr.ph113.preheader:                              ; preds = %._crit_edge109
  %84 = zext i32 %83 to i64
  %xtraiter = and i64 %84, 1
  %85 = icmp eq i32 %83, 1
  br i1 %85, label %.preheader96.loopexit.unr-lcssa, label %.lr.ph113.preheader.new

.lr.ph113.preheader.new:                          ; preds = %.lr.ph113.preheader
  %unroll_iter = and i64 %84, 4294967294
  br label %.lr.ph113

.preheader96.loopexit.unr-lcssa:                  ; preds = %.lr.ph113, %.lr.ph113.preheader
  %indvars.iv126.unr = phi i64 [ 0, %.lr.ph113.preheader ], [ %indvars.iv.next127.1, %.lr.ph113 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader96, label %.lr.ph113.epil

.lr.ph113.epil:                                   ; preds = %.preheader96.loopexit.unr-lcssa
  %86 = load ptr, ptr %54, align 8, !tbaa !24
  %87 = load ptr, ptr %61, align 8, !tbaa !26
  %88 = getelementptr inbounds ptr, ptr %87, i64 %indvars.iv126.unr
  store ptr %86, ptr %88, align 8, !tbaa !28
  %89 = getelementptr inbounds i8, ptr %86, i64 24
  %90 = load ptr, ptr %63, align 8, !tbaa !27
  %91 = getelementptr inbounds ptr, ptr %90, i64 %indvars.iv126.unr
  store ptr %89, ptr %91, align 8, !tbaa !28
  br label %.preheader96

.preheader96:                                     ; preds = %.lr.ph113.epil, %.preheader96.loopexit.unr-lcssa, %._crit_edge109
  %92 = shl i64 %.1, 1
  %93 = add i64 %92, -2
  %.not89114 = icmp eq i64 %93, 2
  %.pre = add i32 %3, -1
  br i1 %.not89114, label %._crit_edge117, label %.lr.ph116

.lr.ph113:                                        ; preds = %.lr.ph113, %.lr.ph113.preheader.new
  %indvars.iv126 = phi i64 [ 0, %.lr.ph113.preheader.new ], [ %indvars.iv.next127.1, %.lr.ph113 ]
  %niter = phi i64 [ 0, %.lr.ph113.preheader.new ], [ %niter.next.1, %.lr.ph113 ]
  %94 = load ptr, ptr %54, align 8, !tbaa !24
  %95 = load ptr, ptr %61, align 8, !tbaa !26
  %96 = getelementptr inbounds ptr, ptr %95, i64 %indvars.iv126
  store ptr %94, ptr %96, align 8, !tbaa !28
  %97 = getelementptr inbounds i8, ptr %94, i64 24
  %98 = load ptr, ptr %63, align 8, !tbaa !27
  %99 = getelementptr inbounds ptr, ptr %98, i64 %indvars.iv126
  store ptr %97, ptr %99, align 8, !tbaa !28
  %indvars.iv.next127 = or disjoint i64 %indvars.iv126, 1
  %100 = load ptr, ptr %54, align 8, !tbaa !24
  %101 = load ptr, ptr %61, align 8, !tbaa !26
  %102 = getelementptr inbounds ptr, ptr %101, i64 %indvars.iv.next127
  store ptr %100, ptr %102, align 8, !tbaa !28
  %103 = getelementptr inbounds i8, ptr %100, i64 24
  %104 = load ptr, ptr %63, align 8, !tbaa !27
  %105 = getelementptr inbounds ptr, ptr %104, i64 %indvars.iv.next127
  store ptr %103, ptr %105, align 8, !tbaa !28
  %indvars.iv.next127.1 = add nuw nsw i64 %indvars.iv126, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader96.loopexit.unr-lcssa, label %.lr.ph113, !llvm.loop !31

.lr.ph116:                                        ; preds = %.preheader96, %.lr.ph116
  %.4115 = phi i32 [ %106, %.lr.ph116 ], [ 2, %.preheader96 ]
  call void @_ZL10boundaryPMP8BPMListsP7BPMNodemii(ptr noundef nonnull %5, ptr noundef nonnull %11, i64 noundef %.1, i32 noundef %.pre, i32 noundef %.4115)
  %106 = add i32 %.4115, 1
  %107 = zext i32 %106 to i64
  %.not89 = icmp eq i64 %93, %107
  br i1 %.not89, label %._crit_edge117, label %.lr.ph116, !llvm.loop !32

._crit_edge117:                                   ; preds = %.lr.ph116, %.preheader96
  %108 = load ptr, ptr %63, align 8, !tbaa !27
  %109 = zext i32 %.pre to i64
  %110 = getelementptr inbounds ptr, ptr %108, i64 %109
  %.0122 = load ptr, ptr %110, align 8, !tbaa !28
  %.not90123 = icmp eq ptr %.0122, null
  br i1 %.not90123, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %._crit_edge117, %._crit_edge121
  %.0124 = phi ptr [ %.0, %._crit_edge121 ], [ %.0122, %._crit_edge117 ]
  %111 = getelementptr inbounds i8, ptr %.0124, i64 4
  %112 = load i32, ptr %111, align 4, !tbaa !16
  %.not91118 = icmp eq i32 %112, 0
  br i1 %.not91118, label %._crit_edge121, label %.lr.ph120

.lr.ph120:                                        ; preds = %.preheader, %.lr.ph120
  %.5119 = phi i32 [ %120, %.lr.ph120 ], [ 0, %.preheader ]
  %113 = zext i32 %.5119 to i64
  %114 = getelementptr inbounds %struct.BPMNode, ptr %11, i64 %113, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !16
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds i32, ptr %0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = add i32 %118, 1
  store i32 %119, ptr %117, align 4, !tbaa !5
  %120 = add i32 %.5119, 1
  %121 = load i32, ptr %111, align 4, !tbaa !16
  %.not91 = icmp eq i32 %120, %121
  br i1 %.not91, label %._crit_edge121, label %.lr.ph120, !llvm.loop !33

._crit_edge121:                                   ; preds = %.lr.ph120, %.preheader
  %122 = getelementptr inbounds i8, ptr %.0124, i64 8
  %.0 = load ptr, ptr %122, align 8, !tbaa !28
  %.not90 = icmp eq ptr %.0, null
  br i1 %.not90, label %.loopexit, label %.preheader, !llvm.loop !34

.loopexit:                                        ; preds = %._crit_edge121, %._crit_edge117, %44
  %123 = load ptr, ptr %54, align 8, !tbaa !24
  call void @_ZL12lodepng_freePv(ptr noundef %123)
  %124 = load ptr, ptr %57, align 8, !tbaa !25
  call void @_ZL12lodepng_freePv(ptr noundef %124)
  %125 = load ptr, ptr %61, align 8, !tbaa !26
  call void @_ZL12lodepng_freePv(ptr noundef %125)
  %126 = load ptr, ptr %63, align 8, !tbaa !27
  call void @_ZL12lodepng_freePv(ptr noundef %126)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #3
  br label %127

127:                                              ; preds = %35, %.loopexit, %33
  %.178 = phi i32 [ 0, %33 ], [ 0, %35 ], [ %spec.select, %.loopexit ]
  call void @_ZL12lodepng_freePv(ptr noundef nonnull %11)
  br label %128

128:                                              ; preds = %9, %4, %127
  %.073 = phi i32 [ %.178, %127 ], [ 80, %4 ], [ 83, %9 ]
  ret i32 %.073
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL12bpmnode_sortP7BPMNodem(ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL10boundaryPMP8BPMListsP7BPMNodemii(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS7BPMNode", !6, i64 0, !6, i64 4, !15, i64 8, !6, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!14, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !11}
!19 = !{!20, !6, i64 32}
!20 = !{!"_ZTS8BPMLists", !6, i64 0, !15, i64 8, !6, i64 16, !6, i64 20, !15, i64 24, !6, i64 32, !15, i64 40, !15, i64 48}
!21 = !{!20, !6, i64 0}
!22 = !{!20, !6, i64 20}
!23 = !{!20, !6, i64 16}
!24 = !{!20, !15, i64 8}
!25 = !{!20, !15, i64 24}
!26 = !{!20, !15, i64 40}
!27 = !{!20, !15, i64 48}
!28 = !{!15, !15, i64 0}
!29 = distinct !{!29, !10, !11, !12}
!30 = distinct !{!30, !10, !12, !11}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass