; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/179 Division 1/Problem C (C)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, 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 { %"struct.std::pair.0", i32 }
%"struct.std::pair.0" = type { i32, i32 }

@MOD = external dso_local global i64, align 8
@c = external dso_local global [51 x [51 x i64]], align 16
@ways = external dso_local global [51 x [51 x [2 x i64]]], align 16
@v = external dso_local global [51 x [51 x [2 x i64]]], align 16
@step = external dso_local global [51 x [51 x [2 x i64]]], align 16
@n = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@w = external dso_local global i64, align 8
@inf = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair.0", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca { i64, i32 }, align 8
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca %"struct.std::pair.0", align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %"struct.std::pair", align 4
  %32 = alloca %"struct.std::pair.0", align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca { i64, i32 }, align 8
  store i32 0, ptr %1, align 4
  store i64 1, ptr @c, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %88, %0
  %38 = load i32, ptr %2, align 4, !tbaa !9
  %39 = icmp sle i32 %38, 50
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %91

41:                                               ; preds = %37
  %42 = load i32, ptr %2, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %43
  %45 = load i32, ptr %2, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [51 x i64], ptr %44, i64 0, i64 %46
  store i64 1, ptr %47, align 8, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %49
  %51 = getelementptr inbounds [51 x i64], ptr %50, i64 0, i64 0
  store i64 1, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %84, %41
  %53 = load i32, ptr %4, align 4, !tbaa !9
  %54 = load i32, ptr %2, align 4, !tbaa !9
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %87

57:                                               ; preds = %52
  %58 = load i32, ptr %2, align 4, !tbaa !9
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %60
  %62 = load i32, ptr %4, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [51 x i64], ptr %61, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = load i32, ptr %2, align 4, !tbaa !9
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %69
  %71 = load i32, ptr %4, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [51 x i64], ptr %70, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = add nsw i64 %66, %74
  %76 = load i64, ptr @MOD, align 8, !tbaa !5
  %77 = srem i64 %75, %76
  %78 = load i32, ptr %2, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %79
  %81 = load i32, ptr %4, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [51 x i64], ptr %80, i64 0, i64 %82
  store i64 %77, ptr %83, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %57
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %4, align 4, !tbaa !9
  br label %52, !llvm.loop !11

87:                                               ; preds = %56
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %2, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %2, align 4, !tbaa !9
  br label %37, !llvm.loop !13

91:                                               ; preds = %40
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %93 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %92, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %111, %91
  %95 = load i32, ptr %5, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = load i64, ptr @n, align 8, !tbaa !5
  %98 = icmp slt i64 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %114

100:                                              ; preds = %94
  %101 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @w)
  %102 = load i64, ptr @w, align 8, !tbaa !5
  %103 = icmp eq i64 %102, 50
  br i1 %103, label %104, label %107

104:                                              ; preds = %100
  %105 = load i64, ptr @a, align 8, !tbaa !5
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr @a, align 8, !tbaa !5
  br label %110

107:                                              ; preds = %100
  %108 = load i64, ptr @b, align 8, !tbaa !5
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr @b, align 8, !tbaa !5
  br label %110

110:                                              ; preds = %107, %104
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %5, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %5, align 4, !tbaa !9
  br label %94, !llvm.loop !14

114:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %148, %114
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = load i64, ptr @a, align 8, !tbaa !5
  %119 = icmp sle i64 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %115
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %151

121:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %144, %121
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = load i64, ptr @b, align 8, !tbaa !5
  %126 = icmp sle i64 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %122
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %147

128:                                              ; preds = %122
  %129 = load i64, ptr @inf, align 8, !tbaa !5
  %130 = load i32, ptr %6, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %131
  %133 = load i32, ptr %7, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [51 x [2 x i64]], ptr %132, i64 0, i64 %134
  %136 = getelementptr inbounds [2 x i64], ptr %135, i64 0, i64 1
  store i64 %129, ptr %136, align 8, !tbaa !5
  %137 = load i32, ptr %6, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %138
  %140 = load i32, ptr %7, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [51 x [2 x i64]], ptr %139, i64 0, i64 %141
  %143 = getelementptr inbounds [2 x i64], ptr %142, i64 0, i64 0
  store i64 %129, ptr %143, align 16, !tbaa !5
  br label %144

144:                                              ; preds = %128
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %7, align 4, !tbaa !9
  br label %122, !llvm.loop !15

147:                                              ; preds = %127
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %6, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %6, align 4, !tbaa !9
  br label %115, !llvm.loop !16

151:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #8
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !9
  %152 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %153 unwind label %185

153:                                              ; preds = %151
  store i64 %152, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  %154 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %155 unwind label %189

155:                                              ; preds = %153
  store { i64, i32 } %154, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %16, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %156 unwind label %189

156:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #8
  store i64 1, ptr @ways, align 16, !tbaa !5
  store i64 0, ptr @step, align 16, !tbaa !5
  br label %157

157:                                              ; preds = %589, %587, %156
  %158 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %159 unwind label %194

159:                                              ; preds = %157
  %160 = xor i1 %158, true
  br i1 %160, label %161, label %592

161:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #8
  %162 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %163 unwind label %198

163:                                              ; preds = %161
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %162, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %164 unwind label %198

164:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %165 = getelementptr inbounds %"struct.std::pair", ptr %17, i32 0, i32 0
  %166 = getelementptr inbounds %"struct.std::pair.0", ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 4, !tbaa !17
  store i32 %167, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %168 = getelementptr inbounds %"struct.std::pair", ptr %17, i32 0, i32 0
  %169 = getelementptr inbounds %"struct.std::pair.0", ptr %168, i32 0, i32 1
  %170 = load i32, ptr %169, align 4, !tbaa !20
  store i32 %170, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %171 = getelementptr inbounds %"struct.std::pair", ptr %17, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !21
  store i32 %172, ptr %20, align 4, !tbaa !9
  %173 = load i32, ptr %18, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %174
  %176 = load i32, ptr %19, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [51 x [2 x i64]], ptr %175, i64 0, i64 %177
  %179 = load i32, ptr %20, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [2 x i64], ptr %178, i64 0, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !5
  %183 = icmp ne i64 %182, 0
  br i1 %183, label %184, label %202

184:                                              ; preds = %164
  store i32 17, ptr %3, align 4
  br label %587, !llvm.loop !22

185:                                              ; preds = %151
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %13, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %14, align 4
  br label %193

189:                                              ; preds = %155, %153
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %13, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %193

193:                                              ; preds = %189, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #8
  br label %626

194:                                              ; preds = %621, %613, %611, %603, %600, %157
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %13, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %14, align 4
  br label %626

198:                                              ; preds = %163, %161
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %13, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %14, align 4
  br label %591

202:                                              ; preds = %164
  %203 = load i32, ptr %18, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %204
  %206 = load i32, ptr %19, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [51 x [2 x i64]], ptr %205, i64 0, i64 %207
  %209 = load i32, ptr %20, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [2 x i64], ptr %208, i64 0, i64 %210
  store i64 1, ptr %211, align 8, !tbaa !5
  %212 = load i32, ptr %20, align 4, !tbaa !9
  %213 = icmp eq i32 %212, 0
  br i1 %213, label %214, label %406

214:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %215

215:                                              ; preds = %402, %214
  %216 = load i32, ptr %21, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = load i64, ptr @a, align 8, !tbaa !5
  %219 = load i32, ptr %18, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = sub nsw i64 %218, %220
  %222 = icmp sle i64 %217, %221
  br i1 %222, label %223, label %229

223:                                              ; preds = %215
  %224 = load i32, ptr %21, align 4, !tbaa !9
  %225 = mul nsw i32 50, %224
  %226 = sext i32 %225 to i64
  %227 = load i64, ptr @K, align 8, !tbaa !5
  %228 = icmp sle i64 %226, %227
  br label %229

229:                                              ; preds = %223, %215
  %230 = phi i1 [ false, %215 ], [ %228, %223 ]
  br i1 %230, label %232, label %231

231:                                              ; preds = %229
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %405

232:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %233

233:                                              ; preds = %398, %232
  %234 = load i32, ptr %22, align 4, !tbaa !9
  %235 = sext i32 %234 to i64
  %236 = load i64, ptr @b, align 8, !tbaa !5
  %237 = load i32, ptr %19, align 4, !tbaa !9
  %238 = sext i32 %237 to i64
  %239 = sub nsw i64 %236, %238
  %240 = icmp sle i64 %235, %239
  br i1 %240, label %241, label %250

241:                                              ; preds = %233
  %242 = load i32, ptr %21, align 4, !tbaa !9
  %243 = mul nsw i32 50, %242
  %244 = load i32, ptr %22, align 4, !tbaa !9
  %245 = mul nsw i32 100, %244
  %246 = add nsw i32 %243, %245
  %247 = sext i32 %246 to i64
  %248 = load i64, ptr @K, align 8, !tbaa !5
  %249 = icmp sle i64 %247, %248
  br label %250

250:                                              ; preds = %241, %233
  %251 = phi i1 [ false, %233 ], [ %249, %241 ]
  br i1 %251, label %253, label %252

252:                                              ; preds = %250
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %401

253:                                              ; preds = %250
  %254 = load i32, ptr %18, align 4, !tbaa !9
  %255 = load i32, ptr %21, align 4, !tbaa !9
  %256 = add nsw i32 %254, %255
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %257
  %259 = load i32, ptr %19, align 4, !tbaa !9
  %260 = load i32, ptr %22, align 4, !tbaa !9
  %261 = add nsw i32 %259, %260
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [51 x [2 x i64]], ptr %258, i64 0, i64 %262
  %264 = load i32, ptr %20, align 4, !tbaa !9
  %265 = sub nsw i32 1, %264
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [2 x i64], ptr %263, i64 0, i64 %266
  %268 = load i64, ptr %267, align 8, !tbaa !5
  %269 = icmp ne i64 %268, 0
  br i1 %269, label %270, label %271

270:                                              ; preds = %253
  br label %398

271:                                              ; preds = %253
  %272 = load i32, ptr %21, align 4, !tbaa !9
  %273 = icmp eq i32 %272, 0
  br i1 %273, label %274, label %278

274:                                              ; preds = %271
  %275 = load i32, ptr %22, align 4, !tbaa !9
  %276 = icmp eq i32 %275, 0
  br i1 %276, label %277, label %278

277:                                              ; preds = %274
  br label %398

278:                                              ; preds = %274, %271
  %279 = load i64, ptr @MOD, align 8, !tbaa !5
  %280 = load i32, ptr %18, align 4, !tbaa !9
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %281
  %283 = load i32, ptr %19, align 4, !tbaa !9
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [51 x [2 x i64]], ptr %282, i64 0, i64 %284
  %286 = load i32, ptr %20, align 4, !tbaa !9
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [2 x i64], ptr %285, i64 0, i64 %287
  %289 = load i64, ptr %288, align 8, !tbaa !5
  %290 = load i64, ptr @a, align 8, !tbaa !5
  %291 = load i32, ptr %18, align 4, !tbaa !9
  %292 = sext i32 %291 to i64
  %293 = sub nsw i64 %290, %292
  %294 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %293
  %295 = load i32, ptr %21, align 4, !tbaa !9
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [51 x i64], ptr %294, i64 0, i64 %296
  %298 = load i64, ptr %297, align 8, !tbaa !5
  %299 = load i64, ptr @b, align 8, !tbaa !5
  %300 = load i32, ptr %19, align 4, !tbaa !9
  %301 = sext i32 %300 to i64
  %302 = sub nsw i64 %299, %301
  %303 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %302
  %304 = load i32, ptr %22, align 4, !tbaa !9
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [51 x i64], ptr %303, i64 0, i64 %305
  %307 = load i64, ptr %306, align 8, !tbaa !5
  %308 = mul nsw i64 %298, %307
  %309 = mul nsw i64 %289, %308
  %310 = load i64, ptr @MOD, align 8, !tbaa !5
  %311 = srem i64 %309, %310
  %312 = load i64, ptr @MOD, align 8, !tbaa !5
  %313 = srem i64 %311, %312
  %314 = load i32, ptr %18, align 4, !tbaa !9
  %315 = load i32, ptr %21, align 4, !tbaa !9
  %316 = add nsw i32 %314, %315
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %317
  %319 = load i32, ptr %19, align 4, !tbaa !9
  %320 = load i32, ptr %22, align 4, !tbaa !9
  %321 = add nsw i32 %319, %320
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [51 x [2 x i64]], ptr %318, i64 0, i64 %322
  %324 = load i32, ptr %20, align 4, !tbaa !9
  %325 = sub nsw i32 1, %324
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [2 x i64], ptr %323, i64 0, i64 %326
  %328 = load i64, ptr %327, align 8, !tbaa !5
  %329 = add nsw i64 %328, %313
  store i64 %329, ptr %327, align 8, !tbaa !5
  %330 = load i64, ptr %327, align 8, !tbaa !5
  %331 = srem i64 %330, %279
  store i64 %331, ptr %327, align 8, !tbaa !5
  %332 = load i32, ptr %18, align 4, !tbaa !9
  %333 = load i32, ptr %21, align 4, !tbaa !9
  %334 = add nsw i32 %332, %333
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %335
  %337 = load i32, ptr %19, align 4, !tbaa !9
  %338 = load i32, ptr %22, align 4, !tbaa !9
  %339 = add nsw i32 %337, %338
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [51 x [2 x i64]], ptr %336, i64 0, i64 %340
  %342 = load i32, ptr %20, align 4, !tbaa !9
  %343 = sub nsw i32 1, %342
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [2 x i64], ptr %341, i64 0, i64 %344
  %346 = load i64, ptr %345, align 8, !tbaa !5
  %347 = load i64, ptr @inf, align 8, !tbaa !5
  %348 = icmp eq i64 %346, %347
  br i1 %348, label %349, label %397

349:                                              ; preds = %278
  %350 = load i32, ptr %18, align 4, !tbaa !9
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %351
  %353 = load i32, ptr %19, align 4, !tbaa !9
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [51 x [2 x i64]], ptr %352, i64 0, i64 %354
  %356 = load i32, ptr %20, align 4, !tbaa !9
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [2 x i64], ptr %355, i64 0, i64 %357
  %359 = load i64, ptr %358, align 8, !tbaa !5
  %360 = add nsw i64 %359, 1
  %361 = load i32, ptr %18, align 4, !tbaa !9
  %362 = load i32, ptr %21, align 4, !tbaa !9
  %363 = add nsw i32 %361, %362
  %364 = sext i32 %363 to i64
  %365 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %364
  %366 = load i32, ptr %19, align 4, !tbaa !9
  %367 = load i32, ptr %22, align 4, !tbaa !9
  %368 = add nsw i32 %366, %367
  %369 = sext i32 %368 to i64
  %370 = getelementptr inbounds [51 x [2 x i64]], ptr %365, i64 0, i64 %369
  %371 = load i32, ptr %20, align 4, !tbaa !9
  %372 = sub nsw i32 1, %371
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [2 x i64], ptr %370, i64 0, i64 %373
  store i64 %360, ptr %374, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %375 = load i32, ptr %18, align 4, !tbaa !9
  %376 = load i32, ptr %21, align 4, !tbaa !9
  %377 = add nsw i32 %375, %376
  store i32 %377, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %378 = load i32, ptr %19, align 4, !tbaa !9
  %379 = load i32, ptr %22, align 4, !tbaa !9
  %380 = add nsw i32 %378, %379
  store i32 %380, ptr %26, align 4, !tbaa !9
  %381 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %382 unwind label %388

382:                                              ; preds = %349
  store i64 %381, ptr %24, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %383 = load i32, ptr %20, align 4, !tbaa !9
  %384 = sub nsw i32 1, %383
  store i32 %384, ptr %27, align 4, !tbaa !9
  %385 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %386 unwind label %392

386:                                              ; preds = %382
  store { i64, i32 } %385, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %28, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(12) %23)
          to label %387 unwind label %392

387:                                              ; preds = %386
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  br label %397

388:                                              ; preds = %349
  %389 = landingpad { ptr, i32 }
          cleanup
  %390 = extractvalue { ptr, i32 } %389, 0
  store ptr %390, ptr %13, align 8
  %391 = extractvalue { ptr, i32 } %389, 1
  store i32 %391, ptr %14, align 4
  br label %396

392:                                              ; preds = %386, %382
  %393 = landingpad { ptr, i32 }
          cleanup
  %394 = extractvalue { ptr, i32 } %393, 0
  store ptr %394, ptr %13, align 8
  %395 = extractvalue { ptr, i32 } %393, 1
  store i32 %395, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %396

396:                                              ; preds = %392, %388
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %590

397:                                              ; preds = %387, %278
  br label %398

398:                                              ; preds = %397, %277, %270
  %399 = load i32, ptr %22, align 4, !tbaa !9
  %400 = add nsw i32 %399, 1
  store i32 %400, ptr %22, align 4, !tbaa !9
  br label %233, !llvm.loop !23

401:                                              ; preds = %252
  br label %402

402:                                              ; preds = %401
  %403 = load i32, ptr %21, align 4, !tbaa !9
  %404 = add nsw i32 %403, 1
  store i32 %404, ptr %21, align 4, !tbaa !9
  br label %215, !llvm.loop !24

405:                                              ; preds = %231
  br label %586

406:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %407

407:                                              ; preds = %582, %406
  %408 = load i32, ptr %29, align 4, !tbaa !9
  %409 = load i32, ptr %18, align 4, !tbaa !9
  %410 = icmp sle i32 %408, %409
  br i1 %410, label %411, label %417

411:                                              ; preds = %407
  %412 = load i32, ptr %29, align 4, !tbaa !9
  %413 = mul nsw i32 50, %412
  %414 = sext i32 %413 to i64
  %415 = load i64, ptr @K, align 8, !tbaa !5
  %416 = icmp sle i64 %414, %415
  br label %417

417:                                              ; preds = %411, %407
  %418 = phi i1 [ false, %407 ], [ %416, %411 ]
  br i1 %418, label %420, label %419

419:                                              ; preds = %417
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %585

420:                                              ; preds = %417
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %421

421:                                              ; preds = %578, %420
  %422 = load i32, ptr %30, align 4, !tbaa !9
  %423 = load i32, ptr %19, align 4, !tbaa !9
  %424 = icmp sle i32 %422, %423
  br i1 %424, label %425, label %434

425:                                              ; preds = %421
  %426 = load i32, ptr %29, align 4, !tbaa !9
  %427 = mul nsw i32 50, %426
  %428 = load i32, ptr %30, align 4, !tbaa !9
  %429 = mul nsw i32 100, %428
  %430 = add nsw i32 %427, %429
  %431 = sext i32 %430 to i64
  %432 = load i64, ptr @K, align 8, !tbaa !5
  %433 = icmp sle i64 %431, %432
  br label %434

434:                                              ; preds = %425, %421
  %435 = phi i1 [ false, %421 ], [ %433, %425 ]
  br i1 %435, label %437, label %436

436:                                              ; preds = %434
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %581

437:                                              ; preds = %434
  %438 = load i32, ptr %18, align 4, !tbaa !9
  %439 = load i32, ptr %29, align 4, !tbaa !9
  %440 = sub nsw i32 %438, %439
  %441 = sext i32 %440 to i64
  %442 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %441
  %443 = load i32, ptr %19, align 4, !tbaa !9
  %444 = load i32, ptr %30, align 4, !tbaa !9
  %445 = sub nsw i32 %443, %444
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds [51 x [2 x i64]], ptr %442, i64 0, i64 %446
  %448 = load i32, ptr %20, align 4, !tbaa !9
  %449 = sub nsw i32 1, %448
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds [2 x i64], ptr %447, i64 0, i64 %450
  %452 = load i64, ptr %451, align 8, !tbaa !5
  %453 = icmp ne i64 %452, 0
  br i1 %453, label %454, label %455

454:                                              ; preds = %437
  br label %578

455:                                              ; preds = %437
  %456 = load i32, ptr %29, align 4, !tbaa !9
  %457 = icmp eq i32 %456, 0
  br i1 %457, label %458, label %462

458:                                              ; preds = %455
  %459 = load i32, ptr %30, align 4, !tbaa !9
  %460 = icmp eq i32 %459, 0
  br i1 %460, label %461, label %462

461:                                              ; preds = %458
  br label %578

462:                                              ; preds = %458, %455
  %463 = load i64, ptr @MOD, align 8, !tbaa !5
  %464 = load i32, ptr %18, align 4, !tbaa !9
  %465 = sext i32 %464 to i64
  %466 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %465
  %467 = load i32, ptr %19, align 4, !tbaa !9
  %468 = sext i32 %467 to i64
  %469 = getelementptr inbounds [51 x [2 x i64]], ptr %466, i64 0, i64 %468
  %470 = load i32, ptr %20, align 4, !tbaa !9
  %471 = sext i32 %470 to i64
  %472 = getelementptr inbounds [2 x i64], ptr %469, i64 0, i64 %471
  %473 = load i64, ptr %472, align 8, !tbaa !5
  %474 = load i32, ptr %18, align 4, !tbaa !9
  %475 = sext i32 %474 to i64
  %476 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %475
  %477 = load i32, ptr %29, align 4, !tbaa !9
  %478 = sext i32 %477 to i64
  %479 = getelementptr inbounds [51 x i64], ptr %476, i64 0, i64 %478
  %480 = load i64, ptr %479, align 8, !tbaa !5
  %481 = load i32, ptr %19, align 4, !tbaa !9
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %482
  %484 = load i32, ptr %30, align 4, !tbaa !9
  %485 = sext i32 %484 to i64
  %486 = getelementptr inbounds [51 x i64], ptr %483, i64 0, i64 %485
  %487 = load i64, ptr %486, align 8, !tbaa !5
  %488 = mul nsw i64 %480, %487
  %489 = mul nsw i64 %473, %488
  %490 = load i64, ptr @MOD, align 8, !tbaa !5
  %491 = srem i64 %489, %490
  %492 = load i64, ptr @MOD, align 8, !tbaa !5
  %493 = srem i64 %491, %492
  %494 = load i32, ptr %18, align 4, !tbaa !9
  %495 = load i32, ptr %29, align 4, !tbaa !9
  %496 = sub nsw i32 %494, %495
  %497 = sext i32 %496 to i64
  %498 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %497
  %499 = load i32, ptr %19, align 4, !tbaa !9
  %500 = load i32, ptr %30, align 4, !tbaa !9
  %501 = sub nsw i32 %499, %500
  %502 = sext i32 %501 to i64
  %503 = getelementptr inbounds [51 x [2 x i64]], ptr %498, i64 0, i64 %502
  %504 = load i32, ptr %20, align 4, !tbaa !9
  %505 = sub nsw i32 1, %504
  %506 = sext i32 %505 to i64
  %507 = getelementptr inbounds [2 x i64], ptr %503, i64 0, i64 %506
  %508 = load i64, ptr %507, align 8, !tbaa !5
  %509 = add nsw i64 %508, %493
  store i64 %509, ptr %507, align 8, !tbaa !5
  %510 = load i64, ptr %507, align 8, !tbaa !5
  %511 = srem i64 %510, %463
  store i64 %511, ptr %507, align 8, !tbaa !5
  %512 = load i32, ptr %18, align 4, !tbaa !9
  %513 = load i32, ptr %29, align 4, !tbaa !9
  %514 = sub nsw i32 %512, %513
  %515 = sext i32 %514 to i64
  %516 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %515
  %517 = load i32, ptr %19, align 4, !tbaa !9
  %518 = load i32, ptr %30, align 4, !tbaa !9
  %519 = sub nsw i32 %517, %518
  %520 = sext i32 %519 to i64
  %521 = getelementptr inbounds [51 x [2 x i64]], ptr %516, i64 0, i64 %520
  %522 = load i32, ptr %20, align 4, !tbaa !9
  %523 = sub nsw i32 1, %522
  %524 = sext i32 %523 to i64
  %525 = getelementptr inbounds [2 x i64], ptr %521, i64 0, i64 %524
  %526 = load i64, ptr %525, align 8, !tbaa !5
  %527 = load i64, ptr @inf, align 8, !tbaa !5
  %528 = icmp eq i64 %526, %527
  br i1 %528, label %529, label %577

529:                                              ; preds = %462
  %530 = load i32, ptr %18, align 4, !tbaa !9
  %531 = sext i32 %530 to i64
  %532 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %531
  %533 = load i32, ptr %19, align 4, !tbaa !9
  %534 = sext i32 %533 to i64
  %535 = getelementptr inbounds [51 x [2 x i64]], ptr %532, i64 0, i64 %534
  %536 = load i32, ptr %20, align 4, !tbaa !9
  %537 = sext i32 %536 to i64
  %538 = getelementptr inbounds [2 x i64], ptr %535, i64 0, i64 %537
  %539 = load i64, ptr %538, align 8, !tbaa !5
  %540 = add nsw i64 %539, 1
  %541 = load i32, ptr %18, align 4, !tbaa !9
  %542 = load i32, ptr %29, align 4, !tbaa !9
  %543 = sub nsw i32 %541, %542
  %544 = sext i32 %543 to i64
  %545 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %544
  %546 = load i32, ptr %19, align 4, !tbaa !9
  %547 = load i32, ptr %30, align 4, !tbaa !9
  %548 = sub nsw i32 %546, %547
  %549 = sext i32 %548 to i64
  %550 = getelementptr inbounds [51 x [2 x i64]], ptr %545, i64 0, i64 %549
  %551 = load i32, ptr %20, align 4, !tbaa !9
  %552 = sub nsw i32 1, %551
  %553 = sext i32 %552 to i64
  %554 = getelementptr inbounds [2 x i64], ptr %550, i64 0, i64 %553
  store i64 %540, ptr %554, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %555 = load i32, ptr %18, align 4, !tbaa !9
  %556 = load i32, ptr %29, align 4, !tbaa !9
  %557 = sub nsw i32 %555, %556
  store i32 %557, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %558 = load i32, ptr %19, align 4, !tbaa !9
  %559 = load i32, ptr %30, align 4, !tbaa !9
  %560 = sub nsw i32 %558, %559
  store i32 %560, ptr %34, align 4, !tbaa !9
  %561 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %34)
          to label %562 unwind label %568

562:                                              ; preds = %529
  store i64 %561, ptr %32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %563 = load i32, ptr %20, align 4, !tbaa !9
  %564 = sub nsw i32 1, %563
  store i32 %564, ptr %35, align 4, !tbaa !9
  %565 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %32, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %566 unwind label %572

566:                                              ; preds = %562
  store { i64, i32 } %565, ptr %36, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 8 %36, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(12) %31)
          to label %567 unwind label %572

567:                                              ; preds = %566
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #8
  br label %577

568:                                              ; preds = %529
  %569 = landingpad { ptr, i32 }
          cleanup
  %570 = extractvalue { ptr, i32 } %569, 0
  store ptr %570, ptr %13, align 8
  %571 = extractvalue { ptr, i32 } %569, 1
  store i32 %571, ptr %14, align 4
  br label %576

572:                                              ; preds = %566, %562
  %573 = landingpad { ptr, i32 }
          cleanup
  %574 = extractvalue { ptr, i32 } %573, 0
  store ptr %574, ptr %13, align 8
  %575 = extractvalue { ptr, i32 } %573, 1
  store i32 %575, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %576

576:                                              ; preds = %572, %568
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %590

577:                                              ; preds = %567, %462
  br label %578

578:                                              ; preds = %577, %461, %454
  %579 = load i32, ptr %30, align 4, !tbaa !9
  %580 = add nsw i32 %579, 1
  store i32 %580, ptr %30, align 4, !tbaa !9
  br label %421, !llvm.loop !25

581:                                              ; preds = %436
  br label %582

582:                                              ; preds = %581
  %583 = load i32, ptr %29, align 4, !tbaa !9
  %584 = add nsw i32 %583, 1
  store i32 %584, ptr %29, align 4, !tbaa !9
  br label %407, !llvm.loop !26

585:                                              ; preds = %419
  br label %586

586:                                              ; preds = %585, %405
  store i32 0, ptr %3, align 4
  br label %587

587:                                              ; preds = %586, %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  %588 = load i32, ptr %3, align 4
  switch i32 %588, label %632 [
    i32 0, label %589
    i32 17, label %157
  ]

589:                                              ; preds = %587
  br label %157, !llvm.loop !22

590:                                              ; preds = %576, %396
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %591

591:                                              ; preds = %590, %198
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  br label %626

592:                                              ; preds = %159
  %593 = load i64, ptr @a, align 8, !tbaa !5
  %594 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %593
  %595 = load i64, ptr @b, align 8, !tbaa !5
  %596 = getelementptr inbounds [51 x [2 x i64]], ptr %594, i64 0, i64 %595
  %597 = getelementptr inbounds [2 x i64], ptr %596, i64 0, i64 1
  %598 = load i64, ptr %597, align 8, !tbaa !5
  %599 = icmp eq i64 %598, 0
  br i1 %599, label %600, label %603

600:                                              ; preds = %592
  %601 = invoke i32 @puts(ptr noundef @.str)
          to label %602 unwind label %194

602:                                              ; preds = %600
  br label %624

603:                                              ; preds = %592
  %604 = load i64, ptr @a, align 8, !tbaa !5
  %605 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %604
  %606 = load i64, ptr @b, align 8, !tbaa !5
  %607 = getelementptr inbounds [51 x [2 x i64]], ptr %605, i64 0, i64 %606
  %608 = getelementptr inbounds [2 x i64], ptr %607, i64 0, i64 1
  %609 = load i64, ptr %608, align 8, !tbaa !5
  %610 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %609)
          to label %611 unwind label %194

611:                                              ; preds = %603
  %612 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %610, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %613 unwind label %194

613:                                              ; preds = %611
  %614 = load i64, ptr @a, align 8, !tbaa !5
  %615 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %614
  %616 = load i64, ptr @b, align 8, !tbaa !5
  %617 = getelementptr inbounds [51 x [2 x i64]], ptr %615, i64 0, i64 %616
  %618 = getelementptr inbounds [2 x i64], ptr %617, i64 0, i64 1
  %619 = load i64, ptr %618, align 8, !tbaa !5
  %620 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %612, i64 noundef %619)
          to label %621 unwind label %194

621:                                              ; preds = %613
  %622 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %620, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %623 unwind label %194

623:                                              ; preds = %621
  br label %624

624:                                              ; preds = %623, %602
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #8
  %625 = load i32, ptr %1, align 4
  ret i32 %625

626:                                              ; preds = %591, %194, %193
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #8
  br label %627

627:                                              ; preds = %626
  %628 = load ptr, ptr %13, align 8
  %629 = load i32, ptr %14, align 4
  %630 = insertvalue { ptr, i32 } poison, ptr %628, 0
  %631 = insertvalue { ptr, i32 } %630, i32 %629, 1
  resume { ptr, i32 } %631

632:                                              ; preds = %587
  unreachable
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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 noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

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

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

declare i32 @puts(ptr noundef) #5

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !10, i64 0}
!18 = !{!"_ZTSSt4pairIS_IiiEiE", !19, i64 0, !10, i64 8}
!19 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!20 = !{!18, !10, i64 4}
!21 = !{!18, !10, i64 8}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, 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 { %"struct.std::pair.0", i32 }
%"struct.std::pair.0" = type { i32, i32 }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@c = external dso_local local_unnamed_addr global [51 x [51 x i64]], align 16
@ways = external dso_local local_unnamed_addr global [51 x [51 x [2 x i64]]], align 16
@v = external dso_local local_unnamed_addr global [51 x [51 x [2 x i64]]], align 16
@step = external dso_local local_unnamed_addr global [51 x [51 x [2 x i64]]], align 16
@n = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local local_unnamed_addr global i64, align 8
@b = external dso_local local_unnamed_addr global i64, align 8
@w = external dso_local global i64, align 8
@inf = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca %"struct.std::pair.0", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair.0", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i64 1, ptr @c, align 16, !tbaa !5
  %17 = load i64, ptr @MOD, align 8
  br label %23

18:                                               ; preds = %._crit_edge
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %21 = load i64, ptr @n, align 8, !tbaa !5
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph193, label %.preheader188

23:                                               ; preds = %0, %._crit_edge
  %indvar = phi i64 [ 0, %0 ], [ %indvar.next, %._crit_edge ]
  %indvars.iv225 = phi i64 [ 1, %0 ], [ %indvars.iv.next226, %._crit_edge ]
  %24 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv225
  %25 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv225, i64 %indvars.iv225
  store i64 1, ptr %25, align 8, !tbaa !5
  store i64 1, ptr %24, align 8, !tbaa !5
  %26 = icmp ugt i64 %indvars.iv225, 1
  br i1 %26, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %23
  %27 = add nsw i64 %indvars.iv225, -1
  %.phi.trans.insert = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %27, i64 0
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !5
  %xtraiter = and i64 %indvar, 1
  %28 = icmp eq i64 %indvar, 1
  br i1 %28, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %indvar, -2
  br label %34

._crit_edge.loopexit.unr-lcssa:                   ; preds = %34, %.lr.ph
  %.unr = phi i64 [ %.pre, %.lr.ph ], [ %42, %34 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %34 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %29 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %27, i64 %indvars.iv.unr
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = add nsw i64 %30, %.unr
  %32 = srem i64 %31, %17
  %33 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv225, i64 %indvars.iv.unr
  store i64 %32, ptr %33, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %23
  %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
  %exitcond228.not = icmp eq i64 %indvars.iv.next226, 51
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond228.not, label %18, label %23, !llvm.loop !9

34:                                               ; preds = %34, %.lr.ph.new
  %35 = phi i64 [ %.pre, %.lr.ph.new ], [ %42, %34 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %34 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %34 ]
  %36 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %27, i64 %indvars.iv
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %37, %35
  %39 = srem i64 %38, %17
  %40 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv225, i64 %indvars.iv
  store i64 %39, ptr %40, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %27, i64 %indvars.iv.next
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = add nsw i64 %42, %37
  %44 = srem i64 %43, %17
  %45 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %indvars.iv225, i64 %indvars.iv.next
  store i64 %44, ptr %45, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %34, !llvm.loop !11

.preheader188:                                    ; preds = %.lr.ph193, %18
  %46 = load i64, ptr @a, align 8, !tbaa !5
  %.not198 = icmp slt i64 %46, 0
  br i1 %.not198, label %._crit_edge200, label %.preheader187.lr.ph

.preheader187.lr.ph:                              ; preds = %.preheader188
  %47 = load i64, ptr @b, align 8, !tbaa !5
  %.not180194 = icmp slt i64 %47, 0
  %48 = load i64, ptr @inf, align 8
  br i1 %.not180194, label %._crit_edge200, label %.preheader187.preheader

.preheader187.preheader:                          ; preds = %.preheader187.lr.ph
  %49 = add nuw i64 %47, 1
  %xtraiter269 = and i64 %49, 3
  %50 = icmp ult i64 %47, 3
  %unroll_iter271 = and i64 %49, -4
  %lcmp.mod270.not = icmp eq i64 %xtraiter269, 0
  br label %.preheader187

.lr.ph193:                                        ; preds = %18, %.lr.ph193
  %indvars.iv229 = phi i64 [ %indvars.iv.next230, %.lr.ph193 ], [ 0, %18 ]
  %51 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @w)
  %52 = load i64, ptr @w, align 8, !tbaa !5
  %53 = icmp eq i64 %52, 50
  %a.b = select i1 %53, ptr @a, ptr @b
  %54 = load i64, ptr %a.b, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %a.b, align 8, !tbaa !5
  %indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1
  %56 = load i64, ptr @n, align 8, !tbaa !5
  %57 = icmp sgt i64 %56, %indvars.iv.next230
  br i1 %57, label %.lr.ph193, label %.preheader188, !llvm.loop !12

.preheader187:                                    ; preds = %.preheader187.preheader, %._crit_edge197
  %indvars.iv236 = phi i64 [ %indvars.iv.next237, %._crit_edge197 ], [ 0, %.preheader187.preheader ]
  br i1 %50, label %._crit_edge197.unr-lcssa, label %.preheader187.new

._crit_edge200:                                   ; preds = %._crit_edge197, %.preheader187.lr.ph, %.preheader188
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #7
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !13
  %58 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %69 unwind label %81

._crit_edge197.unr-lcssa:                         ; preds = %.preheader187.new, %.preheader187
  %indvars.iv232.unr = phi i64 [ 0, %.preheader187 ], [ %indvars.iv.next233.3, %.preheader187.new ]
  br i1 %lcmp.mod270.not, label %._crit_edge197, label %.epil.preheader268

.epil.preheader268:                               ; preds = %._crit_edge197.unr-lcssa, %.epil.preheader268
  %indvars.iv232.epil = phi i64 [ %indvars.iv.next233.epil, %.epil.preheader268 ], [ %indvars.iv232.unr, %._crit_edge197.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader268 ], [ 0, %._crit_edge197.unr-lcssa ]
  %59 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %indvars.iv236, i64 %indvars.iv232.epil
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  store i64 %48, ptr %60, align 8, !tbaa !5
  store i64 %48, ptr %59, align 16, !tbaa !5
  %indvars.iv.next233.epil = add nuw nsw i64 %indvars.iv232.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter269
  br i1 %epil.iter.cmp.not, label %._crit_edge197, label %.epil.preheader268, !llvm.loop !15

._crit_edge197:                                   ; preds = %.epil.preheader268, %._crit_edge197.unr-lcssa
  %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1
  %exitcond239 = icmp eq i64 %indvars.iv236, %46
  br i1 %exitcond239, label %._crit_edge200, label %.preheader187, !llvm.loop !17

.preheader187.new:                                ; preds = %.preheader187, %.preheader187.new
  %indvars.iv232 = phi i64 [ %indvars.iv.next233.3, %.preheader187.new ], [ 0, %.preheader187 ]
  %niter272 = phi i64 [ %niter272.next.3, %.preheader187.new ], [ 0, %.preheader187 ]
  %61 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %indvars.iv236, i64 %indvars.iv232
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  store i64 %48, ptr %62, align 8, !tbaa !5
  store i64 %48, ptr %61, align 16, !tbaa !5
  %indvars.iv.next233 = or disjoint i64 %indvars.iv232, 1
  %63 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %indvars.iv236, i64 %indvars.iv.next233
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  store i64 %48, ptr %64, align 8, !tbaa !5
  store i64 %48, ptr %63, align 16, !tbaa !5
  %indvars.iv.next233.1 = or disjoint i64 %indvars.iv232, 2
  %65 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %indvars.iv236, i64 %indvars.iv.next233.1
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  store i64 %48, ptr %66, align 8, !tbaa !5
  store i64 %48, ptr %65, align 16, !tbaa !5
  %indvars.iv.next233.2 = or disjoint i64 %indvars.iv232, 3
  %67 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %indvars.iv236, i64 %indvars.iv.next233.2
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  store i64 %48, ptr %68, align 8, !tbaa !5
  store i64 %48, ptr %67, align 16, !tbaa !5
  %indvars.iv.next233.3 = add nuw nsw i64 %indvars.iv232, 4
  %niter272.next.3 = add i64 %niter272, 4
  %niter272.ncmp.3 = icmp eq i64 %niter272.next.3, %unroll_iter271
  br i1 %niter272.ncmp.3, label %._crit_edge197.unr-lcssa, label %.preheader187.new, !llvm.loop !18

69:                                               ; preds = %._crit_edge200
  store i64 %58, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 0, ptr %6, align 4, !tbaa !13
  %70 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %71 unwind label %83

71:                                               ; preds = %69
  %.fca.0.extract113 = extractvalue { i64, i32 } %70, 0
  %.fca.1.extract114 = extractvalue { i64, i32 } %70, 1
  store i64 %.fca.0.extract113, ptr %2, align 8
  %.sroa.2116.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %.fca.1.extract114, ptr %.sroa.2116.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %72 unwind label %83

72:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
  store i64 1, ptr @ways, align 16, !tbaa !5
  store i64 0, ptr @step, align 16, !tbaa !5
  %73 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %73, label %._crit_edge219, label %.lr.ph218

.lr.ph218:                                        ; preds = %72
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  %.sroa.233.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  br label %74

74:                                               ; preds = %.lr.ph218, %.critedge
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.0112.0.copyload = load i32, ptr %75, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4
  %.sroa.5.0.copyload.fr = freeze i32 %.sroa.5.0.copyload
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 8
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %76 = sext i32 %.sroa.0112.0.copyload to i64
  %77 = sext i32 %.sroa.5.0.copyload.fr to i64
  %78 = sext i32 %.sroa.6.0.copyload to i64
  %79 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %76, i64 %77, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %.not163 = icmp eq i64 %80, 0
  br i1 %.not163, label %88, label %.critedge, !llvm.loop !19

81:                                               ; preds = %._crit_edge200
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %71, %69
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %85

85:                                               ; preds = %83, %81
  %.pn = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
  br label %228

86:                                               ; preds = %225, %219, %217, %213
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %228

88:                                               ; preds = %74
  store i64 1, ptr %79, align 8, !tbaa !5
  %89 = icmp eq i32 %.sroa.6.0.copyload, 0
  br i1 %89, label %.preheader184, label %.preheader185

.preheader185:                                    ; preds = %88
  %.not164205 = icmp slt i32 %.sroa.0112.0.copyload, 0
  br i1 %.not164205, label %.critedge, label %.lr.ph207

.lr.ph207:                                        ; preds = %.preheader185
  %.not166201 = icmp slt i32 %.sroa.5.0.copyload.fr, 0
  %90 = sub nsw i32 1, %.sroa.6.0.copyload
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %76, i64 %77, i64 %78
  %93 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %76, i64 %77, i64 %78
  br i1 %.not166201, label %.critedge, label %.lr.ph207.split.preheader

.lr.ph207.split.preheader:                        ; preds = %.lr.ph207
  %94 = add nuw i32 %.sroa.5.0.copyload.fr, 1
  %95 = add nuw i32 %.sroa.0112.0.copyload, 1
  %wide.trip.count250 = zext i32 %95 to i64
  %wide.trip.count = zext i32 %94 to i64
  br label %.lr.ph207.split

.preheader184:                                    ; preds = %88
  %96 = load i64, ptr @a, align 8, !tbaa !5
  %.not171213 = icmp slt i64 %96, %76
  br i1 %.not171213, label %.critedge, label %.lr.ph215

.lr.ph215:                                        ; preds = %.preheader184
  %97 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %76, i64 %77, i64 %78
  %98 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %76, i64 %77, i64 %78
  br label %99

99:                                               ; preds = %.lr.ph215, %.critedge2
  %100 = phi i64 [ %96, %.lr.ph215 ], [ %113, %.critedge2 ]
  %indvars.iv258 = phi i64 [ 0, %.lr.ph215 ], [ %indvars.iv.next259, %.critedge2 ]
  %101 = mul nuw nsw i64 %indvars.iv258, 50
  %102 = load i64, ptr @K, align 8, !tbaa !5
  %.not172 = icmp slt i64 %102, %101
  br i1 %.not172, label %.critedge, label %.preheader

.preheader:                                       ; preds = %99
  %103 = load i64, ptr @b, align 8, !tbaa !5
  %104 = sub nsw i64 %103, %77
  %.not173209 = icmp slt i64 %104, 0
  br i1 %.not173209, label %.critedge2, label %.lr.ph211

.lr.ph211:                                        ; preds = %.preheader
  %105 = add nsw i64 %indvars.iv258, %76
  %106 = trunc nsw i64 %105 to i32
  br label %107

107:                                              ; preds = %.lr.ph211, %155
  %108 = phi i64 [ %103, %.lr.ph211 ], [ %156, %155 ]
  %indvars.iv255 = phi i64 [ 0, %.lr.ph211 ], [ %indvars.iv.next256, %155 ]
  %109 = phi i64 [ %104, %.lr.ph211 ], [ %157, %155 ]
  %110 = mul nuw nsw i64 %indvars.iv255, 100
  %111 = add nuw nsw i64 %110, %101
  %112 = load i64, ptr @K, align 8, !tbaa !5
  %.not174 = icmp slt i64 %112, %111
  br i1 %.not174, label %.critedge2.loopexit, label %115

.critedge2.loopexit:                              ; preds = %155, %107
  %.pre262 = load i64, ptr @a, align 8, !tbaa !5
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.preheader
  %113 = phi i64 [ %.pre262, %.critedge2.loopexit ], [ %100, %.preheader ]
  %indvars.iv.next259 = add nuw nsw i64 %indvars.iv258, 1
  %114 = sub nsw i64 %113, %76
  %.not171.not = icmp sgt i64 %114, %indvars.iv258
  br i1 %.not171.not, label %99, label %.critedge, !llvm.loop !20

115:                                              ; preds = %107
  %116 = add nsw i64 %indvars.iv255, %77
  %117 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %105, i64 %116, i64 1
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %.not175 = icmp ne i64 %118, 0
  %119 = or i64 %indvars.iv255, %indvars.iv258
  %120 = and i64 %119, 4294967295
  %or.cond = icmp eq i64 %120, 0
  %or.cond181 = or i1 %or.cond, %.not175
  br i1 %or.cond181, label %155, label %121

121:                                              ; preds = %115
  %122 = load i64, ptr @MOD, align 8, !tbaa !5
  %123 = load i64, ptr %97, align 8, !tbaa !5
  %124 = load i64, ptr @a, align 8, !tbaa !5
  %125 = sub nsw i64 %124, %76
  %126 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %125, i64 %indvars.iv258
  %127 = load i64, ptr %126, align 8, !tbaa !5
  %128 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %109, i64 %indvars.iv255
  %129 = load i64, ptr %128, align 8, !tbaa !5
  %130 = mul i64 %127, %123
  %131 = mul i64 %130, %129
  %132 = srem i64 %131, %122
  %133 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %105, i64 %116, i64 1
  %134 = load i64, ptr %133, align 8, !tbaa !5
  %135 = add nsw i64 %134, %132
  %136 = srem i64 %135, %122
  store i64 %136, ptr %133, align 8, !tbaa !5
  %137 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %105, i64 %116, i64 1
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = load i64, ptr @inf, align 8, !tbaa !5
  %140 = icmp eq i64 %138, %139
  br i1 %140, label %141, label %155

141:                                              ; preds = %121
  %142 = load i64, ptr %98, align 8, !tbaa !5
  %143 = add nsw i64 %142, 1
  store i64 %143, ptr %137, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 %106, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %144 = trunc nsw i64 %116 to i32
  store i32 %144, ptr %10, align 4, !tbaa !13
  %145 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %146 unwind label %150

146:                                              ; preds = %141
  store i64 %145, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  store i32 1, ptr %11, align 4, !tbaa !13
  %147 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %148 unwind label %152

148:                                              ; preds = %146
  %.fca.0.extract30 = extractvalue { i64, i32 } %147, 0
  %.fca.1.extract31 = extractvalue { i64, i32 } %147, 1
  store i64 %.fca.0.extract30, ptr %7, align 8
  store i32 %.fca.1.extract31, ptr %.sroa.233.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %149 unwind label %152

149:                                              ; preds = %148
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  %.pre261 = load i64, ptr @b, align 8, !tbaa !5
  br label %155

150:                                              ; preds = %141
  %151 = landingpad { ptr, i32 }
          cleanup
  br label %154

152:                                              ; preds = %148, %146
  %153 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  br label %154

154:                                              ; preds = %152, %150
  %.pn176 = phi { ptr, i32 } [ %153, %152 ], [ %151, %150 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  br label %228

155:                                              ; preds = %121, %149, %115
  %156 = phi i64 [ %108, %121 ], [ %.pre261, %149 ], [ %108, %115 ]
  %indvars.iv.next256 = add nuw nsw i64 %indvars.iv255, 1
  %157 = sub nsw i64 %156, %77
  %.not173.not = icmp sgt i64 %157, %indvars.iv255
  br i1 %.not173.not, label %107, label %.critedge2.loopexit, !llvm.loop !21

.lr.ph207.split:                                  ; preds = %.lr.ph207.split.preheader, %.critedge7
  %indvars.iv247 = phi i64 [ 0, %.lr.ph207.split.preheader ], [ %indvars.iv.next248, %.critedge7 ]
  %158 = mul nuw nsw i64 %indvars.iv247, 50
  %159 = load i64, ptr @K, align 8, !tbaa !5
  %.not165 = icmp slt i64 %159, %158
  br i1 %.not165, label %.critedge, label %.preheader183

.preheader183:                                    ; preds = %.lr.ph207.split
  %160 = sub nsw i64 %76, %indvars.iv247
  %161 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %76, i64 %indvars.iv247
  %162 = trunc nsw i64 %160 to i32
  br label %163

163:                                              ; preds = %.preheader183, %204
  %indvars.iv243 = phi i64 [ 0, %.preheader183 ], [ %indvars.iv.next244, %204 ]
  %164 = mul nuw nsw i64 %indvars.iv243, 100
  %165 = add nuw nsw i64 %164, %158
  %166 = load i64, ptr @K, align 8, !tbaa !5
  %.not167 = icmp slt i64 %166, %165
  br i1 %.not167, label %.critedge7, label %167

.critedge7:                                       ; preds = %163, %204
  %indvars.iv.next248 = add nuw nsw i64 %indvars.iv247, 1
  %exitcond251.not = icmp eq i64 %indvars.iv.next248, %wide.trip.count250
  br i1 %exitcond251.not, label %.critedge, label %.lr.ph207.split, !llvm.loop !22

167:                                              ; preds = %163
  %168 = sub nsw i64 %77, %indvars.iv243
  %169 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @v, i64 0, i64 %160, i64 %168, i64 %91
  %170 = load i64, ptr %169, align 8, !tbaa !5
  %.not168 = icmp ne i64 %170, 0
  %171 = or i64 %indvars.iv243, %indvars.iv247
  %172 = and i64 %171, 4294967295
  %or.cond9 = icmp eq i64 %172, 0
  %or.cond182 = or i1 %or.cond9, %.not168
  br i1 %or.cond182, label %204, label %173

173:                                              ; preds = %167
  %174 = load i64, ptr @MOD, align 8, !tbaa !5
  %175 = load i64, ptr %92, align 8, !tbaa !5
  %176 = load i64, ptr %161, align 8, !tbaa !5
  %177 = getelementptr inbounds [51 x [51 x i64]], ptr @c, i64 0, i64 %77, i64 %indvars.iv243
  %178 = load i64, ptr %177, align 8, !tbaa !5
  %179 = mul i64 %176, %175
  %180 = mul i64 %179, %178
  %181 = srem i64 %180, %174
  %182 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %160, i64 %168, i64 %91
  %183 = load i64, ptr %182, align 8, !tbaa !5
  %184 = add nsw i64 %183, %181
  %185 = srem i64 %184, %174
  store i64 %185, ptr %182, align 8, !tbaa !5
  %186 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %160, i64 %168, i64 %91
  %187 = load i64, ptr %186, align 8, !tbaa !5
  %188 = load i64, ptr @inf, align 8, !tbaa !5
  %189 = icmp eq i64 %187, %188
  br i1 %189, label %190, label %204

190:                                              ; preds = %173
  %191 = load i64, ptr %93, align 8, !tbaa !5
  %192 = add nsw i64 %191, 1
  store i64 %192, ptr %186, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  store i32 %162, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  %193 = trunc nsw i64 %168 to i32
  store i32 %193, ptr %15, align 4, !tbaa !13
  %194 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %195 unwind label %199

195:                                              ; preds = %190
  store i64 %194, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  store i32 %90, ptr %16, align 4, !tbaa !13
  %196 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %197 unwind label %201

197:                                              ; preds = %195
  %.fca.0.extract = extractvalue { i64, i32 } %196, 0
  %.fca.1.extract = extractvalue { i64, i32 } %196, 1
  store i64 %.fca.0.extract, ptr %12, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %198 unwind label %201

198:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  br label %204

199:                                              ; preds = %190
  %200 = landingpad { ptr, i32 }
          cleanup
  br label %203

201:                                              ; preds = %197, %195
  %202 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  br label %203

203:                                              ; preds = %201, %199
  %.pn169 = phi { ptr, i32 } [ %202, %201 ], [ %200, %199 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  br label %228

204:                                              ; preds = %173, %198, %167
  %indvars.iv.next244 = add nuw nsw i64 %indvars.iv243, 1
  %exitcond246.not = icmp eq i64 %indvars.iv.next244, %wide.trip.count
  br i1 %exitcond246.not, label %.critedge7, label %163, !llvm.loop !23

.critedge:                                        ; preds = %.lr.ph207.split, %.critedge7, %99, %.critedge2, %.lr.ph207, %.preheader185, %.preheader184, %74
  %205 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %205, label %._crit_edge219, label %74

._crit_edge219:                                   ; preds = %.critedge, %72
  %206 = load i64, ptr @a, align 8, !tbaa !5
  %207 = load i64, ptr @b, align 8, !tbaa !5
  %208 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %206, i64 %207, i64 1
  %209 = load i64, ptr %208, align 8, !tbaa !5
  %210 = icmp eq i64 %209, 0
  br i1 %210, label %211, label %213

211:                                              ; preds = %._crit_edge219
  %212 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  br label %227

213:                                              ; preds = %._crit_edge219
  %214 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @step, i64 0, i64 %206, i64 %207, i64 1
  %215 = load i64, ptr %214, align 8, !tbaa !5
  %216 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %215)
          to label %217 unwind label %86

217:                                              ; preds = %213
  %218 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %219 unwind label %86

219:                                              ; preds = %217
  %220 = load i64, ptr @a, align 8, !tbaa !5
  %221 = load i64, ptr @b, align 8, !tbaa !5
  %222 = getelementptr inbounds [51 x [51 x [2 x i64]]], ptr @ways, i64 0, i64 %220, i64 %221, i64 1
  %223 = load i64, ptr %222, align 8, !tbaa !5
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %218, i64 noundef %223)
          to label %225 unwind label %86

225:                                              ; preds = %219
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %227 unwind label %86

227:                                              ; preds = %225, %211
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  ret i32 0

228:                                              ; preds = %154, %203, %86, %85
  %.pn176.pn.pn = phi { ptr, i32 } [ %87, %86 ], [ %.pn, %85 ], [ %.pn176, %154 ], [ %.pn169, %203 ]
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn176.pn.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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 #2 align 2

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4

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

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

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

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

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


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