; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder/lodepng.ll (Z28lodepng_huffman_code_lengthsPjPKjmj)

; 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 = load i64, ptr %8, align 8, !tbaa !9
  %24 = trunc i64 %23 to i32
  %25 = icmp ult i32 %22, %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 = icmp eq i64 %2, 0
  %7 = shl nuw i32 1, %3
  %8 = trunc i64 %2 to i32
  %9 = icmp ult i32 %7, %8
  %or.cond95 = select i1 %6, i1 true, i1 %9
  br i1 %or.cond95, label %130, label %10

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

.lr.ph105.preheader:                              ; preds = %28
  %min.iters.check = icmp ult i64 %2, 20
  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
  %13 = add i64 %2, -1
  %14 = and i64 %13, 4294967295
  %15 = icmp eq i64 %14, 4294967295
  %16 = icmp ugt i64 %13, 4294967295
  %17 = or i1 %15, %16
  br i1 %17, 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 ]
  %18 = getelementptr inbounds i32, ptr %0, i64 %index
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <4 x i32> zeroinitializer, ptr %18, align 4, !tbaa !5
  store <4 x i32> zeroinitializer, ptr %19, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, 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 = %10, %28
  %21 = phi i64 [ %30, %28 ], [ 0, %10 ]
  %.074102 = phi i64 [ %.1, %28 ], [ 0, %10 ]
  %.075101 = phi i32 [ %29, %28 ], [ 0, %10 ]
  %22 = getelementptr inbounds i32, ptr %1, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not92 = icmp eq i32 %23, 0
  br i1 %.not92, label %28, label %24

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

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

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

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

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

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

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

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

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

vector.ph133:                                     ; preds = %.lr.ph108.preheader
  %n.vec135 = and i64 %53, 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>
  %73 = getelementptr inbounds %struct.BPMNode, ptr %55, <2 x i64> %vec.ind
  %74 = getelementptr inbounds %struct.BPMNode, ptr %55, <2 x i64> %step.add
  %75 = getelementptr inbounds ptr, ptr %58, i64 %index138
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  store <2 x ptr> %73, ptr %75, align 8, !tbaa !28
  store <2 x ptr> %74, ptr %76, align 8, !tbaa !28
  %index.next140 = add nuw i64 %index138, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %77 = icmp eq i64 %index.next140, %n.vec135
  br i1 %77, label %middle.block130, label %vector.body137, !llvm.loop !29

middle.block130:                                  ; preds = %vector.body137
  %cmp.n141 = icmp eq i64 %n.vec135, %53
  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 ]
  %78 = getelementptr inbounds %struct.BPMNode, ptr %55, i64 %indvars.iv
  %79 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv
  store ptr %78, ptr %79, align 8, !tbaa !28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not87 = icmp eq i64 %indvars.iv.next, %53
  br i1 %.not87, label %._crit_edge109, label %.lr.ph108, !llvm.loop !30

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

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

.lr.ph113.preheader.new:                          ; preds = %.lr.ph113.preheader
  %unroll_iter = and i64 %86, 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
  %88 = load ptr, ptr %56, align 8, !tbaa !24
  %89 = load ptr, ptr %63, align 8, !tbaa !26
  %90 = getelementptr inbounds ptr, ptr %89, i64 %indvars.iv126.unr
  store ptr %88, ptr %90, align 8, !tbaa !28
  %91 = getelementptr inbounds i8, ptr %88, i64 24
  %92 = load ptr, ptr %65, align 8, !tbaa !27
  %93 = getelementptr inbounds ptr, ptr %92, i64 %indvars.iv126.unr
  store ptr %91, ptr %93, align 8, !tbaa !28
  br label %.preheader96

.preheader96:                                     ; preds = %.lr.ph113.epil, %.preheader96.loopexit.unr-lcssa, %._crit_edge109
  %94 = shl i64 %.1, 1
  %95 = add i64 %94, -2
  %.not89114 = icmp eq i64 %95, 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 ]
  %96 = load ptr, ptr %56, align 8, !tbaa !24
  %97 = load ptr, ptr %63, align 8, !tbaa !26
  %98 = getelementptr inbounds ptr, ptr %97, i64 %indvars.iv126
  store ptr %96, ptr %98, align 8, !tbaa !28
  %99 = getelementptr inbounds i8, ptr %96, i64 24
  %100 = load ptr, ptr %65, align 8, !tbaa !27
  %101 = getelementptr inbounds ptr, ptr %100, i64 %indvars.iv126
  store ptr %99, ptr %101, align 8, !tbaa !28
  %indvars.iv.next127 = or disjoint i64 %indvars.iv126, 1
  %102 = load ptr, ptr %56, align 8, !tbaa !24
  %103 = load ptr, ptr %63, align 8, !tbaa !26
  %104 = getelementptr inbounds ptr, ptr %103, i64 %indvars.iv.next127
  store ptr %102, ptr %104, align 8, !tbaa !28
  %105 = getelementptr inbounds i8, ptr %102, i64 24
  %106 = load ptr, ptr %65, align 8, !tbaa !27
  %107 = getelementptr inbounds ptr, ptr %106, i64 %indvars.iv.next127
  store ptr %105, ptr %107, 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 [ %108, %.lr.ph116 ], [ 2, %.preheader96 ]
  call void @_ZL10boundaryPMP8BPMListsP7BPMNodemii(ptr noundef nonnull %5, ptr noundef nonnull %12, i64 noundef %.1, i32 noundef %.pre, i32 noundef %.4115)
  %108 = add i32 %.4115, 1
  %109 = zext i32 %108 to i64
  %.not89 = icmp eq i64 %95, %109
  br i1 %.not89, label %._crit_edge117, label %.lr.ph116, !llvm.loop !32

._crit_edge117:                                   ; preds = %.lr.ph116, %.preheader96
  %110 = load ptr, ptr %65, align 8, !tbaa !27
  %111 = zext i32 %.pre to i64
  %112 = getelementptr inbounds ptr, ptr %110, i64 %111
  %.0122 = load ptr, ptr %112, 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 ]
  %113 = getelementptr inbounds i8, ptr %.0124, i64 4
  %114 = load i32, ptr %113, align 4, !tbaa !16
  %.not91118 = icmp eq i32 %114, 0
  br i1 %.not91118, label %._crit_edge121, label %.lr.ph120

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

._crit_edge121:                                   ; preds = %.lr.ph120, %.preheader
  %124 = getelementptr inbounds i8, ptr %.0124, i64 8
  %.0 = load ptr, ptr %124, 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, %46
  %125 = load ptr, ptr %56, align 8, !tbaa !24
  call void @_ZL12lodepng_freePv(ptr noundef %125)
  %126 = load ptr, ptr %59, align 8, !tbaa !25
  call void @_ZL12lodepng_freePv(ptr noundef %126)
  %127 = load ptr, ptr %63, align 8, !tbaa !26
  call void @_ZL12lodepng_freePv(ptr noundef %127)
  %128 = load ptr, ptr %65, align 8, !tbaa !27
  call void @_ZL12lodepng_freePv(ptr noundef %128)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %5) #3
  br label %129

129:                                              ; preds = %37, %.loopexit, %35
  %.178 = phi i32 [ 0, %35 ], [ 0, %37 ], [ %spec.select, %.loopexit ]
  call void @_ZL12lodepng_freePv(ptr noundef nonnull %12)
  br label %130

130:                                              ; preds = %10, %4, %129
  %.073 = phi i32 [ %.178, %129 ], [ 80, %4 ], [ 83, %10 ]
  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,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass