; 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 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11__sanitizer15ThreadSuspender13SuspendThreadEi(ptr noundef nonnull align 8 dereferenceable(36) %0, i32 noundef %1) #0 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8
  %13 = getelementptr inbounds %"class.__sanitizer::ThreadSuspender", ptr %12, i32 0, i32 1
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = call noundef zeroext i1 @_ZNK11__sanitizer20SuspendedThreadsList8ContainsEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %14)
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %94

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 16, i32 noundef %18, ptr noundef null, ptr noundef null)
  %20 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %19, ptr noundef %6)
  br i1 %20, label %21, label %32

21:                                               ; preds = %17
  br label %22

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

26:                                               ; preds = %22
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str, i32 noundef %27, i32 noundef %28)
  br label %29

29:                                               ; preds = %26, %22
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %93

32:                                               ; preds = %17
  br label %33

33:                                               ; preds = %32
  %34 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  %35 = sext i32 %34 to i64
  %36 = icmp uge i64 %35, 2
  br i1 %36, label %37, label %39

37:                                               ; preds = %33
  %38 = load i32, ptr %5, align 4, !tbaa !9
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.1, i32 noundef %38)
  br label %39

39:                                               ; preds = %37, %33
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %88, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  br label %43

43:                                               ; preds = %52, %42
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = call noundef i64 @_ZN11__sanitizer16internal_waitpidEiPii(i32 noundef %44, ptr noundef %8, i32 noundef 1073741824)
  store i64 %45, ptr %9, align 8, !tbaa !11
  br label %46

46:                                               ; preds = %43
  %47 = load i64, ptr %9, align 8, !tbaa !11
  %48 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %47, ptr noundef %10)
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = icmp eq i32 %50, 4
  br label %52

52:                                               ; preds = %49, %46
  %53 = phi i1 [ false, %46 ], [ %51, %49 ]
  br i1 %53, label %43, label %54, !llvm.loop !13

54:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %55 = load i64, ptr %9, align 8, !tbaa !11
  %56 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %55, ptr noundef %11)
  br i1 %56, label %57, label %70

57:                                               ; preds = %54
  br label %58

58:                                               ; preds = %57
  %59 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  %60 = sext i32 %59 to i64
  %61 = icmp uge i64 %60, 1
  br i1 %61, label %62, label %65

62:                                               ; preds = %58
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.2, i32 noundef %63, i32 noundef %64)
  br label %65

65:                                               ; preds = %62, %58
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %5, align 4, !tbaa !9
  %69 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 17, i32 noundef %68, ptr noundef null, ptr noundef null)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %88

70:                                               ; preds = %54
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = and i32 %71, 255
  %73 = icmp eq i32 %72, 127
  br i1 %73, label %74, label %87

74:                                               ; preds = %70
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = and i32 %75, 65280
  %77 = ashr i32 %76, 8
  %78 = icmp ne i32 %77, 19
  br i1 %78, label %79, label %87

79:                                               ; preds = %74
  %80 = load i32, ptr %5, align 4, !tbaa !9
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = and i32 %81, 65280
  %83 = ashr i32 %82, 8
  %84 = sext i32 %83 to i64
  %85 = inttoptr i64 %84 to ptr
  %86 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 7, i32 noundef %80, ptr noundef null, ptr noundef %85)
  store i32 7, ptr %7, align 4
  br label %88, !llvm.loop !15

87:                                               ; preds = %74, %70
  store i32 6, ptr %7, align 4
  br label %88

88:                                               ; preds = %87, %79, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %89 = load i32, ptr %7, align 4
  switch i32 %89, label %93 [
    i32 7, label %42
    i32 6, label %90
  ]

90:                                               ; preds = %88
  %91 = getelementptr inbounds %"class.__sanitizer::ThreadSuspender", ptr %12, i32 0, i32 1
  %92 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN11__sanitizer20SuspendedThreadsList6AppendEi(ptr noundef nonnull align 8 dereferenceable(24) %91, i32 noundef %92)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %93

93:                                               ; preds = %90, %88, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %94

94:                                               ; preds = %93, %16
  %95 = load i1, ptr %3, align 1
  ret i1 %95
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11__sanitizer20SuspendedThreadsList8ContainsEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #0 align 2

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

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

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

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

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) #2

declare noundef i64 @_ZN11__sanitizer16internal_waitpidEiPii(i32 noundef, ptr noundef, i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer20SuspendedThreadsList6AppendEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #0 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [52 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11__sanitizer15ThreadSuspender13SuspendThreadEi(ptr noundef nonnull align 8 dereferenceable(36) %0, i32 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = tail call noundef zeroext i1 @_ZNK11__sanitizer20SuspendedThreadsList8ContainsEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %1)
  br i1 %8, label %46, label %9

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %10 = tail call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 16, i32 noundef %1, ptr noundef null, ptr noundef null)
  %11 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %10, ptr noundef nonnull %3)
  %12 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  br i1 %11, label %13, label %16

13:                                               ; preds = %9
  %.not16 = icmp eq i32 %12, 0
  br i1 %.not16, label %45, label %14

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

16:                                               ; preds = %9
  %17 = icmp ugt i32 %12, 1
  br i1 %17, label %18, label %.preheader

18:                                               ; preds = %16
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.1, i32 noundef %1)
  br label %.preheader

.preheader:                                       ; preds = %18, %16
  br label %19

19:                                               ; preds = %.preheader, %40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  br label %20

20:                                               ; preds = %20, %19
  %21 = call noundef i64 @_ZN11__sanitizer16internal_waitpidEiPii(i32 noundef %1, ptr noundef nonnull %4, i32 noundef 1073741824)
  %22 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %21, ptr noundef nonnull %5)
  %23 = load i32, ptr %5, align 4
  %24 = icmp eq i32 %23, 4
  %25 = select i1 %22, i1 %24, i1 false
  br i1 %25, label %20, label %26, !llvm.loop !9

26:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %27 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %21, ptr noundef nonnull %6)
  br i1 %27, label %28, label %33

28:                                               ; preds = %26
  %29 = call noundef i32 @_ZN11__sanitizer9VerbosityEv()
  %.not15 = icmp eq i32 %29, 0
  br i1 %.not15, label %.thread18, label %30

30:                                               ; preds = %28
  %31 = load i32, ptr %6, align 4, !tbaa !5
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.2, i32 noundef %1, i32 noundef %31)
  br label %.thread18

.thread18:                                        ; preds = %28, %30
  %32 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 17, i32 noundef %1, ptr noundef null, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %45

33:                                               ; preds = %26
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = and i32 %34, 255
  %36 = icmp eq i32 %35, 127
  br i1 %36, label %37, label %44

37:                                               ; preds = %33
  %38 = lshr i32 %34, 8
  %39 = and i32 %38, 255
  %.not = icmp eq i32 %39, 19
  br i1 %.not, label %44, label %40

40:                                               ; preds = %37
  %41 = zext nneg i32 %39 to i64
  %42 = inttoptr i64 %41 to ptr
  %43 = call noundef i64 @_ZN11__sanitizer15internal_ptraceEiiPvS0_(i32 noundef 7, i32 noundef %1, ptr noundef null, ptr noundef %42)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %19

44:                                               ; preds = %37, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @_ZN11__sanitizer20SuspendedThreadsList6AppendEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %1)
  br label %45

45:                                               ; preds = %.thread18, %13, %14, %44
  %.2 = phi i1 [ true, %44 ], [ false, %14 ], [ false, %13 ], [ false, %.thread18 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %46

46:                                               ; preds = %2, %45
  %.3 = phi i1 [ %.2, %45 ], [ false, %2 ]
  ret i1 %.3
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK11__sanitizer20SuspendedThreadsList8ContainsEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

declare noundef i64 @_ZN11__sanitizer16internal_waitpidEiPii(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer20SuspendedThreadsList6AppendEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass