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

; 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::ThreadLister" = type <{ i32, i32, %"class.__sanitizer::InternalScopedBuffer", i8, [7 x i8], ptr, i32, [4 x i8] }>
%"class.__sanitizer::InternalScopedBuffer" = type { ptr, i64 }

@.str.2 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 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(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) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN11__sanitizer17internal_getdentsEiPNS_12linux_direntEj(i32 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11__sanitizer20InternalScopedBufferIcE4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11__sanitizer12ThreadLister19GetDirectoryEntriesEv(ptr noundef nonnull align 8 dereferenceable(44) %0) #4 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  br label %9

9:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %10 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 1
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = sext i32 %11 to i64
  store i64 %12, ptr %4, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !15
  %13 = load i64, ptr %4, align 8, !tbaa !15
  %14 = load i64, ptr %5, align 8, !tbaa !15
  %15 = icmp uge i64 %13, %14
  %16 = xor i1 %15, true
  %17 = xor i1 %16, true
  %18 = xor i1 %17, true
  %19 = zext i1 %18 to i64
  %20 = call i64 @llvm.expect.i64(i64 %19, i64 0)
  %21 = icmp ne i64 %20, 0
  br i1 %21, label %22, label %25

22:                                               ; preds = %9
  %23 = load i64, ptr %4, align 8, !tbaa !15
  %24 = load i64, ptr %5, align 8, !tbaa !15
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.2, i32 noundef 788, ptr noundef @.str.12, i64 noundef %23, i64 noundef %24) #7
  unreachable

25:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %28 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 3
  %29 = load i8, ptr %28, align 8, !tbaa !17, !range !18, !noundef !19
  %30 = trunc i8 %29 to i1
  %31 = zext i1 %30 to i64
  store i64 %31, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 1, ptr %7, align 8, !tbaa !15
  %32 = load i64, ptr %6, align 8, !tbaa !15
  %33 = load i64, ptr %7, align 8, !tbaa !15
  %34 = icmp ne i64 %32, %33
  %35 = xor i1 %34, true
  %36 = xor i1 %35, true
  %37 = xor i1 %36, true
  %38 = zext i1 %37 to i64
  %39 = call i64 @llvm.expect.i64(i64 %38, i64 0)
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %27
  %42 = load i64, ptr %6, align 8, !tbaa !15
  %43 = load i64, ptr %7, align 8, !tbaa !15
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.2, i32 noundef 789, ptr noundef @.str.13, i64 noundef %42, i64 noundef %43) #7
  unreachable

44:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %45

45:                                               ; preds = %44
  %46 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 2
  %49 = call noundef ptr @_ZN11__sanitizer20InternalScopedBufferIcE4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %48)
  %50 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 2
  %51 = call noundef i64 @_ZN11__sanitizer20InternalScopedBufferIcE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
  %52 = trunc i64 %51 to i32
  %53 = call noundef i64 @_ZN11__sanitizer17internal_getdentsEiPNS_12linux_direntEj(i32 noundef %47, ptr noundef %49, i32 noundef %52)
  %54 = trunc i64 %53 to i32
  %55 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 6
  store i32 %54, ptr %55, align 8, !tbaa !20
  %56 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 6
  %57 = load i32, ptr %56, align 8, !tbaa !20
  %58 = sext i32 %57 to i64
  %59 = call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %58, ptr noundef null)
  br i1 %59, label %60, label %64

60:                                               ; preds = %45
  %61 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !21
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.14, i32 noundef %62)
  %63 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 3
  store i8 1, ptr %63, align 8, !tbaa !17
  store i1 false, ptr %2, align 1
  br label %74

64:                                               ; preds = %45
  %65 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 6
  %66 = load i32, ptr %65, align 8, !tbaa !20
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  store i1 false, ptr %2, align 1
  br label %74

69:                                               ; preds = %64
  br label %70

70:                                               ; preds = %69
  %71 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 2
  %72 = call noundef ptr @_ZN11__sanitizer20InternalScopedBufferIcE4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %71)
  %73 = getelementptr inbounds %"class.__sanitizer::ThreadLister", ptr %8, i32 0, i32 5
  store ptr %72, ptr %73, align 8, !tbaa !22
  store i1 true, ptr %2, align 1
  br label %74

74:                                               ; preds = %70, %68, %60
  %75 = load i1, ptr %2, align 1
  ret i1 %75
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer20InternalScopedBufferIcE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

attributes #0 = { 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 #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 = { 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 = { "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 = { nounwind }
attributes #7 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"_ZTSN11__sanitizer12ThreadListerE", !11, i64 0, !11, i64 4, !12, i64 8, !14, i64 24, !6, i64 32, !11, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN11__sanitizer20InternalScopedBufferIcEE", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!10, !14, i64 24}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!10, !11, i64 40}
!21 = !{!10, !11, i64 0}
!22 = !{!10, !6, i64 32}


; 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.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef, ptr 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
declare dso_local noundef i64 @_ZN11__sanitizer17internal_getdentsEiPNS_12linux_direntEj(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11__sanitizer20InternalScopedBufferIcE4dataEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN11__sanitizer12ThreadLister19GetDirectoryEntriesEv(ptr noundef nonnull align 8 dereferenceable(44) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !14, !noundef !15
  %.not.not = icmp eq i8 %3, 0
  br i1 %.not.not, label %6, label %4, !prof !16

4:                                                ; preds = %1
  %5 = zext nneg i8 %3 to i64
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.2, i32 noundef 789, ptr noundef nonnull @.str.13, i64 noundef %5, i64 noundef 1) #4
  unreachable

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !17
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = tail call noundef ptr @_ZN11__sanitizer20InternalScopedBufferIcE4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = tail call noundef i64 @_ZN11__sanitizer20InternalScopedBufferIcE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %12 = trunc i64 %11 to i32
  %13 = tail call noundef i64 @_ZN11__sanitizer17internal_getdentsEiPNS_12linux_direntEj(i32 noundef %8, ptr noundef %10, i32 noundef %12)
  %14 = trunc i64 %13 to i32
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %14, ptr %15, align 8, !tbaa !18
  %sext = shl i64 %13, 32
  %16 = ashr exact i64 %sext, 32
  %17 = tail call noundef zeroext i1 @_ZN11__sanitizer16internal_iserrorEmPi(i64 noundef %16, ptr noundef null)
  br i1 %17, label %18, label %20

18:                                               ; preds = %6
  %19 = load i32, ptr %0, align 8, !tbaa !19
  tail call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.14, i32 noundef %19)
  store i8 1, ptr %2, align 8, !tbaa !5
  br label %26

20:                                               ; preds = %6
  %21 = load i32, ptr %15, align 8, !tbaa !18
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %26, label %23

23:                                               ; preds = %20
  %24 = tail call noundef ptr @_ZN11__sanitizer20InternalScopedBufferIcE4dataEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %24, ptr %25, align 8, !tbaa !20
  br label %26

26:                                               ; preds = %20, %23, %18
  %.0 = phi i1 [ false, %18 ], [ true, %23 ], [ false, %20 ]
  ret i1 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer20InternalScopedBufferIcE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #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 = { "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 = { 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, !13, i64 24}
!6 = !{!"_ZTSN11__sanitizer12ThreadListerE", !7, i64 0, !7, i64 4, !10, i64 8, !13, i64 24, !11, i64 32, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11__sanitizer20InternalScopedBufferIcEE", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!17 = !{!6, !7, i64 4}
!18 = !{!6, !7, i64 40}
!19 = !{!6, !7, i64 0}
!20 = !{!6, !11, i64 32}


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