; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common (sanitizer_linux_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.13 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer26GetThreadStackTopAndBottomEbPmS0_(i1 noundef zeroext, ptr noundef, 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: 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer20GetThreadStackAndTlsEbPmS0_S0_S0_(i1 noundef zeroext %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, 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
  %16 = alloca i64, align 8
  %17 = zext i1 %0 to i8
  store i8 %17, ptr %6, align 1, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !9
  %18 = load ptr, ptr %9, align 8, !tbaa !9
  %19 = load ptr, ptr %10, align 8, !tbaa !9
  call void @_ZN11__sanitizerL6GetTlsEPmS0_(ptr noundef %18, ptr noundef %19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %20 = load i8, ptr %6, align 1, !tbaa !5, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  call void @_ZN11__sanitizer26GetThreadStackTopAndBottomEbPmS0_(i1 noundef zeroext %21, ptr noundef %11, ptr noundef %12)
  %22 = load i64, ptr %12, align 8, !tbaa !13
  %23 = load ptr, ptr %7, align 8, !tbaa !9
  store i64 %22, ptr %23, align 8, !tbaa !13
  %24 = load i64, ptr %11, align 8, !tbaa !13
  %25 = load i64, ptr %12, align 8, !tbaa !13
  %26 = sub i64 %24, %25
  %27 = load ptr, ptr %8, align 8, !tbaa !9
  store i64 %26, ptr %27, align 8, !tbaa !13
  %28 = load i8, ptr %6, align 1, !tbaa !5, !range !11, !noundef !12
  %29 = trunc i8 %28 to i1
  br i1 %29, label %107, label %30

30:                                               ; preds = %5
  %31 = load ptr, ptr %9, align 8, !tbaa !9
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = load ptr, ptr %7, align 8, !tbaa !9
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = icmp ugt i64 %32, %34
  br i1 %35, label %36, label %106

36:                                               ; preds = %30
  %37 = load ptr, ptr %9, align 8, !tbaa !9
  %38 = load i64, ptr %37, align 8, !tbaa !13
  %39 = load ptr, ptr %7, align 8, !tbaa !9
  %40 = load i64, ptr %39, align 8, !tbaa !13
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = load i64, ptr %41, align 8, !tbaa !13
  %43 = add i64 %40, %42
  %44 = icmp ult i64 %38, %43
  br i1 %44, label %45, label %106

45:                                               ; preds = %36
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %47 = load ptr, ptr %9, align 8, !tbaa !9
  %48 = load i64, ptr %47, align 8, !tbaa !13
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = load i64, ptr %49, align 8, !tbaa !13
  %51 = add i64 %48, %50
  store i64 %51, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %52 = load ptr, ptr %7, align 8, !tbaa !9
  %53 = load i64, ptr %52, align 8, !tbaa !13
  store i64 %53, ptr %14, align 8, !tbaa !15
  %54 = load i64, ptr %13, align 8, !tbaa !15
  %55 = load i64, ptr %14, align 8, !tbaa !15
  %56 = icmp ugt i64 %54, %55
  %57 = xor i1 %56, true
  %58 = xor i1 %57, true
  %59 = xor i1 %58, true
  %60 = zext i1 %59 to i64
  %61 = call i64 @llvm.expect.i64(i64 %60, i64 0)
  %62 = icmp ne i64 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %46
  %64 = load i64, ptr %13, align 8, !tbaa !15
  %65 = load i64, ptr %14, align 8, !tbaa !15
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 407, ptr noundef @.str.13, i64 noundef %64, i64 noundef %65) #5
  unreachable

66:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %70 = load ptr, ptr %9, align 8, !tbaa !9
  %71 = load i64, ptr %70, align 8, !tbaa !13
  %72 = load ptr, ptr %10, align 8, !tbaa !9
  %73 = load i64, ptr %72, align 8, !tbaa !13
  %74 = add i64 %71, %73
  store i64 %74, ptr %15, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %75 = load ptr, ptr %7, align 8, !tbaa !9
  %76 = load i64, ptr %75, align 8, !tbaa !13
  %77 = load ptr, ptr %8, align 8, !tbaa !9
  %78 = load i64, ptr %77, align 8, !tbaa !13
  %79 = add i64 %76, %78
  store i64 %79, ptr %16, align 8, !tbaa !15
  %80 = load i64, ptr %15, align 8, !tbaa !15
  %81 = load i64, ptr %16, align 8, !tbaa !15
  %82 = icmp ule i64 %80, %81
  %83 = xor i1 %82, true
  %84 = xor i1 %83, true
  %85 = xor i1 %84, true
  %86 = zext i1 %85 to i64
  %87 = call i64 @llvm.expect.i64(i64 %86, i64 0)
  %88 = icmp ne i64 %87, 0
  br i1 %88, label %89, label %92

89:                                               ; preds = %69
  %90 = load i64, ptr %15, align 8, !tbaa !15
  %91 = load i64, ptr %16, align 8, !tbaa !15
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 408, ptr noundef @.str.14, i64 noundef %90, i64 noundef %91) #5
  unreachable

92:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = load ptr, ptr %10, align 8, !tbaa !9
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = load ptr, ptr %8, align 8, !tbaa !9
  %98 = load i64, ptr %97, align 8, !tbaa !13
  %99 = sub i64 %98, %96
  store i64 %99, ptr %97, align 8, !tbaa !13
  %100 = load ptr, ptr %7, align 8, !tbaa !9
  %101 = load i64, ptr %100, align 8, !tbaa !13
  %102 = load ptr, ptr %8, align 8, !tbaa !9
  %103 = load i64, ptr %102, align 8, !tbaa !13
  %104 = add i64 %101, %103
  %105 = load ptr, ptr %9, align 8, !tbaa !9
  store i64 %104, ptr %105, align 8, !tbaa !13
  br label %106

106:                                              ; preds = %94, %36, %30
  br label %107

107:                                              ; preds = %106, %5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11__sanitizerL6GetTlsEPmS0_(ptr noundef, ptr noundef) #0

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 = { nounwind }
attributes #5 = { 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"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 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [55 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer20GetThreadStackAndTlsEbPmS0_S0_S0_(i1 noundef zeroext %0, ptr nocapture noundef %1, ptr nocapture noundef writeonly %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  tail call void @_ZN11__sanitizerL6GetTlsEPmS0_(ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @_ZN11__sanitizer26GetThreadStackTopAndBottomEbPmS0_(i1 noundef zeroext %0, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %8 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %8, ptr %1, align 8, !tbaa !5
  %9 = load i64, ptr %6, align 8, !tbaa !5
  %10 = sub i64 %9, %8
  store i64 %10, ptr %2, align 8, !tbaa !5
  br i1 %0, label %28, label %11

11:                                               ; preds = %5
  %12 = load i64, ptr %3, align 8, !tbaa !5
  %13 = load i64, ptr %1, align 8, !tbaa !5
  %14 = icmp ugt i64 %12, %13
  br i1 %14, label %15, label %28

15:                                               ; preds = %11
  %16 = add i64 %13, %10
  %17 = icmp ult i64 %12, %16
  br i1 %17, label %18, label %28

18:                                               ; preds = %15
  %19 = load i64, ptr %4, align 8, !tbaa !5
  %20 = add i64 %19, %12
  %.not = icmp ugt i64 %20, %13
  br i1 %.not, label %22, label %21, !prof !9

21:                                               ; preds = %18
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 407, ptr noundef nonnull @.str.13, i64 noundef %20, i64 noundef %13) #4
  unreachable

22:                                               ; preds = %18
  %.not32 = icmp ugt i64 %20, %16
  br i1 %.not32, label %23, label %24, !prof !10

23:                                               ; preds = %22
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 408, ptr noundef nonnull @.str.14, i64 noundef %20, i64 noundef %16) #4
  unreachable

24:                                               ; preds = %22
  %25 = sub i64 %10, %19
  store i64 %25, ptr %2, align 8, !tbaa !5
  %26 = load i64, ptr %1, align 8, !tbaa !5
  %27 = add i64 %26, %25
  store i64 %27, ptr %3, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %11, %15, %24, %5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11__sanitizerL6GetTlsEPmS0_(ptr noundef, ptr noundef) local_unnamed_addr #0

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


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