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

; 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::GenericScopedLock" = type { ptr }
%"struct.__sanitizer::ReportFile" = type { ptr, i32, [4096 x i8], [4096 x i8], i64 }

@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1

declare noundef i64 @_ZN11__sanitizer15internal_strlenEPKc(ptr noundef) #0

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

declare void @_ZN11__sanitizer9CloseFileEi(i32 noundef) #0

declare noundef i32 @_ZN11__sanitizer17internal_snprintfEPcmPKcz(ptr noundef, i64 noundef, ptr noundef, ...) #0

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() #2

; 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__sanitizer10ReportFile13SetReportPathEPKc(ptr noundef nonnull align 8 dereferenceable(8216) %0, ptr noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %13, label %12

12:                                               ; preds = %2
  br label %96

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call noundef i64 @_ZN11__sanitizer15internal_strlenEPKc(ptr noundef %14)
  store i64 %15, ptr %5, align 8, !tbaa !9
  %16 = load i64, ptr %5, align 8, !tbaa !9
  %17 = icmp ugt i64 %16, 3996
  br i1 %17, label %18, label %51

18:                                               ; preds = %13
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 0
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = sext i8 %21 to i32
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 1
  %25 = load i8, ptr %24, align 1, !tbaa !11
  %26 = sext i8 %25 to i32
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 2
  %29 = load i8, ptr %28, align 1, !tbaa !11
  %30 = sext i8 %29 to i32
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 3
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %34 = sext i8 %33 to i32
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 5
  %41 = load i8, ptr %40, align 1, !tbaa !11
  %42 = sext i8 %41 to i32
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 6
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = sext i8 %45 to i32
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 7
  %49 = load i8, ptr %48, align 1, !tbaa !11
  %50 = sext i8 %49 to i32
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.4, i32 noundef %22, i32 noundef %26, i32 noundef %30, i32 noundef %34, i32 noundef %38, i32 noundef %42, i32 noundef %46, i32 noundef %50)
  call void @_ZN11__sanitizer3DieEv() #6
  unreachable

51:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %52 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !12
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %53)
  %54 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  %55 = load i32, ptr %54, align 8, !tbaa !15
  %56 = icmp ne i32 %55, 1
  br i1 %56, label %57, label %73

57:                                               ; preds = %51
  %58 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  %59 = load i32, ptr %58, align 8, !tbaa !15
  %60 = icmp ne i32 %59, 2
  br i1 %60, label %61, label %73

61:                                               ; preds = %57
  %62 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !15
  %64 = icmp ne i32 %63, -1
  br i1 %64, label %65, label %73

65:                                               ; preds = %61
  %66 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !15
  invoke void @_ZN11__sanitizer9CloseFileEi(i32 noundef %67)
          to label %68 unwind label %69

68:                                               ; preds = %65
  br label %73

69:                                               ; preds = %88, %81, %73, %65
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %7, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %8, align 4
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %97

73:                                               ; preds = %68, %61, %57, %51
  %74 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  store i32 -1, ptr %74, align 8, !tbaa !15
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = invoke noundef i32 @_ZN11__sanitizer15internal_strcmpEPKcS1_(ptr noundef %75, ptr noundef @.str.5)
          to label %77 unwind label %69

77:                                               ; preds = %73
  %78 = icmp eq i32 %76, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %77
  %80 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  store i32 1, ptr %80, align 8, !tbaa !15
  br label %95

81:                                               ; preds = %77
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = invoke noundef i32 @_ZN11__sanitizer15internal_strcmpEPKcS1_(ptr noundef %82, ptr noundef @.str.6)
          to label %84 unwind label %69

84:                                               ; preds = %81
  %85 = icmp eq i32 %83, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %84
  %87 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 1
  store i32 2, ptr %87, align 8, !tbaa !15
  br label %94

88:                                               ; preds = %84
  %89 = getelementptr inbounds %"struct.__sanitizer::ReportFile", ptr %9, i32 0, i32 2
  %90 = getelementptr inbounds [4096 x i8], ptr %89, i64 0, i64 0
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = invoke noundef i32 (ptr, i64, ptr, ...) @_ZN11__sanitizer17internal_snprintfEPcmPKcz(ptr noundef %90, i64 noundef 4096, ptr noundef @.str.7, ptr noundef %91)
          to label %93 unwind label %69

93:                                               ; preds = %88
  br label %94

94:                                               ; preds = %93, %86
  br label %95

95:                                               ; preds = %94, %79
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %96

96:                                               ; preds = %95, %12
  ret void

97:                                               ; preds = %69
  %98 = load ptr, ptr %7, align 8
  %99 = load i32, ptr %8, align 4
  %100 = insertvalue { ptr, i32 } poison, ptr %98, 0
  %101 = insertvalue { ptr, i32 } %100, i32 %99, 1
  resume { ptr, i32 } %101
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZN11__sanitizer15internal_strcmpEPKcS1_(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

attributes #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 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTSN11__sanitizer10ReportFileE", !6, i64 0, !14, i64 8, !7, i64 12, !7, i64 4108, !10, i64 8208}
!14 = !{!"int", !7, i64 0}
!15 = !{!13, !14, i64 8}


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

%"class.__sanitizer::GenericScopedLock" = type { ptr }

@.str.4 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1

declare noundef i64 @_ZN11__sanitizer15internal_strlenEPKc(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

declare void @_ZN11__sanitizer9CloseFileEi(i32 noundef) local_unnamed_addr #0

declare noundef i32 @_ZN11__sanitizer17internal_snprintfEPcmPKcz(ptr noundef, i64 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() 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__sanitizer10ReportFile13SetReportPathEPKc(ptr noundef nonnull align 8 dereferenceable(8216) %0, ptr noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__sanitizer::GenericScopedLock", align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %50, label %4

4:                                                ; preds = %2
  %5 = tail call noundef i64 @_ZN11__sanitizer15internal_strlenEPKc(ptr noundef nonnull %1)
  %6 = icmp ugt i64 %5, 3996
  br i1 %6, label %7, label %31

7:                                                ; preds = %4
  %8 = load i8, ptr %1, align 1, !tbaa !5
  %9 = sext i8 %8 to i32
  %10 = getelementptr inbounds i8, ptr %1, i64 1
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = sext i8 %11 to i32
  %13 = getelementptr inbounds i8, ptr %1, i64 2
  %14 = load i8, ptr %13, align 1, !tbaa !5
  %15 = sext i8 %14 to i32
  %16 = getelementptr inbounds i8, ptr %1, i64 3
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = sext i8 %17 to i32
  %19 = getelementptr inbounds i8, ptr %1, i64 4
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = sext i8 %20 to i32
  %22 = getelementptr inbounds i8, ptr %1, i64 5
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = sext i8 %23 to i32
  %25 = getelementptr inbounds i8, ptr %1, i64 6
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = sext i8 %26 to i32
  %28 = getelementptr inbounds i8, ptr %1, i64 7
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = sext i8 %29 to i32
  tail call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.4, i32 noundef %9, i32 noundef %12, i32 noundef %15, i32 noundef %18, i32 noundef %21, i32 noundef %24, i32 noundef %27, i32 noundef %30)
  tail call void @_ZN11__sanitizer3DieEv() #5
  unreachable

31:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %32 = load ptr, ptr %0, align 8, !tbaa !8
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %32)
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !13
  switch i32 %34, label %35 [
    i32 1, label %38
    i32 2, label %38
    i32 -1, label %38
  ]

35:                                               ; preds = %31
  invoke void @_ZN11__sanitizer9CloseFileEi(i32 noundef %34)
          to label %38 unwind label %36

36:                                               ; preds = %46, %42, %38, %35
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %37

38:                                               ; preds = %31, %31, %31, %35
  store i32 -1, ptr %33, align 8, !tbaa !13
  %39 = invoke noundef i32 @_ZN11__sanitizer15internal_strcmpEPKcS1_(ptr noundef nonnull %1, ptr noundef nonnull @.str.5)
          to label %40 unwind label %36

40:                                               ; preds = %38
  %41 = icmp eq i32 %39, 0
  br i1 %41, label %.sink.split, label %42

42:                                               ; preds = %40
  %43 = invoke noundef i32 @_ZN11__sanitizer15internal_strcmpEPKcS1_(ptr noundef nonnull %1, ptr noundef nonnull @.str.6)
          to label %44 unwind label %36

44:                                               ; preds = %42
  %45 = icmp eq i32 %43, 0
  br i1 %45, label %.sink.split, label %46

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %0, i64 12
  %48 = invoke noundef i32 (ptr, i64, ptr, ...) @_ZN11__sanitizer17internal_snprintfEPcmPKcz(ptr noundef nonnull %47, i64 noundef 4096, ptr noundef nonnull @.str.7, ptr noundef nonnull %1)
          to label %49 unwind label %36

.sink.split:                                      ; preds = %44, %40
  %.sink = phi i32 [ 1, %40 ], [ 2, %44 ]
  store i32 %.sink, ptr %33, align 8, !tbaa !13
  br label %49

49:                                               ; preds = %.sink.split, %46
  call void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %50

50:                                               ; preds = %2, %49
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZN11__sanitizer15internal_strcmpEPKcS1_(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11__sanitizer17GenericScopedLockINS_15StaticSpinMutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

attributes #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 = { 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 = { 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 = { noreturn }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"_ZTSN11__sanitizer10ReportFileE", !10, i64 0, !11, i64 8, !6, i64 12, !6, i64 4108, !12, i64 8208}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"long", !6, i64 0}
!13 = !{!9, !11, i64 8}


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