; LLVM IR from humz2k/sugaryc :: ext/bdwgc/extra (gc)

; 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._GC_arrays = type { i64, i64, i64, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i64, i64, i64, ptr, ptr, i64, i32, i64, i64, i64, %struct.dl_hashtbl_s, %struct.dl_hashtbl_s, %struct.fnlz_roots_s, i32, ptr, i64, i64, i32, i64, i64, i64, ptr, [64 x ptr], [8 x i8], [64 x ptr], [129 x ptr], [129 x ptr], [129 x ptr], [2049 x i64], [129 x ptr], [4096 x i8], [4096 x i64], [4096 x i64], ptr, [2048 x %struct.roots], [512 x %struct.exclusion], [2048 x ptr] }
%struct.dl_hashtbl_s = type { ptr, i64, i32 }
%struct.fnlz_roots_s = type { ptr, ptr }
%struct.roots = type { ptr, ptr, ptr, i32 }
%struct.exclusion = type { ptr, ptr }
%struct.obj_kind = type { ptr, ptr, i64, i32, i32 }
%struct.hblkhdr = type { ptr, ptr, ptr, i8, i8, i16, i64, i64, ptr, i64, [5 x i64] }

@GC_all_interior_pointers = external dso_local global i32, align 4
@GC_arrays = external dso_local global %struct._GC_arrays, align 8
@GC_is_initialized = external hidden global i32, align 4
@GC_gc_no = external dso_local global i64, align 8
@GC_incremental = external hidden global i32, align 4
@GC_dont_gc = external dso_local global i32, align 4
@GC_debugging_started = external hidden global i32, align 4
@GC_have_errors = external hidden global i32, align 4
@GC_manual_vdb = external hidden global i32, align 4
@GC_bytes_found = external hidden global i64, align 8
@GC_obj_kinds = external hidden global <{ %struct.obj_kind, %struct.obj_kind, %struct.obj_kind, [13 x %struct.obj_kind] }>, align 16

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #1

; Function Attrs: nounwind uwtable
declare dso_local void @GC_init() #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_find_header(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @GC_collect_a_little_inner(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @GC_print_all_errors() #2

; Function Attrs: nounwind uwtable
declare hidden void @GC_dirty_inner(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_generic_malloc_aligned(i64 noundef, i32 noundef, i32 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @GC_notify_or_invoke_finalizers() #2

; Function Attrs: nounwind uwtable
define dso_local void @GC_generic_malloc_many(i64 noundef %0, i32 noundef %1, ptr noundef %2) #2 {
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  store i64 %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %19 = load i64, ptr %4, align 8, !tbaa !5
  %20 = icmp ule i64 %19, 2047
  %21 = zext i1 %20 to i32
  %22 = sext i32 %21 to i64
  %23 = call i64 @llvm.expect.i64(i64 %22, i64 1)
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %31, label %25

25:                                               ; preds = %3
  %26 = load i64, ptr %4, align 8, !tbaa !5
  %27 = load i32, ptr @GC_all_interior_pointers, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = sub i64 2048, %28
  %30 = icmp ule i64 %26, %29
  br i1 %30, label %31, label %34

31:                                               ; preds = %25, %3
  %32 = load i32, ptr @GC_manual_vdb, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %59

34:                                               ; preds = %31, %25
  %35 = load i64, ptr %4, align 8, !tbaa !5
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = call ptr @GC_generic_malloc_aligned(i64 noundef %35, i32 noundef %36, i32 noundef 0, i64 noundef 0)
  store ptr %37, ptr %7, align 8, !tbaa !11
  %38 = load ptr, ptr %7, align 8, !tbaa !11
  %39 = icmp ne ptr null, %38
  %40 = zext i1 %39 to i32
  %41 = sext i32 %40 to i64
  %42 = call i64 @llvm.expect.i64(i64 %41, i64 1)
  %43 = icmp ne i64 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %34
  %45 = load ptr, ptr %7, align 8, !tbaa !11
  store ptr null, ptr %45, align 8, !tbaa !11
  br label %46

46:                                               ; preds = %44, %34
  %47 = load ptr, ptr %7, align 8, !tbaa !11
  %48 = load ptr, ptr %6, align 8, !tbaa !11
  store ptr %47, ptr %48, align 8, !tbaa !11
  %49 = load i32, ptr @GC_manual_vdb, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %58

51:                                               ; preds = %46
  %52 = load ptr, ptr %6, align 8, !tbaa !11
  %53 = call i32 @GC_is_heap_ptr(ptr noundef %52)
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %51
  %56 = load ptr, ptr %6, align 8, !tbaa !11
  call void @GC_dirty_inner(ptr noundef %56)
  %57 = load ptr, ptr %7, align 8, !tbaa !11
  call void asm sideeffect " ", "X,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %57) #3, !srcloc !13
  br label %58

58:                                               ; preds = %55, %51, %46
  store i32 1, ptr %15, align 4
  br label %213

59:                                               ; preds = %31
  %60 = load i64, ptr %4, align 8, !tbaa !5
  %61 = lshr i64 %60, 3
  store i64 %61, ptr %10, align 8, !tbaa !5
  %62 = load i64, ptr %4, align 8, !tbaa !5
  %63 = lshr i64 %62, 4
  store i64 %63, ptr %11, align 8, !tbaa !5
  %64 = load i32, ptr @GC_have_errors, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = call i64 @llvm.expect.i64(i64 %65, i64 0)
  %67 = icmp ne i64 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %59
  call void @GC_print_all_errors()
  br label %69

69:                                               ; preds = %68, %59
  call void @GC_notify_or_invoke_finalizers()
  %70 = load i32, ptr @GC_is_initialized, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = call i64 @llvm.expect.i64(i64 %71, i64 1)
  %73 = icmp ne i64 %72, 0
  br i1 %73, label %75, label %74

74:                                               ; preds = %69
  call void @GC_init()
  br label %75

75:                                               ; preds = %74, %69
  %76 = load i32, ptr @GC_incremental, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %82

78:                                               ; preds = %75
  %79 = load i32, ptr @GC_dont_gc, align 4, !tbaa !9
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  call void @GC_collect_a_little_inner(i32 noundef 1)
  br label %82

82:                                               ; preds = %81, %78, %75
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %84
  store ptr %85, ptr %13, align 8, !tbaa !11
  %86 = load ptr, ptr %13, align 8, !tbaa !11
  %87 = getelementptr inbounds %struct.obj_kind, ptr %86, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  store ptr %88, ptr %14, align 8, !tbaa !11
  %89 = load ptr, ptr %14, align 8, !tbaa !11
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %132

91:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  br label %92

92:                                               ; preds = %127, %91
  %93 = load ptr, ptr %14, align 8, !tbaa !11
  %94 = load i64, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds ptr, ptr %93, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  store ptr %96, ptr %16, align 8, !tbaa !11
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %128

98:                                               ; preds = %92
  %99 = load ptr, ptr %16, align 8, !tbaa !11
  %100 = call ptr @GC_find_header(ptr noundef %99)
  store ptr %100, ptr %17, align 8, !tbaa !11
  %101 = load ptr, ptr %17, align 8, !tbaa !11
  %102 = getelementptr inbounds %struct.hblkhdr, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !16
  %104 = load ptr, ptr %14, align 8, !tbaa !11
  %105 = load i64, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds ptr, ptr %104, i64 %105
  store ptr %103, ptr %106, align 8, !tbaa !11
  %107 = load i64, ptr @GC_gc_no, align 8, !tbaa !5
  %108 = trunc i64 %107 to i16
  %109 = load ptr, ptr %17, align 8, !tbaa !11
  %110 = getelementptr inbounds %struct.hblkhdr, ptr %109, i32 0, i32 5
  store i16 %108, ptr %110, align 2, !tbaa !19
  %111 = load ptr, ptr %16, align 8, !tbaa !11
  %112 = load ptr, ptr %17, align 8, !tbaa !11
  %113 = load i64, ptr %4, align 8, !tbaa !5
  %114 = load ptr, ptr %13, align 8, !tbaa !11
  %115 = getelementptr inbounds %struct.obj_kind, ptr %114, i32 0, i32 4
  %116 = load i32, ptr %115, align 4, !tbaa !20
  %117 = call ptr @GC_reclaim_generic(ptr noundef %111, ptr noundef %112, i64 noundef %113, i32 noundef %116, ptr noundef null, ptr noundef %12)
  store ptr %117, ptr %7, align 8, !tbaa !11
  %118 = load ptr, ptr %7, align 8, !tbaa !11
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %127

120:                                              ; preds = %98
  %121 = load i64, ptr %12, align 8, !tbaa !5
  %122 = load i64, ptr @GC_bytes_found, align 8, !tbaa !5
  %123 = add nsw i64 %122, %121
  store i64 %123, ptr @GC_bytes_found, align 8, !tbaa !5
  %124 = load i64, ptr %12, align 8, !tbaa !5
  %125 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 9), align 8, !tbaa !21
  %126 = add i64 %125, %124
  store i64 %126, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 9), align 8, !tbaa !21
  store i32 4, ptr %15, align 4
  br label %129

127:                                              ; preds = %98
  br label %92, !llvm.loop !25

128:                                              ; preds = %92
  store i32 0, ptr %15, align 4
  br label %129

129:                                              ; preds = %128, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %130 = load i32, ptr %15, align 4
  switch i32 %130, label %213 [
    i32 0, label %131
    i32 4, label %209
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131, %82
  %133 = load ptr, ptr %13, align 8, !tbaa !11
  %134 = getelementptr inbounds %struct.obj_kind, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !27
  %136 = load i64, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds ptr, ptr %135, i64 %136
  store ptr %137, ptr %9, align 8, !tbaa !11
  %138 = load ptr, ptr %9, align 8, !tbaa !11
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  store ptr %139, ptr %7, align 8, !tbaa !11
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %166

141:                                              ; preds = %132
  %142 = load ptr, ptr %9, align 8, !tbaa !11
  store ptr null, ptr %142, align 8, !tbaa !11
  store i64 0, ptr %12, align 8, !tbaa !5
  %143 = load ptr, ptr %7, align 8, !tbaa !11
  store ptr %143, ptr %8, align 8, !tbaa !11
  br label %144

144:                                              ; preds = %159, %141
  %145 = load ptr, ptr %8, align 8, !tbaa !11
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %162

147:                                              ; preds = %144
  %148 = load i64, ptr %4, align 8, !tbaa !5
  %149 = load i64, ptr %12, align 8, !tbaa !5
  %150 = add i64 %149, %148
  store i64 %150, ptr %12, align 8, !tbaa !5
  %151 = load i64, ptr %12, align 8, !tbaa !5
  %152 = icmp uge i64 %151, 4096
  br i1 %152, label %153, label %158

153:                                              ; preds = %147
  %154 = load ptr, ptr %8, align 8, !tbaa !11
  %155 = load ptr, ptr %154, align 8, !tbaa !11
  %156 = load ptr, ptr %9, align 8, !tbaa !11
  store ptr %155, ptr %156, align 8, !tbaa !11
  %157 = load ptr, ptr %8, align 8, !tbaa !11
  store ptr null, ptr %157, align 8, !tbaa !11
  br label %162

158:                                              ; preds = %147
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %8, align 8, !tbaa !11
  %161 = load ptr, ptr %160, align 8, !tbaa !11
  store ptr %161, ptr %8, align 8, !tbaa !11
  br label %144, !llvm.loop !28

162:                                              ; preds = %153, %144
  %163 = load i64, ptr %12, align 8, !tbaa !5
  %164 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 9), align 8, !tbaa !21
  %165 = add i64 %164, %163
  store i64 %165, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 9), align 8, !tbaa !21
  br label %209

166:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %167 = load i64, ptr %4, align 8, !tbaa !5
  %168 = load i32, ptr %5, align 4, !tbaa !9
  %169 = call ptr @GC_allochblk(i64 noundef %167, i32 noundef %168, i32 noundef 0, i64 noundef 0)
  store ptr %169, ptr %18, align 8, !tbaa !11
  %170 = load ptr, ptr %18, align 8, !tbaa !11
  %171 = icmp ne ptr %170, null
  br i1 %171, label %172, label %197

172:                                              ; preds = %166
  %173 = load i32, ptr %5, align 4, !tbaa !9
  %174 = icmp eq i32 %173, 2
  br i1 %174, label %175, label %178

175:                                              ; preds = %172
  %176 = load ptr, ptr %18, align 8, !tbaa !11
  %177 = call ptr @GC_find_header(ptr noundef %176)
  call void @GC_set_hdr_marks(ptr noundef %177)
  br label %178

178:                                              ; preds = %175, %172
  %179 = load i64, ptr %4, align 8, !tbaa !5
  %180 = urem i64 4096, %179
  %181 = sub i64 4096, %180
  %182 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 9), align 8, !tbaa !21
  %183 = add i64 %182, %181
  store i64 %183, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 9), align 8, !tbaa !21
  %184 = load ptr, ptr %18, align 8, !tbaa !11
  %185 = load i64, ptr %10, align 8, !tbaa !5
  %186 = load ptr, ptr %13, align 8, !tbaa !11
  %187 = getelementptr inbounds %struct.obj_kind, ptr %186, i32 0, i32 4
  %188 = load i32, ptr %187, align 4, !tbaa !20
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %193, label %190

190:                                              ; preds = %178
  %191 = load i32, ptr @GC_debugging_started, align 4, !tbaa !9
  %192 = icmp ne i32 %191, 0
  br label %193

193:                                              ; preds = %190, %178
  %194 = phi i1 [ true, %178 ], [ %192, %190 ]
  %195 = zext i1 %194 to i32
  %196 = call ptr @GC_build_fl(ptr noundef %184, i64 noundef %185, i32 noundef %195, ptr noundef null)
  store ptr %196, ptr %7, align 8, !tbaa !11
  store i32 4, ptr %15, align 4
  br label %198

197:                                              ; preds = %166
  store i32 0, ptr %15, align 4
  br label %198

198:                                              ; preds = %197, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  %199 = load i32, ptr %15, align 4
  switch i32 %199, label %213 [
    i32 0, label %200
    i32 4, label %209
  ]

200:                                              ; preds = %198
  %201 = load i64, ptr %4, align 8, !tbaa !5
  %202 = load i32, ptr %5, align 4, !tbaa !9
  %203 = call ptr @GC_generic_malloc_inner(i64 noundef %201, i32 noundef %202, i32 noundef 0)
  store ptr %203, ptr %7, align 8, !tbaa !11
  %204 = load ptr, ptr %7, align 8, !tbaa !11
  %205 = icmp ne ptr %204, null
  br i1 %205, label %206, label %208

206:                                              ; preds = %200
  %207 = load ptr, ptr %7, align 8, !tbaa !11
  store ptr null, ptr %207, align 8, !tbaa !11
  br label %208

208:                                              ; preds = %206, %200
  br label %209

209:                                              ; preds = %208, %198, %162, %129
  %210 = load ptr, ptr %7, align 8, !tbaa !11
  %211 = load ptr, ptr %6, align 8, !tbaa !11
  store ptr %210, ptr %211, align 8, !tbaa !11
  %212 = call ptr @GC_clear_stack(ptr noundef null)
  store i32 0, ptr %15, align 4
  br label %213

213:                                              ; preds = %209, %198, %129, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  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 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %214 = load i32, ptr %15, align 4
  switch i32 %214, label %216 [
    i32 0, label %215
    i32 1, label %215
  ]

215:                                              ; preds = %213, %213
  ret void

216:                                              ; preds = %213
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @GC_is_heap_ptr(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_reclaim_generic(ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_allochblk(i64 noundef, i32 noundef, i32 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @GC_set_hdr_marks(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_build_fl(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_generic_malloc_inner(i64 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @GC_clear_stack(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{i64 2149057755}
!14 = !{!15, !12, i64 8}
!15 = !{!"obj_kind", !12, i64 0, !12, i64 8, !6, i64 16, !10, i64 24, !10, i64 28}
!16 = !{!17, !12, i64 0}
!17 = !{!"hblkhdr", !12, i64 0, !12, i64 8, !12, i64 16, !7, i64 24, !7, i64 25, !18, i64 26, !6, i64 32, !6, i64 40, !12, i64 48, !6, i64 56, !7, i64 64}
!18 = !{!"short", !7, i64 0}
!19 = !{!17, !18, i64 26}
!20 = !{!15, !10, i64 28}
!21 = !{!22, !6, i64 72}
!22 = !{!"_GC_arrays", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !12, i64 216, !12, i64 224, !6, i64 232, !10, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !23, i64 272, !23, i64 296, !24, i64 320, !10, i64 336, !12, i64 344, !6, i64 352, !6, i64 360, !10, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !12, i64 400, !7, i64 408, !7, i64 920, !7, i64 928, !7, i64 1440, !7, i64 2472, !7, i64 3504, !7, i64 4536, !7, i64 20928, !7, i64 21960, !7, i64 26056, !7, i64 58824, !12, i64 91592, !7, i64 91600, !7, i64 157136, !7, i64 165328}
!23 = !{!"dl_hashtbl_s", !12, i64 0, !6, i64 8, !10, i64 16}
!24 = !{!"fnlz_roots_s", !12, i64 0, !12, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!15, !12, i64 0}
!28 = distinct !{!28, !26}


; 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._GC_arrays = type { i64, i64, i64, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i64, i64, i64, ptr, ptr, i64, i32, i64, i64, i64, %struct.dl_hashtbl_s, %struct.dl_hashtbl_s, %struct.fnlz_roots_s, i32, ptr, i64, i64, i32, i64, i64, i64, ptr, [64 x ptr], [8 x i8], [64 x ptr], [129 x ptr], [129 x ptr], [129 x ptr], [2049 x i64], [129 x ptr], [4096 x i8], [4096 x i64], [4096 x i64], ptr, [2048 x %struct.roots], [512 x %struct.exclusion], [2048 x ptr] }
%struct.dl_hashtbl_s = type { ptr, i64, i32 }
%struct.fnlz_roots_s = type { ptr, ptr }
%struct.roots = type { ptr, ptr, ptr, i32 }
%struct.exclusion = type { ptr, ptr }
%struct.obj_kind = type { ptr, ptr, i64, i32, i32 }

@GC_all_interior_pointers = external dso_local local_unnamed_addr global i32, align 4
@GC_arrays = external dso_local local_unnamed_addr global %struct._GC_arrays, align 8
@GC_is_initialized = external hidden local_unnamed_addr global i32, align 4
@GC_gc_no = external dso_local local_unnamed_addr global i64, align 8
@GC_incremental = external hidden local_unnamed_addr global i32, align 4
@GC_dont_gc = external dso_local local_unnamed_addr global i32, align 4
@GC_debugging_started = external hidden local_unnamed_addr global i32, align 4
@GC_have_errors = external hidden local_unnamed_addr global i32, align 4
@GC_manual_vdb = external hidden local_unnamed_addr global i32, align 4
@GC_bytes_found = external hidden local_unnamed_addr global i64, align 8
@GC_obj_kinds = external hidden local_unnamed_addr global <{ %struct.obj_kind, %struct.obj_kind, %struct.obj_kind, [13 x %struct.obj_kind] }>, align 16

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local void @GC_init() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @GC_collect_a_little_inner(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @GC_print_all_errors() local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @GC_notify_or_invoke_finalizers() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @GC_generic_malloc_many(i64 noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #2
  store i64 0, ptr %4, align 8, !tbaa !5
  %5 = icmp ult i64 %0, 2048
  br i1 %5, label %13, label %6, !prof !9

6:                                                ; preds = %3
  %7 = load i32, ptr @GC_all_interior_pointers, align 4, !tbaa !10
  %8 = sext i32 %7 to i64
  %9 = sub nsw i64 2048, %8
  %10 = icmp ult i64 %9, %0
  %11 = load i32, ptr @GC_manual_vdb, align 4
  %12 = icmp ne i32 %11, 0
  %or.cond = select i1 %10, i1 true, i1 %12
  br i1 %or.cond, label %14, label %22

13:                                               ; preds = %3
  %.old = load i32, ptr @GC_manual_vdb, align 4, !tbaa !10
  %.old1.not = icmp eq i32 %.old, 0
  br i1 %.old1.not, label %22, label %14

14:                                               ; preds = %13, %6
  %15 = tail call ptr @GC_generic_malloc_aligned(i64 noundef %0, i32 noundef %1, i32 noundef 0, i64 noundef 0)
  %.not81 = icmp eq ptr %15, null
  br i1 %.not81, label %17, label %16, !prof !12

16:                                               ; preds = %14
  store ptr null, ptr %15, align 8, !tbaa !13
  br label %17

17:                                               ; preds = %16, %14
  store ptr %15, ptr %2, align 8, !tbaa !13
  %18 = load i32, ptr @GC_manual_vdb, align 4, !tbaa !10
  %.not82 = icmp eq i32 %18, 0
  br i1 %.not82, label %97, label %19

19:                                               ; preds = %17
  %20 = tail call i32 @GC_is_heap_ptr(ptr noundef nonnull %2)
  %.not83 = icmp eq i32 %20, 0
  br i1 %.not83, label %97, label %21

21:                                               ; preds = %19
  tail call void @GC_dirty_inner(ptr noundef nonnull %2)
  tail call void asm sideeffect " ", "X,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %15) #2, !srcloc !15
  br label %97

22:                                               ; preds = %6, %13
  %23 = lshr i64 %0, 3
  %24 = lshr i64 %0, 4
  %25 = load i32, ptr @GC_have_errors, align 4, !tbaa !10
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %27, label %26, !prof !9

26:                                               ; preds = %22
  tail call void @GC_print_all_errors()
  br label %27

27:                                               ; preds = %26, %22
  tail call void @GC_notify_or_invoke_finalizers()
  %28 = load i32, ptr @GC_is_initialized, align 4, !tbaa !10
  %.not73 = icmp eq i32 %28, 0
  br i1 %.not73, label %29, label %30, !prof !12

29:                                               ; preds = %27
  tail call void @GC_init()
  br label %30

30:                                               ; preds = %29, %27
  %31 = load i32, ptr @GC_incremental, align 4, !tbaa !10
  %32 = icmp eq i32 %31, 0
  %33 = load i32, ptr @GC_dont_gc, align 4
  %34 = icmp ne i32 %33, 0
  %or.cond4 = select i1 %32, i1 true, i1 %34
  br i1 %or.cond4, label %36, label %35

35:                                               ; preds = %30
  tail call void @GC_collect_a_little_inner(i32 noundef 1)
  br label %36

36:                                               ; preds = %35, %30
  %37 = sext i32 %1 to i64
  %38 = getelementptr inbounds [16 x %struct.obj_kind], ptr @GC_obj_kinds, i64 0, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  %.not74 = icmp eq ptr %40, null
  br i1 %.not74, label %.thread, label %.preheader

.preheader:                                       ; preds = %36
  %41 = getelementptr inbounds ptr, ptr %40, i64 %24
  %42 = getelementptr inbounds i8, ptr %38, i64 28
  br label %43

43:                                               ; preds = %.preheader, %45
  %44 = load ptr, ptr %41, align 8, !tbaa !13
  %.not75 = icmp eq ptr %44, null
  br i1 %.not75, label %.thread, label %45

45:                                               ; preds = %43
  %46 = call ptr @GC_find_header(ptr noundef nonnull %44)
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  store ptr %47, ptr %41, align 8, !tbaa !13
  %48 = load i64, ptr @GC_gc_no, align 8, !tbaa !5
  %49 = trunc i64 %48 to i16
  %50 = getelementptr inbounds i8, ptr %46, i64 26
  store i16 %49, ptr %50, align 2, !tbaa !21
  %51 = load i32, ptr %42, align 4, !tbaa !22
  %52 = call ptr @GC_reclaim_generic(ptr noundef nonnull %44, ptr noundef nonnull %46, i64 noundef %0, i32 noundef %51, ptr noundef null, ptr noundef nonnull %4)
  %.not76 = icmp eq ptr %52, null
  br i1 %.not76, label %43, label %53, !llvm.loop !23

53:                                               ; preds = %45
  %54 = load i64, ptr %4, align 8, !tbaa !5
  %55 = load i64, ptr @GC_bytes_found, align 8, !tbaa !5
  %56 = add nsw i64 %55, %54
  store i64 %56, ptr @GC_bytes_found, align 8, !tbaa !5
  %57 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 72), align 8, !tbaa !25
  %58 = add i64 %57, %54
  store i64 %58, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 72), align 8, !tbaa !25
  br label %95

.thread:                                          ; preds = %43, %36
  %59 = load ptr, ptr %38, align 16, !tbaa !29
  %60 = getelementptr inbounds ptr, ptr %59, i64 %24
  %61 = load ptr, ptr %60, align 8, !tbaa !13
  %.not77 = icmp eq ptr %61, null
  br i1 %.not77, label %74, label %62

62:                                               ; preds = %.thread
  store ptr null, ptr %60, align 8, !tbaa !13
  br label %63

63:                                               ; preds = %62, %69
  %.05998 = phi ptr [ %61, %62 ], [ %70, %69 ]
  %64 = phi i64 [ 0, %62 ], [ %65, %69 ]
  %65 = add i64 %64, %0
  %66 = icmp ugt i64 %65, 4095
  br i1 %66, label %67, label %69

67:                                               ; preds = %63
  store i64 %65, ptr %4, align 8, !tbaa !5
  %68 = load ptr, ptr %.05998, align 8, !tbaa !13
  store ptr %68, ptr %60, align 8, !tbaa !13
  store ptr null, ptr %.05998, align 8, !tbaa !13
  br label %71

69:                                               ; preds = %63
  %70 = load ptr, ptr %.05998, align 8, !tbaa !13
  %.not80 = icmp eq ptr %70, null
  br i1 %.not80, label %.loopexit, label %63, !llvm.loop !30

.loopexit:                                        ; preds = %69
  store i64 %65, ptr %4, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %.loopexit, %67
  %72 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 72), align 8, !tbaa !25
  %73 = add i64 %72, %65
  store i64 %73, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 72), align 8, !tbaa !25
  br label %95

74:                                               ; preds = %.thread
  %75 = call ptr @GC_allochblk(i64 noundef %0, i32 noundef %1, i32 noundef 0, i64 noundef 0)
  %.not78 = icmp eq ptr %75, null
  br i1 %.not78, label %92, label %76

76:                                               ; preds = %74
  %77 = icmp eq i32 %1, 2
  br i1 %77, label %78, label %80

78:                                               ; preds = %76
  %79 = call ptr @GC_find_header(ptr noundef nonnull %75)
  call void @GC_set_hdr_marks(ptr noundef %79)
  br label %80

80:                                               ; preds = %76, %78
  %81 = urem i64 4096, %0
  %82 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 72), align 8, !tbaa !25
  %reass.sub99 = sub i64 %82, %81
  %83 = add i64 %reass.sub99, 4096
  store i64 %83, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 72), align 8, !tbaa !25
  %84 = getelementptr inbounds i8, ptr %38, i64 28
  %85 = load i32, ptr %84, align 4, !tbaa !22
  %86 = icmp ne i32 %85, 0
  %87 = load i32, ptr @GC_debugging_started, align 4
  %88 = icmp ne i32 %87, 0
  %89 = select i1 %86, i1 true, i1 %88
  %90 = zext i1 %89 to i32
  %91 = call ptr @GC_build_fl(ptr noundef nonnull %75, i64 noundef %23, i32 noundef %90, ptr noundef null)
  br label %95

92:                                               ; preds = %74
  %93 = call ptr @GC_generic_malloc_inner(i64 noundef %0, i32 noundef %1, i32 noundef 0)
  %.not79 = icmp eq ptr %93, null
  br i1 %.not79, label %95, label %94

94:                                               ; preds = %92
  store ptr null, ptr %93, align 8, !tbaa !13
  br label %95

95:                                               ; preds = %80, %53, %92, %94, %71
  %.3 = phi ptr [ %52, %53 ], [ %61, %71 ], [ %91, %80 ], [ %93, %94 ], [ null, %92 ]
  store ptr %.3, ptr %2, align 8, !tbaa !13
  %96 = call ptr @GC_clear_stack(ptr noundef null)
  br label %97

97:                                               ; preds = %17, %19, %21, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #2
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @GC_is_heap_ptr(ptr noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @GC_clear_stack(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{i64 2149057755}
!16 = !{!17, !14, i64 8}
!17 = !{!"obj_kind", !14, i64 0, !14, i64 8, !6, i64 16, !11, i64 24, !11, i64 28}
!18 = !{!19, !14, i64 0}
!19 = !{!"hblkhdr", !14, i64 0, !14, i64 8, !14, i64 16, !7, i64 24, !7, i64 25, !20, i64 26, !6, i64 32, !6, i64 40, !14, i64 48, !6, i64 56, !7, i64 64}
!20 = !{!"short", !7, i64 0}
!21 = !{!19, !20, i64 26}
!22 = !{!17, !11, i64 28}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !6, i64 72}
!26 = !{!"_GC_arrays", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !11, i64 176, !11, i64 180, !11, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !14, i64 216, !14, i64 224, !6, i64 232, !11, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !27, i64 272, !27, i64 296, !28, i64 320, !11, i64 336, !14, i64 344, !6, i64 352, !6, i64 360, !11, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !14, i64 400, !7, i64 408, !7, i64 920, !7, i64 928, !7, i64 1440, !7, i64 2472, !7, i64 3504, !7, i64 4536, !7, i64 20928, !7, i64 21960, !7, i64 26056, !7, i64 58824, !14, i64 91592, !7, i64 91600, !7, i64 157136, !7, i64 165328}
!27 = !{!"dl_hashtbl_s", !14, i64 0, !6, i64 8, !11, i64 16}
!28 = !{!"fnlz_roots_s", !14, i64 0, !14, i64 8}
!29 = !{!17, !14, i64 0}
!30 = distinct !{!30, !24}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass