; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/CHEFCK/A.ll (Z4getAv)

; 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::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 }
%"struct.std::pair.0" = type <{ i64, i32, [4 x i8] }>

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@A = external dso_local global [10010001 x i64], align 16
@lft = external dso_local global [10010001 x i64], align 16
@rgt = external dso_local global [10010001 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4getAv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::deque", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 4
  %17 = alloca %"struct.std::pair.0", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca { i64, i32 }, align 8
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca %"struct.std::pair.0", align 8
  %23 = alloca { i64, i32 }, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %24 = 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)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([10010001 x i64], ptr @A, i64 0, i64 1))
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %35 = load i64, ptr %9, align 8, !tbaa !5
  %36 = load i64, ptr %8, align 8, !tbaa !5
  %37 = srem i64 %35, %36
  store i64 %37, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 2, ptr %12, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %123, %0
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = load i32, ptr @n, align 4, !tbaa !9
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %126

43:                                               ; preds = %38
  %44 = load i64, ptr %11, align 8, !tbaa !5
  %45 = load i64, ptr %9, align 8, !tbaa !5
  %46 = mul nsw i64 %44, %45
  %47 = load i64, ptr %8, align 8, !tbaa !5
  %48 = srem i64 %46, %47
  store i64 %48, ptr %11, align 8, !tbaa !5
  %49 = load i64, ptr %11, align 8, !tbaa !5
  %50 = load i64, ptr %7, align 8, !tbaa !5
  %51 = icmp sle i64 %49, %50
  br i1 %51, label %52, label %87

52:                                               ; preds = %43
  %53 = load i64, ptr %1, align 8, !tbaa !5
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = sub nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = mul nsw i64 %58, %63
  %65 = load i64, ptr %10, align 8, !tbaa !5
  %66 = srem i64 %64, %65
  %67 = mul nsw i64 %53, %66
  %68 = load i64, ptr %10, align 8, !tbaa !5
  %69 = srem i64 %67, %68
  %70 = load i64, ptr %2, align 8, !tbaa !5
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = mul nsw i64 %70, %75
  %77 = load i64, ptr %10, align 8, !tbaa !5
  %78 = srem i64 %76, %77
  %79 = add nsw i64 %69, %78
  %80 = load i64, ptr %3, align 8, !tbaa !5
  %81 = add nsw i64 %79, %80
  %82 = load i64, ptr %10, align 8, !tbaa !5
  %83 = srem i64 %81, %82
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %85
  store i64 %83, ptr %86, align 8, !tbaa !5
  br label %122

87:                                               ; preds = %43
  %88 = load i64, ptr %4, align 8, !tbaa !5
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = mul nsw i64 %93, %98
  %100 = load i64, ptr %10, align 8, !tbaa !5
  %101 = srem i64 %99, %100
  %102 = mul nsw i64 %88, %101
  %103 = load i64, ptr %10, align 8, !tbaa !5
  %104 = srem i64 %102, %103
  %105 = load i64, ptr %5, align 8, !tbaa !5
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = mul nsw i64 %105, %110
  %112 = load i64, ptr %10, align 8, !tbaa !5
  %113 = srem i64 %111, %112
  %114 = add nsw i64 %104, %113
  %115 = load i64, ptr %6, align 8, !tbaa !5
  %116 = add nsw i64 %114, %115
  %117 = load i64, ptr %10, align 8, !tbaa !5
  %118 = srem i64 %116, %117
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %120
  store i64 %118, ptr %121, align 8, !tbaa !5
  br label %122

122:                                              ; preds = %87, %52
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %12, align 4, !tbaa !9
  br label %38, !llvm.loop !11

126:                                              ; preds = %42
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #4
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 1, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %154, %126
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = load i32, ptr @k, align 4, !tbaa !9
  %130 = icmp sle i32 %128, %129
  br i1 %130, label %131, label %161

131:                                              ; preds = %127
  br label %132

132:                                              ; preds = %146, %131
  %133 = call noundef zeroext i1 @_ZNKSt5dequeISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  br i1 %133, label %144, label %134

134:                                              ; preds = %132
  %135 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 4, !tbaa !13
  %138 = sext i32 %137 to i64
  %139 = load i32, ptr %15, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !5
  %143 = icmp sge i64 %138, %142
  br label %144

144:                                              ; preds = %134, %132
  %145 = phi i1 [ false, %132 ], [ %143, %134 ]
  br i1 %145, label %146, label %147

146:                                              ; preds = %144
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  br label %132, !llvm.loop !15

147:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #4
  %148 = load i32, ptr %15, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %149
  %151 = invoke { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %152 unwind label %157

152:                                              ; preds = %147
  store { i64, i32 } %151, ptr %20, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %20, i64 12, i1 false)
  invoke void @_ZNSt4pairIiiEC2IxiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(12) %17)
          to label %153 unwind label %157

153:                                              ; preds = %152
  invoke void @_ZNSt5dequeISt4pairIiiESaIS1_EE10push_frontEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %154 unwind label %157

154:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %15, align 4, !tbaa !9
  br label %127, !llvm.loop !16

157:                                              ; preds = %153, %152, %147
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %18, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %222

161:                                              ; preds = %127
  %162 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  %163 = getelementptr inbounds %"struct.std::pair", ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 4, !tbaa !13
  %165 = sext i32 %164 to i64
  %166 = load i32, ptr @k, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [10010001 x i64], ptr @rgt, i64 0, i64 %167
  store i64 %165, ptr %168, align 8, !tbaa !5
  store i64 %165, ptr getelementptr inbounds ([10010001 x i64], ptr @lft, i64 0, i64 1), align 8, !tbaa !5
  br label %169

169:                                              ; preds = %207, %161
  %170 = load i32, ptr %15, align 4, !tbaa !9
  %171 = load i32, ptr @n, align 4, !tbaa !9
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %173, label %221

173:                                              ; preds = %169
  br label %174

174:                                              ; preds = %188, %173
  %175 = call noundef zeroext i1 @_ZNKSt5dequeISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  br i1 %175, label %186, label %176

176:                                              ; preds = %174
  %177 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  %178 = getelementptr inbounds %"struct.std::pair", ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 4, !tbaa !13
  %180 = sext i32 %179 to i64
  %181 = load i32, ptr %15, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %182
  %184 = load i64, ptr %183, align 8, !tbaa !5
  %185 = icmp sge i64 %180, %184
  br label %186

186:                                              ; preds = %176, %174
  %187 = phi i1 [ false, %174 ], [ %185, %176 ]
  br i1 %187, label %188, label %189

188:                                              ; preds = %186
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  br label %174, !llvm.loop !17

189:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #4
  %190 = load i32, ptr %15, align 4, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %191
  %193 = invoke { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %192, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %194 unwind label %203

194:                                              ; preds = %189
  store { i64, i32 } %193, ptr %23, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %23, i64 12, i1 false)
  invoke void @_ZNSt4pairIiiEC2IxiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(12) %22)
          to label %195 unwind label %203

195:                                              ; preds = %194
  invoke void @_ZNSt5dequeISt4pairIiiESaIS1_EE10push_frontEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 4 dereferenceable(8) %21)
          to label %196 unwind label %203

196:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  %197 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  %198 = getelementptr inbounds %"struct.std::pair", ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 4, !tbaa !18
  %200 = load i32, ptr %14, align 4, !tbaa !9
  %201 = icmp eq i32 %199, %200
  br i1 %201, label %202, label %207

202:                                              ; preds = %196
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  br label %207

203:                                              ; preds = %195, %194, %189
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %18, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %222

207:                                              ; preds = %202, %196
  %208 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  %209 = getelementptr inbounds %"struct.std::pair", ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 4, !tbaa !13
  %211 = sext i32 %210 to i64
  %212 = load i32, ptr %15, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [10010001 x i64], ptr @rgt, i64 0, i64 %213
  store i64 %211, ptr %214, align 8, !tbaa !5
  %215 = load i32, ptr %14, align 4, !tbaa !9
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %14, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [10010001 x i64], ptr @lft, i64 0, i64 %217
  store i64 %211, ptr %218, align 8, !tbaa !5
  %219 = load i32, ptr %15, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %15, align 4, !tbaa !9
  br label %169, !llvm.loop !19

221:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void

222:                                              ; preds = %203, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  br label %223

223:                                              ; preds = %222
  %224 = load ptr, ptr %18, align 8
  %225 = load i32, ptr %19, align 4
  %226 = insertvalue { ptr, i32 } poison, ptr %224, 0
  %227 = insertvalue { ptr, i32 } %226, i32 %225, 1
  resume { ptr, i32 } %227
}

; 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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #0

declare i32 @__gxx_personality_v0(...)

; 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) #3

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!14, !10, i64 4}
!19 = distinct !{!19, !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::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 }
%"struct.std::pair.0" = type <{ i64, i32, [4 x i8] }>

@n = external dso_local local_unnamed_addr global i32, align 4
@k = external dso_local local_unnamed_addr global i32, align 4
@A = external dso_local global [10010001 x i64], align 16
@lft = external dso_local local_unnamed_addr global [10010001 x i64], align 16
@rgt = external dso_local local_unnamed_addr global [10010001 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4getAv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::deque", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca %"struct.std::pair.0", align 8
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca %"struct.std::pair.0", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %17 = 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)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %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) %7)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @A, i64 8))
  %28 = load i64, ptr %9, align 8, !tbaa !5
  %29 = load i64, ptr %8, align 8, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !9
  %.not32 = icmp slt i32 %30, 2
  br i1 %.not32, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %31 = srem i64 %28, %29
  %32 = load i64, ptr %7, align 8, !tbaa !5
  %33 = load i64, ptr %1, align 8
  %34 = load i64, ptr %10, align 8
  %35 = load i64, ptr %2, align 8
  %36 = load i64, ptr %3, align 8
  %37 = load i64, ptr %4, align 8
  %38 = load i64, ptr %5, align 8
  %39 = load i64, ptr %6, align 8
  %40 = add nuw i32 %30, 1
  %wide.trip.count = zext i32 %40 to i64
  %load_initial = load i64, ptr getelementptr inbounds (i8, ptr @A, i64 8), align 8
  br label %42

._crit_edge:                                      ; preds = %42, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %11) #3
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #3
  store i32 1, ptr %12, align 4, !tbaa !9
  %41 = load i32, ptr @k, align 4, !tbaa !9
  %.not2537 = icmp slt i32 %41, 1
  br i1 %.not2537, label %._crit_edge38, label %.preheader31.lr.ph

.preheader31.lr.ph:                               ; preds = %._crit_edge
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  br label %.preheader31

42:                                               ; preds = %.lr.ph, %42
  %store_forwarded = phi i64 [ %load_initial, %.lr.ph ], [ %.sink, %42 ]
  %indvars.iv = phi i64 [ 2, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %.034 = phi i64 [ %31, %.lr.ph ], [ %44, %42 ]
  %43 = mul nsw i64 %.034, %28
  %44 = srem i64 %43, %29
  %.not30 = icmp sgt i64 %44, %32
  %45 = mul nsw i64 %store_forwarded, %store_forwarded
  %46 = srem i64 %45, %34
  %. = select i1 %.not30, i64 %37, i64 %33
  %.57 = select i1 %.not30, i64 %38, i64 %35
  %.58 = select i1 %.not30, i64 %39, i64 %36
  %47 = mul nsw i64 %46, %.
  %48 = srem i64 %47, %34
  %49 = mul nsw i64 %.57, %store_forwarded
  %50 = srem i64 %49, %34
  %51 = add nsw i64 %50, %48
  %52 = add nsw i64 %51, %.58
  %.sink = srem i64 %52, %34
  %53 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %indvars.iv
  store i64 %.sink, ptr %53, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %42, !llvm.loop !11

.preheader31:                                     ; preds = %.preheader31.lr.ph, %69
  %54 = call noundef zeroext i1 @_ZNKSt5dequeISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  br i1 %54, label %.critedge, label %.lr.ph35

.lr.ph35:                                         ; preds = %.preheader31, %62
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = sext i32 %56 to i64
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %.not28 = icmp sgt i64 %61, %57
  br i1 %.not28, label %.critedge, label %62

62:                                               ; preds = %.lr.ph35
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %63 = call noundef zeroext i1 @_ZNKSt5dequeISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  br i1 %63, label %.critedge, label %.lr.ph35, !llvm.loop !15

.critedge:                                        ; preds = %.lr.ph35, %62, %.preheader31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #3
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %65
  %67 = invoke { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %68 unwind label %73

68:                                               ; preds = %.critedge
  %.fca.0.extract3 = extractvalue { i64, i32 } %67, 0
  %.fca.1.extract4 = extractvalue { i64, i32 } %67, 1
  store i64 %.fca.0.extract3, ptr %14, align 8
  store i32 %.fca.1.extract4, ptr %.sroa.26.0..sroa_idx, align 8
  call void @_ZNSt4pairIiiEC2IxiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(12) %14)
  invoke void @_ZNSt5dequeISt4pairIiiESaIS1_EE10push_frontEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %69 unwind label %73

69:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %12, align 4, !tbaa !9
  %72 = load i32, ptr @k, align 4, !tbaa !9
  %.not25.not = icmp slt i32 %70, %72
  br i1 %.not25.not, label %.preheader31, label %._crit_edge38, !llvm.loop !16

73:                                               ; preds = %68, %.critedge
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br label %117

._crit_edge38:                                    ; preds = %69, %._crit_edge
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %76 = load i32, ptr %75, align 4, !tbaa !13
  %77 = sext i32 %76 to i64
  %78 = load i32, ptr @k, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [10010001 x i64], ptr @rgt, i64 0, i64 %79
  store i64 %77, ptr %80, align 8, !tbaa !5
  store i64 %77, ptr getelementptr inbounds (i8, ptr @lft, i64 8), align 8, !tbaa !5
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = load i32, ptr @n, align 4, !tbaa !9
  %.not2641 = icmp sgt i32 %81, %82
  br i1 %.not2641, label %._crit_edge43, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %._crit_edge38
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %107
  %indvars.iv45 = phi i64 [ 1, %.preheader.lr.ph ], [ %indvars.iv.next46, %107 ]
  %83 = call noundef zeroext i1 @_ZNKSt5dequeISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  br i1 %83, label %.critedge2, label %.lr.ph39

.lr.ph39:                                         ; preds = %.preheader, %91
  %84 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = sext i32 %85 to i64
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !5
  %.not27 = icmp sgt i64 %90, %86
  br i1 %.not27, label %.critedge2, label %91

91:                                               ; preds = %.lr.ph39
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %92 = call noundef zeroext i1 @_ZNKSt5dequeISt4pairIiiESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  br i1 %92, label %.critedge2, label %.lr.ph39, !llvm.loop !17

.critedge2:                                       ; preds = %.lr.ph39, %91, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #3
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10010001 x i64], ptr @A, i64 0, i64 %94
  %96 = invoke { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %97 unwind label %105

97:                                               ; preds = %.critedge2
  %.fca.0.extract = extractvalue { i64, i32 } %96, 0
  %.fca.1.extract = extractvalue { i64, i32 } %96, 1
  store i64 %.fca.0.extract, ptr %16, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt4pairIiiEC2IxiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(12) %16)
  invoke void @_ZNSt5dequeISt4pairIiiESaIS1_EE10push_frontEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %98 unwind label %105

98:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  %99 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %100 = getelementptr inbounds i8, ptr %99, i64 4
  %101 = load i32, ptr %100, align 4, !tbaa !18
  %102 = zext i32 %101 to i64
  %103 = icmp eq i64 %indvars.iv45, %102
  br i1 %103, label %104, label %107

104:                                              ; preds = %98
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  br label %107

105:                                              ; preds = %97, %.critedge2
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  br label %117

107:                                              ; preds = %104, %98
  %108 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5dequeISt4pairIiiESaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %109 = load i32, ptr %108, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [10010001 x i64], ptr @rgt, i64 0, i64 %112
  store i64 %110, ptr %113, align 8, !tbaa !5
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %114 = getelementptr inbounds [10010001 x i64], ptr @lft, i64 0, i64 %indvars.iv.next46
  store i64 %110, ptr %114, align 8, !tbaa !5
  %115 = add nsw i32 %111, 1
  store i32 %115, ptr %12, align 4, !tbaa !9
  %116 = load i32, ptr @n, align 4, !tbaa !9
  %.not26.not = icmp slt i32 %111, %116
  br i1 %.not26.not, label %.preheader, label %._crit_edge43, !llvm.loop !19

._crit_edge43:                                    ; preds = %107, %._crit_edge38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #3
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  ret void

117:                                              ; preds = %105, %73
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %106, %105 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #3
  call void @_ZNSt5dequeISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress 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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!14, !10, i64 4}
!19 = distinct !{!19, !12}


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