; LLVM IR from SHY-Corp/LeetCode-Solutions :: C++/3. LongestSubstringWithoutRepeatingCharacters/Z20findLongestSubstringNSt7/cx_80000945/Z20findLongestSubstringNSt7 (traitsIcESaIcEEE)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20findLongestSubstringNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, 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
  %11 = alloca %"class.std::unordered_map", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %15 = alloca %"struct.std::__detail::_Node_iterator", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %11) #4
  call void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #4
  %18 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0)
          to label %19 unwind label %47

19:                                               ; preds = %2
  %20 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %21 unwind label %47

21:                                               ; preds = %19
  store i32 0, ptr %20, align 4, !tbaa !9
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %93, %21
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %26, label %96

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %28)
          to label %30 unwind label %51

30:                                               ; preds = %26
  %31 = invoke ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %32 unwind label %51

32:                                               ; preds = %30
  %33 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %14, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %33, i32 0, i32 0
  store ptr %31, ptr %34, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %35 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %11) #4
  %36 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %15, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %36, i32 0, i32 0
  store ptr %35, ptr %37, align 8
  %38 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br i1 %38, label %39, label %55

39:                                               ; preds = %32
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %42)
          to label %44 unwind label %47

44:                                               ; preds = %39
  %45 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 1 dereferenceable(1) %43)
          to label %46 unwind label %47

46:                                               ; preds = %44
  store i32 %40, ptr %45, align 4, !tbaa !9
  br label %92

47:                                               ; preds = %107, %89, %84, %79, %75, %59, %55, %44, %39, %19, %2
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %12, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %13, align 4
  br label %113

51:                                               ; preds = %30, %26
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %12, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %113

55:                                               ; preds = %32
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %57)
          to label %59 unwind label %47

59:                                               ; preds = %55
  %60 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 1 dereferenceable(1) %58)
          to label %61 unwind label %47

61:                                               ; preds = %59
  %62 = load i32, ptr %60, align 4, !tbaa !9
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = icmp sge i32 %62, %63
  br i1 %64, label %65, label %84

65:                                               ; preds = %61
  %66 = load i32, ptr %5, align 4, !tbaa !9
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = sub nsw i32 %66, %67
  store i32 %68, ptr %8, align 4, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %65
  %73 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %73, ptr %9, align 4, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %74, ptr %10, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %72, %65
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %77)
          to label %79 unwind label %47

79:                                               ; preds = %75
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 1 dereferenceable(1) %78)
          to label %81 unwind label %47

81:                                               ; preds = %79
  %82 = load i32, ptr %80, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %7, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %81, %61
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %87)
          to label %89 unwind label %47

89:                                               ; preds = %84
  %90 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 1 dereferenceable(1) %88)
          to label %91 unwind label %47

91:                                               ; preds = %89
  store i32 %85, ptr %90, align 4, !tbaa !9
  br label %92

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

93:                                               ; preds = %92
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %5, align 4, !tbaa !9
  br label %22, !llvm.loop !11

96:                                               ; preds = %22
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = load i32, ptr %5, align 4, !tbaa !9
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = sub nsw i32 %98, %99
  %101 = icmp slt i32 %97, %100
  br i1 %101, label %102, label %107

102:                                              ; preds = %96
  %103 = load i32, ptr %5, align 4, !tbaa !9
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = sub nsw i32 %103, %104
  store i32 %105, ptr %9, align 4, !tbaa !9
  %106 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %106, ptr %10, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %102, %96
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %109, i64 noundef %111)
          to label %112 unwind label %47

112:                                              ; preds = %107
  call void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void

113:                                              ; preds = %51, %47
  call void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %12, align 8
  %116 = load i32, ptr %13, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) #2 align 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
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #3 align 2

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 = { 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 = { 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 #4 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z20findLongestSubstringNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::unordered_map", align 8
  %4 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %5 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %6 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %7 = trunc i64 %6 to i32
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #5
  call void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  %8 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef 0)
  %9 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %10 unwind label %.loopexit.split-lp

10:                                               ; preds = %2
  store i32 0, ptr %9, align 4, !tbaa !5
  %11 = icmp sgt i32 %7, 1
  br i1 %11, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %10
  %wide.trip.count = and i64 %6, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %38
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %38 ]
  %.02754 = phi i32 [ undef, %.lr.ph.preheader ], [ %.3, %38 ]
  %.02853 = phi i32 [ 0, %.lr.ph.preheader ], [ %.331, %38 ]
  %.03451 = phi i32 [ 0, %.lr.ph.preheader ], [ %.236, %38 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %12 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %13 = invoke ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %14 unwind label %20

14:                                               ; preds = %.lr.ph
  store ptr %13, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %15 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  store ptr %15, ptr %5, align 8
  %16 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  br i1 %16, label %18, label %22

18:                                               ; preds = %14
  %19 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %38 unwind label %.loopexit

.loopexit:                                        ; preds = %18, %22, %26, %35
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %45

.loopexit.split-lp:                               ; preds = %2, %._crit_edge
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %45

20:                                               ; preds = %.lr.ph
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %45

22:                                               ; preds = %14
  %23 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %24 unwind label %.loopexit

24:                                               ; preds = %22
  %25 = load i32, ptr %23, align 4, !tbaa !5
  %.not = icmp slt i32 %25, %.03451
  br i1 %.not, label %35, label %26

26:                                               ; preds = %24
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %28 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %29 unwind label %.loopexit

29:                                               ; preds = %26
  %30 = trunc nuw nsw i64 %indvars.iv to i32
  %31 = sub nsw i32 %30, %.03451
  %32 = icmp slt i32 %.02853, %31
  %spec.select40 = select i1 %32, i32 %.03451, i32 %.02754
  %spec.select = call i32 @llvm.smax.i32(i32 %.02853, i32 %31)
  %33 = load i32, ptr %28, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  br label %35

35:                                               ; preds = %29, %24
  %.135 = phi i32 [ %34, %29 ], [ %.03451, %24 ]
  %.230 = phi i32 [ %spec.select, %29 ], [ %.02853, %24 ]
  %.2 = phi i32 [ %spec.select40, %29 ], [ %.02754, %24 ]
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv)
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 1 dereferenceable(1) %36)
          to label %38 unwind label %.loopexit

38:                                               ; preds = %35, %18
  %.sink59 = phi ptr [ %19, %18 ], [ %37, %35 ]
  %.236 = phi i32 [ %.03451, %18 ], [ %.135, %35 ]
  %.331 = phi i32 [ %.02853, %18 ], [ %.230, %35 ]
  %.3 = phi i32 [ %.02754, %18 ], [ %.2, %35 ]
  %39 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %39, ptr %.sink59, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %38, %10
  %.034.lcssa = phi i32 [ 0, %10 ], [ %.236, %38 ]
  %.033.lcssa = phi i32 [ 1, %10 ], [ %7, %38 ]
  %.028.lcssa = phi i32 [ 0, %10 ], [ %.331, %38 ]
  %.027.lcssa = phi i32 [ undef, %10 ], [ %.3, %38 ]
  %40 = sub nsw i32 %.033.lcssa, %.034.lcssa
  %41 = icmp slt i32 %.028.lcssa, %40
  %spec.select41 = call i32 @llvm.smax.i32(i32 %.028.lcssa, i32 %40)
  %spec.select42 = select i1 %41, i32 %.034.lcssa, i32 %.027.lcssa
  %42 = sext i32 %spec.select42 to i64
  %43 = zext nneg i32 %spec.select41 to i64
  invoke void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %42, i64 noundef %43)
          to label %44 unwind label %.loopexit.split-lp

44:                                               ; preds = %._crit_edge
  call void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #5
  ret void

45:                                               ; preds = %.loopexit, %.loopexit.split-lp, %20
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn
}

; 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 nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 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
declare void @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

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 = { 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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass