; LLVM IR from Aryansh-S/USACO :: algo_ds/DP/atcoder/l-deque.ll (Z5solveiib)

; 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"

%"struct.std::pair" = type { i64, i64 }

@a = external dso_local global [3005 x i64], align 16
@dp = external dso_local global [3005 x [3005 x [2 x %"struct.std::pair"]]], align 16

; Function Attrs: mustprogress uwtable
define dso_local { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %1, i1 noundef zeroext %2) #0 {
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca %"struct.std::pair", align 8
  %24 = alloca %"struct.std::pair", align 8
  %25 = alloca %"struct.std::pair", align 8
  %26 = alloca %"struct.std::pair", align 8
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca i64, align 8
  %29 = alloca %"struct.std::pair", align 8
  %30 = alloca %"struct.std::pair", align 8
  %31 = alloca %"struct.std::pair", align 8
  %32 = alloca i64, align 8
  %33 = alloca %"struct.std::pair", align 8
  %34 = alloca %"struct.std::pair", align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  %35 = zext i1 %2 to i8
  store i8 %35, ptr %7, align 1, !tbaa !9
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %37
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [3005 x [2 x %"struct.std::pair"]], ptr %38, i64 0, i64 %40
  %42 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %43 = trunc i8 %42 to i1
  %44 = zext i1 %43 to i64
  %45 = getelementptr inbounds [2 x %"struct.std::pair"], ptr %41, i64 0, i64 %44
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %46 = call noundef zeroext i1 @_ZStneIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  br i1 %46, label %47, label %58

47:                                               ; preds = %3
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %49
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [3005 x [2 x %"struct.std::pair"]], ptr %50, i64 0, i64 %52
  %54 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %55 = trunc i8 %54 to i1
  %56 = zext i1 %55 to i64
  %57 = getelementptr inbounds [2 x %"struct.std::pair"], ptr %53, i64 0, i64 %56
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 16 %57, i64 16, i1 false)
  br label %381

58:                                               ; preds = %3
  %59 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %221

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %66 = trunc i8 %65 to i1
  %67 = xor i1 %66, true
  %68 = call { i64, i64 } @_Z5solveiib(i32 noundef %63, i32 noundef %64, i1 noundef zeroext %67)
  %69 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %70 = extractvalue { i64, i64 } %68, 0
  store i64 %70, ptr %69, align 8
  %71 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %72 = extractvalue { i64, i64 } %68, 1
  store i64 %72, ptr %71, align 8
  %73 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  %74 = load i64, ptr %73, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %79 = trunc i8 %78 to i1
  %80 = xor i1 %79, true
  %81 = call { i64, i64 } @_Z5solveiib(i32 noundef %76, i32 noundef %77, i1 noundef zeroext %80)
  %82 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %83 = extractvalue { i64, i64 } %81, 0
  store i64 %83, ptr %82, align 8
  %84 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %85 = extractvalue { i64, i64 } %81, 1
  store i64 %85, ptr %84, align 8
  %86 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %87 = load i64, ptr %86, align 8, !tbaa !16
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !17
  %92 = add nsw i64 %87, %91
  %93 = sub nsw i64 %74, %92
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 1
  %97 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %98 = trunc i8 %97 to i1
  %99 = xor i1 %98, true
  %100 = call { i64, i64 } @_Z5solveiib(i32 noundef %94, i32 noundef %96, i1 noundef zeroext %99)
  %101 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %102 = extractvalue { i64, i64 } %100, 0
  store i64 %102, ptr %101, align 8
  %103 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %104 = extractvalue { i64, i64 } %100, 1
  store i64 %104, ptr %103, align 8
  %105 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %111 = trunc i8 %110 to i1
  %112 = xor i1 %111, true
  %113 = call { i64, i64 } @_Z5solveiib(i32 noundef %107, i32 noundef %109, i1 noundef zeroext %112)
  %114 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %115 = extractvalue { i64, i64 } %113, 0
  store i64 %115, ptr %114, align 8
  %116 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %117 = extractvalue { i64, i64 } %113, 1
  store i64 %117, ptr %116, align 8
  %118 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %119 = load i64, ptr %118, align 8, !tbaa !16
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !17
  %124 = add nsw i64 %119, %123
  %125 = sub nsw i64 %106, %124
  %126 = icmp slt i64 %93, %125
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br i1 %126, label %127, label %174

127:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %132 = trunc i8 %131 to i1
  %133 = xor i1 %132, true
  %134 = call { i64, i64 } @_Z5solveiib(i32 noundef %129, i32 noundef %130, i1 noundef zeroext %133)
  %135 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %136 = extractvalue { i64, i64 } %134, 0
  store i64 %136, ptr %135, align 8
  %137 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %138 = extractvalue { i64, i64 } %134, 1
  store i64 %138, ptr %137, align 8
  %139 = getelementptr inbounds %"struct.std::pair", ptr %16, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %140 = load i32, ptr %5, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %144 = trunc i8 %143 to i1
  %145 = xor i1 %144, true
  %146 = call { i64, i64 } @_Z5solveiib(i32 noundef %141, i32 noundef %142, i1 noundef zeroext %145)
  %147 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %148 = extractvalue { i64, i64 } %146, 0
  store i64 %148, ptr %147, align 8
  %149 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %150 = extractvalue { i64, i64 } %146, 1
  store i64 %150, ptr %149, align 8
  %151 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %152 = load i64, ptr %151, align 8, !tbaa !16
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !17
  %157 = add nsw i64 %152, %156
  store i64 %157, ptr %17, align 8, !tbaa !17
  %158 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %159 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %160 = extractvalue { i64, i64 } %158, 0
  store i64 %160, ptr %159, align 8
  %161 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %162 = extractvalue { i64, i64 } %158, 1
  store i64 %162, ptr %161, align 8
  %163 = load i32, ptr %5, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %164
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [3005 x [2 x %"struct.std::pair"]], ptr %165, i64 0, i64 %167
  %169 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %170 = trunc i8 %169 to i1
  %171 = zext i1 %170 to i64
  %172 = getelementptr inbounds [2 x %"struct.std::pair"], ptr %168, i64 0, i64 %171
  %173 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %172, ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %173, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %381

174:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = load i32, ptr %6, align 4, !tbaa !5
  %177 = sub nsw i32 %176, 1
  %178 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %179 = trunc i8 %178 to i1
  %180 = xor i1 %179, true
  %181 = call { i64, i64 } @_Z5solveiib(i32 noundef %175, i32 noundef %177, i1 noundef zeroext %180)
  %182 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %183 = extractvalue { i64, i64 } %181, 0
  store i64 %183, ptr %182, align 8
  %184 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %185 = extractvalue { i64, i64 } %181, 1
  store i64 %185, ptr %184, align 8
  %186 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  %187 = load i32, ptr %5, align 4, !tbaa !5
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = sub nsw i32 %188, 1
  %190 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %191 = trunc i8 %190 to i1
  %192 = xor i1 %191, true
  %193 = call { i64, i64 } @_Z5solveiib(i32 noundef %187, i32 noundef %189, i1 noundef zeroext %192)
  %194 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 0
  %195 = extractvalue { i64, i64 } %193, 0
  store i64 %195, ptr %194, align 8
  %196 = getelementptr inbounds { i64, i64 }, ptr %22, i32 0, i32 1
  %197 = extractvalue { i64, i64 } %193, 1
  store i64 %197, ptr %196, align 8
  %198 = getelementptr inbounds %"struct.std::pair", ptr %22, i32 0, i32 1
  %199 = load i64, ptr %198, align 8, !tbaa !16
  %200 = load i32, ptr %6, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %201
  %203 = load i64, ptr %202, align 8, !tbaa !17
  %204 = add nsw i64 %199, %203
  store i64 %204, ptr %21, align 8, !tbaa !17
  %205 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %186, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %206 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %207 = extractvalue { i64, i64 } %205, 0
  store i64 %207, ptr %206, align 8
  %208 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %209 = extractvalue { i64, i64 } %205, 1
  store i64 %209, ptr %208, align 8
  %210 = load i32, ptr %5, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %211
  %213 = load i32, ptr %6, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [3005 x [2 x %"struct.std::pair"]], ptr %212, i64 0, i64 %214
  %216 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %217 = trunc i8 %216 to i1
  %218 = zext i1 %217 to i64
  %219 = getelementptr inbounds [2 x %"struct.std::pair"], ptr %215, i64 0, i64 %218
  %220 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %219, ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %220, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %381

221:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #5
  %222 = load i32, ptr %5, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  %224 = load i32, ptr %6, align 4, !tbaa !5
  %225 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %226 = trunc i8 %225 to i1
  %227 = xor i1 %226, true
  %228 = call { i64, i64 } @_Z5solveiib(i32 noundef %223, i32 noundef %224, i1 noundef zeroext %227)
  %229 = getelementptr inbounds { i64, i64 }, ptr %23, i32 0, i32 0
  %230 = extractvalue { i64, i64 } %228, 0
  store i64 %230, ptr %229, align 8
  %231 = getelementptr inbounds { i64, i64 }, ptr %23, i32 0, i32 1
  %232 = extractvalue { i64, i64 } %228, 1
  store i64 %232, ptr %231, align 8
  %233 = getelementptr inbounds %"struct.std::pair", ptr %23, i32 0, i32 0
  %234 = load i64, ptr %233, align 8, !tbaa !13
  %235 = load i32, ptr %5, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %236
  %238 = load i64, ptr %237, align 8, !tbaa !17
  %239 = add nsw i64 %234, %238
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #5
  %240 = load i32, ptr %5, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  %242 = load i32, ptr %6, align 4, !tbaa !5
  %243 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %244 = trunc i8 %243 to i1
  %245 = xor i1 %244, true
  %246 = call { i64, i64 } @_Z5solveiib(i32 noundef %241, i32 noundef %242, i1 noundef zeroext %245)
  %247 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 0
  %248 = extractvalue { i64, i64 } %246, 0
  store i64 %248, ptr %247, align 8
  %249 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 1
  %250 = extractvalue { i64, i64 } %246, 1
  store i64 %250, ptr %249, align 8
  %251 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %252 = load i64, ptr %251, align 8, !tbaa !16
  %253 = sub nsw i64 %239, %252
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #5
  %254 = load i32, ptr %5, align 4, !tbaa !5
  %255 = load i32, ptr %6, align 4, !tbaa !5
  %256 = sub nsw i32 %255, 1
  %257 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %258 = trunc i8 %257 to i1
  %259 = xor i1 %258, true
  %260 = call { i64, i64 } @_Z5solveiib(i32 noundef %254, i32 noundef %256, i1 noundef zeroext %259)
  %261 = getelementptr inbounds { i64, i64 }, ptr %25, i32 0, i32 0
  %262 = extractvalue { i64, i64 } %260, 0
  store i64 %262, ptr %261, align 8
  %263 = getelementptr inbounds { i64, i64 }, ptr %25, i32 0, i32 1
  %264 = extractvalue { i64, i64 } %260, 1
  store i64 %264, ptr %263, align 8
  %265 = getelementptr inbounds %"struct.std::pair", ptr %25, i32 0, i32 0
  %266 = load i64, ptr %265, align 8, !tbaa !13
  %267 = load i32, ptr %6, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %268
  %270 = load i64, ptr %269, align 8, !tbaa !17
  %271 = add nsw i64 %266, %270
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #5
  %272 = load i32, ptr %5, align 4, !tbaa !5
  %273 = load i32, ptr %6, align 4, !tbaa !5
  %274 = sub nsw i32 %273, 1
  %275 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %276 = trunc i8 %275 to i1
  %277 = xor i1 %276, true
  %278 = call { i64, i64 } @_Z5solveiib(i32 noundef %272, i32 noundef %274, i1 noundef zeroext %277)
  %279 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 0
  %280 = extractvalue { i64, i64 } %278, 0
  store i64 %280, ptr %279, align 8
  %281 = getelementptr inbounds { i64, i64 }, ptr %26, i32 0, i32 1
  %282 = extractvalue { i64, i64 } %278, 1
  store i64 %282, ptr %281, align 8
  %283 = getelementptr inbounds %"struct.std::pair", ptr %26, i32 0, i32 1
  %284 = load i64, ptr %283, align 8, !tbaa !16
  %285 = sub nsw i64 %271, %284
  %286 = icmp sgt i64 %253, %285
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  br i1 %286, label %287, label %334

287:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #5
  %288 = load i32, ptr %5, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  %290 = load i32, ptr %6, align 4, !tbaa !5
  %291 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %292 = trunc i8 %291 to i1
  %293 = xor i1 %292, true
  %294 = call { i64, i64 } @_Z5solveiib(i32 noundef %289, i32 noundef %290, i1 noundef zeroext %293)
  %295 = getelementptr inbounds { i64, i64 }, ptr %29, i32 0, i32 0
  %296 = extractvalue { i64, i64 } %294, 0
  store i64 %296, ptr %295, align 8
  %297 = getelementptr inbounds { i64, i64 }, ptr %29, i32 0, i32 1
  %298 = extractvalue { i64, i64 } %294, 1
  store i64 %298, ptr %297, align 8
  %299 = getelementptr inbounds %"struct.std::pair", ptr %29, i32 0, i32 0
  %300 = load i64, ptr %299, align 8, !tbaa !13
  %301 = load i32, ptr %5, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %302
  %304 = load i64, ptr %303, align 8, !tbaa !17
  %305 = add nsw i64 %300, %304
  store i64 %305, ptr %28, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #5
  %306 = load i32, ptr %5, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  %308 = load i32, ptr %6, align 4, !tbaa !5
  %309 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %310 = trunc i8 %309 to i1
  %311 = xor i1 %310, true
  %312 = call { i64, i64 } @_Z5solveiib(i32 noundef %307, i32 noundef %308, i1 noundef zeroext %311)
  %313 = getelementptr inbounds { i64, i64 }, ptr %30, i32 0, i32 0
  %314 = extractvalue { i64, i64 } %312, 0
  store i64 %314, ptr %313, align 8
  %315 = getelementptr inbounds { i64, i64 }, ptr %30, i32 0, i32 1
  %316 = extractvalue { i64, i64 } %312, 1
  store i64 %316, ptr %315, align 8
  %317 = getelementptr inbounds %"struct.std::pair", ptr %30, i32 0, i32 1
  %318 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %317)
  %319 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 0
  %320 = extractvalue { i64, i64 } %318, 0
  store i64 %320, ptr %319, align 8
  %321 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 1
  %322 = extractvalue { i64, i64 } %318, 1
  store i64 %322, ptr %321, align 8
  %323 = load i32, ptr %5, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %324
  %326 = load i32, ptr %6, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [3005 x [2 x %"struct.std::pair"]], ptr %325, i64 0, i64 %327
  %329 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %330 = trunc i8 %329 to i1
  %331 = zext i1 %330 to i64
  %332 = getelementptr inbounds [2 x %"struct.std::pair"], ptr %328, i64 0, i64 %331
  %333 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %332, ptr noundef nonnull align 8 dereferenceable(16) %27) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %333, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #5
  br label %381

334:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #5
  %335 = load i32, ptr %5, align 4, !tbaa !5
  %336 = load i32, ptr %6, align 4, !tbaa !5
  %337 = sub nsw i32 %336, 1
  %338 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %339 = trunc i8 %338 to i1
  %340 = xor i1 %339, true
  %341 = call { i64, i64 } @_Z5solveiib(i32 noundef %335, i32 noundef %337, i1 noundef zeroext %340)
  %342 = getelementptr inbounds { i64, i64 }, ptr %33, i32 0, i32 0
  %343 = extractvalue { i64, i64 } %341, 0
  store i64 %343, ptr %342, align 8
  %344 = getelementptr inbounds { i64, i64 }, ptr %33, i32 0, i32 1
  %345 = extractvalue { i64, i64 } %341, 1
  store i64 %345, ptr %344, align 8
  %346 = getelementptr inbounds %"struct.std::pair", ptr %33, i32 0, i32 0
  %347 = load i64, ptr %346, align 8, !tbaa !13
  %348 = load i32, ptr %6, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %349
  %351 = load i64, ptr %350, align 8, !tbaa !17
  %352 = add nsw i64 %347, %351
  store i64 %352, ptr %32, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #5
  %353 = load i32, ptr %5, align 4, !tbaa !5
  %354 = load i32, ptr %6, align 4, !tbaa !5
  %355 = sub nsw i32 %354, 1
  %356 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %357 = trunc i8 %356 to i1
  %358 = xor i1 %357, true
  %359 = call { i64, i64 } @_Z5solveiib(i32 noundef %353, i32 noundef %355, i1 noundef zeroext %358)
  %360 = getelementptr inbounds { i64, i64 }, ptr %34, i32 0, i32 0
  %361 = extractvalue { i64, i64 } %359, 0
  store i64 %361, ptr %360, align 8
  %362 = getelementptr inbounds { i64, i64 }, ptr %34, i32 0, i32 1
  %363 = extractvalue { i64, i64 } %359, 1
  store i64 %363, ptr %362, align 8
  %364 = getelementptr inbounds %"struct.std::pair", ptr %34, i32 0, i32 1
  %365 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(8) %364)
  %366 = getelementptr inbounds { i64, i64 }, ptr %31, i32 0, i32 0
  %367 = extractvalue { i64, i64 } %365, 0
  store i64 %367, ptr %366, align 8
  %368 = getelementptr inbounds { i64, i64 }, ptr %31, i32 0, i32 1
  %369 = extractvalue { i64, i64 } %365, 1
  store i64 %369, ptr %368, align 8
  %370 = load i32, ptr %5, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %371
  %373 = load i32, ptr %6, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [3005 x [2 x %"struct.std::pair"]], ptr %372, i64 0, i64 %374
  %376 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %377 = trunc i8 %376 to i1
  %378 = zext i1 %377 to i64
  %379 = getelementptr inbounds [2 x %"struct.std::pair"], ptr %375, i64 0, i64 %378
  %380 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %379, ptr noundef nonnull align 8 dereferenceable(16) %31) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %380, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #5
  br label %381

381:                                              ; preds = %334, %287, %174, %127, %47
  %382 = load { i64, i64 }, ptr %4, align 8
  ret { i64, i64 } %382
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSSt4pairIxxE", !15, i64 0, !15, i64 8}
!15 = !{!"long long", !7, i64 0}
!16 = !{!14, !15, i64 8}
!17 = !{!15, !15, i64 0}


; 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"

%"struct.std::pair" = type { i64, i64 }

@a = external dso_local local_unnamed_addr global [3005 x i64], align 16
@dp = external dso_local global [3005 x [3005 x [2 x %"struct.std::pair"]]], align 16

; Function Attrs: mustprogress uwtable
define dso_local { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::pair", align 8
  %19 = sext i32 %0 to i64
  %20 = sext i32 %1 to i64
  %21 = zext i1 %2 to i64
  %22 = getelementptr inbounds [3005 x [3005 x [2 x %"struct.std::pair"]]], ptr @dp, i64 0, i64 %19, i64 %20, i64 %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %23 = call noundef zeroext i1 @_ZStneIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br i1 %23, label %24, label %26

24:                                               ; preds = %3
  %25 = load <2 x i64>, ptr %22, align 16
  br label %125

26:                                               ; preds = %3
  %27 = add nsw i32 %0, 1
  %28 = add nsw i32 %1, -1
  br i1 %2, label %29, label %77

29:                                               ; preds = %26
  %30 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext false)
  %31 = extractvalue { i64, i64 } %30, 0
  %32 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext false)
  %33 = extractvalue { i64, i64 } %32, 1
  %34 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %19
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = add i64 %35, %33
  %37 = sub i64 %31, %36
  %38 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext false)
  %39 = extractvalue { i64, i64 } %38, 0
  %40 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext false)
  %41 = extractvalue { i64, i64 } %40, 1
  %42 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %20
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = add i64 %43, %41
  %45 = sub i64 %39, %44
  %46 = icmp slt i64 %37, %45
  br i1 %46, label %47, label %62

47:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  %48 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext false)
  %49 = extractvalue { i64, i64 } %48, 0
  store i64 %49, ptr %8, align 8
  %50 = getelementptr inbounds i8, ptr %8, i64 8
  %51 = extractvalue { i64, i64 } %48, 1
  store i64 %51, ptr %50, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %52 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext false)
  %53 = extractvalue { i64, i64 } %52, 1
  %54 = load i64, ptr %34, align 8, !tbaa !9
  %55 = add nsw i64 %53, %54
  store i64 %55, ptr %9, align 8, !tbaa !9
  %56 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %57 = extractvalue { i64, i64 } %56, 0
  store i64 %57, ptr %7, align 8
  %58 = getelementptr inbounds i8, ptr %7, i64 8
  %59 = extractvalue { i64, i64 } %56, 1
  store i64 %59, ptr %58, align 8
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  %61 = load <2 x i64>, ptr %60, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %125

62:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  %63 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext false)
  %64 = extractvalue { i64, i64 } %63, 0
  store i64 %64, ptr %11, align 8
  %65 = getelementptr inbounds i8, ptr %11, i64 8
  %66 = extractvalue { i64, i64 } %63, 1
  store i64 %66, ptr %65, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %67 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext false)
  %68 = extractvalue { i64, i64 } %67, 1
  %69 = load i64, ptr %42, align 8, !tbaa !9
  %70 = add nsw i64 %68, %69
  store i64 %70, ptr %12, align 8, !tbaa !9
  %71 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %72 = extractvalue { i64, i64 } %71, 0
  store i64 %72, ptr %10, align 8
  %73 = getelementptr inbounds i8, ptr %10, i64 8
  %74 = extractvalue { i64, i64 } %71, 1
  store i64 %74, ptr %73, align 8
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  %76 = load <2 x i64>, ptr %75, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br label %125

77:                                               ; preds = %26
  %78 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext true)
  %79 = extractvalue { i64, i64 } %78, 0
  %80 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %19
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = add nsw i64 %79, %81
  %83 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext true)
  %84 = extractvalue { i64, i64 } %83, 1
  %85 = sub i64 %82, %84
  %86 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext true)
  %87 = extractvalue { i64, i64 } %86, 0
  %88 = getelementptr inbounds [3005 x i64], ptr @a, i64 0, i64 %20
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = add nsw i64 %87, %89
  %91 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext true)
  %92 = extractvalue { i64, i64 } %91, 1
  %93 = sub i64 %90, %92
  %94 = icmp sgt i64 %85, %93
  br i1 %94, label %95, label %110

95:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %96 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext true)
  %97 = extractvalue { i64, i64 } %96, 0
  %98 = load i64, ptr %80, align 8, !tbaa !9
  %99 = add nsw i64 %97, %98
  store i64 %99, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #4
  %100 = call { i64, i64 } @_Z5solveiib(i32 noundef %27, i32 noundef %1, i1 noundef zeroext true)
  %101 = extractvalue { i64, i64 } %100, 0
  store i64 %101, ptr %15, align 8
  %102 = getelementptr inbounds i8, ptr %15, i64 8
  %103 = extractvalue { i64, i64 } %100, 1
  store i64 %103, ptr %102, align 8
  %104 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %102)
  %105 = extractvalue { i64, i64 } %104, 0
  store i64 %105, ptr %13, align 8
  %106 = getelementptr inbounds i8, ptr %13, i64 8
  %107 = extractvalue { i64, i64 } %104, 1
  store i64 %107, ptr %106, align 8
  %108 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  %109 = load <2 x i64>, ptr %108, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  br label %125

110:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #4
  %111 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext true)
  %112 = extractvalue { i64, i64 } %111, 0
  %113 = load i64, ptr %88, align 8, !tbaa !9
  %114 = add nsw i64 %112, %113
  store i64 %114, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #4
  %115 = call { i64, i64 } @_Z5solveiib(i32 noundef %0, i32 noundef %28, i1 noundef zeroext true)
  %116 = extractvalue { i64, i64 } %115, 0
  store i64 %116, ptr %18, align 8
  %117 = getelementptr inbounds i8, ptr %18, i64 8
  %118 = extractvalue { i64, i64 } %115, 1
  store i64 %118, ptr %117, align 8
  %119 = call { i64, i64 } @_ZSt9make_pairIxxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %117)
  %120 = extractvalue { i64, i64 } %119, 0
  store i64 %120, ptr %16, align 8
  %121 = getelementptr inbounds i8, ptr %16, i64 8
  %122 = extractvalue { i64, i64 } %119, 1
  store i64 %122, ptr %121, align 8
  %123 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %16) #4
  %124 = load <2 x i64>, ptr %123, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #4
  br label %125

125:                                              ; preds = %110, %95, %62, %47, %24
  %126 = phi <2 x i64> [ %25, %24 ], [ %61, %47 ], [ %76, %62 ], [ %109, %95 ], [ %124, %110 ]
  %127 = extractelement <2 x i64> %126, i64 0
  %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %127, 0
  %128 = extractelement <2 x i64> %126, i64 1
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %128, 1
  ret { i64, i64 } %.fca.1.insert
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass