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

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

@_ZN11__sanitizerL14g_total_mmapedE = external hidden global %"struct.__sanitizer::atomic_uintptr_t", align 8
@.str.17 = external hidden unnamed_addr constant [53 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer8RawWriteEPKc(ptr noundef) #0

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

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer17IncreaseTotalMmapEm(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  store i64 %0, ptr %2, align 8, !tbaa !5
  %4 = call noundef ptr @_ZN11__sanitizer12common_flagsEv()
  %5 = getelementptr inbounds %"struct.__sanitizer::CommonFlags", ptr %4, i32 0, i32 30
  %6 = load i64, ptr %5, align 8, !tbaa !9
  %7 = icmp ne i64 %6, 0
  br i1 %7, label %9, label %8

8:                                                ; preds = %1
  br label %31

9:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = call noundef i64 @_ZN11__sanitizer16atomic_fetch_addINS_16atomic_uintptr_tEEENT_4TypeEPVS2_S3_NS_12memory_orderE(ptr noundef @_ZN11__sanitizerL14g_total_mmapedE, i64 noundef %10, i32 noundef 1)
  %12 = load i64, ptr %2, align 8, !tbaa !5
  %13 = add i64 %11, %12
  store i64 %13, ptr %3, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %9
  %15 = load i64, ptr %3, align 8, !tbaa !5
  %16 = lshr i64 %15, 20
  %17 = call noundef ptr @_ZN11__sanitizer12common_flagsEv()
  %18 = getelementptr inbounds %"struct.__sanitizer::CommonFlags", ptr %17, i32 0, i32 30
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = icmp ult i64 %16, %19
  %21 = xor i1 %20, true
  %22 = xor i1 %21, true
  %23 = xor i1 %22, true
  %24 = zext i1 %23 to i64
  %25 = call i64 @llvm.expect.i64(i64 %24, i64 0)
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %14
  call void @_ZN11__sanitizer8RawWriteEPKc(ptr noundef @.str.17)
  call void @_ZN11__sanitizer3DieEv() #6
  unreachable

28:                                               ; preds = %14
  br label %29

29:                                               ; preds = %28
  br label %30

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

31:                                               ; preds = %30, %8
  ret void
}

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

@_ZN11__sanitizerL14g_total_mmapedE = external hidden global %"struct.__sanitizer::atomic_uintptr_t", align 8
@.str.17 = external hidden unnamed_addr constant [53 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer8RawWriteEPKc(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer17IncreaseTotalMmapEm(i64 noundef %0) local_unnamed_addr #0 {
  %2 = tail call noundef ptr @_ZN11__sanitizer12common_flagsEv()
  %3 = getelementptr inbounds i8, ptr %2, i64 96
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %13, label %5

5:                                                ; preds = %1
  %6 = tail call noundef i64 @_ZN11__sanitizer16atomic_fetch_addINS_16atomic_uintptr_tEEENT_4TypeEPVS2_S3_NS_12memory_orderE(ptr noundef nonnull @_ZN11__sanitizerL14g_total_mmapedE, i64 noundef %0, i32 noundef 1)
  %7 = add i64 %6, %0
  %8 = lshr i64 %7, 20
  %9 = tail call noundef ptr @_ZN11__sanitizer12common_flagsEv()
  %10 = getelementptr inbounds i8, ptr %9, i64 96
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %.not3 = icmp ult i64 %8, %11
  br i1 %.not3, label %13, label %12, !prof !13

12:                                               ; preds = %5
  tail call void @_ZN11__sanitizer8RawWriteEPKc(ptr noundef nonnull @.str.17)
  tail call void @_ZN11__sanitizer3DieEv() #3
  unreachable

13:                                               ; preds = %5, %1
  ret void
}

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


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