; LLVM IR from DionysiosB/CodeForces :: 0600-0699 (696A-LorenzoVonMatterhorn)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long, long>, std::pair<const std::pair<long, long>, long>, std::_Select1st<std::pair<const std::pair<long, long>, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long, long>, std::pair<const std::pair<long, long>, long>, std::_Select1st<std::pair<const std::pair<long, long>, long>>, std::less<std::pair<long, long>>>::_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 }
%"struct.std::pair" = type { i64, i64 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::map", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #6
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  br label %22

22:                                               ; preds = %170, %0
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = add nsw i64 %23, -1
  store i64 %24, ptr %2, align 8, !tbaa !5
  %25 = icmp ne i64 %23, 0
  br i1 %25, label %26, label %172

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %27 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %28 unwind label %47

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %30 unwind label %47

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %32 unwind label %47

32:                                               ; preds = %30
  %33 = load i64, ptr %4, align 8, !tbaa !5
  %34 = icmp eq i64 %33, 1
  br i1 %34, label %35, label %108

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %37 unwind label %51

37:                                               ; preds = %35
  br label %38

38:                                               ; preds = %97, %37
  %39 = load i64, ptr %5, align 8, !tbaa !5
  %40 = load i64, ptr %6, align 8, !tbaa !5
  %41 = icmp ne i64 %39, %40
  br i1 %41, label %42, label %106

42:                                               ; preds = %38
  %43 = load i64, ptr %5, align 8, !tbaa !5
  %44 = load i64, ptr %6, align 8, !tbaa !5
  %45 = icmp sgt i64 %43, %44
  br i1 %45, label %46, label %55

46:                                               ; preds = %42
  call void @_ZSt4swapIlENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %55

47:                                               ; preds = %30, %28, %26
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %7, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %8, align 4
  br label %171

51:                                               ; preds = %35
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  br label %107

55:                                               ; preds = %46, %42
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %56 = load i64, ptr %6, align 8, !tbaa !5
  %57 = sdiv i64 %56, 2
  store i64 %57, ptr %11, align 8, !tbaa !5
  %58 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %59 unwind label %78

59:                                               ; preds = %55
  %60 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %61 = extractvalue { i64, i64 } %58, 0
  store i64 %61, ptr %60, align 8
  %62 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %63 = extractvalue { i64, i64 } %58, 1
  store i64 %63, ptr %62, align 8
  %64 = invoke noundef i64 @_ZNKSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %65 unwind label %78

65:                                               ; preds = %59
  %66 = icmp ule i64 %64, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br i1 %66, label %67, label %86

67:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %68 = load i64, ptr %6, align 8, !tbaa !5
  %69 = sdiv i64 %68, 2
  store i64 %69, ptr %13, align 8, !tbaa !5
  %70 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %71 unwind label %82

71:                                               ; preds = %67
  %72 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %73 = extractvalue { i64, i64 } %70, 0
  store i64 %73, ptr %72, align 8
  %74 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %75 = extractvalue { i64, i64 } %70, 1
  store i64 %75, ptr %74, align 8
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %77 unwind label %82

77:                                               ; preds = %71
  store i64 0, ptr %76, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %86

78:                                               ; preds = %59, %55
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %7, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br label %107

82:                                               ; preds = %71, %67
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %7, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %107

86:                                               ; preds = %77, %65
  %87 = load i64, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %88 = load i64, ptr %6, align 8, !tbaa !5
  %89 = sdiv i64 %88, 2
  store i64 %89, ptr %15, align 8, !tbaa !5
  %90 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %91 unwind label %102

91:                                               ; preds = %86
  %92 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %93 = extractvalue { i64, i64 } %90, 0
  store i64 %93, ptr %92, align 8
  %94 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %95 = extractvalue { i64, i64 } %90, 1
  store i64 %95, ptr %94, align 8
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %97 unwind label %102

97:                                               ; preds = %91
  %98 = load i64, ptr %96, align 8, !tbaa !5
  %99 = add nsw i64 %98, %87
  store i64 %99, ptr %96, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  %100 = load i64, ptr %6, align 8, !tbaa !5
  %101 = sdiv i64 %100, 2
  store i64 %101, ptr %6, align 8, !tbaa !5
  br label %38, !llvm.loop !9

102:                                              ; preds = %91, %86
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %7, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %107

106:                                              ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %170

107:                                              ; preds = %102, %82, %78, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %171

108:                                              ; preds = %32
  %109 = load i64, ptr %4, align 8, !tbaa !5
  %110 = icmp eq i64 %109, 2
  br i1 %110, label %111, label %169

111:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %155, %111
  %113 = load i64, ptr %5, align 8, !tbaa !5
  %114 = load i64, ptr %6, align 8, !tbaa !5
  %115 = icmp ne i64 %113, %114
  br i1 %115, label %116, label %158

116:                                              ; preds = %112
  %117 = load i64, ptr %5, align 8, !tbaa !5
  %118 = load i64, ptr %6, align 8, !tbaa !5
  %119 = icmp sgt i64 %117, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %116
  call void @_ZSt4swapIlENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %121

121:                                              ; preds = %120, %116
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %122 = load i64, ptr %6, align 8, !tbaa !5
  %123 = sdiv i64 %122, 2
  store i64 %123, ptr %18, align 8, !tbaa !5
  %124 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %125 unwind label %147

125:                                              ; preds = %121
  %126 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %127 = extractvalue { i64, i64 } %124, 0
  store i64 %127, ptr %126, align 8
  %128 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %129 = extractvalue { i64, i64 } %124, 1
  store i64 %129, ptr %128, align 8
  %130 = invoke noundef i64 @_ZNKSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %131 unwind label %147

131:                                              ; preds = %125
  %132 = icmp ugt i64 %130, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br i1 %132, label %133, label %155

133:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %134 = load i64, ptr %6, align 8, !tbaa !5
  %135 = sdiv i64 %134, 2
  store i64 %135, ptr %20, align 8, !tbaa !5
  %136 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %137 unwind label %151

137:                                              ; preds = %133
  %138 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %139 = extractvalue { i64, i64 } %136, 0
  store i64 %139, ptr %138, align 8
  %140 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %141 = extractvalue { i64, i64 } %136, 1
  store i64 %141, ptr %140, align 8
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %143 unwind label %151

143:                                              ; preds = %137
  %144 = load i64, ptr %142, align 8, !tbaa !5
  %145 = load i64, ptr %16, align 8, !tbaa !5
  %146 = add nsw i64 %145, %144
  store i64 %146, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %155

147:                                              ; preds = %125, %121
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %7, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %168

151:                                              ; preds = %137, %133
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %7, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %168

155:                                              ; preds = %143, %131
  %156 = load i64, ptr %6, align 8, !tbaa !5
  %157 = sdiv i64 %156, 2
  store i64 %157, ptr %6, align 8, !tbaa !5
  br label %112, !llvm.loop !11

158:                                              ; preds = %112
  %159 = load i64, ptr %16, align 8, !tbaa !5
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %159)
          to label %161 unwind label %164

161:                                              ; preds = %158
  %162 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %160, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %163 unwind label %164

163:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %169

164:                                              ; preds = %161, %158
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %7, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %8, align 4
  br label %168

168:                                              ; preds = %164, %151, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %171

169:                                              ; preds = %163, %108
  br label %170

170:                                              ; preds = %169, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %22, !llvm.loop !12

171:                                              ; preds = %168, %107, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %174

172:                                              ; preds = %22
  store i32 0, ptr %1, align 4
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %173 = load i32, ptr %1, align 4
  ret i32 %173

174:                                              ; preds = %171
  %175 = load ptr, ptr %7, align 8
  %176 = load i32, ptr %8, align 4
  %177 = insertvalue { ptr, i32 } poison, ptr %175, 0
  %178 = insertvalue { ptr, i32 } %177, i32 %176, 1
  resume { ptr, i32 } %178
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(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.end.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

attributes #0 = { mustprogress norecurse 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 = { 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 = { 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 #5 = { inlinehint 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long, long>, std::pair<const std::pair<long, long>, long>, std::_Select1st<std::pair<const std::pair<long, long>, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long, long>, std::pair<const std::pair<long, long>, long>, std::_Select1st<std::pair<const std::pair<long, long>, long>>, std::less<std::pair<long, long>>>::_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 }
%"struct.std::pair" = type { i64, i64 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::map", align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #6
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr %1, align 8, !tbaa !5
  %.not29 = icmp eq i64 %18, 0
  br i1 %.not29, label %._crit_edge32, label %.lr.ph31

.lr.ph31:                                         ; preds = %0
  %20 = getelementptr inbounds i8, ptr %13, i64 8
  %21 = getelementptr inbounds i8, ptr %15, i64 8
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  %23 = getelementptr inbounds i8, ptr %9, i64 8
  %24 = getelementptr inbounds i8, ptr %11, i64 8
  br label %25

25:                                               ; preds = %.lr.ph31, %125
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %26 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %27 unwind label %43

27:                                               ; preds = %25
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %29 unwind label %43

29:                                               ; preds = %27
  %30 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %31 unwind label %43

31:                                               ; preds = %29
  %32 = load i64, ptr %3, align 8, !tbaa !5
  switch i64 %32, label %125 [
    i64 1, label %35
    i64 2, label %.preheader21
  ]

.preheader21:                                     ; preds = %31
  %33 = load i64, ptr %4, align 8, !tbaa !5
  %34 = load i64, ptr %5, align 8, !tbaa !5
  %.not1424 = icmp eq i64 %33, %34
  br i1 %.not1424, label %._crit_edge, label %.lr.ph

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %.preheader unwind label %45

.preheader:                                       ; preds = %35
  %37 = load i64, ptr %4, align 8, !tbaa !5
  %38 = load i64, ptr %5, align 8, !tbaa !5
  %.not1726 = icmp eq i64 %37, %38
  br i1 %.not1726, label %._crit_edge28, label %.lr.ph27

.lr.ph27:                                         ; preds = %.preheader, %79
  %39 = phi i64 [ %83, %79 ], [ %38, %.preheader ]
  %40 = phi i64 [ %84, %79 ], [ %37, %.preheader ]
  %41 = icmp sgt i64 %40, %39
  br i1 %41, label %42, label %47

42:                                               ; preds = %.lr.ph27
  call void @_ZSt4swapIlENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %.pre33 = load i64, ptr %5, align 8, !tbaa !5
  br label %47

43:                                               ; preds = %29, %27, %25
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %128

45:                                               ; preds = %35
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %87

47:                                               ; preds = %42, %.lr.ph27
  %48 = phi i64 [ %.pre33, %42 ], [ %39, %.lr.ph27 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %49 = sdiv i64 %48, 2
  store i64 %49, ptr %8, align 8, !tbaa !5
  %50 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %51 unwind label %66

51:                                               ; preds = %47
  %52 = extractvalue { i64, i64 } %50, 0
  store i64 %52, ptr %7, align 8
  %53 = extractvalue { i64, i64 } %50, 1
  store i64 %53, ptr %22, align 8
  %54 = invoke noundef i64 @_ZNKSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %55 unwind label %66

55:                                               ; preds = %51
  %56 = icmp eq i64 %54, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br i1 %56, label %57, label %70

57:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %58 = load i64, ptr %5, align 8, !tbaa !5
  %59 = sdiv i64 %58, 2
  store i64 %59, ptr %10, align 8, !tbaa !5
  %60 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %61 unwind label %68

61:                                               ; preds = %57
  %62 = extractvalue { i64, i64 } %60, 0
  store i64 %62, ptr %9, align 8
  %63 = extractvalue { i64, i64 } %60, 1
  store i64 %63, ptr %23, align 8
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %65 unwind label %68

65:                                               ; preds = %61
  store i64 0, ptr %64, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %70

66:                                               ; preds = %51, %47
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  br label %87

68:                                               ; preds = %61, %57
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %87

70:                                               ; preds = %65, %55
  %71 = load i64, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %72 = load i64, ptr %5, align 8, !tbaa !5
  %73 = sdiv i64 %72, 2
  store i64 %73, ptr %12, align 8, !tbaa !5
  %74 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %75 unwind label %85

75:                                               ; preds = %70
  %76 = extractvalue { i64, i64 } %74, 0
  store i64 %76, ptr %11, align 8
  %77 = extractvalue { i64, i64 } %74, 1
  store i64 %77, ptr %24, align 8
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %79 unwind label %85

79:                                               ; preds = %75
  %80 = load i64, ptr %78, align 8, !tbaa !5
  %81 = add nsw i64 %80, %71
  store i64 %81, ptr %78, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  %82 = load i64, ptr %5, align 8, !tbaa !5
  %83 = sdiv i64 %82, 2
  store i64 %83, ptr %5, align 8, !tbaa !5
  %84 = load i64, ptr %4, align 8, !tbaa !5
  %.not17 = icmp eq i64 %84, %83
  br i1 %.not17, label %._crit_edge28, label %.lr.ph27, !llvm.loop !9

85:                                               ; preds = %75, %70
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %87

._crit_edge28:                                    ; preds = %79, %.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %125

87:                                               ; preds = %85, %68, %66, %45
  %.pn18 = phi { ptr, i32 } [ %86, %85 ], [ %69, %68 ], [ %67, %66 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %128

.lr.ph:                                           ; preds = %.preheader21, %116
  %88 = phi i64 [ %118, %116 ], [ %34, %.preheader21 ]
  %89 = phi i64 [ %119, %116 ], [ %33, %.preheader21 ]
  %.025 = phi i64 [ %.1, %116 ], [ 0, %.preheader21 ]
  %90 = icmp sgt i64 %89, %88
  br i1 %90, label %91, label %92

91:                                               ; preds = %.lr.ph
  call void @_ZSt4swapIlENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %.pre = load i64, ptr %5, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %91, %.lr.ph
  %93 = phi i64 [ %.pre, %91 ], [ %88, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %94 = sdiv i64 %93, 2
  store i64 %94, ptr %14, align 8, !tbaa !5
  %95 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %96 unwind label %112

96:                                               ; preds = %92
  %97 = extractvalue { i64, i64 } %95, 0
  store i64 %97, ptr %13, align 8
  %98 = extractvalue { i64, i64 } %95, 1
  store i64 %98, ptr %20, align 8
  %99 = invoke noundef i64 @_ZNKSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEE5countERS4_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %100 unwind label %112

100:                                              ; preds = %96
  %.not15 = icmp eq i64 %99, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  br i1 %.not15, label %116, label %101

101:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %102 = load i64, ptr %5, align 8, !tbaa !5
  %103 = sdiv i64 %102, 2
  store i64 %103, ptr %16, align 8, !tbaa !5
  %104 = invoke { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %105 unwind label %114

105:                                              ; preds = %101
  %106 = extractvalue { i64, i64 } %104, 0
  store i64 %106, ptr %15, align 8
  %107 = extractvalue { i64, i64 } %104, 1
  store i64 %107, ptr %21, align 8
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEEixEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %109 unwind label %114

109:                                              ; preds = %105
  %110 = load i64, ptr %108, align 8, !tbaa !5
  %111 = add nsw i64 %110, %.025
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  br label %116

112:                                              ; preds = %96, %92
  %113 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  br label %128

114:                                              ; preds = %105, %101
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  br label %128

116:                                              ; preds = %109, %100
  %.1 = phi i64 [ %111, %109 ], [ %.025, %100 ]
  %117 = load i64, ptr %5, align 8, !tbaa !5
  %118 = sdiv i64 %117, 2
  store i64 %118, ptr %5, align 8, !tbaa !5
  %119 = load i64, ptr %4, align 8, !tbaa !5
  %.not14 = icmp eq i64 %119, %118
  br i1 %.not14, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %116, %.preheader21
  %.0.lcssa = phi i64 [ 0, %.preheader21 ], [ %.1, %116 ]
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.0.lcssa)
          to label %121 unwind label %123

121:                                              ; preds = %._crit_edge
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %125 unwind label %123

123:                                              ; preds = %121, %._crit_edge
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %128

125:                                              ; preds = %121, %31, %._crit_edge28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %126 = load i64, ptr %1, align 8, !tbaa !5
  %127 = add nsw i64 %126, -1
  store i64 %127, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %126, 0
  br i1 %.not, label %._crit_edge32, label %25, !llvm.loop !12

128:                                              ; preds = %112, %114, %123, %87, %43
  %.pn18.pn = phi { ptr, i32 } [ %.pn18, %87 ], [ %44, %43 ], [ %115, %114 ], [ %113, %112 ], [ %124, %123 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn18.pn

._crit_edge32:                                    ; preds = %125, %0
  call void @_ZNSt3mapISt4pairIllElSt4lessIS1_ESaIS0_IKS1_lEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIlRlESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(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.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

attributes #0 = { mustprogress norecurse 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 = { 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 = { 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 #5 = { inlinehint 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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