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

%"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 }

; 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: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12CoverageData20InitializeGuardArrayEPi(ptr noundef nonnull align 8 dereferenceable(193) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  call void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds i32, ptr %9, i64 0
  %11 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %11, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %31, %2
  %13 = load i32, ptr %6, align 4, !tbaa !9
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %34

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %18 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %8, i32 0, i32 1
  %19 = call noundef i64 @_ZN11__sanitizer19atomic_load_relaxedINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_(ptr noundef %18)
  store i64 %19, ptr %7, align 8, !tbaa !11
  %20 = getelementptr inbounds %"class.__sanitizer::CoverageData", ptr %8, i32 0, i32 1
  %21 = load i64, ptr %7, align 8, !tbaa !11
  %22 = add i64 %21, 1
  call void @_ZN11__sanitizer20atomic_store_relaxedINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeE(ptr noundef %20, i64 noundef %22)
  %23 = load i64, ptr %7, align 8, !tbaa !11
  %24 = add i64 %23, 1
  %25 = trunc i64 %24 to i32
  %26 = sub nsw i32 0, %25
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %27, i64 %29
  store i32 %26, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %31

31:                                               ; preds = %17
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %6, align 4, !tbaa !9
  br label %12, !llvm.loop !13

34:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer20atomic_store_relaxedINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeE(ptr noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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"}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12CoverageData20InitializeGuardArrayEPi(ptr noundef nonnull align 8 dereferenceable(193) %0, ptr nocapture noundef %1) local_unnamed_addr #0 align 2 {
  tail call void @_ZN11__sanitizer12CoverageData6EnableEv(ptr noundef nonnull align 8 dereferenceable(193) %0)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not9 = icmp slt i32 %3, 1
  br i1 %.not9, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = add nuw i32 %3, 1
  %wide.trip.count = zext i32 %5 to i64
  br label %6

._crit_edge:                                      ; preds = %6, %2
  ret void

6:                                                ; preds = %.lr.ph, %6
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %6 ]
  %7 = tail call noundef i64 @_ZN11__sanitizer19atomic_load_relaxedINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_(ptr noundef nonnull %4)
  %8 = add i64 %7, 1
  tail call void @_ZN11__sanitizer20atomic_store_relaxedINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeE(ptr noundef nonnull %4, i64 noundef %8)
  %9 = trunc i64 %7 to i32
  %.neg8 = xor i32 %9, -1
  %10 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  store i32 %.neg8, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %6, !llvm.loop !9
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer19atomic_load_relaxedINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer20atomic_store_relaxedINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeE(ptr noundef, i64 noundef) local_unnamed_addr #1

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 = { 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" }

!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,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass