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

; 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.GC_ms_entry = type { ptr, %union.word_ptr_ao_u }
%union.word_ptr_ao_u = type { i64 }

@GC_arrays = external global %struct._GC_arrays, align 8
@GC_on_abort = external global ptr, align 8
@GC_n_rescuing_pages = external hidden global i64, align 8
@GC_on_mark_stack_empty = external hidden global ptr, align 8
@GC_print_stats = external global i32, align 4
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @GC_mark_some(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  switch i32 %6, label %143 [
    i32 0, label %7
    i32 1, label %8
    i32 2, label %42
    i32 3, label %63
    i32 5, label %105
    i32 4, label %105
  ]

7:                                                ; preds = %1
  store i32 1, ptr %2, align 4
  br label %146

8:                                                ; preds = %1
  %9 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %10 = ptrtoint ptr %9 to i64
  %11 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 20), align 8, !tbaa !16
  %12 = getelementptr inbounds %struct.GC_ms_entry, ptr %11, i64 -2048
  %13 = ptrtoint ptr %12 to i64
  %14 = icmp uge i64 %10, %13
  br i1 %14, label %15, label %22

15:                                               ; preds = %8
  store i32 1, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 22), align 8, !tbaa !17
  %16 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %17 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %18 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %19 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %20 = getelementptr inbounds %struct.GC_ms_entry, ptr %18, i64 %19
  %21 = call ptr @GC_mark_from(ptr noundef %16, ptr noundef %17, ptr noundef %20)
  store ptr %21, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  br label %41

22:                                               ; preds = %8
  %23 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %24 = call ptr @GC_push_next_marked_dirty(ptr noundef %23)
  store ptr %24, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %25 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %26 = icmp eq ptr null, %25
  br i1 %26, label %27, label %39

27:                                               ; preds = %22
  %28 = load i32, ptr @GC_print_stats, align 4, !tbaa !21
  %29 = icmp ne i32 %28, 0
  %30 = xor i1 %29, true
  %31 = zext i1 %30 to i32
  %32 = sext i32 %31 to i64
  %33 = call i64 @llvm.expect.i64(i64 %32, i64 1)
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %27
  br label %38

36:                                               ; preds = %27
  %37 = load i64, ptr @GC_n_rescuing_pages, align 8, !tbaa !22
  call void (ptr, ...) @GC_log_printf(ptr noundef @.str.1, i64 noundef %37)
  br label %38

38:                                               ; preds = %36, %35
  br label %39

39:                                               ; preds = %38, %22
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  call void @push_roots_and_advance(i32 noundef 0, ptr noundef %40)
  br label %41

41:                                               ; preds = %39, %15
  br label %145

42:                                               ; preds = %1
  %43 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %44 = ptrtoint ptr %43 to i64
  %45 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %46 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %47 = udiv i64 %46, 4
  %48 = getelementptr inbounds %struct.GC_ms_entry, ptr %45, i64 %47
  %49 = ptrtoint ptr %48 to i64
  %50 = icmp uge i64 %44, %49
  br i1 %50, label %51, label %58

51:                                               ; preds = %42
  %52 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %53 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %54 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %55 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %56 = getelementptr inbounds %struct.GC_ms_entry, ptr %54, i64 %55
  %57 = call ptr @GC_mark_from(ptr noundef %52, ptr noundef %53, ptr noundef %56)
  store ptr %57, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  br label %62

58:                                               ; preds = %42
  %59 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %60 = call ptr @GC_push_next_marked_uncollectable(ptr noundef %59)
  store ptr %60, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  call void @push_roots_and_advance(i32 noundef 1, ptr noundef %61)
  br label %62

62:                                               ; preds = %58, %51
  br label %145

63:                                               ; preds = %1
  %64 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %65 = ptrtoint ptr %64 to i64
  %66 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %67 = ptrtoint ptr %66 to i64
  %68 = icmp uge i64 %65, %67
  br i1 %68, label %69, label %76

69:                                               ; preds = %63
  %70 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %71 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %72 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %73 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %74 = getelementptr inbounds %struct.GC_ms_entry, ptr %72, i64 %73
  %75 = call ptr @GC_mark_from(ptr noundef %70, ptr noundef %71, ptr noundef %74)
  store ptr %75, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  br label %104

76:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %77 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 22), align 8, !tbaa !17
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %82

79:                                               ; preds = %76
  store i32 0, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  %80 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %81 = mul i64 2, %80
  call void @alloc_mark_stack(i64 noundef %81)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %102

82:                                               ; preds = %76
  %83 = load ptr, ptr @GC_on_mark_stack_empty, align 8, !tbaa !5
  store ptr %83, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %101

86:                                               ; preds = %82
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %89 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 20), align 8, !tbaa !16
  %90 = call ptr %87(ptr noundef %88, ptr noundef %89)
  store ptr %90, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %91 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %92 = ptrtoint ptr %91 to i64
  %93 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %94 = ptrtoint ptr %93 to i64
  %95 = icmp uge i64 %92, %94
  br i1 %95, label %99, label %96

96:                                               ; preds = %86
  %97 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 22), align 8, !tbaa !17
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %96, %86
  store i32 2, ptr %5, align 4
  br label %102

100:                                              ; preds = %96
  br label %101

101:                                              ; preds = %100, %82
  store i32 0, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %102

102:                                              ; preds = %101, %99, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %103 = load i32, ptr %5, align 4
  switch i32 %103, label %148 [
    i32 1, label %146
    i32 2, label %145
  ]

104:                                              ; preds = %69
  br label %145

105:                                              ; preds = %1, %1
  %106 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 23), align 4, !tbaa !23
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  store i32 2, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  br label %145

109:                                              ; preds = %105
  %110 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %111 = ptrtoint ptr %110 to i64
  %112 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %113 = ptrtoint ptr %112 to i64
  %114 = icmp uge i64 %111, %113
  br i1 %114, label %115, label %122

115:                                              ; preds = %109
  %116 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  %117 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %118 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 19), align 8, !tbaa !18
  %119 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %120 = getelementptr inbounds %struct.GC_ms_entry, ptr %118, i64 %119
  %121 = call ptr @GC_mark_from(ptr noundef %116, ptr noundef %117, ptr noundef %120)
  store ptr %121, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 21), align 8, !tbaa !15
  br label %145

122:                                              ; preds = %109
  %123 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %124 = icmp eq ptr null, %123
  br i1 %124, label %125, label %135

125:                                              ; preds = %122
  %126 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  %127 = icmp eq i32 %126, 5
  br i1 %127, label %128, label %135

128:                                              ; preds = %125
  %129 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 22), align 8, !tbaa !17
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %128
  %132 = load i64, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 30), align 8, !tbaa !19
  %133 = mul i64 2, %132
  call void @alloc_mark_stack(i64 noundef %133)
  br label %134

134:                                              ; preds = %131, %128
  store i32 4, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  br label %135

135:                                              ; preds = %134, %125, %122
  %136 = load ptr, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %137 = call ptr @GC_push_next_marked(ptr noundef %136)
  store ptr %137, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 29), align 8, !tbaa !20
  %138 = load i32, ptr getelementptr inbounds (%struct._GC_arrays, ptr @GC_arrays, i32 0, i32 31), align 8, !tbaa !9
  %139 = icmp eq i32 %138, 4
  br i1 %139, label %140, label %142

140:                                              ; preds = %135
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  call void @push_roots_and_advance(i32 noundef 1, ptr noundef %141)
  br label %142

142:                                              ; preds = %140, %135
  br label %145

143:                                              ; preds = %1
  %144 = load ptr, ptr @GC_on_abort, align 8, !tbaa !5
  call void %144(ptr noundef @.str.2)
  call void @abort() #6
  unreachable

145:                                              ; preds = %142, %115, %108, %104, %102, %62, %41
  store i32 0, ptr %2, align 4
  br label %146

146:                                              ; preds = %145, %102, %7
  %147 = load i32, ptr %2, align 4
  ret i32 %147

148:                                              ; preds = %102
  unreachable
}

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @alloc_mark_stack(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @GC_push_next_marked(ptr noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { "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, !12, i64 240}
!10 = !{!"_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, !12, i64 176, !12, i64 180, !12, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !6, i64 216, !6, i64 224, !11, i64 232, !12, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !13, i64 272, !13, i64 296, !14, i64 320, !12, i64 336, !6, i64 344, !11, i64 352, !11, i64 360, !12, 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}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"dl_hashtbl_s", !6, i64 0, !11, i64 8, !12, i64 16}
!14 = !{!"fnlz_roots_s", !6, i64 0, !6, i64 8}
!15 = !{!10, !6, i64 168}
!16 = !{!10, !6, i64 160}
!17 = !{!10, !12, i64 176}
!18 = !{!10, !6, i64 152}
!19 = !{!10, !11, i64 232}
!20 = !{!10, !6, i64 224}
!21 = !{!12, !12, i64 0}
!22 = !{!11, !11, i64 0}
!23 = !{!10, !12, i64 180}


; 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.GC_ms_entry = type { ptr, %union.word_ptr_ao_u }
%union.word_ptr_ao_u = type { i64 }

@GC_arrays = external local_unnamed_addr global %struct._GC_arrays, align 8
@GC_on_abort = external local_unnamed_addr global ptr, align 8
@GC_n_rescuing_pages = external hidden local_unnamed_addr global i64, align 8
@GC_on_mark_stack_empty = external hidden local_unnamed_addr global ptr, align 8
@GC_print_stats = external local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @GC_mark_some(ptr noundef %0) local_unnamed_addr #1 {
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 240), align 8
  switch i32 %2, label %80 [
    i32 0, label %.thread
    i32 1, label %3
    i32 2, label %20
    i32 3, label %32
    i32 5, label %54
    i32 4, label %54
  ]

3:                                                ; preds = %1
  %4 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  %5 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 160), align 8, !tbaa !14
  %6 = getelementptr inbounds i8, ptr %5, i64 -32768
  %.not17 = icmp ult ptr %4, %6
  br i1 %.not17, label %12, label %7

7:                                                ; preds = %3
  store i32 1, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 176), align 8, !tbaa !15
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 152), align 8, !tbaa !16
  %9 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 232), align 8, !tbaa !17
  %10 = getelementptr inbounds %struct.GC_ms_entry, ptr %8, i64 %9
  %11 = tail call ptr @GC_mark_from(ptr noundef %4, ptr noundef %8, ptr noundef %10)
  store ptr %11, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  br label %.thread

12:                                               ; preds = %3
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  %14 = tail call ptr @GC_push_next_marked_dirty(ptr noundef %13)
  store ptr %14, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  %15 = icmp ne ptr %14, null
  %16 = load i32, ptr @GC_print_stats, align 4
  %.not18 = icmp eq i32 %16, 0
  %or.cond19 = select i1 %15, i1 true, i1 %.not18
  br i1 %or.cond19, label %19, label %17, !prof !19

17:                                               ; preds = %12
  %18 = load i64, ptr @GC_n_rescuing_pages, align 8, !tbaa !20
  tail call void (ptr, ...) @GC_log_printf(ptr noundef nonnull @.str.1, i64 noundef %18) #3
  br label %19

19:                                               ; preds = %17, %12
  tail call void @push_roots_and_advance(i32 noundef 0, ptr noundef %0)
  br label %.thread

20:                                               ; preds = %1
  %21 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  %22 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 152), align 8, !tbaa !16
  %23 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 232), align 8, !tbaa !17
  %24 = lshr i64 %23, 2
  %25 = getelementptr inbounds %struct.GC_ms_entry, ptr %22, i64 %24
  %.not16 = icmp ult ptr %21, %25
  br i1 %.not16, label %29, label %26

26:                                               ; preds = %20
  %27 = getelementptr inbounds %struct.GC_ms_entry, ptr %22, i64 %23
  %28 = tail call ptr @GC_mark_from(ptr noundef %21, ptr noundef %22, ptr noundef %27)
  store ptr %28, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  br label %.thread

29:                                               ; preds = %20
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  %31 = tail call ptr @GC_push_next_marked_uncollectable(ptr noundef %30)
  store ptr %31, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  tail call void @push_roots_and_advance(i32 noundef 1, ptr noundef %0)
  br label %.thread

32:                                               ; preds = %1
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  %34 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 152), align 8, !tbaa !16
  %.not13 = icmp ult ptr %33, %34
  br i1 %.not13, label %39, label %35

35:                                               ; preds = %32
  %36 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 232), align 8, !tbaa !17
  %37 = getelementptr inbounds %struct.GC_ms_entry, ptr %34, i64 %36
  %38 = tail call ptr @GC_mark_from(ptr noundef %33, ptr noundef %34, ptr noundef %37)
  store ptr %38, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  br label %.thread

39:                                               ; preds = %32
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 176), align 8, !tbaa !15
  %.not14 = icmp eq i32 %40, 0
  br i1 %.not14, label %44, label %41

41:                                               ; preds = %39
  store i32 0, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 240), align 8, !tbaa !21
  %42 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 232), align 8, !tbaa !17
  %43 = shl i64 %42, 1
  tail call void @alloc_mark_stack(i64 noundef %43)
  br label %.thread

44:                                               ; preds = %39
  %45 = load ptr, ptr @GC_on_mark_stack_empty, align 8, !tbaa !22
  %.not15 = icmp eq ptr %45, null
  br i1 %.not15, label %53, label %46

46:                                               ; preds = %44
  %47 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 160), align 8, !tbaa !14
  %48 = tail call ptr %45(ptr noundef %33, ptr noundef %47) #3
  store ptr %48, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 152), align 8, !tbaa !16
  %50 = icmp uge ptr %48, %49
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 176), align 8
  %52 = icmp ne i32 %51, 0
  %or.cond = select i1 %50, i1 true, i1 %52
  br i1 %or.cond, label %.thread, label %53

53:                                               ; preds = %46, %44
  store i32 0, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 240), align 8, !tbaa !21
  br label %.thread

54:                                               ; preds = %1, %1
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 180), align 4, !tbaa !23
  %.not = icmp eq i32 %55, 0
  br i1 %.not, label %56, label %57

56:                                               ; preds = %54
  store i32 2, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 240), align 8, !tbaa !21
  br label %.thread

57:                                               ; preds = %54
  %58 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  %59 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 152), align 8, !tbaa !16
  %.not11 = icmp ult ptr %58, %59
  br i1 %.not11, label %64, label %60

60:                                               ; preds = %57
  %61 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 232), align 8, !tbaa !17
  %62 = getelementptr inbounds %struct.GC_ms_entry, ptr %59, i64 %61
  %63 = tail call ptr @GC_mark_from(ptr noundef %58, ptr noundef %59, ptr noundef %62)
  store ptr %63, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 168), align 8, !tbaa !5
  br label %.thread

64:                                               ; preds = %57
  %65 = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  %66 = icmp eq ptr %65, null
  %67 = icmp eq i32 %2, 5
  %or.cond3 = and i1 %67, %66
  br i1 %or.cond3, label %68, label %74

68:                                               ; preds = %64
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 176), align 8, !tbaa !15
  %.not12 = icmp eq i32 %69, 0
  br i1 %.not12, label %73, label %70

70:                                               ; preds = %68
  %71 = load i64, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 232), align 8, !tbaa !17
  %72 = shl i64 %71, 1
  tail call void @alloc_mark_stack(i64 noundef %72)
  %.pre.pre = load ptr, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  br label %73

73:                                               ; preds = %70, %68
  %.pre = phi ptr [ %.pre.pre, %70 ], [ null, %68 ]
  store i32 4, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 240), align 8, !tbaa !21
  br label %74

74:                                               ; preds = %73, %64
  %75 = phi ptr [ %.pre, %73 ], [ %65, %64 ]
  %76 = tail call ptr @GC_push_next_marked(ptr noundef %75)
  store ptr %76, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 224), align 8, !tbaa !18
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @GC_arrays, i64 240), align 8, !tbaa !21
  %78 = icmp eq i32 %77, 4
  br i1 %78, label %79, label %.thread

79:                                               ; preds = %74
  tail call void @push_roots_and_advance(i32 noundef 1, ptr noundef %0)
  br label %.thread

80:                                               ; preds = %1
  %81 = load ptr, ptr @GC_on_abort, align 8, !tbaa !22
  tail call void %81(ptr noundef nonnull @.str.2) #3
  tail call void @abort() #4
  unreachable

.thread:                                          ; preds = %46, %53, %41, %35, %56, %60, %19, %7, %29, %26, %79, %74, %1
  %.1 = phi i32 [ 1, %1 ], [ 0, %74 ], [ 0, %79 ], [ 0, %26 ], [ 0, %29 ], [ 0, %7 ], [ 0, %19 ], [ 0, %60 ], [ 0, %56 ], [ 0, %35 ], [ 1, %41 ], [ 1, %53 ], [ 0, %46 ]
  ret i32 %.1
}

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

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

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

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

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass