; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common (sanitizer_stoptheworld_linux_libcdep)

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

%"class.__sanitizer::ThreadSuspender" = type <{ ptr, %"class.__sanitizer::SuspendedThreadsList", i32, [4 x i8] }>
%"class.__sanitizer::SuspendedThreadsList" = type { %"class.__sanitizer::InternalMmapVector" }
%"class.__sanitizer::InternalMmapVector" = type { %"class.__sanitizer::InternalMmapVectorNoCtor" }
%"class.__sanitizer::InternalMmapVectorNoCtor" = type { ptr, i64, i64 }

@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [45 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 noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef, ptr noundef) #1

declare noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN11__sanitizer9VerbosityEv() #2

declare void @_ZN11__sanitizer6ReportEPKcz(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: mustprogress uwtable
define dso_local void @_ZN11__sanitizer15ThreadSuspender16ResumeAllThreadsEv(ptr noundef nonnull align 8 dereferenceable(36) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %7

7:                                                ; preds = %42, %1
  %8 = load i64, ptr %3, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.__sanitizer::ThreadSuspender", ptr %6, i32 0, i32 1
  %10 = call noundef i64 @_ZNK11__sanitizer20SuspendedThreadsList12thread_countEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  %11 = icmp ult i64 %8, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %45

13:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %14 = getelementptr inbounds %"class.__sanitizer::ThreadSuspender", ptr %6, i32 0, i32 1
  %15 = load i64, ptr %3, align 8, !tbaa !9
  %16 = call noundef i32 @_ZNK11__sanitizer20SuspendedThreadsList11GetThreadIDEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %15)
  store i32 %16, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %17 = load i32, ptr %4, align 4, !tbaa !11
  %18 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 17, i32 noundef %17, ptr noundef null, ptr noundef null)
  %19 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %18, ptr noundef %5)
  br i1 %19, label %30, label %20

20:                                               ; preds = %13
  br label %21

21:                                               ; preds = %20
  %22 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  %23 = sext i32 %22 to i64
  %24 = icmp uge i64 %23, 2
  br i1 %24, label %25, label %27

25:                                               ; preds = %21
  %26 = load i32, ptr %4, align 4, !tbaa !11
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.3, i32 noundef %26)
  br label %27

27:                                               ; preds = %25, %21
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %41

30:                                               ; preds = %13
  br label %31

31:                                               ; preds = %30
  %32 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  %33 = sext i32 %32 to i64
  %34 = icmp uge i64 %33, 1
  br i1 %34, label %35, label %38

35:                                               ; preds = %31
  %36 = load i32, ptr %4, align 4, !tbaa !11
  %37 = load i32, ptr %5, align 4, !tbaa !11
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.4, i32 noundef %36, i32 noundef %37)
  br label %38

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

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %42

42:                                               ; preds = %41
  %43 = load i64, ptr %3, align 8, !tbaa !9
  %44 = add i64 %43, 1
  store i64 %44, ptr %3, align 8, !tbaa !9
  br label %7, !llvm.loop !13

45:                                               ; preds = %12
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK11__sanitizer20SuspendedThreadsList12thread_countEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK11__sanitizer20SuspendedThreadsList11GetThreadIDEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 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 = { inlinehint mustprogress 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 = { mustprogress 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 = { mustprogress 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 }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [45 x i8], align 1

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

declare noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef, ptr noundef) local_unnamed_addr #1

declare noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN11__sanitizer9VerbosityEv() local_unnamed_addr #2

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer15ThreadSuspender16ResumeAllThreadsEv(ptr noundef nonnull align 8 dereferenceable(36) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca i32, align 4
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = tail call noundef i64 @_ZNK11__sanitizer20SuspendedThreadsList12thread_countEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %.not7 = icmp eq i64 %4, 0
  br i1 %.not7, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %15, %1
  ret void

.lr.ph:                                           ; preds = %1, %15
  %.06 = phi i64 [ %16, %15 ], [ 0, %1 ]
  %5 = call noundef i32 @_ZNK11__sanitizer20SuspendedThreadsList11GetThreadIDEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %6 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 17, i32 noundef %5, ptr noundef null, ptr noundef null)
  %7 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %6, ptr noundef nonnull %2)
  %8 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  br i1 %7, label %12, label %9

9:                                                ; preds = %.lr.ph
  %10 = icmp ugt i32 %8, 1
  br i1 %10, label %11, label %15

11:                                               ; preds = %9
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.3, i32 noundef %5)
  br label %15

12:                                               ; preds = %.lr.ph
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %15, label %13

13:                                               ; preds = %12
  %14 = load i32, ptr %2, align 4, !tbaa !5
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.4, i32 noundef %5, i32 noundef %14)
  br label %15

15:                                               ; preds = %12, %13, %9, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %16 = add nuw i64 %.06, 1
  %17 = call noundef i64 @_ZNK11__sanitizer20SuspendedThreadsList12thread_countEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %18 = icmp ult i64 %16, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !9
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK11__sanitizer20SuspendedThreadsList12thread_countEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK11__sanitizer20SuspendedThreadsList11GetThreadIDEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 = { mustprogress 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 = { mustprogress 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 }

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass