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

@GC_incomplete_normal_bl = external hidden global ptr, align 8
@GC_old_normal_bl = external hidden global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@GC_on_abort = external global ptr, align 8

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

; Function Attrs: nounwind uwtable
define dso_local void @GC_bl_init_no_interiors() #1 {
  %1 = load ptr, ptr @GC_incomplete_normal_bl, align 8, !tbaa !5
  %2 = icmp eq ptr %1, null
  br i1 %2, label %3, label %16

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

8:                                                ; preds = %3
  %9 = load ptr, ptr @GC_incomplete_normal_bl, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %13

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

13:                                               ; preds = %8
  %14 = load ptr, ptr @GC_old_normal_bl, align 8, !tbaa !5
  call void @GC_clear_bl(ptr noundef %14)
  %15 = load ptr, ptr @GC_incomplete_normal_bl, align 8, !tbaa !5
  call void @GC_clear_bl(ptr noundef %15)
  br label %16

16:                                               ; preds = %13, %0
  ret void
}

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

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


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

@GC_incomplete_normal_bl = external hidden local_unnamed_addr global ptr, align 8
@GC_old_normal_bl = external hidden local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@GC_on_abort = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: nounwind uwtable
define dso_local void @GC_bl_init_no_interiors() local_unnamed_addr #1 {
  %1 = load ptr, ptr @GC_incomplete_normal_bl, align 8, !tbaa !5
  %2 = icmp eq ptr %1, null
  br i1 %2, label %3, label %13

3:                                                ; preds = %0
  %4 = tail call ptr @GC_scratch_alloc(i64 noundef 32768) #3
  store ptr %4, ptr @GC_old_normal_bl, align 8, !tbaa !5
  %5 = tail call ptr @GC_scratch_alloc(i64 noundef 32768) #3
  store ptr %5, ptr @GC_incomplete_normal_bl, align 8, !tbaa !5
  %6 = load ptr, ptr @GC_old_normal_bl, align 8, !tbaa !5
  %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 !5
  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_normal_bl, align 8, !tbaa !5
  tail call void @GC_clear_bl(ptr noundef %12)
  br label %13

13:                                               ; preds = %11, %0
  ret void
}

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

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


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