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

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

@.str.2 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef, ptr noundef, i1 noundef zeroext) #0

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

; 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__sanitizer10UnmapOrDieEPvm(ptr noundef, i64 noundef) #0

; 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
define dso_local noundef ptr @_ZN11__sanitizer16MmapAlignedOrDieEmmPKc(i64 noundef %0, i64 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i64 %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %17 = load i64, ptr %4, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZN11__sanitizer12IsPowerOfTwoEm(i64 noundef %17)
  %19 = zext i1 %18 to i64
  store i64 %19, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !11
  %20 = load i64, ptr %7, align 8, !tbaa !11
  %21 = load i64, ptr %8, align 8, !tbaa !11
  %22 = icmp ne i64 %20, %21
  %23 = xor i1 %22, true
  %24 = xor i1 %23, true
  %25 = xor i1 %24, true
  %26 = zext i1 %25 to i64
  %27 = call i64 @llvm.expect.i64(i64 %26, i64 0)
  %28 = icmp ne i64 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %16
  %30 = load i64, ptr %7, align 8, !tbaa !11
  %31 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.2, i32 noundef 152, ptr noundef @.str.4, i64 noundef %30, i64 noundef %31) #6
  unreachable

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

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %35 = load i64, ptr %5, align 8, !tbaa !5
  %36 = call noundef zeroext i1 @_ZN11__sanitizer12IsPowerOfTwoEm(i64 noundef %35)
  %37 = zext i1 %36 to i64
  store i64 %37, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !11
  %38 = load i64, ptr %9, align 8, !tbaa !11
  %39 = load i64, ptr %10, align 8, !tbaa !11
  %40 = icmp ne i64 %38, %39
  %41 = xor i1 %40, true
  %42 = xor i1 %41, true
  %43 = xor i1 %42, true
  %44 = zext i1 %43 to i64
  %45 = call i64 @llvm.expect.i64(i64 %44, i64 0)
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %50

47:                                               ; preds = %34
  %48 = load i64, ptr %9, align 8, !tbaa !11
  %49 = load i64, ptr %10, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.2, i32 noundef 153, ptr noundef @.str.5, i64 noundef %48, i64 noundef %49) #6
  unreachable

50:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %51

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %52 = load i64, ptr %4, align 8, !tbaa !5
  %53 = load i64, ptr %5, align 8, !tbaa !5
  %54 = add i64 %52, %53
  store i64 %54, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %55 = load i64, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %6, align 8, !tbaa !9
  %57 = call noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef %55, ptr noundef %56, i1 noundef zeroext false)
  %58 = ptrtoint ptr %57 to i64
  store i64 %58, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %59 = load i64, ptr %12, align 8, !tbaa !5
  %60 = load i64, ptr %11, align 8, !tbaa !5
  %61 = add i64 %59, %60
  store i64 %61, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %62 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %62, ptr %14, align 8, !tbaa !5
  %63 = load i64, ptr %14, align 8, !tbaa !5
  %64 = load i64, ptr %5, align 8, !tbaa !5
  %65 = sub i64 %64, 1
  %66 = and i64 %63, %65
  %67 = icmp ne i64 %66, 0
  br i1 %67, label %68, label %76

68:                                               ; preds = %51
  %69 = load i64, ptr %12, align 8, !tbaa !5
  %70 = load i64, ptr %5, align 8, !tbaa !5
  %71 = add i64 %69, %70
  %72 = load i64, ptr %5, align 8, !tbaa !5
  %73 = sub i64 %72, 1
  %74 = xor i64 %73, -1
  %75 = and i64 %71, %74
  store i64 %75, ptr %14, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %68, %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %77 = load i64, ptr %14, align 8, !tbaa !5
  %78 = load i64, ptr %4, align 8, !tbaa !5
  %79 = add i64 %77, %78
  store i64 %79, ptr %15, align 8, !tbaa !5
  %80 = load i64, ptr %14, align 8, !tbaa !5
  %81 = load i64, ptr %12, align 8, !tbaa !5
  %82 = icmp ne i64 %80, %81
  br i1 %82, label %83, label %89

83:                                               ; preds = %76
  %84 = load i64, ptr %12, align 8, !tbaa !5
  %85 = inttoptr i64 %84 to ptr
  %86 = load i64, ptr %14, align 8, !tbaa !5
  %87 = load i64, ptr %12, align 8, !tbaa !5
  %88 = sub i64 %86, %87
  call void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef %85, i64 noundef %88)
  br label %89

89:                                               ; preds = %83, %76
  %90 = load i64, ptr %15, align 8, !tbaa !5
  %91 = load i64, ptr %13, align 8, !tbaa !5
  %92 = icmp ne i64 %90, %91
  br i1 %92, label %93, label %99

93:                                               ; preds = %89
  %94 = load i64, ptr %15, align 8, !tbaa !5
  %95 = inttoptr i64 %94 to ptr
  %96 = load i64, ptr %13, align 8, !tbaa !5
  %97 = load i64, ptr %15, align 8, !tbaa !5
  %98 = sub i64 %96, %97
  call void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef %95, i64 noundef %98)
  br label %99

99:                                               ; preds = %93, %89
  %100 = load i64, ptr %14, align 8, !tbaa !5
  %101 = inttoptr i64 %100 to ptr
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret ptr %101
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer12IsPowerOfTwoEm(i64 noundef) #4

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 = { 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 = { 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 #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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"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"

@.str.2 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef, i64 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
define dso_local noundef ptr @_ZN11__sanitizer16MmapAlignedOrDieEmmPKc(i64 noundef %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = tail call noundef zeroext i1 @_ZN11__sanitizer12IsPowerOfTwoEm(i64 noundef %0)
  br i1 %4, label %6, label %5, !prof !5

5:                                                ; preds = %3
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.2, i32 noundef 152, ptr noundef nonnull @.str.4, i64 noundef 0, i64 noundef 0) #3
  unreachable

6:                                                ; preds = %3
  %7 = tail call noundef zeroext i1 @_ZN11__sanitizer12IsPowerOfTwoEm(i64 noundef %1)
  br i1 %7, label %9, label %8, !prof !5

8:                                                ; preds = %6
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.2, i32 noundef 153, ptr noundef nonnull @.str.5, i64 noundef 0, i64 noundef 0) #3
  unreachable

9:                                                ; preds = %6
  %10 = add i64 %1, %0
  %11 = tail call noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef %10, ptr noundef %2, i1 noundef zeroext false)
  %12 = ptrtoint ptr %11 to i64
  %13 = add i64 %10, %12
  %14 = add i64 %1, -1
  %15 = and i64 %14, %12
  %.not = icmp eq i64 %15, 0
  %16 = add i64 %12, %1
  %17 = sub i64 0, %1
  %18 = and i64 %16, %17
  %.0 = select i1 %.not, i64 %12, i64 %18
  %19 = add i64 %.0, %0
  %.not37 = icmp eq i64 %.0, %12
  br i1 %.not37, label %22, label %20

20:                                               ; preds = %9
  %21 = sub i64 %.0, %12
  tail call void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef %11, i64 noundef %21)
  br label %22

22:                                               ; preds = %20, %9
  %.not38 = icmp eq i64 %19, %13
  br i1 %.not38, label %26, label %23

23:                                               ; preds = %22
  %24 = inttoptr i64 %19 to ptr
  %25 = sub i64 %13, %19
  tail call void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef %24, i64 noundef %25)
  br label %26

26:                                               ; preds = %23, %22
  %27 = inttoptr i64 %.0 to ptr
  ret ptr %27
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer12IsPowerOfTwoEm(i64 noundef) local_unnamed_addr #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 = { 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 = { 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 }

!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 = !{!"branch_weights", !"expected", i32 2000, i32 1}


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