; 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::CommonFlags" = type { i8, ptr, i8, ptr, i8, i8, i8, i8, i32, ptr, i8, i8, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i64, ptr, i8, i8, i8, i64, i64, i64, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, i8, i8, i8, i8, i8, i8, i32, ptr, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i8, i8, i8, i8, ptr }
%"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 }
%"struct.__sanitizer::atomic_uintptr_t" = type { i64 }
%"class.__sanitizer::StaticSpinMutex" = type { %"struct.__sanitizer::atomic_uint8_t" }
%"struct.__sanitizer::atomic_uint8_t" = type { i8 }

@_ZL12coverage_dir = external hidden global ptr, align 8
@_ZL16coverage_enabled = external hidden global i8, align 1
@.str.5 = external hidden unnamed_addr constant [119 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [64 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 void @_ZN11__sanitizer16CovUpdateMappingEPKcm(ptr noundef, i64 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
declare dso_local void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11__sanitizer12common_flagsEv() #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData7DisableEv(ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData18ReinitializeGuardsEv(ptr noundef nonnull align 8 dereferenceable(193)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12CoverageData6ReInitEv(ptr noundef nonnull align 8 dereferenceable(193) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @_ZN11__sanitizer12CoverageData7DisableEv(ptr noundef nonnull align 8 dereferenceable(193) %7)
  %8 = load i8, ptr @_ZL16coverage_enabled, align 1, !tbaa !9, !range !11, !noundef !12
  %9 = trunc i8 %8 to i1
  br i1 %9, label %10, label %32

10:                                               ; preds = %1
  %11 = call noundef ptr @_ZN11__sanitizer12common_flagsEv()
  %12 = getelementptr inbounds %"struct.__sanitizer::CommonFlags", ptr %11, i32 0, i32 41
  %13 = load i8, ptr %12, align 8, !tbaa !13, !range !11, !noundef !12
  %14 = trunc i8 %13 to i1
  br i1 %14, label %15, label %30

15:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %16 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %7, i32 0, i32 2
  %17 = call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef %16, i32 noundef 1)
  store i64 %17, ptr %3, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %18 = load i64, ptr %3, align 8, !tbaa !17
  %19 = udiv i64 %18, 8
  store i64 %19, ptr %4, align 8, !tbaa !17
  call void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193) %7)
  %20 = load i64, ptr %3, align 8, !tbaa !17
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %22, label %24

22:                                               ; preds = %15
  %23 = load i64, ptr %4, align 8, !tbaa !17
  call void @_ZN11__sanitizer12CoverageData6ExtendEm(ptr noundef nonnull align 8 dereferenceable(193) %7, i64 noundef %23)
  br label %24

24:                                               ; preds = %22, %15
  %25 = load i8, ptr @_ZL16coverage_enabled, align 1, !tbaa !9, !range !11, !noundef !12
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  %28 = load ptr, ptr @_ZL12coverage_dir, align 8, !tbaa !5
  call void @_ZN11__sanitizer16CovUpdateMappingEPKcm(ptr noundef %28, i64 noundef 0)
  br label %29

29:                                               ; preds = %27, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %31

30:                                               ; preds = %10
  call void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193) %7)
  br label %31

31:                                               ; preds = %30, %29
  br label %32

32:                                               ; preds = %31, %1
  br label %33

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %34 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %7, i32 0, i32 1
  %35 = call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef %34, i32 noundef 1)
  store i64 %35, ptr %5, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !18
  %36 = load i64, ptr %5, align 8, !tbaa !18
  %37 = load i64, ptr %6, align 8, !tbaa !18
  %38 = icmp eq i64 %36, %37
  %39 = xor i1 %38, true
  %40 = xor i1 %39, true
  %41 = xor i1 %40, true
  %42 = zext i1 %41 to i64
  %43 = call i64 @llvm.expect.i64(i64 %42, i64 0)
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %48

45:                                               ; preds = %33
  %46 = load i64, ptr %5, align 8, !tbaa !18
  %47 = load i64, ptr %6, align 8, !tbaa !18
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.5, i32 noundef 291, ptr noundef @.str.6, i64 noundef %46, i64 noundef %47) #7
  unreachable

48:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %49

49:                                               ; preds = %48
  call void @_ZN11__sanitizer12CoverageData18ReinitializeGuardsEv(ptr noundef nonnull align 8 dereferenceable(193) %7)
  ret void
}

; 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) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData6ExtendEm(ptr noundef nonnull align 8 dereferenceable(193), i64 noundef) #2 align 2

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

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

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 = { 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 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !10, i64 128}
!14 = !{!"_ZTSN11__sanitizer11CommonFlagsE", !10, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 33, !10, i64 34, !10, i64 35, !15, i64 36, !6, i64 40, !10, i64 48, !10, i64 49, !15, i64 52, !10, i64 56, !10, i64 57, !10, i64 58, !10, i64 59, !10, i64 60, !10, i64 61, !10, i64 62, !10, i64 63, !10, i64 64, !10, i64 65, !10, i64 66, !10, i64 67, !16, i64 72, !6, i64 80, !10, i64 88, !10, i64 89, !10, i64 90, !16, i64 96, !16, i64 104, !16, i64 112, !10, i64 120, !10, i64 121, !10, i64 122, !10, i64 123, !10, i64 124, !10, i64 125, !10, i64 126, !10, i64 127, !10, i64 128, !6, i64 136, !10, i64 144, !10, i64 145, !10, i64 146, !10, i64 147, !10, i64 148, !10, i64 149, !15, i64 152, !6, i64 160, !10, i64 168, !10, i64 169, !10, i64 170, !10, i64 171, !10, i64 172, !10, i64 173, !10, i64 174, !10, i64 175, !10, i64 176, !10, i64 177, !10, i64 178, !10, i64 179, !10, i64 180, !10, i64 181, !15, i64 184, !10, i64 188, !10, i64 189, !10, i64 190, !10, i64 191, !6, i64 192}
!15 = !{!"int", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"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"

@_ZL12coverage_dir = external hidden local_unnamed_addr global ptr, align 8
@_ZL16coverage_enabled = external hidden local_unnamed_addr global i8, align 1
@.str.5 = external hidden unnamed_addr constant [119 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [64 x i8], align 1

declare void @_ZN11__sanitizer16CovUpdateMappingEPKcm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11__sanitizer12common_flagsEv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData7DisableEv(ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData18ReinitializeGuardsEv(ptr noundef nonnull align 8 dereferenceable(193)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12CoverageData6ReInitEv(ptr noundef nonnull align 8 dereferenceable(193) %0) local_unnamed_addr #1 align 2 {
  tail call void @_ZN11__sanitizer12CoverageData7DisableEv(ptr noundef nonnull align 8 dereferenceable(193) %0)
  %2 = load i8, ptr @_ZL16coverage_enabled, align 1, !tbaa !5, !range !9, !noundef !10
  %3 = trunc nuw i8 %2 to i1
  br i1 %3, label %4, label %20

4:                                                ; preds = %1
  %5 = tail call noundef ptr @_ZN11__sanitizer12common_flagsEv()
  %6 = getelementptr inbounds i8, ptr %5, i64 128
  %7 = load i8, ptr %6, align 8, !tbaa !11, !range !9, !noundef !10
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %9, label %19

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = tail call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef nonnull %10, i32 noundef 1)
  tail call void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193) %0)
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %14, label %12

12:                                               ; preds = %9
  %13 = lshr i64 %11, 3
  tail call void @_ZN11__sanitizer12CoverageData6ExtendEm(ptr noundef nonnull align 8 dereferenceable(193) %0, i64 noundef %13)
  br label %14

14:                                               ; preds = %12, %9
  %15 = load i8, ptr @_ZL16coverage_enabled, align 1, !tbaa !5, !range !9, !noundef !10
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %17, label %20

17:                                               ; preds = %14
  %18 = load ptr, ptr @_ZL12coverage_dir, align 8, !tbaa !16
  tail call void @_ZN11__sanitizer16CovUpdateMappingEPKcm(ptr noundef %18, i64 noundef 0)
  br label %20

19:                                               ; preds = %4
  tail call void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193) %0)
  br label %20

20:                                               ; preds = %14, %17, %1, %19
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = tail call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef nonnull %21, i32 noundef 1)
  %.not7 = icmp eq i64 %22, 0
  br i1 %.not7, label %24, label %23, !prof !17

23:                                               ; preds = %20
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.5, i32 noundef 291, ptr noundef nonnull @.str.6, i64 noundef %22, i64 noundef 0) #4
  unreachable

24:                                               ; preds = %20
  tail call void @_ZN11__sanitizer12CoverageData18ReinitializeGuardsEv(ptr noundef nonnull align 8 dereferenceable(193) %0)
  ret void
}

; 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 #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData6ExtendEm(ptr noundef nonnull align 8 dereferenceable(193), i64 noundef) local_unnamed_addr #1 align 2

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

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 = { 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 #2 = { 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 #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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !6, i64 128}
!12 = !{!"_ZTSN11__sanitizer11CommonFlagsE", !6, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !6, i64 33, !6, i64 34, !6, i64 35, !14, i64 36, !13, i64 40, !6, i64 48, !6, i64 49, !14, i64 52, !6, i64 56, !6, i64 57, !6, i64 58, !6, i64 59, !6, i64 60, !6, i64 61, !6, i64 62, !6, i64 63, !6, i64 64, !6, i64 65, !6, i64 66, !6, i64 67, !15, i64 72, !13, i64 80, !6, i64 88, !6, i64 89, !6, i64 90, !15, i64 96, !15, i64 104, !15, i64 112, !6, i64 120, !6, i64 121, !6, i64 122, !6, i64 123, !6, i64 124, !6, i64 125, !6, i64 126, !6, i64 127, !6, i64 128, !13, i64 136, !6, i64 144, !6, i64 145, !6, i64 146, !6, i64 147, !6, i64 148, !6, i64 149, !14, i64 152, !13, i64 160, !6, i64 168, !6, i64 169, !6, i64 170, !6, i64 171, !6, i64 172, !6, i64 173, !6, i64 174, !6, i64 175, !6, i64 176, !6, i64 177, !6, i64 178, !6, i64 179, !6, i64 180, !6, i64 181, !14, i64 184, !6, i64 188, !6, i64 189, !6, i64 190, !6, i64 191, !13, i64 192}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!"branch_weights", !"expected", i32 2000, i32 1}


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