; LLVM IR from abeaumont/competitive-programming :: hackerearth/january-circuits-18 (buying-items)

; 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::unordered_set" = 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::pair" = type <{ %"struct.std::__detail::_Node_iterator", i8, [7 x i8] }>
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@best = external dso_local global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z1sRKSt6vectorIS_IiSaIiEESaIS1_EERSt13unordered_setIiSt4hashIiESt8equal_toIiES0_Eiiix(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i64 noundef %5) #0 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::unordered_set", align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %21 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i64 %5, ptr %12, align 8, !tbaa !11
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = call noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %23) #4
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = icmp eq i64 %24, %26
  br i1 %27, label %28, label %31

28:                                               ; preds = %6
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @best, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %30 = load i64, ptr %29, align 8, !tbaa !11
  store i64 %30, ptr @best, align 8, !tbaa !11
  br label %31

31:                                               ; preds = %28, %6
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = icmp eq i32 %32, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  br label %136

36:                                               ; preds = %31
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  %43 = load i64, ptr %12, align 8, !tbaa !11
  call void @_Z1sRKSt6vectorIS_IiSaIiEESaIS1_EERSt13unordered_setIiSt4hashIiESt8equal_toIiES0_Eiiix(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(56) %38, i32 noundef %39, i32 noundef %40, i32 noundef %42, i64 noundef %43)
  call void @llvm.lifetime.start.p0(i64 56, ptr %13) #4
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %83, %36
  %45 = load i32, ptr %14, align 4, !tbaa !9
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %86

49:                                               ; preds = %44
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %52) #4
  %54 = load i32, ptr %14, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55) #4
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %82

59:                                               ; preds = %49
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = invoke noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(56) %60, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %62 unwind label %78

62:                                               ; preds = %59
  %63 = icmp ne i64 %61, 0
  br i1 %63, label %82, label %64

64:                                               ; preds = %62
  %65 = invoke { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %66 unwind label %78

66:                                               ; preds = %64
  %67 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %68 = extractvalue { ptr, i8 } %65, 0
  store ptr %68, ptr %67, align 8
  %69 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %70 = extractvalue { ptr, i8 } %65, 1
  store i8 %70, ptr %69, align 8
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = invoke { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56) %71, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %73 unwind label %78

73:                                               ; preds = %66
  %74 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %75 = extractvalue { ptr, i8 } %72, 0
  store ptr %75, ptr %74, align 8
  %76 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %77 = extractvalue { ptr, i8 } %72, 1
  store i8 %77, ptr %76, align 8
  br label %82

78:                                               ; preds = %66, %64, %59
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %15, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %137

82:                                               ; preds = %73, %62, %49
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %14, align 4, !tbaa !9
  br label %44, !llvm.loop !13

86:                                               ; preds = %48
  %87 = call noundef zeroext i1 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  br i1 %87, label %135, label %88

88:                                               ; preds = %86
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  %95 = load i64, ptr %12, align 8, !tbaa !11
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %96, i64 noundef %98) #4
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %99, i64 noundef %101) #4
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = add nsw i64 %95, %104
  invoke void @_Z1sRKSt6vectorIS_IiSaIiEESaIS1_EERSt13unordered_setIiSt4hashIiESt8equal_toIiES0_Eiiix(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 8 dereferenceable(56) %90, i32 noundef %91, i32 noundef %92, i32 noundef %94, i64 noundef %105)
          to label %106 unwind label %118

106:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store ptr %13, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %107 = load ptr, ptr %19, align 8, !tbaa !5
  %108 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %107) #4
  %109 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %20, i32 0, i32 0
  %110 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %109, i32 0, i32 0
  store ptr %108, ptr %110, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %111 = load ptr, ptr %19, align 8, !tbaa !5
  %112 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %111) #4
  %113 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %21, i32 0, i32 0
  %114 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %113, i32 0, i32 0
  store ptr %112, ptr %114, align 8
  br label %115

115:                                              ; preds = %128, %106
  %116 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  br i1 %116, label %122, label %117

117:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %134

118:                                              ; preds = %88
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %15, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %16, align 4
  br label %137

122:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  %124 = load i32, ptr %123, align 4, !tbaa !9
  store i32 %124, ptr %22, align 4, !tbaa !9
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = invoke noundef i64 @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(56) %125, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %127 unwind label %130

127:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %128

128:                                              ; preds = %127
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorIiLb1ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  br label %115

130:                                              ; preds = %122
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %15, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %137

134:                                              ; preds = %117
  br label %135

135:                                              ; preds = %134, %86
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #4
  br label %136

136:                                              ; preds = %135, %35
  ret void

137:                                              ; preds = %130, %118, %78
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %13) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %13) #4
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %15, align 8
  %140 = load i32, ptr %16, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #2 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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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::unordered_set" = 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 }

@best = external dso_local global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z1sRKSt6vectorIS_IiSaIiEESaIS1_EERSt13unordered_setIiSt4hashIiESt8equal_toIiES0_Eiiix(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i64 noundef %5) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::unordered_set", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %12 = alloca i32, align 4
  store i64 %5, ptr %7, align 8, !tbaa !5
  %13 = tail call noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) %1) #4
  %14 = sext i32 %3 to i64
  %15 = icmp eq i64 %13, %14
  br i1 %15, label %16, label %19

16:                                               ; preds = %6
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @best, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %18 = load i64, ptr %17, align 8, !tbaa !5
  store i64 %18, ptr @best, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %16, %6
  %20 = icmp eq i32 %4, %2
  br i1 %20, label %69, label %21

21:                                               ; preds = %19
  %22 = add nsw i32 %4, 1
  %23 = load i64, ptr %7, align 8, !tbaa !5
  call void @_Z1sRKSt6vectorIS_IiSaIiEESaIS1_EERSt13unordered_setIiSt4hashIiESt8equal_toIiES0_Eiiix(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %2, i32 noundef %3, i32 noundef %22, i64 noundef %23)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #4
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  %24 = icmp sgt i32 %3, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %21
  %25 = sext i32 %4 to i64
  br label %27

._crit_edge:                                      ; preds = %42, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  %26 = call noundef zeroext i1 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  br i1 %26, label %68, label %46

27:                                               ; preds = %.lr.ph, %42
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %25) #4
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %30) #4
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %.not = icmp eq i32 %32, 0
  br i1 %.not, label %42, label %33

33:                                               ; preds = %27
  %34 = invoke noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %35 unwind label %40

35:                                               ; preds = %33
  %.not32 = icmp eq i64 %34, 0
  br i1 %.not32, label %36, label %42

36:                                               ; preds = %35
  %37 = invoke { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %38 unwind label %40

38:                                               ; preds = %36
  %39 = invoke { ptr, i8 } @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %42 unwind label %40

40:                                               ; preds = %38, %36, %33
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  br label %70

42:                                               ; preds = %38, %27, %35
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %9, align 4, !tbaa !9
  %45 = icmp slt i32 %44, %3
  br i1 %45, label %27, label %._crit_edge, !llvm.loop !11

46:                                               ; preds = %._crit_edge
  %47 = load i64, ptr %7, align 8, !tbaa !5
  %48 = sext i32 %4 to i64
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %48) #4
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %14) #4
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = add nsw i64 %47, %52
  invoke void @_Z1sRKSt6vectorIS_IiSaIiEESaIS1_EERSt13unordered_setIiSt4hashIiESt8equal_toIiES0_Eiiix(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %2, i32 noundef %3, i32 noundef %22, i64 noundef %53)
          to label %54 unwind label %58

54:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %55 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  store ptr %55, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %56 = call ptr @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  store ptr %56, ptr %11, align 8
  %57 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %57, label %.lr.ph35, label %._crit_edge36

._crit_edge36:                                    ; preds = %63, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %68

58:                                               ; preds = %46
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %70

.lr.ph35:                                         ; preds = %54, %63
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %61 = load i32, ptr %60, align 4, !tbaa !9
  store i32 %61, ptr %12, align 4, !tbaa !9
  %62 = invoke noundef i64 @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %63 unwind label %66

63:                                               ; preds = %.lr.ph35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorIiLb1ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  %65 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseIiLb0EEES3_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %65, label %.lr.ph35, label %._crit_edge36

66:                                               ; preds = %.lr.ph35
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %70

68:                                               ; preds = %._crit_edge36, %._crit_edge
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #4
  br label %69

69:                                               ; preds = %19, %68
  ret void

70:                                               ; preds = %66, %58, %40
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %67, %66 ], [ %59, %58 ]
  call void @_ZNSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_setIiSt4hashIiESt8equal_toIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt8__detail14_Node_iteratorIiLb1ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass