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

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

@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@GC_on_abort = external global ptr, align 8
@GC_all_interior_pointers = external global i32, align 4
@GC_old_stack_bl = external hidden global ptr, align 8
@GC_incomplete_stack_bl = external hidden global ptr, align 8

declare void @GC_err_printf(ptr noundef, ...) #0

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

declare ptr @GC_scratch_alloc(i64 noundef) #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @GC_bl_init() #1 {
  %1 = load i32, ptr @GC_all_interior_pointers, align 4, !tbaa !5
  %2 = icmp ne i32 %1, 0
  br i1 %2, label %4, label %3

3:                                                ; preds = %0
  call void @GC_bl_init_no_interiors()
  br label %4

4:                                                ; preds = %3, %0
  %5 = call ptr @GC_scratch_alloc(i64 noundef 32768)
  store ptr %5, ptr @GC_old_stack_bl, align 8, !tbaa !9
  %6 = call ptr @GC_scratch_alloc(i64 noundef 32768)
  store ptr %6, ptr @GC_incomplete_stack_bl, align 8, !tbaa !9
  %7 = load ptr, ptr @GC_old_stack_bl, align 8, !tbaa !9
  %8 = icmp eq ptr %7, null
  br i1 %8, label %12, label %9

9:                                                ; preds = %4
  %10 = load ptr, ptr @GC_incomplete_stack_bl, align 8, !tbaa !9
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %9, %4
  call void (ptr, ...) @GC_err_printf(ptr noundef @.str.4)
  %13 = load ptr, ptr @GC_on_abort, align 8, !tbaa !9
  call void %13(ptr noundef null)
  call void @exit(i32 noundef 1) #3
  unreachable

14:                                               ; preds = %9
  %15 = load ptr, ptr @GC_old_stack_bl, align 8, !tbaa !9
  call void @GC_clear_bl(ptr noundef %15)
  %16 = load ptr, ptr @GC_incomplete_stack_bl, align 8, !tbaa !9
  call void @GC_clear_bl(ptr noundef %16)
  ret void
}

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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


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

@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@GC_on_abort = external local_unnamed_addr global ptr, align 8
@GC_all_interior_pointers = external local_unnamed_addr global i32, align 4
@GC_old_stack_bl = external hidden local_unnamed_addr global ptr, align 8
@GC_incomplete_stack_bl = external hidden local_unnamed_addr global ptr, align 8

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

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

declare ptr @GC_scratch_alloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local void @GC_bl_init() local_unnamed_addr #1 {
  %1 = load i32, ptr @GC_all_interior_pointers, align 4, !tbaa !5
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %2, label %3

2:                                                ; preds = %0
  tail call void @GC_bl_init_no_interiors()
  br label %3

3:                                                ; preds = %2, %0
  %4 = tail call ptr @GC_scratch_alloc(i64 noundef 32768) #3
  store ptr %4, ptr @GC_old_stack_bl, align 8, !tbaa !9
  %5 = tail call ptr @GC_scratch_alloc(i64 noundef 32768) #3
  store ptr %5, ptr @GC_incomplete_stack_bl, align 8, !tbaa !9
  %6 = load ptr, ptr @GC_old_stack_bl, align 8, !tbaa !9
  %7 = icmp eq ptr %6, null
  %8 = icmp eq ptr %5, null
  %or.cond = select i1 %7, i1 true, i1 %8
  br i1 %or.cond, label %9, label %11

9:                                                ; preds = %3
  tail call void (ptr, ...) @GC_err_printf(ptr noundef nonnull @.str.4) #3
  %10 = load ptr, ptr @GC_on_abort, align 8, !tbaa !9
  tail call void %10(ptr noundef null) #3
  tail call void @exit(i32 noundef 1) #4
  unreachable

11:                                               ; preds = %3
  tail call void @GC_clear_bl(ptr noundef nonnull %6)
  %12 = load ptr, ptr @GC_incomplete_stack_bl, align 8, !tbaa !9
  tail call void @GC_clear_bl(ptr noundef %12)
  ret void
}

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 = { 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SimplifyCFGPass,TailCallElimPass