; LLVM IR from brewlin/garbage-collect :: gc-python/malloc (obmalloc)

; 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.pool_header = type { %union.anon, ptr, ptr, ptr, i32, i32, i32, i32 }
%union.anon = type { ptr }
%struct.arena_object = type { i64, ptr, i32, i32, ptr, ptr, ptr }

@usedpools = external dso_local global [64 x ptr], align 16
@arenas = external dso_local global ptr, align 8
@maxarenas = external dso_local global i32, align 4
@unused_arena_objects = external dso_local global ptr, align 8
@usable_arenas = external dso_local global ptr, align 8
@narenas_currently_allocated = external dso_local global i64, align 8
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__.PyObject_Free = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [81 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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: nounwind uwtable
define dso_local void @PyObject_Free(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %1
  store i32 1, ptr %8, align 4
  br label %464

14:                                               ; preds = %1
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = ptrtoint ptr %15 to i64
  %17 = and i64 %16, -4096
  %18 = inttoptr i64 %17 to ptr
  store ptr %18, ptr %3, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.pool_header, ptr %19, i32 0, i32 4
  %21 = load i32, ptr %20, align 8, !tbaa !9
  %22 = load i32, ptr @maxarenas, align 4, !tbaa !12
  %23 = icmp ult i32 %21, %22
  br i1 %23, label %24, label %462

24:                                               ; preds = %14
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = ptrtoint ptr %25 to i64
  %27 = load ptr, ptr @arenas, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.pool_header, ptr %28, i32 0, i32 4
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds %struct.arena_object, ptr %27, i64 %31
  %33 = getelementptr inbounds %struct.arena_object, ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = sub i64 %26, %34
  %36 = icmp ult i64 %35, 262144
  br i1 %36, label %37, label %462

37:                                               ; preds = %24
  %38 = load ptr, ptr @arenas, align 8, !tbaa !5
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.pool_header, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds %struct.arena_object, ptr %38, i64 %42
  %44 = getelementptr inbounds %struct.arena_object, ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !13
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %462

47:                                               ; preds = %37
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.pool_header, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !16
  %51 = icmp ugt i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  br label %54

53:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 338, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

54:                                               ; preds = %52
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.pool_header, ptr %55, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  store ptr %57, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %57, ptr %58, align 8, !tbaa !5
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.pool_header, ptr %60, i32 0, i32 1
  store ptr %59, ptr %61, align 8, !tbaa !17
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %426

64:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.pool_header, ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !16
  %68 = add i32 %67, -1
  store i32 %68, ptr %66, align 8, !tbaa !16
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %64
  store i32 1, ptr %8, align 4
  br label %425

71:                                               ; preds = %64
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.pool_header, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !18
  store ptr %74, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.pool_header, ptr %75, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !19
  store ptr %77, ptr %6, align 8, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.pool_header, ptr %79, i32 0, i32 3
  store ptr %78, ptr %80, align 8, !tbaa !19
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.pool_header, ptr %82, i32 0, i32 2
  store ptr %81, ptr %83, align 8, !tbaa !18
  %84 = load ptr, ptr @arenas, align 8, !tbaa !5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.pool_header, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds %struct.arena_object, ptr %84, i64 %88
  store ptr %89, ptr %9, align 8, !tbaa !5
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.arena_object, ptr %90, i32 0, i32 4
  %92 = load ptr, ptr %91, align 8, !tbaa !20
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.pool_header, ptr %93, i32 0, i32 2
  store ptr %92, ptr %94, align 8, !tbaa !18
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.arena_object, ptr %96, i32 0, i32 4
  store ptr %95, ptr %97, align 8, !tbaa !20
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.arena_object, ptr %98, i32 0, i32 2
  %100 = load i32, ptr %99, align 8, !tbaa !21
  %101 = add i32 %100, 1
  store i32 %101, ptr %99, align 8, !tbaa !21
  store i32 %101, ptr %10, align 4, !tbaa !12
  %102 = load i32, ptr %10, align 4, !tbaa !12
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.arena_object, ptr %103, i32 0, i32 3
  %105 = load i32, ptr %104, align 4, !tbaa !22
  %106 = icmp eq i32 %102, %105
  br i1 %106, label %107, label %208

107:                                              ; preds = %71
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.arena_object, ptr %108, i32 0, i32 6
  %110 = load ptr, ptr %109, align 8, !tbaa !23
  %111 = icmp eq ptr %110, null
  br i1 %111, label %119, label %112

112:                                              ; preds = %107
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.arena_object, ptr %113, i32 0, i32 6
  %115 = load ptr, ptr %114, align 8, !tbaa !23
  %116 = getelementptr inbounds %struct.arena_object, ptr %115, i32 0, i32 0
  %117 = load i64, ptr %116, align 8, !tbaa !13
  %118 = icmp ne i64 %117, 0
  br i1 %118, label %119, label %120

119:                                              ; preds = %112, %107
  br label %121

120:                                              ; preds = %112
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 388, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

121:                                              ; preds = %119
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.arena_object, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !24
  %125 = icmp eq ptr %124, null
  br i1 %125, label %133, label %126

126:                                              ; preds = %121
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.arena_object, ptr %127, i32 0, i32 5
  %129 = load ptr, ptr %128, align 8, !tbaa !24
  %130 = getelementptr inbounds %struct.arena_object, ptr %129, i32 0, i32 0
  %131 = load i64, ptr %130, align 8, !tbaa !13
  %132 = icmp ne i64 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %126, %121
  br label %135

134:                                              ; preds = %126
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 390, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

135:                                              ; preds = %133
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.arena_object, ptr %136, i32 0, i32 6
  %138 = load ptr, ptr %137, align 8, !tbaa !23
  %139 = icmp eq ptr %138, null
  br i1 %139, label %140, label %154

140:                                              ; preds = %135
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.arena_object, ptr %141, i32 0, i32 5
  %143 = load ptr, ptr %142, align 8, !tbaa !24
  store ptr %143, ptr @usable_arenas, align 8, !tbaa !5
  %144 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %145 = icmp eq ptr %144, null
  br i1 %145, label %151, label %146

146:                                              ; preds = %140
  %147 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.arena_object, ptr %147, i32 0, i32 0
  %149 = load i64, ptr %148, align 8, !tbaa !13
  %150 = icmp ne i64 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %146, %140
  br label %153

152:                                              ; preds = %146
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 398, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

153:                                              ; preds = %151
  br label %172

154:                                              ; preds = %135
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.arena_object, ptr %155, i32 0, i32 6
  %157 = load ptr, ptr %156, align 8, !tbaa !23
  %158 = getelementptr inbounds %struct.arena_object, ptr %157, i32 0, i32 5
  %159 = load ptr, ptr %158, align 8, !tbaa !24
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = icmp eq ptr %159, %160
  br i1 %161, label %162, label %163

162:                                              ; preds = %154
  br label %164

163:                                              ; preds = %154
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 401, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

164:                                              ; preds = %162
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.arena_object, ptr %165, i32 0, i32 5
  %167 = load ptr, ptr %166, align 8, !tbaa !24
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.arena_object, ptr %168, i32 0, i32 6
  %170 = load ptr, ptr %169, align 8, !tbaa !23
  %171 = getelementptr inbounds %struct.arena_object, ptr %170, i32 0, i32 5
  store ptr %167, ptr %171, align 8, !tbaa !24
  br label %172

172:                                              ; preds = %164, %153
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.arena_object, ptr %173, i32 0, i32 5
  %175 = load ptr, ptr %174, align 8, !tbaa !24
  %176 = icmp ne ptr %175, null
  br i1 %176, label %177, label %195

177:                                              ; preds = %172
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.arena_object, ptr %178, i32 0, i32 5
  %180 = load ptr, ptr %179, align 8, !tbaa !24
  %181 = getelementptr inbounds %struct.arena_object, ptr %180, i32 0, i32 6
  %182 = load ptr, ptr %181, align 8, !tbaa !23
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = icmp eq ptr %182, %183
  br i1 %184, label %185, label %186

185:                                              ; preds = %177
  br label %187

186:                                              ; preds = %177
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 407, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

187:                                              ; preds = %185
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.arena_object, ptr %188, i32 0, i32 6
  %190 = load ptr, ptr %189, align 8, !tbaa !23
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.arena_object, ptr %191, i32 0, i32 5
  %193 = load ptr, ptr %192, align 8, !tbaa !24
  %194 = getelementptr inbounds %struct.arena_object, ptr %193, i32 0, i32 6
  store ptr %190, ptr %194, align 8, !tbaa !23
  br label %195

195:                                              ; preds = %187, %172
  %196 = load ptr, ptr @unused_arena_objects, align 8, !tbaa !5
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.arena_object, ptr %197, i32 0, i32 5
  store ptr %196, ptr %198, align 8, !tbaa !24
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %199, ptr @unused_arena_objects, align 8, !tbaa !5
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.arena_object, ptr %200, i32 0, i32 0
  %202 = load i64, ptr %201, align 8, !tbaa !13
  %203 = inttoptr i64 %202 to ptr
  call void @free(ptr noundef %203) #4
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.arena_object, ptr %204, i32 0, i32 0
  store i64 0, ptr %205, align 8, !tbaa !13
  %206 = load i64, ptr @narenas_currently_allocated, align 8, !tbaa !25
  %207 = add i64 %206, -1
  store i64 %207, ptr @narenas_currently_allocated, align 8, !tbaa !25
  store i32 1, ptr %8, align 4
  br label %425

208:                                              ; preds = %71
  %209 = load i32, ptr %10, align 4, !tbaa !12
  %210 = icmp eq i32 %209, 1
  br i1 %210, label %211, label %232

211:                                              ; preds = %208
  %212 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.arena_object, ptr %213, i32 0, i32 5
  store ptr %212, ptr %214, align 8, !tbaa !24
  %215 = load ptr, ptr %9, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.arena_object, ptr %215, i32 0, i32 6
  store ptr null, ptr %216, align 8, !tbaa !23
  %217 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %218 = icmp ne ptr %217, null
  br i1 %218, label %219, label %223

219:                                              ; preds = %211
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.arena_object, ptr %221, i32 0, i32 6
  store ptr %220, ptr %222, align 8, !tbaa !23
  br label %223

223:                                              ; preds = %219, %211
  %224 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %224, ptr @usable_arenas, align 8, !tbaa !5
  %225 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.arena_object, ptr %225, i32 0, i32 0
  %227 = load i64, ptr %226, align 8, !tbaa !13
  %228 = icmp ne i64 %227, 0
  br i1 %228, label %229, label %230

229:                                              ; preds = %223
  br label %231

230:                                              ; preds = %223
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 436, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

231:                                              ; preds = %229
  store i32 1, ptr %8, align 4
  br label %425

232:                                              ; preds = %208
  %233 = load ptr, ptr %9, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.arena_object, ptr %233, i32 0, i32 5
  %235 = load ptr, ptr %234, align 8, !tbaa !24
  %236 = icmp eq ptr %235, null
  br i1 %236, label %245, label %237

237:                                              ; preds = %232
  %238 = load i32, ptr %10, align 4, !tbaa !12
  %239 = load ptr, ptr %9, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.arena_object, ptr %239, i32 0, i32 5
  %241 = load ptr, ptr %240, align 8, !tbaa !24
  %242 = getelementptr inbounds %struct.arena_object, ptr %241, i32 0, i32 2
  %243 = load i32, ptr %242, align 8, !tbaa !21
  %244 = icmp ule i32 %238, %243
  br i1 %244, label %245, label %246

245:                                              ; preds = %237, %232
  store i32 1, ptr %8, align 4
  br label %425

246:                                              ; preds = %237
  %247 = load ptr, ptr %9, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.arena_object, ptr %247, i32 0, i32 6
  %249 = load ptr, ptr %248, align 8, !tbaa !23
  %250 = icmp ne ptr %249, null
  br i1 %250, label %251, label %269

251:                                              ; preds = %246
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.arena_object, ptr %252, i32 0, i32 6
  %254 = load ptr, ptr %253, align 8, !tbaa !23
  %255 = getelementptr inbounds %struct.arena_object, ptr %254, i32 0, i32 5
  %256 = load ptr, ptr %255, align 8, !tbaa !24
  %257 = load ptr, ptr %9, align 8, !tbaa !5
  %258 = icmp eq ptr %256, %257
  br i1 %258, label %259, label %260

259:                                              ; preds = %251
  br label %261

260:                                              ; preds = %251
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 461, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

261:                                              ; preds = %259
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.arena_object, ptr %262, i32 0, i32 5
  %264 = load ptr, ptr %263, align 8, !tbaa !24
  %265 = load ptr, ptr %9, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.arena_object, ptr %265, i32 0, i32 6
  %267 = load ptr, ptr %266, align 8, !tbaa !23
  %268 = getelementptr inbounds %struct.arena_object, ptr %267, i32 0, i32 5
  store ptr %264, ptr %268, align 8, !tbaa !24
  br label %279

269:                                              ; preds = %246
  %270 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %271 = load ptr, ptr %9, align 8, !tbaa !5
  %272 = icmp eq ptr %270, %271
  br i1 %272, label %273, label %274

273:                                              ; preds = %269
  br label %275

274:                                              ; preds = %269
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.1, i32 noundef 466, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

275:                                              ; preds = %273
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.arena_object, ptr %276, i32 0, i32 5
  %278 = load ptr, ptr %277, align 8, !tbaa !24
  store ptr %278, ptr @usable_arenas, align 8, !tbaa !5
  br label %279

279:                                              ; preds = %275, %261
  %280 = load ptr, ptr %9, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.arena_object, ptr %280, i32 0, i32 6
  %282 = load ptr, ptr %281, align 8, !tbaa !23
  %283 = load ptr, ptr %9, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.arena_object, ptr %283, i32 0, i32 5
  %285 = load ptr, ptr %284, align 8, !tbaa !24
  %286 = getelementptr inbounds %struct.arena_object, ptr %285, i32 0, i32 6
  store ptr %282, ptr %286, align 8, !tbaa !23
  br label %287

287:                                              ; preds = %302, %279
  %288 = load ptr, ptr %9, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.arena_object, ptr %288, i32 0, i32 5
  %290 = load ptr, ptr %289, align 8, !tbaa !24
  %291 = icmp ne ptr %290, null
  br i1 %291, label %292, label %300

292:                                              ; preds = %287
  %293 = load i32, ptr %10, align 4, !tbaa !12
  %294 = load ptr, ptr %9, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.arena_object, ptr %294, i32 0, i32 5
  %296 = load ptr, ptr %295, align 8, !tbaa !24
  %297 = getelementptr inbounds %struct.arena_object, ptr %296, i32 0, i32 2
  %298 = load i32, ptr %297, align 8, !tbaa !21
  %299 = icmp ugt i32 %293, %298
  br label %300

300:                                              ; preds = %292, %287
  %301 = phi i1 [ false, %287 ], [ %299, %292 ]
  br i1 %301, label %302, label %315

302:                                              ; preds = %300
  %303 = load ptr, ptr %9, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.arena_object, ptr %303, i32 0, i32 5
  %305 = load ptr, ptr %304, align 8, !tbaa !24
  %306 = load ptr, ptr %9, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.arena_object, ptr %306, i32 0, i32 6
  store ptr %305, ptr %307, align 8, !tbaa !23
  %308 = load ptr, ptr %9, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.arena_object, ptr %308, i32 0, i32 5
  %310 = load ptr, ptr %309, align 8, !tbaa !24
  %311 = getelementptr inbounds %struct.arena_object, ptr %310, i32 0, i32 5
  %312 = load ptr, ptr %311, align 8, !tbaa !24
  %313 = load ptr, ptr %9, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.arena_object, ptr %313, i32 0, i32 5
  store ptr %312, ptr %314, align 8, !tbaa !24
  br label %287, !llvm.loop !26

315:                                              ; preds = %300
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.arena_object, ptr %316, i32 0, i32 5
  %318 = load ptr, ptr %317, align 8, !tbaa !24
  %319 = icmp eq ptr %318, null
  br i1 %319, label %330, label %320

320:                                              ; preds = %315
  %321 = load ptr, ptr %9, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.arena_object, ptr %321, i32 0, i32 6
  %323 = load ptr, ptr %322, align 8, !tbaa !23
  %324 = load ptr, ptr %9, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.arena_object, ptr %324, i32 0, i32 5
  %326 = load ptr, ptr %325, align 8, !tbaa !24
  %327 = getelementptr inbounds %struct.arena_object, ptr %326, i32 0, i32 6
  %328 = load ptr, ptr %327, align 8, !tbaa !23
  %329 = icmp eq ptr %323, %328
  br i1 %329, label %330, label %331

330:                                              ; preds = %320, %315
  br label %332

331:                                              ; preds = %320
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.1, i32 noundef 482, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

332:                                              ; preds = %330
  %333 = load ptr, ptr %9, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.arena_object, ptr %333, i32 0, i32 6
  %335 = load ptr, ptr %334, align 8, !tbaa !23
  %336 = getelementptr inbounds %struct.arena_object, ptr %335, i32 0, i32 5
  %337 = load ptr, ptr %336, align 8, !tbaa !24
  %338 = load ptr, ptr %9, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.arena_object, ptr %338, i32 0, i32 5
  %340 = load ptr, ptr %339, align 8, !tbaa !24
  %341 = icmp eq ptr %337, %340
  br i1 %341, label %342, label %343

342:                                              ; preds = %332
  br label %344

343:                                              ; preds = %332
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.1, i32 noundef 483, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

344:                                              ; preds = %342
  %345 = load ptr, ptr %9, align 8, !tbaa !5
  %346 = load ptr, ptr %9, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.arena_object, ptr %346, i32 0, i32 6
  %348 = load ptr, ptr %347, align 8, !tbaa !23
  %349 = getelementptr inbounds %struct.arena_object, ptr %348, i32 0, i32 5
  store ptr %345, ptr %349, align 8, !tbaa !24
  %350 = load ptr, ptr %9, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.arena_object, ptr %350, i32 0, i32 5
  %352 = load ptr, ptr %351, align 8, !tbaa !24
  %353 = icmp ne ptr %352, null
  br i1 %353, label %354, label %360

354:                                              ; preds = %344
  %355 = load ptr, ptr %9, align 8, !tbaa !5
  %356 = load ptr, ptr %9, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.arena_object, ptr %356, i32 0, i32 5
  %358 = load ptr, ptr %357, align 8, !tbaa !24
  %359 = getelementptr inbounds %struct.arena_object, ptr %358, i32 0, i32 6
  store ptr %355, ptr %359, align 8, !tbaa !23
  br label %360

360:                                              ; preds = %354, %344
  %361 = load ptr, ptr %9, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.arena_object, ptr %361, i32 0, i32 5
  %363 = load ptr, ptr %362, align 8, !tbaa !24
  %364 = icmp eq ptr %363, null
  br i1 %364, label %373, label %365

365:                                              ; preds = %360
  %366 = load i32, ptr %10, align 4, !tbaa !12
  %367 = load ptr, ptr %9, align 8, !tbaa !5
  %368 = getelementptr inbounds %struct.arena_object, ptr %367, i32 0, i32 5
  %369 = load ptr, ptr %368, align 8, !tbaa !24
  %370 = getelementptr inbounds %struct.arena_object, ptr %369, i32 0, i32 2
  %371 = load i32, ptr %370, align 8, !tbaa !21
  %372 = icmp ule i32 %366, %371
  br i1 %372, label %373, label %374

373:                                              ; preds = %365, %360
  br label %375

374:                                              ; preds = %365
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.1, i32 noundef 491, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

375:                                              ; preds = %373
  %376 = load ptr, ptr %9, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.arena_object, ptr %376, i32 0, i32 6
  %378 = load ptr, ptr %377, align 8, !tbaa !23
  %379 = icmp eq ptr %378, null
  br i1 %379, label %388, label %380

380:                                              ; preds = %375
  %381 = load i32, ptr %10, align 4, !tbaa !12
  %382 = load ptr, ptr %9, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.arena_object, ptr %382, i32 0, i32 6
  %384 = load ptr, ptr %383, align 8, !tbaa !23
  %385 = getelementptr inbounds %struct.arena_object, ptr %384, i32 0, i32 2
  %386 = load i32, ptr %385, align 8, !tbaa !21
  %387 = icmp ugt i32 %381, %386
  br i1 %387, label %388, label %389

388:                                              ; preds = %380, %375
  br label %390

389:                                              ; preds = %380
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.1, i32 noundef 493, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

390:                                              ; preds = %388
  %391 = load ptr, ptr %9, align 8, !tbaa !5
  %392 = getelementptr inbounds %struct.arena_object, ptr %391, i32 0, i32 5
  %393 = load ptr, ptr %392, align 8, !tbaa !24
  %394 = icmp eq ptr %393, null
  br i1 %394, label %403, label %395

395:                                              ; preds = %390
  %396 = load ptr, ptr %9, align 8, !tbaa !5
  %397 = getelementptr inbounds %struct.arena_object, ptr %396, i32 0, i32 5
  %398 = load ptr, ptr %397, align 8, !tbaa !24
  %399 = getelementptr inbounds %struct.arena_object, ptr %398, i32 0, i32 6
  %400 = load ptr, ptr %399, align 8, !tbaa !23
  %401 = load ptr, ptr %9, align 8, !tbaa !5
  %402 = icmp eq ptr %400, %401
  br i1 %402, label %403, label %404

403:                                              ; preds = %395, %390
  br label %405

404:                                              ; preds = %395
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 495, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

405:                                              ; preds = %403
  %406 = load ptr, ptr @usable_arenas, align 8, !tbaa !5
  %407 = load ptr, ptr %9, align 8, !tbaa !5
  %408 = icmp eq ptr %406, %407
  br i1 %408, label %409, label %414

409:                                              ; preds = %405
  %410 = load ptr, ptr %9, align 8, !tbaa !5
  %411 = getelementptr inbounds %struct.arena_object, ptr %410, i32 0, i32 6
  %412 = load ptr, ptr %411, align 8, !tbaa !23
  %413 = icmp eq ptr %412, null
  br i1 %413, label %422, label %414

414:                                              ; preds = %409, %405
  %415 = load ptr, ptr %9, align 8, !tbaa !5
  %416 = getelementptr inbounds %struct.arena_object, ptr %415, i32 0, i32 6
  %417 = load ptr, ptr %416, align 8, !tbaa !23
  %418 = getelementptr inbounds %struct.arena_object, ptr %417, i32 0, i32 5
  %419 = load ptr, ptr %418, align 8, !tbaa !24
  %420 = load ptr, ptr %9, align 8, !tbaa !5
  %421 = icmp eq ptr %419, %420
  br i1 %421, label %422, label %423

422:                                              ; preds = %414, %409
  br label %424

423:                                              ; preds = %414
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.1, i32 noundef 498, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

424:                                              ; preds = %422
  store i32 1, ptr %8, align 4
  br label %425

425:                                              ; preds = %424, %245, %231, %195, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %464

426:                                              ; preds = %54
  %427 = load ptr, ptr %3, align 8, !tbaa !5
  %428 = getelementptr inbounds %struct.pool_header, ptr %427, i32 0, i32 0
  %429 = load i32, ptr %428, align 8, !tbaa !16
  %430 = add i32 %429, -1
  store i32 %430, ptr %428, align 8, !tbaa !16
  %431 = load ptr, ptr %3, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.pool_header, ptr %431, i32 0, i32 0
  %433 = load i32, ptr %432, align 8, !tbaa !16
  %434 = icmp ugt i32 %433, 0
  br i1 %434, label %435, label %436

435:                                              ; preds = %426
  br label %437

436:                                              ; preds = %426
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 510, ptr noundef @__PRETTY_FUNCTION__.PyObject_Free) #5
  unreachable

437:                                              ; preds = %435
  %438 = load ptr, ptr %3, align 8, !tbaa !5
  %439 = getelementptr inbounds %struct.pool_header, ptr %438, i32 0, i32 5
  %440 = load i32, ptr %439, align 4, !tbaa !28
  store i32 %440, ptr %7, align 4, !tbaa !12
  %441 = load i32, ptr %7, align 4, !tbaa !12
  %442 = load i32, ptr %7, align 4, !tbaa !12
  %443 = add i32 %441, %442
  %444 = zext i32 %443 to i64
  %445 = getelementptr inbounds [64 x ptr], ptr @usedpools, i64 0, i64 %444
  %446 = load ptr, ptr %445, align 8, !tbaa !5
  store ptr %446, ptr %5, align 8, !tbaa !5
  %447 = load ptr, ptr %5, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.pool_header, ptr %447, i32 0, i32 3
  %449 = load ptr, ptr %448, align 8, !tbaa !19
  store ptr %449, ptr %6, align 8, !tbaa !5
  %450 = load ptr, ptr %5, align 8, !tbaa !5
  %451 = load ptr, ptr %3, align 8, !tbaa !5
  %452 = getelementptr inbounds %struct.pool_header, ptr %451, i32 0, i32 2
  store ptr %450, ptr %452, align 8, !tbaa !18
  %453 = load ptr, ptr %6, align 8, !tbaa !5
  %454 = load ptr, ptr %3, align 8, !tbaa !5
  %455 = getelementptr inbounds %struct.pool_header, ptr %454, i32 0, i32 3
  store ptr %453, ptr %455, align 8, !tbaa !19
  %456 = load ptr, ptr %3, align 8, !tbaa !5
  %457 = load ptr, ptr %5, align 8, !tbaa !5
  %458 = getelementptr inbounds %struct.pool_header, ptr %457, i32 0, i32 3
  store ptr %456, ptr %458, align 8, !tbaa !19
  %459 = load ptr, ptr %3, align 8, !tbaa !5
  %460 = load ptr, ptr %6, align 8, !tbaa !5
  %461 = getelementptr inbounds %struct.pool_header, ptr %460, i32 0, i32 2
  store ptr %459, ptr %461, align 8, !tbaa !18
  store i32 1, ptr %8, align 4
  br label %464

462:                                              ; preds = %37, %24, %14
  %463 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %463) #4
  store i32 0, ptr %8, align 4
  br label %464

464:                                              ; preds = %462, %437, %425, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  %465 = load i32, ptr %8, align 4
  switch i32 %465, label %467 [
    i32 0, label %466
    i32 1, label %466
  ]

466:                                              ; preds = %464, %464
  ret void

467:                                              ; preds = %464
  unreachable
}

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !11, i64 32}
!10 = !{!"pool_header", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"arena_object", !15, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!"long", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!10, !6, i64 8}
!18 = !{!10, !6, i64 16}
!19 = !{!10, !6, i64 24}
!20 = !{!14, !6, i64 24}
!21 = !{!14, !11, i64 16}
!22 = !{!14, !11, i64 20}
!23 = !{!14, !6, i64 40}
!24 = !{!14, !6, i64 32}
!25 = !{!15, !15, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!10, !11, i64 36}


; 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.arena_object = type { i64, ptr, i32, i32, ptr, ptr, ptr }

@usedpools = external dso_local local_unnamed_addr global [64 x ptr], align 16
@arenas = external dso_local local_unnamed_addr global ptr, align 8
@maxarenas = external dso_local local_unnamed_addr global i32, align 4
@unused_arena_objects = external dso_local local_unnamed_addr global ptr, align 8
@usable_arenas = external dso_local local_unnamed_addr global ptr, align 8
@narenas_currently_allocated = external dso_local local_unnamed_addr global i64, align 8
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__.PyObject_Free = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [81 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @PyObject_Free(ptr noundef %0) local_unnamed_addr #1 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %183, label %3

3:                                                ; preds = %1
  %4 = ptrtoint ptr %0 to i64
  %5 = and i64 %4, -4096
  %6 = inttoptr i64 %5 to ptr
  %7 = getelementptr inbounds i8, ptr %6, i64 32
  %8 = load i32, ptr %7, align 32, !tbaa !5
  %9 = load i32, ptr @maxarenas, align 4, !tbaa !11
  %10 = icmp ult i32 %8, %9
  br i1 %10, label %11, label %182

11:                                               ; preds = %3
  %12 = load ptr, ptr @arenas, align 8, !tbaa !12
  %13 = zext i32 %8 to i64
  %14 = getelementptr inbounds %struct.arena_object, ptr %12, i64 %13
  %15 = load i64, ptr %14, align 8, !tbaa !13
  %16 = sub i64 %4, %15
  %17 = icmp ugt i64 %16, 262143
  %.not = icmp eq i64 %15, 0
  %or.cond = or i1 %.not, %17
  br i1 %or.cond, label %182, label %18

18:                                               ; preds = %11
  %19 = load i32, ptr %6, align 4096, !tbaa !16
  %.not123 = icmp eq i32 %19, 0
  br i1 %.not123, label %20, label %21

20:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 338, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %6, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  store ptr %23, ptr %0, align 8, !tbaa !12
  store ptr %0, ptr %22, align 8, !tbaa !17
  %.not124 = icmp eq ptr %23, null
  %24 = load i32, ptr %6, align 4096, !tbaa !16
  %25 = add i32 %24, -1
  store i32 %25, ptr %6, align 4096, !tbaa !16
  %.not125 = icmp eq i32 %25, 0
  br i1 %.not124, label %168, label %26

26:                                               ; preds = %21
  br i1 %.not125, label %27, label %183

27:                                               ; preds = %26
  %28 = getelementptr inbounds i8, ptr %6, i64 16
  %29 = load ptr, ptr %28, align 16, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %6, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %29, i64 24
  store ptr %31, ptr %32, align 8, !tbaa !19
  %33 = getelementptr inbounds i8, ptr %31, i64 16
  store ptr %29, ptr %33, align 8, !tbaa !18
  %34 = load ptr, ptr @arenas, align 8, !tbaa !12
  %35 = getelementptr inbounds %struct.arena_object, ptr %34, i64 %13
  %36 = getelementptr inbounds i8, ptr %35, i64 24
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  store ptr %37, ptr %28, align 16, !tbaa !18
  store ptr %6, ptr %36, align 8, !tbaa !20
  %38 = getelementptr inbounds i8, ptr %35, i64 16
  %39 = load i32, ptr %38, align 8, !tbaa !21
  %40 = add i32 %39, 1
  store i32 %40, ptr %38, align 8, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %35, i64 20
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %43 = icmp eq i32 %40, %42
  br i1 %43, label %44, label %84

44:                                               ; preds = %27
  %45 = getelementptr inbounds i8, ptr %35, i64 40
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  %47 = icmp eq ptr %46, null
  br i1 %47, label %51, label %48

48:                                               ; preds = %44
  %49 = load i64, ptr %46, align 8, !tbaa !13
  %.not134 = icmp eq i64 %49, 0
  br i1 %.not134, label %50, label %.thread140

50:                                               ; preds = %48
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 388, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

51:                                               ; preds = %44
  %52 = getelementptr inbounds i8, ptr %35, i64 32
  %53 = load ptr, ptr %52, align 8, !tbaa !24
  %54 = icmp eq ptr %53, null
  br i1 %54, label %62, label %58

.thread140:                                       ; preds = %48
  %55 = getelementptr inbounds i8, ptr %35, i64 32
  %56 = load ptr, ptr %55, align 8, !tbaa !24
  %57 = icmp eq ptr %56, null
  br i1 %57, label %.thread141, label %.thread142

58:                                               ; preds = %51
  %59 = load i64, ptr %53, align 8, !tbaa !13
  %.not135 = icmp eq i64 %59, 0
  br i1 %.not135, label %61, label %.thread

.thread142:                                       ; preds = %.thread140
  %60 = load i64, ptr %56, align 8, !tbaa !13
  %.not135143 = icmp eq i64 %60, 0
  br i1 %.not135143, label %61, label %.thread141

61:                                               ; preds = %.thread142, %58
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 390, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

62:                                               ; preds = %51
  store ptr null, ptr @usable_arenas, align 8, !tbaa !12
  br label %68

.thread:                                          ; preds = %58
  store ptr %53, ptr @usable_arenas, align 8, !tbaa !12
  br label %68

.thread141:                                       ; preds = %.thread142, %.thread140
  %63 = getelementptr inbounds i8, ptr %46, i64 32
  %64 = load ptr, ptr %63, align 8, !tbaa !24
  %65 = icmp eq ptr %64, %35
  br i1 %65, label %67, label %66

66:                                               ; preds = %.thread141
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 401, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

67:                                               ; preds = %.thread141
  store ptr %56, ptr %63, align 8, !tbaa !24
  br label %68

68:                                               ; preds = %.thread, %62, %67
  %69 = phi ptr [ %52, %62 ], [ %52, %.thread ], [ %55, %67 ]
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %.not137 = icmp eq ptr %70, null
  br i1 %.not137, label %78, label %71

71:                                               ; preds = %68
  %72 = getelementptr inbounds i8, ptr %70, i64 40
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  %74 = icmp eq ptr %73, %35
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 407, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

76:                                               ; preds = %71
  %77 = load ptr, ptr %45, align 8, !tbaa !23
  store ptr %77, ptr %72, align 8, !tbaa !23
  br label %78

78:                                               ; preds = %76, %68
  %79 = load ptr, ptr @unused_arena_objects, align 8, !tbaa !12
  store ptr %79, ptr %69, align 8, !tbaa !24
  store ptr %35, ptr @unused_arena_objects, align 8, !tbaa !12
  %80 = load i64, ptr %35, align 8, !tbaa !13
  %81 = inttoptr i64 %80 to ptr
  tail call void @free(ptr noundef %81) #4
  store i64 0, ptr %35, align 8, !tbaa !13
  %82 = load i64, ptr @narenas_currently_allocated, align 8, !tbaa !25
  %83 = add i64 %82, -1
  store i64 %83, ptr @narenas_currently_allocated, align 8, !tbaa !25
  br label %183

84:                                               ; preds = %27
  %85 = icmp eq i32 %39, 0
  br i1 %85, label %86, label %96

86:                                               ; preds = %84
  %87 = load ptr, ptr @usable_arenas, align 8, !tbaa !12
  %88 = getelementptr inbounds i8, ptr %35, i64 32
  store ptr %87, ptr %88, align 8, !tbaa !24
  %89 = getelementptr inbounds i8, ptr %35, i64 40
  store ptr null, ptr %89, align 8, !tbaa !23
  %90 = load ptr, ptr @usable_arenas, align 8, !tbaa !12
  %.not132 = icmp eq ptr %90, null
  br i1 %.not132, label %93, label %91

91:                                               ; preds = %86
  %92 = getelementptr inbounds i8, ptr %90, i64 40
  store ptr %35, ptr %92, align 8, !tbaa !23
  br label %93

93:                                               ; preds = %91, %86
  store ptr %35, ptr @usable_arenas, align 8, !tbaa !12
  %94 = load i64, ptr %35, align 8, !tbaa !13
  %.not133 = icmp eq i64 %94, 0
  br i1 %.not133, label %95, label %183

95:                                               ; preds = %93
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 436, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

96:                                               ; preds = %84
  %97 = getelementptr inbounds i8, ptr %35, i64 32
  %98 = load ptr, ptr %97, align 8, !tbaa !24
  %99 = icmp eq ptr %98, null
  br i1 %99, label %183, label %100

100:                                              ; preds = %96
  %101 = getelementptr inbounds i8, ptr %98, i64 16
  %102 = load i32, ptr %101, align 8, !tbaa !21
  %.not127 = icmp ugt i32 %40, %102
  br i1 %.not127, label %103, label %183

103:                                              ; preds = %100
  %104 = getelementptr inbounds i8, ptr %35, i64 40
  %105 = load ptr, ptr %104, align 8, !tbaa !23
  %.not128 = icmp eq ptr %105, null
  br i1 %.not128, label %112, label %106

106:                                              ; preds = %103
  %107 = getelementptr inbounds i8, ptr %105, i64 32
  %108 = load ptr, ptr %107, align 8, !tbaa !24
  %109 = icmp eq ptr %108, %35
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 461, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

111:                                              ; preds = %106
  store ptr %98, ptr %107, align 8, !tbaa !24
  br label %.lr.ph.preheader

112:                                              ; preds = %103
  %113 = load ptr, ptr @usable_arenas, align 8, !tbaa !12
  %114 = icmp eq ptr %113, %35
  br i1 %114, label %116, label %115

115:                                              ; preds = %112
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.1, i32 noundef 466, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

116:                                              ; preds = %112
  store ptr %98, ptr @usable_arenas, align 8, !tbaa !12
  %.pre = load ptr, ptr %104, align 8, !tbaa !23
  br label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %111, %116
  %117 = phi ptr [ %.pre, %116 ], [ %105, %111 ]
  %118 = load ptr, ptr %97, align 8, !tbaa !24
  %119 = getelementptr inbounds i8, ptr %118, i64 40
  store ptr %117, ptr %119, align 8, !tbaa !23
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %124
  %120 = phi ptr [ %126, %124 ], [ %118, %.lr.ph.preheader ]
  %121 = getelementptr inbounds i8, ptr %120, i64 16
  %122 = load i32, ptr %121, align 8, !tbaa !21
  %123 = icmp ugt i32 %40, %122
  br i1 %123, label %124, label %.critedge

124:                                              ; preds = %.lr.ph
  store ptr %120, ptr %104, align 8, !tbaa !23
  %125 = getelementptr inbounds i8, ptr %120, i64 32
  %126 = load ptr, ptr %125, align 8, !tbaa !24
  store ptr %126, ptr %97, align 8, !tbaa !24
  %.not129 = icmp eq ptr %126, null
  br i1 %.not129, label %.critedge.thread, label %.lr.ph, !llvm.loop !26

.critedge:                                        ; preds = %.lr.ph
  %127 = load ptr, ptr %104, align 8, !tbaa !23
  %128 = getelementptr inbounds i8, ptr %120, i64 40
  %129 = load ptr, ptr %128, align 8, !tbaa !23
  %130 = icmp eq ptr %127, %129
  br i1 %130, label %.critedge.thread, label %131

131:                                              ; preds = %.critedge
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.1, i32 noundef 482, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

.critedge.thread:                                 ; preds = %124, %.critedge
  %132 = phi ptr [ %127, %.critedge ], [ %120, %124 ]
  %133 = phi ptr [ %120, %.critedge ], [ null, %124 ]
  %134 = getelementptr inbounds i8, ptr %132, i64 32
  %135 = load ptr, ptr %134, align 8, !tbaa !24
  %136 = icmp eq ptr %135, %133
  br i1 %136, label %138, label %137

137:                                              ; preds = %.critedge.thread
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.1, i32 noundef 483, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

138:                                              ; preds = %.critedge.thread
  store ptr %35, ptr %134, align 8, !tbaa !24
  %139 = load ptr, ptr %97, align 8, !tbaa !24
  %.not130 = icmp eq ptr %139, null
  br i1 %.not130, label %146, label %140

140:                                              ; preds = %138
  %141 = getelementptr inbounds i8, ptr %139, i64 40
  store ptr %35, ptr %141, align 8, !tbaa !23
  %142 = getelementptr inbounds i8, ptr %139, i64 16
  %143 = load i32, ptr %142, align 8, !tbaa !21
  %.not131 = icmp ugt i32 %40, %143
  br i1 %.not131, label %144, label %.thread139

144:                                              ; preds = %140
  tail call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.1, i32 noundef 491, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

.thread139:                                       ; preds = %140
  %.pre151 = load ptr, ptr %104, align 8, !tbaa !23
  %145 = icmp ne ptr %.pre151, null
  br i1 %145, label %.thread153, label %.thread152

146:                                              ; preds = %138
  %147 = getelementptr inbounds i8, ptr %132, i64 16
  %148 = load i32, ptr %147, align 8, !tbaa !21
  %149 = icmp ugt i32 %40, %148
  br i1 %149, label %158, label %153

.thread153:                                       ; preds = %.thread139
  %150 = getelementptr inbounds i8, ptr %.pre151, i64 16
  %151 = load i32, ptr %150, align 8, !tbaa !21
  %152 = icmp ugt i32 %40, %151
  br i1 %152, label %.thread152, label %153

153:                                              ; preds = %.thread153, %146
  tail call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, i32 noundef 493, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

.thread152:                                       ; preds = %.thread153, %.thread139
  %154 = getelementptr inbounds i8, ptr %139, i64 40
  %155 = load ptr, ptr %154, align 8, !tbaa !23
  %156 = icmp eq ptr %155, %35
  br i1 %156, label %158, label %157

157:                                              ; preds = %.thread152
  tail call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 495, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

158:                                              ; preds = %146, %.thread152
  %159 = phi ptr [ %.pre151, %.thread152 ], [ %132, %146 ]
  %160 = phi i1 [ %145, %.thread152 ], [ true, %146 ]
  %161 = load ptr, ptr @usable_arenas, align 8, !tbaa !12
  %162 = icmp ne ptr %161, %35
  %brmerge = or i1 %160, %162
  br i1 %brmerge, label %163, label %183

163:                                              ; preds = %158
  %164 = getelementptr inbounds i8, ptr %159, i64 32
  %165 = load ptr, ptr %164, align 8, !tbaa !24
  %166 = icmp eq ptr %165, %35
  br i1 %166, label %183, label %167

167:                                              ; preds = %163
  tail call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, i32 noundef 498, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

168:                                              ; preds = %21
  br i1 %.not125, label %169, label %170

169:                                              ; preds = %168
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 510, ptr noundef nonnull @__PRETTY_FUNCTION__.PyObject_Free) #3
  unreachable

170:                                              ; preds = %168
  %171 = getelementptr inbounds i8, ptr %6, i64 36
  %172 = load i32, ptr %171, align 4, !tbaa !28
  %173 = shl i32 %172, 1
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds [64 x ptr], ptr @usedpools, i64 0, i64 %174
  %176 = load ptr, ptr %175, align 16, !tbaa !12
  %177 = getelementptr inbounds i8, ptr %176, i64 24
  %178 = load ptr, ptr %177, align 8, !tbaa !19
  %179 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %176, ptr %179, align 16, !tbaa !18
  %180 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %178, ptr %180, align 8, !tbaa !19
  store ptr %6, ptr %177, align 8, !tbaa !19
  %181 = getelementptr inbounds i8, ptr %178, i64 16
  store ptr %6, ptr %181, align 8, !tbaa !18
  br label %183

182:                                              ; preds = %11, %3
  tail call void @free(ptr noundef nonnull %0) #4
  br label %183

183:                                              ; preds = %158, %78, %26, %93, %100, %96, %163, %1, %182, %170
  ret void
}

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { noreturn nounwind "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 = { 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { noreturn nounwind }
attributes #4 = { nounwind }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass