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

%"struct.__sanitizer::atomic_uintptr_t" = type { i64 }

@_ZN11__sanitizerL21kThreadDescriptorSizeE = external hidden global %"struct.__sanitizer::atomic_uintptr_t", align 8
@.str.12 = external hidden unnamed_addr constant [9 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: mustprogress uwtable
define dso_local noundef i64 @_ZN11__sanitizer20ThreadDescriptorSizeEv() #1 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca [64 x i8], align 16
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %9 = call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef @_ZN11__sanitizerL21kThreadDescriptorSizeE, i32 noundef 1)
  store i64 %9, ptr %2, align 8, !tbaa !5
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = icmp ne i64 %10, 0
  br i1 %11, label %12, label %14

12:                                               ; preds = %0
  %13 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %13, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %103

14:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 64, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %15 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %16 = call i64 @confstr(i32 noundef 2, ptr noundef %15, i64 noundef 64) #5
  store i64 %16, ptr %5, align 8, !tbaa !5
  %17 = load i64, ptr %5, align 8, !tbaa !5
  %18 = icmp ult i64 %17, 64
  br i1 %18, label %19, label %101

19:                                               ; preds = %14
  %20 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %21 = call noundef i32 @_ZN11__sanitizer16internal_strncmpEPKcS1_m(ptr noundef %20, ptr noundef @.str.12, i64 noundef 8)
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %101

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %24 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = call noundef i64 @_ZN11__sanitizer23internal_simple_strtollEPKcPPci(ptr noundef %25, ptr noundef %6, i32 noundef 10)
  %27 = trunc i64 %26 to i32
  store i32 %27, ptr %7, align 4, !tbaa !9
  %28 = load ptr, ptr %6, align 8, !tbaa !11
  %29 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 0
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = icmp ne ptr %28, %30
  br i1 %31, label %32, label %94

32:                                               ; preds = %23
  %33 = load ptr, ptr %6, align 8, !tbaa !11
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %42, label %37

37:                                               ; preds = %32
  %38 = load ptr, ptr %6, align 8, !tbaa !11
  %39 = load i8, ptr %38, align 1, !tbaa !13
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 46
  br i1 %41, label %42, label %94

42:                                               ; preds = %37, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  %43 = load ptr, ptr %6, align 8, !tbaa !11
  %44 = load i8, ptr %43, align 1, !tbaa !13
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 46
  br i1 %46, label %47, label %52

47:                                               ; preds = %42
  %48 = load ptr, ptr %6, align 8, !tbaa !11
  %49 = getelementptr inbounds i8, ptr %48, i64 1
  %50 = call noundef i64 @_ZN11__sanitizer23internal_simple_strtollEPKcPPci(ptr noundef %49, ptr noundef null, i32 noundef 10)
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr %8, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %47, %42
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = icmp sle i32 %53, 3
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  store i64 1696, ptr %2, align 8, !tbaa !5
  br label %93

56:                                               ; preds = %52
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = icmp eq i32 %57, 4
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  store i64 1728, ptr %2, align 8, !tbaa !5
  br label %92

60:                                               ; preds = %56
  %61 = load i32, ptr %7, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 5
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  store i64 1728, ptr %2, align 8, !tbaa !5
  br label %91

64:                                               ; preds = %60
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = icmp sle i32 %65, 9
  br i1 %66, label %67, label %68

67:                                               ; preds = %64
  store i64 1712, ptr %2, align 8, !tbaa !5
  br label %90

68:                                               ; preds = %64
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = icmp eq i32 %69, 10
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  store i64 1776, ptr %2, align 8, !tbaa !5
  br label %89

72:                                               ; preds = %68
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = icmp eq i32 %73, 11
  br i1 %74, label %81, label %75

75:                                               ; preds = %72
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = icmp eq i32 %76, 12
  br i1 %77, label %78, label %82

78:                                               ; preds = %75
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = icmp eq i32 %79, 1
  br i1 %80, label %81, label %82

81:                                               ; preds = %78, %72
  store i64 2288, ptr %2, align 8, !tbaa !5
  br label %88

82:                                               ; preds = %78, %75
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = icmp sle i32 %83, 13
  br i1 %84, label %85, label %86

85:                                               ; preds = %82
  store i64 2304, ptr %2, align 8, !tbaa !5
  br label %87

86:                                               ; preds = %82
  store i64 2304, ptr %2, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %86, %85
  br label %88

88:                                               ; preds = %87, %81
  br label %89

89:                                               ; preds = %88, %71
  br label %90

90:                                               ; preds = %89, %67
  br label %91

91:                                               ; preds = %90, %63
  br label %92

92:                                               ; preds = %91, %59
  br label %93

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

94:                                               ; preds = %93, %37, %23
  %95 = load i64, ptr %2, align 8, !tbaa !5
  %96 = icmp ne i64 %95, 0
  br i1 %96, label %97, label %99

97:                                               ; preds = %94
  %98 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZN11__sanitizer12atomic_storeINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef @_ZN11__sanitizerL21kThreadDescriptorSizeE, i64 noundef %98, i32 noundef 1)
  br label %99

99:                                               ; preds = %97, %94
  %100 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %100, ptr %1, align 8
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %102

101:                                              ; preds = %19, %14
  store i64 0, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %102

102:                                              ; preds = %101, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %4) #5
  br label %103

103:                                              ; preds = %102, %12
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %104 = load i64, ptr %1, align 8
  ret i64 %104
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind
declare i64 @confstr(i32 noundef, ptr noundef, i64 noundef) #3

declare noundef i32 @_ZN11__sanitizer16internal_strncmpEPKcS1_m(ptr noundef, ptr noundef, i64 noundef) #4

declare noundef i64 @_ZN11__sanitizer23internal_simple_strtollEPKcPPci(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer12atomic_storeINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef, i64 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { "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 }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !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__sanitizerL21kThreadDescriptorSizeE = external hidden global %"struct.__sanitizer::atomic_uintptr_t", align 8
@.str.12 = external hidden unnamed_addr constant [9 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: mustprogress uwtable
define dso_local noundef i64 @_ZN11__sanitizer20ThreadDescriptorSizeEv() local_unnamed_addr #1 {
  %1 = alloca [64 x i8], align 16
  %2 = alloca ptr, align 8
  %3 = tail call noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef nonnull @_ZN11__sanitizerL21kThreadDescriptorSizeE, i32 noundef 1)
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %4, label %35

4:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %1) #5
  %5 = call i64 @confstr(i32 noundef 2, ptr noundef nonnull %1, i64 noundef 64) #5
  %6 = icmp ult i64 %5, 64
  br i1 %6, label %7, label %34

7:                                                ; preds = %4
  %8 = call noundef i32 @_ZN11__sanitizer16internal_strncmpEPKcS1_m(ptr noundef nonnull %1, ptr noundef nonnull @.str.12, i64 noundef 8)
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %34

10:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = call noundef i64 @_ZN11__sanitizer23internal_simple_strtollEPKcPPci(ptr noundef nonnull %11, ptr noundef nonnull %2, i32 noundef 10)
  %13 = trunc i64 %12 to i32
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %.not25 = icmp eq ptr %14, %11
  br i1 %.not25, label %33, label %15

15:                                               ; preds = %10
  %16 = load i8, ptr %14, align 1, !tbaa !9
  switch i8 %16, label %33 [
    i8 46, label %17
    i8 0, label %22
  ]

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %14, i64 1
  %19 = call noundef i64 @_ZN11__sanitizer23internal_simple_strtollEPKcPPci(ptr noundef nonnull %18, ptr noundef null, i32 noundef 10)
  %20 = and i64 %19, 4294967295
  %21 = icmp eq i64 %20, 1
  br label %22

22:                                               ; preds = %15, %17
  %.0 = phi i1 [ %21, %17 ], [ false, %15 ]
  %23 = icmp slt i32 %13, 4
  br i1 %23, label %32, label %24

24:                                               ; preds = %22
  %25 = and i32 %13, 2147483646
  %switch = icmp eq i32 %25, 4
  br i1 %switch, label %32, label %26

26:                                               ; preds = %24
  %27 = icmp ult i32 %13, 10
  br i1 %27, label %32, label %28

28:                                               ; preds = %26
  switch i32 %13, label %29 [
    i32 10, label %32
    i32 11, label %31
  ]

29:                                               ; preds = %28
  %30 = icmp eq i32 %13, 12
  %or.cond = and i1 %30, %.0
  br i1 %or.cond, label %31, label %32

31:                                               ; preds = %28, %29
  br label %32

32:                                               ; preds = %31, %22, %24, %26, %28, %29
  %.119.ph = phi i64 [ 2304, %29 ], [ 1776, %28 ], [ 1712, %26 ], [ 1728, %24 ], [ 1696, %22 ], [ 2288, %31 ]
  call void @_ZN11__sanitizer12atomic_storeINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef nonnull @_ZN11__sanitizerL21kThreadDescriptorSizeE, i64 noundef %.119.ph, i32 noundef 1)
  br label %33

33:                                               ; preds = %15, %10, %32
  %.11930 = phi i64 [ %.119.ph, %32 ], [ 0, %10 ], [ 0, %15 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %34

34:                                               ; preds = %4, %7, %33
  %.017 = phi i64 [ %.11930, %33 ], [ 0, %7 ], [ 0, %4 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %1) #5
  br label %35

35:                                               ; preds = %0, %34
  %.1 = phi i64 [ %.017, %34 ], [ %3, %0 ]
  ret i64 %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11__sanitizer11atomic_loadINS_16atomic_uintptr_tEEENT_4TypeEPVKS2_NS_12memory_orderE(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @confstr(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare noundef i32 @_ZN11__sanitizer16internal_strncmpEPKcS1_m(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare noundef i64 @_ZN11__sanitizer23internal_simple_strtollEPKcPPci(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer12atomic_storeINS_16atomic_uintptr_tEEEvPVT_NS2_4TypeENS_12memory_orderE(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { "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 }

!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 = !{!7, !7, i64 0}


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