; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common (sanitizer_coverage_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"

%"struct.__sanitizer::atomic_uintptr_t" = type { i64 }
%"class.__sanitizer::CoverageData" = type <{ ptr, %"struct.__sanitizer::atomic_uintptr_t", %"struct.__sanitizer::atomic_uintptr_t", i64, i32, [4 x i8], %"class.__sanitizer::InternalMmapVectorNoCtor", %"class.__sanitizer::InternalMmapVectorNoCtor.0", %"class.__sanitizer::InternalMmapVectorNoCtor.0", %"class.__sanitizer::InternalMmapVectorNoCtor.1", i64, ptr, %"struct.__sanitizer::atomic_uintptr_t", %"struct.__sanitizer::atomic_uintptr_t", ptr, i64, ptr, %"class.__sanitizer::StaticSpinMutex", [7 x i8] }>
%"class.__sanitizer::InternalMmapVectorNoCtor" = type { ptr, i64, i64 }
%"class.__sanitizer::InternalMmapVectorNoCtor.0" = type { ptr, i64, i64 }
%"class.__sanitizer::InternalMmapVectorNoCtor.1" = type { ptr, i64, i64 }
%"class.__sanitizer::StaticSpinMutex" = type { %"struct.__sanitizer::atomic_uint8_t" }
%"struct.__sanitizer::atomic_uint8_t" = type { i8 }

@.str.5 = external hidden unnamed_addr constant [119 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [79 x i8], align 1
@_ZL16coverage_counter = external hidden global %"struct.__sanitizer::atomic_uintptr_t", align 8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef, i32 noundef) #1

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN11__sanitizer18BundlePcAndCounterEmm(i64 noundef, i64 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12CoverageData3AddEmPj(ptr noundef nonnull align 8 dereferenceable(193) %0, i64 noundef %1, ptr noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %15, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = call noundef i32 @_ZN11__sanitizer11atomic_loadINS_15atomic_uint32_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef %16, i32 noundef 1)
  store i32 %17, ptr %8, align 4, !tbaa !11
  %18 = load i32, ptr %8, align 4, !tbaa !11
  %19 = icmp sge i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %3
  store i32 1, ptr %9, align 4
  br label %69

21:                                               ; preds = %3
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = load i32, ptr %8, align 4, !tbaa !11
  %24 = sub nsw i32 0, %23
  call void @_ZN11__sanitizer12atomic_storeINS_15atomic_uint32_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef %22, i32 noundef %24, i32 noundef 1)
  %25 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %14, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = icmp ne ptr %26, null
  br i1 %27, label %29, label %28

28:                                               ; preds = %21
  store i32 1, ptr %9, align 4
  br label %69

29:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %30 = load i32, ptr %8, align 4, !tbaa !11
  %31 = sub nsw i32 0, %30
  %32 = sub nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  store i64 %33, ptr %10, align 8, !tbaa !9
  %34 = load i64, ptr %10, align 8, !tbaa !9
  %35 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %14, i32 0, i32 1
  %36 = call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef %35, i32 noundef 4)
  %37 = icmp uge i64 %34, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %29
  store i32 1, ptr %9, align 4
  br label %68

39:                                               ; preds = %29
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %41 = load i64, ptr %10, align 8, !tbaa !9
  %42 = mul i64 %41, 8
  store i64 %42, ptr %11, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %43 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %14, i32 0, i32 2
  %44 = call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef %43, i32 noundef 4)
  store i64 %44, ptr %12, align 8, !tbaa !21
  %45 = load i64, ptr %11, align 8, !tbaa !21
  %46 = load i64, ptr %12, align 8, !tbaa !21
  %47 = icmp ult i64 %45, %46
  %48 = xor i1 %47, true
  %49 = xor i1 %48, true
  %50 = xor i1 %49, true
  %51 = zext i1 %50 to i64
  %52 = call i64 @llvm.expect.i64(i64 %51, i64 0)
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %40
  %55 = load i64, ptr %11, align 8, !tbaa !21
  %56 = load i64, ptr %12, align 8, !tbaa !21
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.5, i32 noundef 419, ptr noundef @.str.14, i64 noundef %55, i64 noundef %56) #6
  unreachable

57:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %60 = call noundef i64 @_ZN11__sanitizer16atomic_fetch_addINS_16atomic_uintptr_tEEENT_4TypeEPVS2_S3_NS_12memory_orderE(ptr noundef @_ZL16coverage_counter, i64 noundef 1, i32 noundef 1)
  store i64 %60, ptr %13, align 8, !tbaa !9
  %61 = load i64, ptr %5, align 8, !tbaa !9
  %62 = load i64, ptr %13, align 8, !tbaa !9
  %63 = call noundef i64 @_ZN11__sanitizer18BundlePcAndCounterEmm(i64 noundef %61, i64 noundef %62)
  %64 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %14, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !13
  %66 = load i64, ptr %10, align 8, !tbaa !9
  %67 = getelementptr inbounds i64, ptr %65, i64 %66
  store i64 %63, ptr %67, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  store i32 0, ptr %9, align 4
  br label %68

68:                                               ; preds = %59, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %69

69:                                               ; preds = %68, %28, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %70 = load i32, ptr %9, align 4
  switch i32 %70, label %72 [
    i32 0, label %71
    i32 1, label %71
  ]

71:                                               ; preds = %69, %69
  ret void

72:                                               ; preds = %69
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11__sanitizer11atomic_loadINS_15atomic_uint32_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer12atomic_storeINS_15atomic_uint32_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef, i32 noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer16atomic_fetch_addINS_16atomic_uintptr_tEEENT_4TypeEPVS2_S3_NS_12memory_orderE(ptr noundef, i64 noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #3 = { noreturn "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 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 }
attributes #6 = { noreturn }

!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 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN11__sanitizer12CoverageDataE", !6, i64 0, !15, i64 8, !15, i64 16, !10, i64 24, !12, i64 32, !16, i64 40, !17, i64 64, !17, i64 88, !18, i64 112, !10, i64 136, !6, i64 144, !15, i64 152, !15, i64 160, !6, i64 168, !10, i64 176, !6, i64 184, !19, i64 192}
!15 = !{!"_ZTSN11__sanitizer16atomic_uintptr_tE", !10, i64 0}
!16 = !{!"_ZTSN11__sanitizer24InternalMmapVectorNoCtorIPiEE", !6, i64 0, !10, i64 8, !10, i64 16}
!17 = !{!"_ZTSN11__sanitizer24InternalMmapVectorNoCtorINS_12CoverageData12NamedPcRangeEEE", !6, i64 0, !10, i64 8, !10, i64 16}
!18 = !{!"_ZTSN11__sanitizer24InternalMmapVectorNoCtorINS_12CoverageData14CounterAndSizeEEE", !6, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!"_ZTSN11__sanitizer15StaticSpinMutexE", !20, i64 0}
!20 = !{!"_ZTSN11__sanitizer14atomic_uint8_tE", !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"long long", !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"

%"struct.__sanitizer::atomic_uintptr_t" = type { i64 }

@.str.5 = external hidden unnamed_addr constant [119 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [79 x i8], align 1
@_ZL16coverage_counter = external hidden global %"struct.__sanitizer::atomic_uintptr_t", align 8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN11__sanitizer18BundlePcAndCounterEmm(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12CoverageData3AddEmPj(ptr noundef nonnull align 8 dereferenceable(193) %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #2 align 2 {
  %4 = tail call noundef i32 @_ZN11__sanitizer11atomic_loadINS_15atomic_uint32_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef %2, i32 noundef 1)
  %5 = icmp sgt i32 %4, -1
  br i1 %5, label %24, label %6

6:                                                ; preds = %3
  %7 = sub nsw i32 0, %4
  tail call void @_ZN11__sanitizer12atomic_storeINS_15atomic_uint32_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef %2, i32 noundef %7, i32 noundef 1)
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %24, label %9

9:                                                ; preds = %6
  %10 = xor i32 %4, -1
  %11 = zext nneg i32 %10 to i64
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = tail call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef nonnull %12, i32 noundef 4)
  %.not16 = icmp ugt i64 %13, %11
  br i1 %.not16, label %14, label %24

14:                                               ; preds = %9
  %15 = shl nuw nsw i64 %11, 3
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = tail call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef nonnull %16, i32 noundef 4)
  %.not17 = icmp ult i64 %15, %17
  br i1 %.not17, label %19, label %18, !prof !18

18:                                               ; preds = %14
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.5, i32 noundef 419, ptr noundef nonnull @.str.14, i64 noundef %15, i64 noundef %17) #3
  unreachable

19:                                               ; preds = %14
  %20 = tail call noundef i64 @_ZN11__sanitizer16atomic_fetch_addINS_16atomic_uintptr_tEEENT_4TypeEPVS2_S3_NS_12memory_orderE(ptr noundef nonnull @_ZL16coverage_counter, i64 noundef 1, i32 noundef 1)
  %21 = tail call noundef i64 @_ZN11__sanitizer18BundlePcAndCounterEmm(i64 noundef %1, i64 noundef %20)
  %22 = load ptr, ptr %0, align 8, !tbaa !5
  %23 = getelementptr inbounds i64, ptr %22, i64 %11
  store i64 %21, ptr %23, align 8, !tbaa !19
  br label %24

24:                                               ; preds = %19, %9, %6, %3
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11__sanitizer11atomic_loadINS_15atomic_uint32_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer12atomic_storeINS_15atomic_uint32_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer16atomic_fetch_addINS_16atomic_uintptr_tEEENT_4TypeEPVS2_S3_NS_12memory_orderE(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

attributes #0 = { inlinehint 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 #1 = { noreturn "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 = { 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 = { noreturn }

!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, !7, i64 0}
!6 = !{!"_ZTSN11__sanitizer12CoverageDataE", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !14, i64 64, !14, i64 88, !15, i64 112, !11, i64 136, !7, i64 144, !10, i64 152, !10, i64 160, !7, i64 168, !11, i64 176, !7, i64 184, !16, i64 192}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11__sanitizer16atomic_uintptr_tE", !11, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN11__sanitizer24InternalMmapVectorNoCtorIPiEE", !7, i64 0, !11, i64 8, !11, i64 16}
!14 = !{!"_ZTSN11__sanitizer24InternalMmapVectorNoCtorINS_12CoverageData12NamedPcRangeEEE", !7, i64 0, !11, i64 8, !11, i64 16}
!15 = !{!"_ZTSN11__sanitizer24InternalMmapVectorNoCtorINS_12CoverageData14CounterAndSizeEEE", !7, i64 0, !11, i64 8, !11, i64 16}
!16 = !{!"_ZTSN11__sanitizer15StaticSpinMutexE", !17, i64 0}
!17 = !{!"_ZTSN11__sanitizer14atomic_uint8_tE", !8, i64 0}
!18 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!19 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass