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

@.str = external hidden unnamed_addr constant [116 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11__sanitizer23IsAccessibleMemoryRangeEmm(i64 noundef %0, i64 noundef %1) #3 {
  %3 = alloca i1, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [2 x i32], align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %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
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %16 = call noundef i64 @_ZN11__sanitizer17GetPageSizeCachedEv()
  store i64 %16, ptr %6, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %18 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %18, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %19 = load i64, ptr %6, align 8, !tbaa !5
  %20 = mul i64 %19, 10
  store i64 %20, ptr %8, align 8, !tbaa !9
  %21 = load i64, ptr %7, align 8, !tbaa !9
  %22 = load i64, ptr %8, align 8, !tbaa !9
  %23 = icmp ult i64 %21, %22
  %24 = xor i1 %23, true
  %25 = xor i1 %24, true
  %26 = xor i1 %25, true
  %27 = zext i1 %26 to i64
  %28 = call i64 @llvm.expect.i64(i64 %27, i64 0)
  %29 = icmp ne i64 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %17
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = load i64, ptr %8, align 8, !tbaa !9
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 216, ptr noundef @.str.6, i64 noundef %31, i64 noundef %32) #8
  unreachable

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

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %36 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 0
  %37 = call i32 @pipe(ptr noundef %36) #7
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %82

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %41 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 1
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = load i64, ptr %4, align 8, !tbaa !5
  %44 = inttoptr i64 %43 to ptr
  %45 = load i64, ptr %5, align 8, !tbaa !5
  %46 = call noundef i64 @_ZN11__sanitizer14internal_writeEiPKvm(i32 noundef %42, ptr noundef %44, i64 noundef %45)
  store i64 %46, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  %47 = load i64, ptr %11, align 8, !tbaa !5
  %48 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %47, ptr noundef %12)
  br i1 %48, label %49, label %68

49:                                               ; preds = %40
  br label %50

50:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 14, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %51 = load i32, ptr %12, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  store i64 %52, ptr %15, align 8, !tbaa !9
  %53 = load i64, ptr %14, align 8, !tbaa !9
  %54 = load i64, ptr %15, align 8, !tbaa !9
  %55 = icmp eq i64 %53, %54
  %56 = xor i1 %55, true
  %57 = xor i1 %56, true
  %58 = xor i1 %57, true
  %59 = zext i1 %58 to i64
  %60 = call i64 @llvm.expect.i64(i64 %59, i64 0)
  %61 = icmp ne i64 %60, 0
  br i1 %61, label %62, label %65

62:                                               ; preds = %50
  %63 = load i64, ptr %14, align 8, !tbaa !9
  %64 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 225, ptr noundef @.str.7, i64 noundef %63, i64 noundef %64) #8
  unreachable

65:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  store i8 0, ptr %13, align 1, !tbaa !13
  br label %73

68:                                               ; preds = %40
  %69 = load i64, ptr %11, align 8, !tbaa !5
  %70 = load i64, ptr %5, align 8, !tbaa !5
  %71 = icmp eq i64 %69, %70
  %72 = zext i1 %71 to i8
  store i8 %72, ptr %13, align 1, !tbaa !13
  br label %73

73:                                               ; preds = %68, %67
  %74 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 0
  %75 = load i32, ptr %74, align 4, !tbaa !11
  %76 = call noundef i64 @_ZN11__sanitizer14internal_closeEi(i32 noundef %75)
  %77 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 1
  %78 = load i32, ptr %77, align 4, !tbaa !11
  %79 = call noundef i64 @_ZN11__sanitizer14internal_closeEi(i32 noundef %78)
  %80 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %81 = trunc i8 %80 to i1
  store i1 %81, ptr %3, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %82

82:                                               ; preds = %73, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %83 = load i1, ptr %3, align 1
  ret i1 %83
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN11__sanitizer17GetPageSizeCachedEv() #4

; Function Attrs: nounwind
declare i32 @pipe(ptr noundef) #5

declare noundef i64 @_ZN11__sanitizer14internal_writeEiPKvm(i32 noundef, ptr noundef, i64 noundef) #6

declare noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef, ptr noundef) #6

declare noundef i64 @_ZN11__sanitizer14internal_closeEi(i32 noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { 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 #4 = { inlinehint 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 "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 = { "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 #7 = { nounwind }
attributes #8 = { 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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}


; 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 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 zeroext i1 @_ZN11__sanitizer23IsAccessibleMemoryRangeEmm(i64 noundef %0, i64 noundef %1) local_unnamed_addr #2 {
  %3 = alloca [2 x i32], align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef i64 @_ZN11__sanitizer17GetPageSizeCachedEv()
  %6 = mul i64 %5, 10
  %.not = icmp ugt i64 %6, %1
  br i1 %.not, label %8, label %7, !prof !5

7:                                                ; preds = %2
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 216, ptr noundef nonnull @.str.6, i64 noundef %1, i64 noundef %6) #6
  unreachable

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %9 = call i32 @pipe(ptr noundef nonnull %3) #7
  %.not17 = icmp eq i32 %9, 0
  br i1 %.not17, label %10, label %27

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !6
  %13 = inttoptr i64 %0 to ptr
  %14 = call noundef i64 @_ZN11__sanitizer14internal_writeEiPKvm(i32 noundef %12, ptr noundef %13, i64 noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %15 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %14, ptr noundef nonnull %4)
  br i1 %15, label %16, label %20

16:                                               ; preds = %10
  %17 = load i32, ptr %4, align 4, !tbaa !6
  %.not18 = icmp eq i32 %17, 14
  br i1 %.not18, label %22, label %18, !prof !5

18:                                               ; preds = %16
  %19 = sext i32 %17 to i64
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 225, ptr noundef nonnull @.str.7, i64 noundef 14, i64 noundef %19) #6
  unreachable

20:                                               ; preds = %10
  %21 = icmp eq i64 %14, %1
  br label %22

22:                                               ; preds = %16, %20
  %.016 = phi i1 [ %21, %20 ], [ false, %16 ]
  %23 = load i32, ptr %3, align 4, !tbaa !6
  %24 = call noundef i64 @_ZN11__sanitizer14internal_closeEi(i32 noundef %23)
  %25 = load i32, ptr %11, align 4, !tbaa !6
  %26 = call noundef i64 @_ZN11__sanitizer14internal_closeEi(i32 noundef %25)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %27

27:                                               ; preds = %8, %22
  %.0 = phi i1 [ %.016, %22 ], [ false, %8 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret i1 %.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN11__sanitizer17GetPageSizeCachedEv() local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @pipe(ptr noundef) local_unnamed_addr #4

declare noundef i64 @_ZN11__sanitizer14internal_writeEiPKvm(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef, ptr noundef) local_unnamed_addr #5

declare noundef i64 @_ZN11__sanitizer14internal_closeEi(i32 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #4 = { nounwind "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 = { "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 = { noreturn }
attributes #7 = { 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 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


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