; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1696_C.ll (Z5solvev)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i64 }

@a = external dso_local global [50010 x i64], align 16
@b = external dso_local global [50010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

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

24:                                               ; preds = %35, %0
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = load i64, ptr %1, align 8, !tbaa !9
  %28 = icmp sle i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %38

30:                                               ; preds = %24
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [50010 x i64], ptr @a, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %33)
  br label %35

35:                                               ; preds = %30
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  br label %24, !llvm.loop !11

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %50, %38
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %53

45:                                               ; preds = %40
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [50010 x i64], ptr @b, i64 0, i64 %47
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %48)
  br label %50

50:                                               ; preds = %45
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !13

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %105, %53
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = load i64, ptr %1, align 8, !tbaa !9
  %58 = icmp sle i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %109

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [50010 x i64], ptr @a, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !9
  store i64 %64, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 1, ptr %10, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %70, %60
  %66 = load i64, ptr %9, align 8, !tbaa !9
  %67 = load i64, ptr %2, align 8, !tbaa !9
  %68 = srem i64 %66, %67
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %65
  %71 = load i64, ptr %2, align 8, !tbaa !9
  %72 = load i64, ptr %9, align 8, !tbaa !9
  %73 = sdiv i64 %72, %71
  store i64 %73, ptr %9, align 8, !tbaa !9
  %74 = load i64, ptr %2, align 8, !tbaa !9
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = mul nsw i64 %75, %74
  store i64 %76, ptr %10, align 8, !tbaa !9
  br label %65, !llvm.loop !14

77:                                               ; preds = %65
  %78 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIixESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br i1 %78, label %97, label %79

79:                                               ; preds = %77
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !15
  %83 = sext i32 %82 to i64
  %84 = load i64, ptr %9, align 8, !tbaa !9
  %85 = icmp eq i64 %83, %84
  br i1 %85, label %86, label %97

86:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %87, i64 16, i1 false)
  call void @_ZNSt6vectorISt4pairIixESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %88 = load i64, ptr %10, align 8, !tbaa !9
  %89 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !17
  %91 = add nsw i64 %90, %88
  store i64 %91, ptr %89, align 8, !tbaa !17
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %92 unwind label %93

92:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  br label %104

93:                                               ; preds = %86
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %12, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  br label %108

97:                                               ; preds = %79, %77
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  invoke void @_ZNSt4pairIixEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %98 unwind label %100

98:                                               ; preds = %97
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %99 unwind label %100

99:                                               ; preds = %98
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %104

100:                                              ; preds = %98, %97
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %12, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %108

104:                                              ; preds = %99, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !18

108:                                              ; preds = %100, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %210

109:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %160, %109
  %111 = load i32, ptr %15, align 4, !tbaa !5
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = icmp sle i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %164

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [50010 x i64], ptr @b, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !9
  store i64 %119, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 1, ptr %17, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %125, %115
  %121 = load i64, ptr %16, align 8, !tbaa !9
  %122 = load i64, ptr %2, align 8, !tbaa !9
  %123 = srem i64 %121, %122
  %124 = icmp eq i64 %123, 0
  br i1 %124, label %125, label %132

125:                                              ; preds = %120
  %126 = load i64, ptr %2, align 8, !tbaa !9
  %127 = load i64, ptr %16, align 8, !tbaa !9
  %128 = sdiv i64 %127, %126
  store i64 %128, ptr %16, align 8, !tbaa !9
  %129 = load i64, ptr %2, align 8, !tbaa !9
  %130 = load i64, ptr %17, align 8, !tbaa !9
  %131 = mul nsw i64 %130, %129
  store i64 %131, ptr %17, align 8, !tbaa !9
  br label %120, !llvm.loop !19

132:                                              ; preds = %120
  %133 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIixESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br i1 %133, label %152, label %134

134:                                              ; preds = %132
  %135 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 8, !tbaa !15
  %138 = sext i32 %137 to i64
  %139 = load i64, ptr %16, align 8, !tbaa !9
  %140 = icmp eq i64 %138, %139
  br i1 %140, label %141, label %152

141:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %142 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %142, i64 16, i1 false)
  call void @_ZNSt6vectorISt4pairIixESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %143 = load i64, ptr %17, align 8, !tbaa !9
  %144 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %145 = load i64, ptr %144, align 8, !tbaa !17
  %146 = add nsw i64 %145, %143
  store i64 %146, ptr %144, align 8, !tbaa !17
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %147 unwind label %148

147:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %159

148:                                              ; preds = %141
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %12, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %163

152:                                              ; preds = %134, %132
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  invoke void @_ZNSt4pairIixEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %153 unwind label %155

153:                                              ; preds = %152
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %154 unwind label %155

154:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %159

155:                                              ; preds = %153, %152
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %12, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %163

159:                                              ; preds = %154, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %15, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %15, align 4, !tbaa !5
  br label %110, !llvm.loop !20

163:                                              ; preds = %155, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %210

164:                                              ; preds = %114
  %165 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %166 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %167 = icmp ne i64 %165, %166
  br i1 %167, label %168, label %175

168:                                              ; preds = %164
  %169 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %170 unwind label %171

170:                                              ; preds = %168
  store i32 1, ptr %20, align 4
  br label %207

171:                                              ; preds = %204, %168
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %12, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %13, align 4
  br label %210

175:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %199, %175
  %177 = load i32, ptr %21, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  %180 = icmp ult i64 %178, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %176
  store i32 18, ptr %20, align 4
  br label %202

182:                                              ; preds = %176
  %183 = load i32, ptr %21, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %184) #6
  %186 = load i32, ptr %21, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %187) #6
  %189 = invoke noundef zeroext i1 @_ZStneIixEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %185, ptr noundef nonnull align 8 dereferenceable(16) %188)
          to label %190 unwind label %194

190:                                              ; preds = %182
  br i1 %189, label %191, label %198

191:                                              ; preds = %190
  %192 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %193 unwind label %194

193:                                              ; preds = %191
  store i32 1, ptr %20, align 4
  br label %202

194:                                              ; preds = %191, %182
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %12, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %210

198:                                              ; preds = %190
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %21, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %21, align 4, !tbaa !5
  br label %176, !llvm.loop !21

202:                                              ; preds = %193, %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  %203 = load i32, ptr %20, align 4
  switch i32 %203, label %207 [
    i32 18, label %204
  ]

204:                                              ; preds = %202
  %205 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %206 unwind label %171

206:                                              ; preds = %204
  store i32 0, ptr %20, align 4
  br label %207

207:                                              ; preds = %206, %202, %170
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  %208 = load i32, ptr %20, align 4
  switch i32 %208, label %216 [
    i32 0, label %209
    i32 1, label %209
  ]

209:                                              ; preds = %207, %207
  ret void

210:                                              ; preds = %194, %171, %163, %108
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  br label %211

211:                                              ; preds = %210
  %212 = load ptr, ptr %12, align 8
  %213 = load i32, ptr %13, align 4
  %214 = insertvalue { ptr, i32 } poison, ptr %212, 0
  %215 = insertvalue { ptr, i32 } %214, i32 %213, 1
  resume { ptr, i32 } %215

216:                                              ; preds = %207
  unreachable
}

; 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 @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneIixEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #5

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIixE", !6, i64 0, !10, i64 8}
!17 = !{!16, !10, i64 8}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, long long>, std::allocator<std::pair<int, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i64 }

@a = external dso_local global [50010 x i64], align 16
@b = external dso_local global [50010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %.not41 = icmp slt i64 %16, 1
  br i1 %.not41, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %.not3043 = icmp slt i32 %18, 1
  br i1 %.not3043, label %._crit_edge47, label %.lr.ph46

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %19 = getelementptr inbounds [50010 x i64], ptr @a, i64 0, i64 %indvars.iv
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp sgt i64 %21, %indvars.iv
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge47:                                    ; preds = %.lr.ph46, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %22 = load i64, ptr %1, align 8, !tbaa !5
  %.not3152 = icmp slt i64 %22, 1
  br i1 %.not3152, label %.preheader40, label %.lr.ph55

.lr.ph55:                                         ; preds = %._crit_edge47
  %23 = getelementptr inbounds i8, ptr %8, i64 8
  br label %30

.lr.ph46:                                         ; preds = %._crit_edge, %.lr.ph46
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph46 ], [ 1, %._crit_edge ]
  %24 = getelementptr inbounds [50010 x i64], ptr @b, i64 0, i64 %indvars.iv74
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %.not30.not = icmp slt i64 %indvars.iv74, %27
  br i1 %.not30.not, label %.lr.ph46, label %._crit_edge47, !llvm.loop !13

.preheader40:                                     ; preds = %61, %._crit_edge47
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %.not3263 = icmp slt i32 %28, 1
  br i1 %.not3263, label %._crit_edge66, label %.lr.ph65

.lr.ph65:                                         ; preds = %.preheader40
  %29 = getelementptr inbounds i8, ptr %12, i64 8
  br label %67

30:                                               ; preds = %.lr.ph55, %61
  %indvars.iv77 = phi i64 [ 1, %.lr.ph55 ], [ %indvars.iv.next78, %61 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %31 = getelementptr inbounds [50010 x i64], ptr @a, i64 0, i64 %indvars.iv77
  %32 = load i64, ptr %31, align 8, !tbaa !5
  store i64 %32, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %33 = load i64, ptr %2, align 8, !tbaa !5
  %34 = srem i64 %32, %33
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %.lr.ph50, label %41

.lr.ph50:                                         ; preds = %30, %.lr.ph50
  %storemerge3648 = phi i64 [ %38, %.lr.ph50 ], [ 1, %30 ]
  %36 = phi i64 [ %37, %.lr.ph50 ], [ %32, %30 ]
  %37 = sdiv i64 %36, %33
  %38 = mul nsw i64 %33, %storemerge3648
  %39 = srem i64 %37, %33
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %.lr.ph50, label %._crit_edge51, !llvm.loop !14

._crit_edge51:                                    ; preds = %.lr.ph50
  store i64 %37, ptr %6, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %._crit_edge51, %30
  %storemerge36.lcssa = phi i64 [ %38, %._crit_edge51 ], [ 1, %30 ]
  store i64 %storemerge36.lcssa, ptr %7, align 8, !tbaa !5
  %42 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIixESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br i1 %42, label %57, label %43

43:                                               ; preds = %41
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %45 = load i32, ptr %44, align 8, !tbaa !15
  %46 = sext i32 %45 to i64
  %47 = load i64, ptr %6, align 8, !tbaa !5
  %48 = icmp eq i64 %47, %46
  br i1 %48, label %49, label %57

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %50, i64 16, i1 false)
  call void @_ZNSt6vectorISt4pairIixESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %51 = load i64, ptr %7, align 8, !tbaa !5
  %52 = load i64, ptr %23, align 8, !tbaa !17
  %53 = add nsw i64 %52, %51
  store i64 %53, ptr %23, align 8, !tbaa !17
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %54 unwind label %55

54:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %61

55:                                               ; preds = %49
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %63

57:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @_ZNSt4pairIixEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %58 unwind label %59

58:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %61

59:                                               ; preds = %57
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %63

61:                                               ; preds = %58, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %62 = load i64, ptr %1, align 8, !tbaa !5
  %.not31.not = icmp sgt i64 %62, %indvars.iv77
  br i1 %.not31.not, label %30, label %.preheader40, !llvm.loop !18

63:                                               ; preds = %59, %55
  %.pn37 = phi { ptr, i32 } [ %60, %59 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %115

._crit_edge66:                                    ; preds = %98, %.preheader40
  %64 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %65 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %.not33 = icmp eq i64 %64, %65
  br i1 %.not33, label %.preheader, label %.critedge.invoke

.preheader:                                       ; preds = %._crit_edge66
  %66 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %.not3467.not = icmp eq i64 %66, 0
  br i1 %.not3467.not, label %.critedge.invoke, label %.lr.ph69

67:                                               ; preds = %.lr.ph65, %98
  %indvars.iv80 = phi i64 [ 1, %.lr.ph65 ], [ %indvars.iv.next81, %98 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %68 = getelementptr inbounds [50010 x i64], ptr @b, i64 0, i64 %indvars.iv80
  %69 = load i64, ptr %68, align 8, !tbaa !5
  store i64 %69, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %70 = load i64, ptr %2, align 8, !tbaa !5
  %71 = srem i64 %69, %70
  %72 = icmp eq i64 %71, 0
  br i1 %72, label %.lr.ph59, label %78

.lr.ph59:                                         ; preds = %67, %.lr.ph59
  %storemerge57 = phi i64 [ %75, %.lr.ph59 ], [ 1, %67 ]
  %73 = phi i64 [ %74, %.lr.ph59 ], [ %69, %67 ]
  %74 = sdiv i64 %73, %70
  %75 = mul nsw i64 %70, %storemerge57
  %76 = srem i64 %74, %70
  %77 = icmp eq i64 %76, 0
  br i1 %77, label %.lr.ph59, label %._crit_edge60, !llvm.loop !19

._crit_edge60:                                    ; preds = %.lr.ph59
  store i64 %74, ptr %10, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %._crit_edge60, %67
  %storemerge.lcssa = phi i64 [ %75, %._crit_edge60 ], [ 1, %67 ]
  store i64 %storemerge.lcssa, ptr %11, align 8, !tbaa !5
  %79 = call noundef zeroext i1 @_ZNKSt6vectorISt4pairIixESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br i1 %79, label %94, label %80

80:                                               ; preds = %78
  %81 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %82 = load i32, ptr %81, align 8, !tbaa !15
  %83 = sext i32 %82 to i64
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = icmp eq i64 %84, %83
  br i1 %85, label %86, label %94

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %87, i64 16, i1 false)
  call void @_ZNSt6vectorISt4pairIixESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %88 = load i64, ptr %11, align 8, !tbaa !5
  %89 = load i64, ptr %29, align 8, !tbaa !17
  %90 = add nsw i64 %89, %88
  store i64 %90, ptr %29, align 8, !tbaa !17
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %91 unwind label %92

91:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %98

92:                                               ; preds = %86
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %101

94:                                               ; preds = %80, %78
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  call void @_ZNSt4pairIixEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  invoke void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %95 unwind label %96

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  br label %98

96:                                               ; preds = %94
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  br label %101

98:                                               ; preds = %95, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %99 = load i32, ptr %3, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %.not32.not = icmp slt i64 %indvars.iv80, %100
  br i1 %.not32.not, label %67, label %._crit_edge66, !llvm.loop !20

101:                                              ; preds = %96, %92
  %.pn = phi { ptr, i32 } [ %97, %96 ], [ %93, %92 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %115

102:                                              ; preds = %.critedge.invoke
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %115

104:                                              ; preds = %109
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %105 = call noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %.not34 = icmp ugt i64 %105, %indvars.iv.next84
  br i1 %.not34, label %.lr.ph69, label %.critedge.invoke, !llvm.loop !21

.lr.ph69:                                         ; preds = %.preheader, %104
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %104 ], [ 0, %.preheader ]
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv83) #6
  %107 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv83) #6
  %108 = invoke noundef zeroext i1 @_ZStneIixEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %106, ptr noundef nonnull align 8 dereferenceable(16) %107)
          to label %109 unwind label %.loopexit

109:                                              ; preds = %.lr.ph69
  br i1 %108, label %110, label %104

110:                                              ; preds = %109
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %114 unwind label %.loopexit.split-lp

.loopexit:                                        ; preds = %.lr.ph69
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %115

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

.critedge.invoke:                                 ; preds = %104, %._crit_edge66, %.preheader
  %112 = phi ptr [ @.str.1, %.preheader ], [ @.str, %._crit_edge66 ], [ @.str.1, %104 ]
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %112)
          to label %114 unwind label %102

114:                                              ; preds = %.critedge.invoke, %110
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void

115:                                              ; preds = %.loopexit, %.loopexit.split-lp, %102, %101, %63
  %.pn37.pn = phi { ptr, i32 } [ %.pn37, %63 ], [ %.pn, %101 ], [ %103, %102 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorISt4pairIixESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn37.pn
}

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

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

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

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 #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIixESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIixESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIixESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIixESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneIixEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

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

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

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


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