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

; 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.bi = type { [1024 x ptr], ptr, ptr, i64, ptr }
%struct.hblkhdr = type { ptr, ptr, ptr, i8, i8, i16, i64, i64, ptr, i64, [5 x i64] }

@GC_arrays = external global %struct._GC_arrays, align 8
@GC_on_abort = external global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 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

declare ptr @GC_find_header(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 @GC_freehblk(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 ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  br label %17

17:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  br label %18

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  br label %19

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = ptrtoint ptr %20 to i64
  %22 = lshr i64 %21, 22
  store i64 %22, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %23 = load i64, ptr %11, align 8, !tbaa !9
  %24 = and i64 %23, 2047
  %25 = getelementptr inbounds [2048 x ptr], ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 61), i64 0, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %26, ptr %12, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %39, %19
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.bi, ptr %28, i32 0, i32 3
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = load i64, ptr %11, align 8, !tbaa !9
  %32 = icmp ne i64 %30, %31
  br i1 %32, label %33, label %37

33:                                               ; preds = %27
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 28), align 8, !tbaa !13
  %36 = icmp ne ptr %34, %35
  br label %37

37:                                               ; preds = %33, %27
  %38 = phi i1 [ false, %27 ], [ %36, %33 ]
  br i1 %38, label %39, label %43

39:                                               ; preds = %37
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.bi, ptr %40, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  store ptr %42, ptr %12, align 8, !tbaa !5
  br label %27, !llvm.loop !19

43:                                               ; preds = %37
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %44, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %45

45:                                               ; preds = %43
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.bi, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = ptrtoint ptr %49 to i64
  %51 = lshr i64 %50, 12
  %52 = and i64 %51, 1023
  %53 = getelementptr inbounds [1024 x ptr], ptr %48, i64 0, i64 %52
  store ptr %53, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %54

54:                                               ; preds = %46
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  store ptr %57, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %58

58:                                               ; preds = %55
  br label %59

59:                                               ; preds = %58
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.hblkhdr, ptr %60, i32 0, i32 6
  %62 = load i64, ptr %61, align 8, !tbaa !21
  %63 = add i64 %62, 4096
  %64 = sub i64 %63, 1
  %65 = lshr i64 %64, 12
  %66 = mul i64 4096, %65
  store i64 %66, ptr %8, align 8, !tbaa !9
  %67 = load i64, ptr %8, align 8, !tbaa !9
  %68 = and i64 %67, -9223372036854775808
  %69 = icmp ne i64 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %59
  %71 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %71(ptr noundef @.str.9)
  call void @abort() #6
  unreachable

72:                                               ; preds = %59
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = load i64, ptr %8, align 8, !tbaa !9
  call void @GC_remove_counts(ptr noundef %73, i64 noundef %74)
  %75 = load i64, ptr %8, align 8, !tbaa !9
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.hblkhdr, ptr %76, i32 0, i32 6
  store i64 %75, ptr %77, align 8, !tbaa !21
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.hblkhdr, ptr %78, i32 0, i32 4
  %80 = load i8, ptr %79, align 1, !tbaa !24
  %81 = zext i8 %80 to i32
  %82 = and i32 %81, 4
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %90

84:                                               ; preds = %72
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  call void (ptr, ...) @GC_log_printf(ptr noundef @.str.10, ptr noundef %86)
  %87 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %87(ptr noundef @.str.11)
  call void @abort() #6
  unreachable

88:                                               ; No predecessors!
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89, %72
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.hblkhdr, ptr %91, i32 0, i32 4
  %93 = load i8, ptr %92, align 1, !tbaa !24
  %94 = zext i8 %93 to i32
  %95 = or i32 %94, 4
  %96 = trunc i32 %95 to i8
  store i8 %96, ptr %92, align 1, !tbaa !24
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = load i64, ptr %8, align 8, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %97, i64 %98
  store ptr %99, ptr %3, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  br label %101

101:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  br label %102

102:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = ptrtoint ptr %103 to i64
  %105 = lshr i64 %104, 22
  store i64 %105, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %106 = load i64, ptr %15, align 8, !tbaa !9
  %107 = and i64 %106, 2047
  %108 = getelementptr inbounds [2048 x ptr], ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 61), i64 0, i64 %107
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  store ptr %109, ptr %16, align 8, !tbaa !5
  br label %110

110:                                              ; preds = %122, %102
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.bi, ptr %111, i32 0, i32 3
  %113 = load i64, ptr %112, align 8, !tbaa !11
  %114 = load i64, ptr %15, align 8, !tbaa !9
  %115 = icmp ne i64 %113, %114
  br i1 %115, label %116, label %120

116:                                              ; preds = %110
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 28), align 8, !tbaa !13
  %119 = icmp ne ptr %117, %118
  br label %120

120:                                              ; preds = %116, %110
  %121 = phi i1 [ false, %110 ], [ %119, %116 ]
  br i1 %121, label %122, label %126

122:                                              ; preds = %120
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.bi, ptr %123, i32 0, i32 4
  %125 = load ptr, ptr %124, align 8, !tbaa !18
  store ptr %125, ptr %16, align 8, !tbaa !5
  br label %110, !llvm.loop !25

126:                                              ; preds = %120
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %127, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %128

128:                                              ; preds = %126
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.bi, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = ptrtoint ptr %132 to i64
  %134 = lshr i64 %133, 12
  %135 = and i64 %134, 1023
  %136 = getelementptr inbounds [1024 x ptr], ptr %131, i64 0, i64 %135
  store ptr %136, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %137

137:                                              ; preds = %129
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = load ptr, ptr %139, align 8, !tbaa !5
  store ptr %140, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %141

141:                                              ; preds = %138
  br label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = call ptr @GC_free_block_ending_at(ptr noundef %143)
  store ptr %144, ptr %4, align 8, !tbaa !5
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %174

147:                                              ; preds = %142
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.hblkhdr, ptr %148, i32 0, i32 4
  %150 = load i8, ptr %149, align 1, !tbaa !24
  %151 = zext i8 %150 to i32
  %152 = and i32 %151, 4
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %174

154:                                              ; preds = %147
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.hblkhdr, ptr %155, i32 0, i32 6
  %157 = load i64, ptr %156, align 8, !tbaa !21
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.hblkhdr, ptr %158, i32 0, i32 6
  %160 = load i64, ptr %159, align 8, !tbaa !21
  %161 = add i64 %157, %160
  %162 = and i64 %161, -9223372036854775808
  %163 = icmp ne i64 %162, 0
  br i1 %163, label %174, label %164

164:                                              ; preds = %154
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  call void @GC_remove_from_fl(ptr noundef %165)
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.hblkhdr, ptr %166, i32 0, i32 6
  %168 = load i64, ptr %167, align 8, !tbaa !21
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.hblkhdr, ptr %169, i32 0, i32 6
  %171 = load i64, ptr %170, align 8, !tbaa !21
  %172 = add i64 %171, %168
  store i64 %172, ptr %170, align 8, !tbaa !21
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  call void @GC_remove_header(ptr noundef %173)
  br label %174

174:                                              ; preds = %164, %154, %147, %142
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = icmp ne ptr %175, null
  br i1 %176, label %177, label %202

177:                                              ; preds = %174
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = call ptr @GC_find_header(ptr noundef %178)
  store ptr %179, ptr %6, align 8, !tbaa !5
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.hblkhdr, ptr %180, i32 0, i32 6
  %182 = load i64, ptr %181, align 8, !tbaa !21
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.hblkhdr, ptr %183, i32 0, i32 6
  %185 = load i64, ptr %184, align 8, !tbaa !21
  %186 = add i64 %182, %185
  %187 = and i64 %186, -9223372036854775808
  %188 = icmp ne i64 %187, 0
  br i1 %188, label %201, label %189

189:                                              ; preds = %177
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  call void @GC_remove_from_fl(ptr noundef %190)
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.hblkhdr, ptr %191, i32 0, i32 6
  %193 = load i64, ptr %192, align 8, !tbaa !21
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.hblkhdr, ptr %194, i32 0, i32 6
  %196 = load i64, ptr %195, align 8, !tbaa !21
  %197 = add i64 %196, %193
  store i64 %197, ptr %195, align 8, !tbaa !21
  %198 = load ptr, ptr %2, align 8, !tbaa !5
  call void @GC_remove_header(ptr noundef %198)
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %199, ptr %2, align 8, !tbaa !5
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %200, ptr %5, align 8, !tbaa !5
  br label %201

201:                                              ; preds = %189, %177
  br label %202

202:                                              ; preds = %201, %174
  %203 = load i64, ptr %8, align 8, !tbaa !9
  %204 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 4), align 8, !tbaa !26
  %205 = add i64 %204, %203
  store i64 %205, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 4), align 8, !tbaa !26
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  call void @GC_add_to_fl(ptr noundef %206, ptr noundef %207)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

; Function Attrs: noreturn nounwind
declare void @abort() #3

declare void @GC_remove_counts(ptr noundef, i64 noundef) #1

declare void @GC_log_printf(ptr noundef, ...) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @GC_remove_from_fl(ptr noundef) #4

declare void @GC_remove_header(ptr noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #4 = { inlinehint 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 #5 = { nounwind }
attributes #6 = { 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 8208}
!12 = !{!"bi", !7, i64 0, !6, i64 8192, !6, i64 8200, !10, i64 8208, !6, i64 8216}
!13 = !{!14, !6, i64 216}
!14 = !{!"_GC_arrays", !10, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !15, i64 176, !15, i64 180, !15, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !6, i64 216, !6, i64 224, !10, i64 232, !15, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !16, i64 272, !16, i64 296, !17, i64 320, !15, i64 336, !6, i64 344, !10, i64 352, !10, i64 360, !15, i64 368, !10, i64 376, !10, i64 384, !10, i64 392, !6, 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, !6, i64 91592, !7, i64 91600, !7, i64 157136, !7, i64 165328}
!15 = !{!"int", !7, i64 0}
!16 = !{!"dl_hashtbl_s", !6, i64 0, !10, i64 8, !15, i64 16}
!17 = !{!"fnlz_roots_s", !6, i64 0, !6, i64 8}
!18 = !{!12, !6, i64 8216}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !10, i64 32}
!22 = !{!"hblkhdr", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !23, i64 26, !10, i64 32, !10, i64 40, !6, i64 48, !10, i64 56, !7, i64 64}
!23 = !{!"short", !7, i64 0}
!24 = !{!22, !7, i64 25}
!25 = distinct !{!25, !20}
!26 = !{!14, !10, i64 32}


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

@GC_arrays = external local_unnamed_addr global %struct._GC_arrays, align 8
@GC_on_abort = external local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1

declare ptr @GC_find_header(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @GC_freehblk(ptr noundef %0) local_unnamed_addr #1 {
  %2 = ptrtoint ptr %0 to i64
  %3 = lshr i64 %2, 22
  %4 = and i64 %3, 2047
  %5 = getelementptr inbounds [2048 x ptr], ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 165328), i64 0, i64 %4
  %6 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 216), align 8
  br label %7

7:                                                ; preds = %7, %1
  %.054.in = phi ptr [ %5, %1 ], [ %13, %7 ]
  %.054 = load ptr, ptr %.054.in, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %.054, i64 8208
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = icmp ne i64 %9, %3
  %11 = icmp ne ptr %.054, %6
  %12 = select i1 %10, i1 %11, i1 false
  %13 = getelementptr inbounds i8, ptr %.054, i64 8216
  br i1 %12, label %7, label %14, !llvm.loop !12

14:                                               ; preds = %7
  %15 = lshr i64 %2, 12
  %16 = and i64 %15, 1023
  %17 = getelementptr inbounds [1024 x ptr], ptr %.054, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 32
  %20 = load i64, ptr %19, align 8, !tbaa !14
  %21 = add i64 %20, 4095
  %22 = and i64 %21, -4096
  %.not = icmp sgt i64 %21, -1
  br i1 %.not, label %25, label %23

23:                                               ; preds = %14
  %24 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  tail call void %24(ptr noundef nonnull @.str.9) #4
  tail call void @abort() #5
  unreachable

25:                                               ; preds = %14
  tail call void @GC_remove_counts(ptr noundef %0, i64 noundef %22) #4
  store i64 %22, ptr %19, align 8, !tbaa !14
  %26 = getelementptr inbounds i8, ptr %18, i64 25
  %27 = load i8, ptr %26, align 1, !tbaa !17
  %28 = and i8 %27, 4
  %.not57 = icmp eq i8 %28, 0
  br i1 %.not57, label %31, label %29

29:                                               ; preds = %25
  tail call void (ptr, ...) @GC_log_printf(ptr noundef nonnull @.str.10, ptr noundef %0) #4
  %30 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  tail call void %30(ptr noundef nonnull @.str.11) #4
  tail call void @abort() #5
  unreachable

31:                                               ; preds = %25
  %32 = or disjoint i8 %27, 4
  store i8 %32, ptr %26, align 1, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %0, i64 %22
  %34 = ptrtoint ptr %33 to i64
  %35 = lshr i64 %34, 22
  %36 = and i64 %35, 2047
  %37 = getelementptr inbounds [2048 x ptr], ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 165328), i64 0, i64 %36
  %38 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 216), align 8
  br label %39

39:                                               ; preds = %39, %31
  %.0.in = phi ptr [ %37, %31 ], [ %45, %39 ]
  %.0 = load ptr, ptr %.0.in, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %.0, i64 8208
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = icmp ne i64 %41, %35
  %43 = icmp ne ptr %.0, %38
  %44 = select i1 %42, i1 %43, i1 false
  %45 = getelementptr inbounds i8, ptr %.0, i64 8216
  br i1 %44, label %39, label %46, !llvm.loop !18

46:                                               ; preds = %39
  %47 = lshr i64 %34, 12
  %48 = and i64 %47, 1023
  %49 = getelementptr inbounds [1024 x ptr], ptr %.0, i64 0, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = tail call ptr @GC_free_block_ending_at(ptr noundef %0)
  %.not58 = icmp eq ptr %50, null
  br i1 %.not58, label %65, label %52

52:                                               ; preds = %46
  %53 = getelementptr inbounds i8, ptr %50, i64 25
  %54 = load i8, ptr %53, align 1, !tbaa !17
  %55 = and i8 %54, 4
  %.not59 = icmp eq i8 %55, 0
  br i1 %.not59, label %65, label %56

56:                                               ; preds = %52
  %57 = load i64, ptr %19, align 8, !tbaa !14
  %58 = getelementptr inbounds i8, ptr %50, i64 32
  %59 = load i64, ptr %58, align 8, !tbaa !14
  %60 = add i64 %59, %57
  %.not60 = icmp sgt i64 %60, -1
  br i1 %.not60, label %61, label %65

61:                                               ; preds = %56
  tail call void @GC_remove_from_fl(ptr noundef nonnull %50)
  %62 = load i64, ptr %58, align 8, !tbaa !14
  %63 = load i64, ptr %19, align 8, !tbaa !14
  %64 = add i64 %63, %62
  store i64 %64, ptr %19, align 8, !tbaa !14
  tail call void @GC_remove_header(ptr noundef %33) #4
  br label %65

65:                                               ; preds = %61, %56, %52, %46
  %.not61 = icmp eq ptr %51, null
  br i1 %.not61, label %76, label %66

66:                                               ; preds = %65
  %67 = tail call ptr @GC_find_header(ptr noundef nonnull %51) #4
  %68 = load i64, ptr %19, align 8, !tbaa !14
  %69 = getelementptr inbounds i8, ptr %67, i64 32
  %70 = load i64, ptr %69, align 8, !tbaa !14
  %71 = add i64 %70, %68
  %.not62 = icmp sgt i64 %71, -1
  br i1 %.not62, label %72, label %76

72:                                               ; preds = %66
  tail call void @GC_remove_from_fl(ptr noundef nonnull %67)
  %73 = load i64, ptr %19, align 8, !tbaa !14
  %74 = load i64, ptr %69, align 8, !tbaa !14
  %75 = add i64 %74, %73
  store i64 %75, ptr %69, align 8, !tbaa !14
  tail call void @GC_remove_header(ptr noundef %0) #4
  br label %76

76:                                               ; preds = %66, %72, %65
  %.053 = phi ptr [ %18, %66 ], [ %67, %72 ], [ %18, %65 ]
  %.052 = phi ptr [ %0, %66 ], [ %51, %72 ], [ %0, %65 ]
  %77 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 32), align 8, !tbaa !19
  %78 = add i64 %77, %22
  store i64 %78, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 32), align 8, !tbaa !19
  tail call void @GC_add_to_fl(ptr noundef %.052, ptr noundef %.053)
  ret void
}

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #2

declare void @GC_remove_counts(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @GC_log_printf(ptr noundef, ...) local_unnamed_addr #0

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @GC_remove_from_fl(ptr noundef) local_unnamed_addr #3

declare void @GC_remove_header(ptr noundef) local_unnamed_addr #0

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 #3 = { inlinehint 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 #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 8208}
!10 = !{!"bi", !7, i64 0, !6, i64 8192, !6, i64 8200, !11, i64 8208, !6, i64 8216}
!11 = !{!"long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !11, i64 32}
!15 = !{!"hblkhdr", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 25, !16, i64 26, !11, i64 32, !11, i64 40, !6, i64 48, !11, i64 56, !7, i64 64}
!16 = !{!"short", !7, i64 0}
!17 = !{!15, !7, i64 25}
!18 = distinct !{!18, !13}
!19 = !{!20, !11, i64 32}
!20 = !{!"_GC_arrays", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !21, i64 176, !21, i64 180, !21, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !6, i64 216, !6, i64 224, !11, i64 232, !21, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !22, i64 272, !22, i64 296, !23, i64 320, !21, i64 336, !6, i64 344, !11, i64 352, !11, i64 360, !21, i64 368, !11, i64 376, !11, i64 384, !11, i64 392, !6, 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, !6, i64 91592, !7, i64 91600, !7, i64 157136, !7, i64 165328}
!21 = !{!"int", !7, i64 0}
!22 = !{!"dl_hashtbl_s", !6, i64 0, !11, i64 8, !21, i64 16}
!23 = !{!"fnlz_roots_s", !6, i64 0, !6, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass