; LLVM IR from imteekay/algorithms :: competitive-programming/uri/threebonacci_sequence.ll (Z9fibonaccii)

; 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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, unsigned long long>, std::_Select1st<std::pair<const int, unsigned long long>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, unsigned long long>, std::_Select1st<std::pair<const int, unsigned long long>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z13hasDigitThreey(i64 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: mustprogress uwtable
define dso_local noundef i64 @_Z9fibonaccii(i32 noundef %0) #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::map", align 8
  %4 = alloca %"class.std::map", align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 1, ptr %5, align 4, !tbaa !5
  %14 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %15 unwind label %22

15:                                               ; preds = %1
  store i64 1, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 2, ptr %8, align 4, !tbaa !5
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %17 unwind label %26

17:                                               ; preds = %15
  store i64 1, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 3, ptr %10, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %81, %17
  %19 = load i32, ptr %9, align 4, !tbaa !5
  %20 = icmp sle i32 %19, 60
  br i1 %20, label %30, label %21

21:                                               ; preds = %18
  store i32 2, ptr %11, align 4
  br label %84

22:                                               ; preds = %1
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %6, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %95

26:                                               ; preds = %15
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %6, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %95

30:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %31 = load i32, ptr %10, align 4, !tbaa !5
  %32 = sub nsw i32 %31, 1
  store i32 %32, ptr %12, align 4, !tbaa !5
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %34 unwind label %62

34:                                               ; preds = %30
  %35 = load i64, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = sub nsw i32 %36, 2
  store i32 %37, ptr %13, align 4, !tbaa !5
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %39 unwind label %66

39:                                               ; preds = %34
  %40 = load i64, ptr %38, align 8, !tbaa !9
  %41 = add i64 %35, %40
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %43 unwind label %66

43:                                               ; preds = %39
  store i64 %41, ptr %42, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %45 unwind label %71

45:                                               ; preds = %43
  %46 = load i64, ptr %44, align 8, !tbaa !9
  %47 = urem i64 %46, 3
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %54, label %49

49:                                               ; preds = %45
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %51 unwind label %71

51:                                               ; preds = %49
  %52 = load i64, ptr %50, align 8, !tbaa !9
  %53 = call noundef zeroext i1 @_Z13hasDigitThreey(i64 noundef %52)
  br i1 %53, label %54, label %75

54:                                               ; preds = %51, %45
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %56 unwind label %71

56:                                               ; preds = %54
  %57 = load i64, ptr %55, align 8, !tbaa !9
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %59 unwind label %71

59:                                               ; preds = %56
  store i64 %57, ptr %58, align 8, !tbaa !9
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %9, align 4, !tbaa !5
  br label %75

62:                                               ; preds = %30
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %6, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %7, align 4
  br label %70

66:                                               ; preds = %39, %34
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %85

71:                                               ; preds = %56, %54, %49, %43
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %6, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %7, align 4
  br label %85

75:                                               ; preds = %59, %51
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = icmp sgt i32 %76, %77
  br i1 %78, label %79, label %80

79:                                               ; preds = %75
  store i32 2, ptr %11, align 4
  br label %84

80:                                               ; preds = %75
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %10, align 4, !tbaa !5
  br label %18, !llvm.loop !11

84:                                               ; preds = %79, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %86

85:                                               ; preds = %71, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %94

86:                                               ; preds = %84
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %88 unwind label %90

88:                                               ; preds = %86
  %89 = load i64, ptr %87, align 8, !tbaa !9
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #3
  ret i64 %89

90:                                               ; preds = %86
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %6, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %7, align 4
  br label %94

94:                                               ; preds = %90, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %95

95:                                               ; preds = %94, %26, %22
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #3
  br label %96

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"int", !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, unsigned long long>, std::_Select1st<std::pair<const int, unsigned long long>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, unsigned long long>, std::_Select1st<std::pair<const int, unsigned long long>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z13hasDigitThreey(i64 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: 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 noundef i64 @_Z9fibonaccii(i32 noundef %0) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::map", align 8
  %4 = alloca %"class.std::map", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 1, ptr %5, align 4, !tbaa !5
  %11 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %12 unwind label %15

12:                                               ; preds = %1
  store i64 1, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 2, ptr %6, align 4, !tbaa !5
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %14 unwind label %17

14:                                               ; preds = %12
  store i64 1, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  store i32 3, ptr %8, align 4, !tbaa !5
  br label %19

15:                                               ; preds = %1
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %70

17:                                               ; preds = %12
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  br label %70

19:                                               ; preds = %14, %58
  %storemerge11 = phi i32 [ 2, %14 ], [ %59, %58 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #3
  store i32 %storemerge11, ptr %9, align 4, !tbaa !5
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %21 unwind label %49

21:                                               ; preds = %19
  %22 = load i64, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = add nsw i32 %23, -2
  store i32 %24, ptr %10, align 4, !tbaa !5
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %26 unwind label %51

26:                                               ; preds = %21
  %27 = load i64, ptr %25, align 8, !tbaa !9
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %29 unwind label %51

29:                                               ; preds = %26
  %30 = add i64 %27, %22
  store i64 %30, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #3
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %32 unwind label %54

32:                                               ; preds = %29
  %33 = load i64, ptr %31, align 8, !tbaa !9
  %34 = urem i64 %33, 3
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %41, label %36

36:                                               ; preds = %32
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %38 unwind label %54

38:                                               ; preds = %36
  %39 = load i64, ptr %37, align 8, !tbaa !9
  %40 = call noundef zeroext i1 @_Z13hasDigitThreey(i64 noundef %39)
  br i1 %40, label %41, label %._crit_edge

._crit_edge:                                      ; preds = %38
  %.pre = load i32, ptr %7, align 4, !tbaa !5
  br label %56

41:                                               ; preds = %38, %32
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %43 unwind label %54

43:                                               ; preds = %41
  %44 = load i64, ptr %42, align 8, !tbaa !9
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %46 unwind label %54

46:                                               ; preds = %43
  store i64 %44, ptr %45, align 8, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %7, align 4, !tbaa !5
  br label %56

49:                                               ; preds = %19
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %53

51:                                               ; preds = %26, %21
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  br label %53

53:                                               ; preds = %51, %49
  %.pn = phi { ptr, i32 } [ %52, %51 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #3
  br label %64

54:                                               ; preds = %43, %41, %36, %29
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %64

56:                                               ; preds = %._crit_edge, %46
  %.pr = phi i32 [ %.pre, %._crit_edge ], [ %48, %46 ]
  %57 = icmp sgt i32 %.pr, %0
  br i1 %57, label %62, label %58

58:                                               ; preds = %56
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %8, align 4, !tbaa !5
  %61 = icmp slt i32 %.pr, 61
  br i1 %61, label %19, label %62, !llvm.loop !11

62:                                               ; preds = %56, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %65 unwind label %67

64:                                               ; preds = %54, %53
  %.pn6 = phi { ptr, i32 } [ %55, %54 ], [ %.pn, %53 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  br label %69

65:                                               ; preds = %62
  %66 = load i64, ptr %63, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #3
  ret i64 %66

67:                                               ; preds = %62
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %69

69:                                               ; preds = %67, %64
  %.pn8 = phi { ptr, i32 } [ %68, %67 ], [ %.pn6, %64 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %70

70:                                               ; preds = %69, %17, %15
  %.pn8.pn = phi { ptr, i32 } [ %.pn8, %69 ], [ %18, %17 ], [ %16, %15 ]
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #3
  call void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #3
  resume { ptr, i32 } %.pn8.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiySt4lessIiESaISt4pairIKiyEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"int", !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass