; LLVM IR from eyangch/competitive-programming :: Codeforces/1417 (e)

; 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" }
%"struct.std::greater" = type { i8 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3getiRA301000_x(i32 noundef, ptr noundef nonnull align 8 dereferenceable(2408000)) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updixiRA301000_x(i32 noundef, i64 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(2408000)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca [301000 x i64], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::greater", align 1
  %16 = alloca [2 x i64], align 16
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::stack", align 8
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair", align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::greater", align 1
  store i32 0, ptr %1, align 4
  %28 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %29 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = zext i32 %35 to i64
  %37 = call ptr @llvm.stacksave.p0()
  store ptr %37, ptr %3, align 8
  %38 = alloca i32, i64 %36, align 16
  store i64 %36, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %39

39:                                               ; preds = %49, %0
  %40 = load i32, ptr %5, align 4, !tbaa !8
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %52

44:                                               ; preds = %39
  %45 = load i32, ptr %5, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %38, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  br label %49

49:                                               ; preds = %44
  %50 = load i32, ptr %5, align 4, !tbaa !8
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !8
  br label %39, !llvm.loop !11

52:                                               ; preds = %43
  %53 = load i32, ptr %2, align 4, !tbaa !8
  %54 = zext i32 %53 to i64
  %55 = alloca %"struct.std::pair", i64 %54, align 16
  store i64 %54, ptr %6, align 8
  %56 = icmp eq i64 %54, 0
  br i1 %56, label %63, label %57

57:                                               ; preds = %52
  %58 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %54
  br label %59

59:                                               ; preds = %59, %57
  %60 = phi ptr [ %55, %57 ], [ %61, %59 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %60)
  %61 = getelementptr inbounds %"struct.std::pair", ptr %60, i64 1
  %62 = icmp eq ptr %61, %58
  br i1 %62, label %63, label %59

63:                                               ; preds = %59, %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %64

64:                                               ; preds = %76, %63
  %65 = load i32, ptr %7, align 4, !tbaa !8
  %66 = load i32, ptr %2, align 4, !tbaa !8
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %79

69:                                               ; preds = %64
  %70 = load i32, ptr %7, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  %72 = load i32, ptr %7, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %73
  %75 = getelementptr inbounds %"struct.std::pair", ptr %74, i32 0, i32 1
  store i32 %71, ptr %75, align 4, !tbaa !13
  br label %76

76:                                               ; preds = %69
  %77 = load i32, ptr %7, align 4, !tbaa !8
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !8
  br label %64, !llvm.loop !15

79:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 2408000, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 29, ptr %11, align 4, !tbaa !8
  br label %80

80:                                               ; preds = %286, %79
  %81 = load i32, ptr %11, align 4, !tbaa !8
  %82 = icmp sge i32 %81, 0
  br i1 %82, label %84, label %83

83:                                               ; preds = %80
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %289

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %85 = load i32, ptr %11, align 4, !tbaa !8
  %86 = shl i32 1, %85
  store i32 %86, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %87

87:                                               ; preds = %110, %84
  %88 = load i32, ptr %14, align 4, !tbaa !8
  %89 = load i32, ptr %2, align 4, !tbaa !8
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %113

92:                                               ; preds = %87
  %93 = load i32, ptr %13, align 4, !tbaa !8
  %94 = load i32, ptr %14, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %95
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 4, !tbaa !13
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %38, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %103 = and i32 %93, %102
  %104 = load i32, ptr %14, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %105
  %107 = getelementptr inbounds %"struct.std::pair", ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 8, !tbaa !18
  %109 = add nsw i32 %108, %103
  store i32 %109, ptr %107, align 8, !tbaa !18
  br label %110

110:                                              ; preds = %92
  %111 = load i32, ptr %14, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %14, align 4, !tbaa !8
  br label %87, !llvm.loop !19

113:                                              ; preds = %91
  %114 = load i32, ptr %2, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %115
  call void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef %55, ptr noundef %116)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  %117 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  store i64 0, ptr %117, align 8, !tbaa !16
  %118 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  store i64 0, ptr %118, align 16, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %119

119:                                              ; preds = %262, %113
  %120 = load i32, ptr %17, align 4, !tbaa !8
  %121 = icmp slt i32 %120, 2
  br i1 %121, label %123, label %122

122:                                              ; preds = %119
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %266

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 80, ptr %18) #8
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
  %124 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 0
  %125 = getelementptr inbounds %"struct.std::pair", ptr %124, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !13
  %127 = load i32, ptr %2, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %126, i64 noundef 1, i32 noundef %127, ptr noundef nonnull align 8 dereferenceable(2408000) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %128 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 0
  %129 = getelementptr inbounds %"struct.std::pair", ptr %128, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 -1, ptr %20, align 4, !tbaa !8
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %129, ptr noundef nonnull align 4 dereferenceable(4) %20)
          to label %130 unwind label %137

130:                                              ; preds = %123
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %18, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %131 unwind label %137

131:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !8
  br label %132

132:                                              ; preds = %207, %131
  %133 = load i32, ptr %23, align 4, !tbaa !8
  %134 = load i32, ptr %2, align 4, !tbaa !8
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %141, label %136

136:                                              ; preds = %132
  store i32 17, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %215

137:                                              ; preds = %130, %123
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %21, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %265

141:                                              ; preds = %132
  br label %142

142:                                              ; preds = %178, %141
  %143 = load i32, ptr %23, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %144
  %146 = getelementptr inbounds %"struct.std::pair", ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 8, !tbaa !18
  %148 = load i32, ptr %13, align 4, !tbaa !8
  %149 = xor i32 %148, -1
  %150 = and i32 %147, %149
  %151 = load i32, ptr %23, align 4, !tbaa !8
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %153
  %155 = getelementptr inbounds %"struct.std::pair", ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 8, !tbaa !18
  %157 = load i32, ptr %13, align 4, !tbaa !8
  %158 = xor i32 %157, -1
  %159 = and i32 %156, %158
  %160 = icmp ne i32 %150, %159
  br i1 %160, label %161, label %165

161:                                              ; preds = %142
  %162 = invoke noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %163 unwind label %179

163:                                              ; preds = %161
  %164 = xor i1 %162, true
  br label %165

165:                                              ; preds = %163, %142
  %166 = phi i1 [ false, %142 ], [ %164, %163 ]
  br i1 %166, label %167, label %183

167:                                              ; preds = %165
  %168 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %169 unwind label %179

169:                                              ; preds = %167
  %170 = getelementptr inbounds %"struct.std::pair", ptr %168, i32 0, i32 0
  %171 = load i32, ptr %170, align 4, !tbaa !18
  %172 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %173 unwind label %179

173:                                              ; preds = %169
  %174 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !13
  %176 = sext i32 %175 to i64
  %177 = load i32, ptr %2, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %171, i64 noundef %176, i32 noundef %177, ptr noundef nonnull align 8 dereferenceable(2408000) %10)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %178 unwind label %179

178:                                              ; preds = %173
  br label %142, !llvm.loop !20

179:                                              ; preds = %173, %169, %167, %161
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %21, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %22, align 4
  br label %214

183:                                              ; preds = %165
  %184 = load i32, ptr %23, align 4, !tbaa !8
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %185
  %187 = getelementptr inbounds %"struct.std::pair", ptr %186, i32 0, i32 1
  %188 = load i32, ptr %187, align 4, !tbaa !13
  %189 = call noundef i64 @_Z3getiRA301000_x(i32 noundef %188, ptr noundef nonnull align 8 dereferenceable(2408000) %10)
  %190 = load i32, ptr %17, align 4, !tbaa !8
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 %191
  %193 = load i64, ptr %192, align 8, !tbaa !16
  %194 = add nsw i64 %193, %189
  store i64 %194, ptr %192, align 8, !tbaa !16
  %195 = load i32, ptr %23, align 4, !tbaa !8
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %196
  %198 = getelementptr inbounds %"struct.std::pair", ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 4, !tbaa !13
  %200 = load i32, ptr %2, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %199, i64 noundef 1, i32 noundef %200, ptr noundef nonnull align 8 dereferenceable(2408000) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %201 = load i32, ptr %23, align 4, !tbaa !8
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %202
  %204 = getelementptr inbounds %"struct.std::pair", ptr %203, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  store i32 -1, ptr %25, align 4, !tbaa !8
  invoke void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %204, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %205 unwind label %210

205:                                              ; preds = %183
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %18, ptr noundef nonnull align 4 dereferenceable(8) %24)
          to label %206 unwind label %210

206:                                              ; preds = %205
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %23, align 4, !tbaa !8
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %23, align 4, !tbaa !8
  br label %132, !llvm.loop !21

210:                                              ; preds = %205, %183
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %21, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  br label %214

214:                                              ; preds = %210, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %265

215:                                              ; preds = %136
  br label %216

216:                                              ; preds = %231, %215
  %217 = invoke noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %218 unwind label %232

218:                                              ; preds = %216
  %219 = xor i1 %217, true
  br i1 %219, label %220, label %236

220:                                              ; preds = %218
  %221 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %222 unwind label %232

222:                                              ; preds = %220
  %223 = getelementptr inbounds %"struct.std::pair", ptr %221, i32 0, i32 0
  %224 = load i32, ptr %223, align 4, !tbaa !18
  %225 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %226 unwind label %232

226:                                              ; preds = %222
  %227 = getelementptr inbounds %"struct.std::pair", ptr %225, i32 0, i32 1
  %228 = load i32, ptr %227, align 4, !tbaa !13
  %229 = sext i32 %228 to i64
  %230 = load i32, ptr %2, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %224, i64 noundef %229, i32 noundef %230, ptr noundef nonnull align 8 dereferenceable(2408000) %10)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %231 unwind label %232

231:                                              ; preds = %226
  br label %216, !llvm.loop !22

232:                                              ; preds = %256, %226, %222, %220, %216
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %21, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %22, align 4
  br label %265

236:                                              ; preds = %218
  %237 = load i32, ptr %17, align 4, !tbaa !8
  %238 = icmp eq i32 %237, 0
  br i1 %238, label %239, label %261

239:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !8
  br label %240

240:                                              ; preds = %253, %239
  %241 = load i32, ptr %26, align 4, !tbaa !8
  %242 = load i32, ptr %2, align 4, !tbaa !8
  %243 = icmp slt i32 %241, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %240
  store i32 24, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %256

245:                                              ; preds = %240
  %246 = load i32, ptr %13, align 4, !tbaa !8
  %247 = load i32, ptr %26, align 4, !tbaa !8
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %248
  %250 = getelementptr inbounds %"struct.std::pair", ptr %249, i32 0, i32 0
  %251 = load i32, ptr %250, align 8, !tbaa !18
  %252 = xor i32 %251, %246
  store i32 %252, ptr %250, align 8, !tbaa !18
  br label %253

253:                                              ; preds = %245
  %254 = load i32, ptr %26, align 4, !tbaa !8
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %26, align 4, !tbaa !8
  br label %240, !llvm.loop !23

256:                                              ; preds = %244
  %257 = load i32, ptr %2, align 4, !tbaa !8
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds %"struct.std::pair", ptr %55, i64 %258
  invoke void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef %55, ptr noundef %259)
          to label %260 unwind label %232

260:                                              ; preds = %256
  br label %261

261:                                              ; preds = %260, %236
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %18) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %18) #8
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %17, align 4, !tbaa !8
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %17, align 4, !tbaa !8
  br label %119, !llvm.loop !24

265:                                              ; preds = %232, %214, %137
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %18) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 2408000, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %298

266:                                              ; preds = %122
  %267 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %268 = load i64, ptr %267, align 16, !tbaa !16
  %269 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  %270 = load i64, ptr %269, align 8, !tbaa !16
  %271 = icmp sle i64 %268, %270
  br i1 %271, label %272, label %277

272:                                              ; preds = %266
  %273 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 0
  %274 = load i64, ptr %273, align 16, !tbaa !16
  %275 = load i64, ptr %9, align 8, !tbaa !16
  %276 = add nsw i64 %275, %274
  store i64 %276, ptr %9, align 8, !tbaa !16
  br label %285

277:                                              ; preds = %266
  %278 = getelementptr inbounds [2 x i64], ptr %16, i64 0, i64 1
  %279 = load i64, ptr %278, align 8, !tbaa !16
  %280 = load i64, ptr %9, align 8, !tbaa !16
  %281 = add nsw i64 %280, %279
  store i64 %281, ptr %9, align 8, !tbaa !16
  %282 = load i32, ptr %13, align 4, !tbaa !8
  %283 = load i32, ptr %8, align 4, !tbaa !8
  %284 = or i32 %283, %282
  store i32 %284, ptr %8, align 4, !tbaa !8
  br label %285

285:                                              ; preds = %277, %272
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %11, align 4, !tbaa !8
  %288 = add nsw i32 %287, -1
  store i32 %288, ptr %11, align 4, !tbaa !8
  br label %80, !llvm.loop !25

289:                                              ; preds = %83
  %290 = load i64, ptr %9, align 8, !tbaa !16
  %291 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %290)
  %292 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %291, ptr noundef @.str)
  %293 = load i32, ptr %8, align 4, !tbaa !8
  %294 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %292, i32 noundef %293)
  %295 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %294, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 2408000, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %296 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %296)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %297 = load i32, ptr %1, align 4
  ret i32 %297

298:                                              ; preds = %265
  %299 = load ptr, ptr %21, align 8
  %300 = load i32, ptr %22, align 4
  %301 = insertvalue { ptr, i32 } poison, ptr %299, 0
  %302 = insertvalue { ptr, i32 } %301, i32 %300, 1
  resume { ptr, i32 } %302
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #0 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 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: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { "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 willreturn }
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 = { 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 #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 4}
!14 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!15 = distinct !{!15, !12}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !10, i64 0}
!18 = !{!14, !9, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3getiRA301000_x(i32 noundef, ptr noundef nonnull align 8 dereferenceable(2408000)) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updixiRA301000_x(i32 noundef, i64 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(2408000)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca [301000 x i64], align 16
  %3 = alloca %"class.std::stack", align 8
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %15 = load i32, ptr %1, align 4, !tbaa !8
  %16 = zext i32 %15 to i64
  %17 = call ptr @llvm.stacksave.p0()
  %18 = alloca i32, i64 %16, align 16
  %19 = load i32, ptr %1, align 4, !tbaa !8
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa71 = phi i32 [ %19, %0 ], [ %26, %.lr.ph ]
  %21 = zext i32 %.lcssa71 to i64
  %22 = alloca %"struct.std::pair", i64 %21, align 16
  %23 = icmp eq i32 %.lcssa71, 0
  br i1 %23, label %._crit_edge76, label %29

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %24 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr %1, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !11

29:                                               ; preds = %._crit_edge
  %30 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %21
  br label %31

31:                                               ; preds = %31, %29
  %32 = phi ptr [ %22, %29 ], [ %33, %31 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %32)
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = icmp eq ptr %33, %30
  br i1 %34, label %.loopexit, label %31

.loopexit:                                        ; preds = %31
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  %35 = icmp sgt i32 %.pre, 0
  br i1 %35, label %.lr.ph75.preheader, label %._crit_edge76

.lr.ph75.preheader:                               ; preds = %.loopexit
  %wide.trip.count = zext nneg i32 %.pre to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %36 = icmp ult i32 %.pre, 8
  br i1 %36, label %._crit_edge76.loopexit.unr-lcssa, label %.lr.ph75.preheader.new

.lr.ph75.preheader.new:                           ; preds = %.lr.ph75.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  br label %.lr.ph75

._crit_edge76.loopexit.unr-lcssa:                 ; preds = %.lr.ph75, %.lr.ph75.preheader
  %indvars.iv99.unr = phi i64 [ 0, %.lr.ph75.preheader ], [ %indvars.iv.next100.7, %.lr.ph75 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge76, label %.lr.ph75.epil

.lr.ph75.epil:                                    ; preds = %._crit_edge76.loopexit.unr-lcssa, %.lr.ph75.epil
  %indvars.iv99.epil = phi i64 [ %indvars.iv.next100.epil, %.lr.ph75.epil ], [ %indvars.iv99.unr, %._crit_edge76.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph75.epil ], [ 0, %._crit_edge76.loopexit.unr-lcssa ]
  %indvars.iv.next100.epil = add nuw nsw i64 %indvars.iv99.epil, 1
  %37 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv99.epil, i32 1
  %38 = trunc nuw nsw i64 %indvars.iv.next100.epil to i32
  store i32 %38, ptr %37, align 4, !tbaa !13
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge76, label %.lr.ph75.epil, !llvm.loop !15

._crit_edge76:                                    ; preds = %._crit_edge76.loopexit.unr-lcssa, %.lr.ph75.epil, %._crit_edge, %.loopexit
  call void @llvm.lifetime.start.p0(i64 2408000, ptr nonnull %2) #9
  %invariant.gep = getelementptr i8, ptr %18, i64 -4
  %39 = getelementptr inbounds i8, ptr %22, i64 4
  br label %61

.lr.ph75:                                         ; preds = %.lr.ph75, %.lr.ph75.preheader.new
  %indvars.iv99 = phi i64 [ 0, %.lr.ph75.preheader.new ], [ %indvars.iv.next100.7, %.lr.ph75 ]
  %niter = phi i64 [ 0, %.lr.ph75.preheader.new ], [ %niter.next.7, %.lr.ph75 ]
  %indvars.iv.next100 = or disjoint i64 %indvars.iv99, 1
  %40 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv99, i32 1
  %41 = trunc nuw nsw i64 %indvars.iv.next100 to i32
  store i32 %41, ptr %40, align 4, !tbaa !13
  %indvars.iv.next100.1 = or disjoint i64 %indvars.iv99, 2
  %42 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100, i32 1
  %43 = trunc nuw nsw i64 %indvars.iv.next100.1 to i32
  store i32 %43, ptr %42, align 4, !tbaa !13
  %indvars.iv.next100.2 = or disjoint i64 %indvars.iv99, 3
  %44 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100.1, i32 1
  %45 = trunc nuw nsw i64 %indvars.iv.next100.2 to i32
  store i32 %45, ptr %44, align 4, !tbaa !13
  %indvars.iv.next100.3 = or disjoint i64 %indvars.iv99, 4
  %46 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100.2, i32 1
  %47 = trunc nuw nsw i64 %indvars.iv.next100.3 to i32
  store i32 %47, ptr %46, align 4, !tbaa !13
  %indvars.iv.next100.4 = or disjoint i64 %indvars.iv99, 5
  %48 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100.3, i32 1
  %49 = trunc nuw nsw i64 %indvars.iv.next100.4 to i32
  store i32 %49, ptr %48, align 4, !tbaa !13
  %indvars.iv.next100.5 = or disjoint i64 %indvars.iv99, 6
  %50 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100.4, i32 1
  %51 = trunc nuw nsw i64 %indvars.iv.next100.5 to i32
  store i32 %51, ptr %50, align 4, !tbaa !13
  %indvars.iv.next100.6 = or disjoint i64 %indvars.iv99, 7
  %52 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100.5, i32 1
  %53 = trunc nuw nsw i64 %indvars.iv.next100.6 to i32
  store i32 %53, ptr %52, align 4, !tbaa !13
  %indvars.iv.next100.7 = add nuw nsw i64 %indvars.iv99, 8
  %54 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next100.6, i32 1
  %55 = trunc nuw nsw i64 %indvars.iv.next100.7 to i32
  store i32 %55, ptr %54, align 4, !tbaa !13
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge76.loopexit.unr-lcssa, label %.lr.ph75, !llvm.loop !17

56:                                               ; preds = %._crit_edge89.1
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.1)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %58, i32 noundef %.149)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 2408000, ptr nonnull %2) #9
  call void @llvm.stackrestore.p0(ptr %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0

61:                                               ; preds = %._crit_edge76, %._crit_edge89.1
  %.04697 = phi i32 [ 29, %._crit_edge76 ], [ %206, %._crit_edge89.1 ]
  %.04796 = phi i64 [ 0, %._crit_edge76 ], [ %.1, %._crit_edge89.1 ]
  %.04895 = phi i32 [ 0, %._crit_edge76 ], [ %.149, %._crit_edge89.1 ]
  %62 = shl nuw i32 1, %.04697
  %63 = load i32, ptr %1, align 4, !tbaa !8
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph79.preheader, label %._crit_edge80

.lr.ph79.preheader:                               ; preds = %61
  %wide.trip.count105 = zext nneg i32 %63 to i64
  %xtraiter128 = and i64 %wide.trip.count105, 1
  %65 = icmp eq i32 %63, 1
  br i1 %65, label %._crit_edge80.loopexit.unr-lcssa, label %.lr.ph79.preheader.new

.lr.ph79.preheader.new:                           ; preds = %.lr.ph79.preheader
  %unroll_iter131 = and i64 %wide.trip.count105, 2147483646
  br label %.lr.ph79

._crit_edge80.loopexit.unr-lcssa:                 ; preds = %.lr.ph79, %.lr.ph79.preheader
  %indvars.iv102.unr = phi i64 [ 0, %.lr.ph79.preheader ], [ %indvars.iv.next103.1, %.lr.ph79 ]
  %lcmp.mod130.not = icmp eq i64 %xtraiter128, 0
  br i1 %lcmp.mod130.not, label %._crit_edge80, label %.lr.ph79.epil

.lr.ph79.epil:                                    ; preds = %._crit_edge80.loopexit.unr-lcssa
  %66 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv102.unr
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = sext i32 %68 to i64
  %gep.epil = getelementptr i32, ptr %invariant.gep, i64 %69
  %70 = load i32, ptr %gep.epil, align 4, !tbaa !8
  %71 = and i32 %70, %62
  %72 = load i32, ptr %66, align 8, !tbaa !18
  %73 = add nsw i32 %72, %71
  store i32 %73, ptr %66, align 8, !tbaa !18
  br label %._crit_edge80

._crit_edge80:                                    ; preds = %.lr.ph79.epil, %._crit_edge80.loopexit.unr-lcssa, %61
  %74 = sext i32 %63 to i64
  %75 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %74
  call void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef nonnull %22, ptr noundef nonnull %75)
  %76 = xor i32 %62, -1
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #9
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %77 = load i32, ptr %39, align 4, !tbaa !13
  %78 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %77, i64 noundef 1, i32 noundef %78, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  store i32 -1, ptr %5, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %5)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %95 unwind label %105

.lr.ph79:                                         ; preds = %.lr.ph79, %.lr.ph79.preheader.new
  %indvars.iv102 = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %indvars.iv.next103.1, %.lr.ph79 ]
  %niter132 = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %niter132.next.1, %.lr.ph79 ]
  %79 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv102
  %80 = getelementptr inbounds i8, ptr %79, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !13
  %82 = sext i32 %81 to i64
  %gep = getelementptr i32, ptr %invariant.gep, i64 %82
  %83 = load i32, ptr %gep, align 4, !tbaa !8
  %84 = and i32 %83, %62
  %85 = load i32, ptr %79, align 16, !tbaa !18
  %86 = add nsw i32 %85, %84
  store i32 %86, ptr %79, align 16, !tbaa !18
  %indvars.iv.next103 = or disjoint i64 %indvars.iv102, 1
  %87 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next103
  %88 = getelementptr inbounds i8, ptr %87, i64 4
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = sext i32 %89 to i64
  %gep.1 = getelementptr i32, ptr %invariant.gep, i64 %90
  %91 = load i32, ptr %gep.1, align 4, !tbaa !8
  %92 = and i32 %91, %62
  %93 = load i32, ptr %87, align 8, !tbaa !18
  %94 = add nsw i32 %93, %92
  store i32 %94, ptr %87, align 8, !tbaa !18
  %indvars.iv.next103.1 = add nuw nsw i64 %indvars.iv102, 2
  %niter132.next.1 = add i64 %niter132, 2
  %niter132.ncmp.1 = icmp eq i64 %niter132.next.1, %unroll_iter131
  br i1 %niter132.ncmp.1, label %._crit_edge80.loopexit.unr-lcssa, label %.lr.ph79, !llvm.loop !19

95:                                               ; preds = %._crit_edge80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %96 = load i32, ptr %1, align 4, !tbaa !8
  %97 = icmp sgt i32 %96, 1
  br i1 %97, label %.preheader, label %.preheader62

.preheader62:                                     ; preds = %125, %95
  %.sroa.0.0 = phi i64 [ 0, %95 ], [ %126, %125 ]
  %98 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %98, label %.preheader61, label %.lr.ph88

.preheader:                                       ; preds = %95, %125
  %.sroa.0.1 = phi i64 [ %126, %125 ], [ 0, %95 ]
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %125 ], [ 1, %95 ]
  %99 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv107
  %100 = getelementptr i8, ptr %99, i64 -8
  %101 = load i32, ptr %99, align 8, !tbaa !18
  %102 = load i32, ptr %100, align 8, !tbaa !18
  %103 = xor i32 %102, %101
  %104 = and i32 %103, %76
  %.not5882 = icmp eq i32 %104, 0
  br i1 %.not5882, label %.critedge, label %.lr.ph83

105:                                              ; preds = %161, %._crit_edge80
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %207

.lr.ph83:                                         ; preds = %.preheader, %108
  %107 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %107, label %.critedge, label %108

108:                                              ; preds = %.lr.ph83
  %109 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %110 = load i32, ptr %109, align 4, !tbaa !18
  %111 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = load i32, ptr %112, align 4, !tbaa !13
  %114 = sext i32 %113 to i64
  %115 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %110, i64 noundef %114, i32 noundef %115, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %116 = load i32, ptr %99, align 8, !tbaa !18
  %117 = load i32, ptr %100, align 8, !tbaa !18
  %118 = xor i32 %117, %116
  %119 = and i32 %118, %76
  %.not58 = icmp eq i32 %119, 0
  br i1 %.not58, label %.critedge, label %.lr.ph83, !llvm.loop !20

.critedge:                                        ; preds = %.lr.ph83, %108, %.preheader
  %120 = getelementptr inbounds i8, ptr %99, i64 4
  %121 = load i32, ptr %120, align 4, !tbaa !13
  %122 = call noundef i64 @_Z3getiRA301000_x(i32 noundef %121, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  %123 = load i32, ptr %120, align 4, !tbaa !13
  %124 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %123, i64 noundef 1, i32 noundef %124, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  store i32 -1, ptr %7, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %120, ptr noundef nonnull align 4 dereferenceable(4) %7)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %125 unwind label %.loopexit118

125:                                              ; preds = %.critedge
  %126 = add nsw i64 %.sroa.0.1, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %127 = load i32, ptr %1, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next108, %128
  br i1 %129, label %.preheader, label %.preheader62, !llvm.loop !21

.loopexit118:                                     ; preds = %.critedge
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %130

.loopexit.split-lp:                               ; preds = %.critedge.1
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %130

130:                                              ; preds = %.loopexit.split-lp, %.loopexit118
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit118 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br label %207

.lr.ph88:                                         ; preds = %.preheader62, %.lr.ph88
  %131 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %132 = load i32, ptr %131, align 4, !tbaa !18
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %134 = getelementptr inbounds i8, ptr %133, i64 4
  %135 = load i32, ptr %134, align 4, !tbaa !13
  %136 = sext i32 %135 to i64
  %137 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %132, i64 noundef %136, i32 noundef %137, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %138 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %138, label %.preheader61, label %.lr.ph88, !llvm.loop !22

139:                                              ; preds = %._crit_edge92
  %140 = landingpad { ptr, i32 }
          cleanup
  br label %207

.preheader61:                                     ; preds = %.lr.ph88, %.preheader62
  %141 = load i32, ptr %1, align 4, !tbaa !8
  %142 = icmp sgt i32 %141, 0
  br i1 %142, label %.lr.ph91.preheader, label %._crit_edge92

.lr.ph91.preheader:                               ; preds = %.preheader61
  %wide.trip.count113 = zext nneg i32 %141 to i64
  %xtraiter133 = and i64 %wide.trip.count113, 3
  %143 = icmp ult i32 %141, 4
  br i1 %143, label %._crit_edge92.loopexit.unr-lcssa, label %.lr.ph91.preheader.new

.lr.ph91.preheader.new:                           ; preds = %.lr.ph91.preheader
  %unroll_iter136 = and i64 %wide.trip.count113, 2147483644
  br label %.lr.ph91

._crit_edge92.loopexit.unr-lcssa:                 ; preds = %.lr.ph91, %.lr.ph91.preheader
  %indvars.iv110.unr = phi i64 [ 0, %.lr.ph91.preheader ], [ %indvars.iv.next111.3, %.lr.ph91 ]
  %lcmp.mod135.not = icmp eq i64 %xtraiter133, 0
  br i1 %lcmp.mod135.not, label %._crit_edge92, label %.lr.ph91.epil

.lr.ph91.epil:                                    ; preds = %._crit_edge92.loopexit.unr-lcssa, %.lr.ph91.epil
  %indvars.iv110.epil = phi i64 [ %indvars.iv.next111.epil, %.lr.ph91.epil ], [ %indvars.iv110.unr, %._crit_edge92.loopexit.unr-lcssa ]
  %epil.iter134 = phi i64 [ %epil.iter134.next, %.lr.ph91.epil ], [ 0, %._crit_edge92.loopexit.unr-lcssa ]
  %144 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv110.epil
  %145 = load i32, ptr %144, align 8, !tbaa !18
  %146 = xor i32 %145, %62
  store i32 %146, ptr %144, align 8, !tbaa !18
  %indvars.iv.next111.epil = add nuw nsw i64 %indvars.iv110.epil, 1
  %epil.iter134.next = add i64 %epil.iter134, 1
  %epil.iter134.cmp.not = icmp eq i64 %epil.iter134.next, %xtraiter133
  br i1 %epil.iter134.cmp.not, label %._crit_edge92, label %.lr.ph91.epil, !llvm.loop !23

._crit_edge92:                                    ; preds = %._crit_edge92.loopexit.unr-lcssa, %.lr.ph91.epil, %.preheader61
  %147 = sext i32 %141 to i64
  %148 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %147
  invoke void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef nonnull %22, ptr noundef nonnull %148)
          to label %161 unwind label %139

.lr.ph91:                                         ; preds = %.lr.ph91, %.lr.ph91.preheader.new
  %indvars.iv110 = phi i64 [ 0, %.lr.ph91.preheader.new ], [ %indvars.iv.next111.3, %.lr.ph91 ]
  %niter137 = phi i64 [ 0, %.lr.ph91.preheader.new ], [ %niter137.next.3, %.lr.ph91 ]
  %149 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv110
  %150 = load i32, ptr %149, align 16, !tbaa !18
  %151 = xor i32 %150, %62
  store i32 %151, ptr %149, align 16, !tbaa !18
  %indvars.iv.next111 = or disjoint i64 %indvars.iv110, 1
  %152 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next111
  %153 = load i32, ptr %152, align 8, !tbaa !18
  %154 = xor i32 %153, %62
  store i32 %154, ptr %152, align 8, !tbaa !18
  %indvars.iv.next111.1 = or disjoint i64 %indvars.iv110, 2
  %155 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next111.1
  %156 = load i32, ptr %155, align 16, !tbaa !18
  %157 = xor i32 %156, %62
  store i32 %157, ptr %155, align 16, !tbaa !18
  %indvars.iv.next111.2 = or disjoint i64 %indvars.iv110, 3
  %158 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv.next111.2
  %159 = load i32, ptr %158, align 8, !tbaa !18
  %160 = xor i32 %159, %62
  store i32 %160, ptr %158, align 8, !tbaa !18
  %indvars.iv.next111.3 = add nuw nsw i64 %indvars.iv110, 4
  %niter137.next.3 = add i64 %niter137, 4
  %niter137.ncmp.3 = icmp eq i64 %niter137.next.3, %unroll_iter136
  br i1 %niter137.ncmp.3, label %._crit_edge92.loopexit.unr-lcssa, label %.lr.ph91, !llvm.loop !24

161:                                              ; preds = %._crit_edge92
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #9
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %162 = load i32, ptr %39, align 4, !tbaa !13
  %163 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %162, i64 noundef 1, i32 noundef %163, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  store i32 -1, ptr %5, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %5)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
          to label %164 unwind label %105

164:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %165 = load i32, ptr %1, align 4, !tbaa !8
  %166 = icmp sgt i32 %165, 1
  br i1 %166, label %.preheader.1, label %.preheader62.1

.preheader.1:                                     ; preds = %164, %191
  %.sroa.7.0 = phi i64 [ %192, %191 ], [ 0, %164 ]
  %indvars.iv107.1 = phi i64 [ %indvars.iv.next108.1, %191 ], [ 1, %164 ]
  %167 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 %indvars.iv107.1
  %168 = getelementptr i8, ptr %167, i64 -8
  %169 = load i32, ptr %167, align 8, !tbaa !18
  %170 = load i32, ptr %168, align 8, !tbaa !18
  %171 = xor i32 %170, %169
  %172 = and i32 %171, %76
  %.not5882.1 = icmp eq i32 %172, 0
  br i1 %.not5882.1, label %.critedge.1, label %.lr.ph83.1

.lr.ph83.1:                                       ; preds = %.preheader.1, %174
  %173 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %173, label %.critedge.1, label %174

174:                                              ; preds = %.lr.ph83.1
  %175 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %176 = load i32, ptr %175, align 4, !tbaa !18
  %177 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %178 = getelementptr inbounds i8, ptr %177, i64 4
  %179 = load i32, ptr %178, align 4, !tbaa !13
  %180 = sext i32 %179 to i64
  %181 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %176, i64 noundef %180, i32 noundef %181, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %182 = load i32, ptr %167, align 8, !tbaa !18
  %183 = load i32, ptr %168, align 8, !tbaa !18
  %184 = xor i32 %183, %182
  %185 = and i32 %184, %76
  %.not58.1 = icmp eq i32 %185, 0
  br i1 %.not58.1, label %.critedge.1, label %.lr.ph83.1, !llvm.loop !20

.critedge.1:                                      ; preds = %.lr.ph83.1, %174, %.preheader.1
  %186 = getelementptr inbounds i8, ptr %167, i64 4
  %187 = load i32, ptr %186, align 4, !tbaa !13
  %188 = call noundef i64 @_Z3getiRA301000_x(i32 noundef %187, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  %189 = load i32, ptr %186, align 4, !tbaa !13
  %190 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %189, i64 noundef 1, i32 noundef %190, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  store i32 -1, ptr %7, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %186, ptr noundef nonnull align 4 dereferenceable(4) %7)
  invoke void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %191 unwind label %.loopexit.split-lp

191:                                              ; preds = %.critedge.1
  %192 = add nsw i64 %.sroa.7.0, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107.1, 1
  %193 = load i32, ptr %1, align 4, !tbaa !8
  %194 = sext i32 %193 to i64
  %195 = icmp slt i64 %indvars.iv.next108.1, %194
  br i1 %195, label %.preheader.1, label %.preheader62.1, !llvm.loop !21

.preheader62.1:                                   ; preds = %191, %164
  %.sroa.7.1 = phi i64 [ 0, %164 ], [ %192, %191 ]
  %196 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %196, label %._crit_edge89.1, label %.lr.ph88.1

.lr.ph88.1:                                       ; preds = %.preheader62.1, %.lr.ph88.1
  %197 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %198 = load i32, ptr %197, align 4, !tbaa !18
  %199 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %200 = getelementptr inbounds i8, ptr %199, i64 4
  %201 = load i32, ptr %200, align 4, !tbaa !13
  %202 = sext i32 %201 to i64
  %203 = load i32, ptr %1, align 4, !tbaa !8
  call void @_Z3updixiRA301000_x(i32 noundef %198, i64 noundef %202, i32 noundef %203, ptr noundef nonnull align 8 dereferenceable(2408000) %2)
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %204 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %204, label %._crit_edge89.1, label %.lr.ph88.1, !llvm.loop !22

._crit_edge89.1:                                  ; preds = %.lr.ph88.1, %.preheader62.1
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #9
  %.not = icmp sgt i64 %.sroa.0.0, %.sroa.7.1
  %205 = select i1 %.not, i32 %62, i32 0
  %.149 = or i32 %205, %.04895
  %.pn = call i64 @llvm.smin.i64(i64 %.sroa.0.0, i64 %.sroa.7.1)
  %.1 = add nsw i64 %.pn, %.04796
  %206 = add nsw i32 %.04697, -1
  %.not121 = icmp eq i32 %.04697, 0
  br i1 %.not121, label %56, label %61, !llvm.loop !25

207:                                              ; preds = %139, %130, %105
  %.pn59 = phi { ptr, i32 } [ %lpad.phi, %130 ], [ %140, %139 ], [ %106, %105 ]
  call void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 2408000, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn59
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiESt7greaterIS1_EEvT_S5_T0_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; 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 #6 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 nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #8

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 4}
!14 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !12}
!18 = !{!14, !9, i64 0}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass