; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2017.01 (cownav)

; 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<state, std::allocator<state>>::_Deque_impl" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl" = type { %"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.state = type { i32, i32, i32, i32, i32, i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@dy = external dso_local global [4 x i32], align 16
@dx = external dso_local global [4 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_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 ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::queue", align 8
  %14 = alloca %struct.state, align 4
  %15 = alloca %struct.state, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.state, align 4
  %18 = alloca %struct.state, align 4
  %19 = alloca %struct.state, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  %28 = load ptr, ptr @stdin, align 8, !tbaa !8
  %29 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %28)
  %30 = load ptr, ptr @stdout, align 8, !tbaa !8
  %31 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %33 = load i32, ptr %2, align 4, !tbaa !11
  %34 = zext i32 %33 to i64
  %35 = call ptr @llvm.stacksave.p0()
  store ptr %35, ptr %3, align 8
  %36 = alloca %"class.std::__cxx11::basic_string", i64 %34, align 16
  store i64 %34, ptr %4, align 8
  %37 = icmp eq i64 %34, 0
  br i1 %37, label %44, label %38

38:                                               ; preds = %0
  %39 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %36, i64 %34
  br label %40

40:                                               ; preds = %40, %38
  %41 = phi ptr [ %36, %38 ], [ %42, %40 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %41) #9
  %42 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %41, i64 1
  %43 = icmp eq ptr %42, %39
  br i1 %43, label %44, label %40

44:                                               ; preds = %40, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %56, %44
  %46 = load i32, ptr %5, align 4, !tbaa !11
  %47 = load i32, ptr %2, align 4, !tbaa !11
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %63

50:                                               ; preds = %45
  %51 = load i32, ptr %5, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %36, i64 %52
  %54 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %53)
          to label %55 unwind label %59

55:                                               ; preds = %50
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %5, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !11
  br label %45, !llvm.loop !13

59:                                               ; preds = %50
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %6, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %454

63:                                               ; preds = %49
  %64 = load i32, ptr %2, align 4, !tbaa !11
  %65 = zext i32 %64 to i64
  %66 = load i32, ptr %2, align 4, !tbaa !11
  %67 = zext i32 %66 to i64
  %68 = load i32, ptr %2, align 4, !tbaa !11
  %69 = zext i32 %68 to i64
  %70 = load i32, ptr %2, align 4, !tbaa !11
  %71 = zext i32 %70 to i64
  %72 = mul nuw i64 %65, %67
  %73 = mul nuw i64 %72, %69
  %74 = mul nuw i64 %73, %71
  %75 = alloca [4 x i32], i64 %74, align 16
  store i64 %65, ptr %8, align 8
  store i64 %67, ptr %9, align 8
  store i64 %69, ptr %10, align 8
  store i64 %71, ptr %11, align 8
  %76 = mul nuw i64 %67, %69
  %77 = mul nuw i64 %76, %71
  %78 = mul nsw i64 0, %77
  %79 = getelementptr inbounds [4 x i32], ptr %75, i64 %78
  %80 = mul nuw i64 %69, %71
  %81 = mul nsw i64 0, %80
  %82 = getelementptr inbounds [4 x i32], ptr %79, i64 %81
  %83 = mul nsw i64 0, %71
  %84 = getelementptr inbounds [4 x i32], ptr %82, i64 %83
  %85 = getelementptr inbounds [4 x i32], ptr %84, i64 0
  %86 = getelementptr inbounds [4 x i32], ptr %85, i64 0, i64 0
  %87 = load i32, ptr %2, align 4, !tbaa !11
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = mul nuw i64 %67, %69
  %91 = mul nuw i64 %90, %71
  %92 = mul nsw i64 %89, %91
  %93 = getelementptr inbounds [4 x i32], ptr %75, i64 %92
  %94 = load i32, ptr %2, align 4, !tbaa !11
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = mul nuw i64 %69, %71
  %98 = mul nsw i64 %96, %97
  %99 = getelementptr inbounds [4 x i32], ptr %93, i64 %98
  %100 = load i32, ptr %2, align 4, !tbaa !11
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = mul nsw i64 %102, %71
  %104 = getelementptr inbounds [4 x i32], ptr %99, i64 %103
  %105 = load i32, ptr %2, align 4, !tbaa !11
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [4 x i32], ptr %104, i64 %107
  %109 = getelementptr inbounds [4 x i32], ptr %108, i64 0, i64 0
  %110 = getelementptr inbounds i32, ptr %109, i64 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 2147483647, ptr %12, align 4, !tbaa !11
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %86, ptr noundef %110, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %111 unwind label %161

111:                                              ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #9
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %112 unwind label %165

112:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #9
  %113 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 0
  %114 = load i32, ptr %2, align 4, !tbaa !11
  %115 = sub nsw i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !15
  %116 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 1
  store i32 0, ptr %116, align 4, !tbaa !17
  %117 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 2
  %118 = load i32, ptr %2, align 4, !tbaa !11
  %119 = sub nsw i32 %118, 1
  store i32 %119, ptr %117, align 4, !tbaa !18
  %120 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 3
  store i32 0, ptr %120, align 4, !tbaa !19
  %121 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 4
  store i32 0, ptr %121, align 4, !tbaa !20
  %122 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 5
  store i32 0, ptr %122, align 4, !tbaa !21
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 4 dereferenceable(24) %14)
          to label %123 unwind label %169

123:                                              ; preds = %112
  br label %124

124:                                              ; preds = %396, %394, %123
  %125 = invoke noundef zeroext i1 @_ZNKSt5queueI5stateSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %126 unwind label %169

126:                                              ; preds = %124
  %127 = xor i1 %125, true
  br i1 %127, label %128, label %397

128:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #9
  %129 = invoke noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %130 unwind label %173

130:                                              ; preds = %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %129, i64 24, i1 false), !tbaa.struct !22
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %131 unwind label %173

131:                                              ; preds = %130
  %132 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %133 = load i32, ptr %132, align 4, !tbaa !15
  %134 = sext i32 %133 to i64
  %135 = mul nuw i64 %67, %69
  %136 = mul nuw i64 %135, %71
  %137 = mul nsw i64 %134, %136
  %138 = getelementptr inbounds [4 x i32], ptr %75, i64 %137
  %139 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !17
  %141 = sext i32 %140 to i64
  %142 = mul nuw i64 %69, %71
  %143 = mul nsw i64 %141, %142
  %144 = getelementptr inbounds [4 x i32], ptr %138, i64 %143
  %145 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %146 = load i32, ptr %145, align 4, !tbaa !18
  %147 = sext i32 %146 to i64
  %148 = mul nsw i64 %147, %71
  %149 = getelementptr inbounds [4 x i32], ptr %144, i64 %148
  %150 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %151 = load i32, ptr %150, align 4, !tbaa !19
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [4 x i32], ptr %149, i64 %152
  %154 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %155 = load i32, ptr %154, align 4, !tbaa !20
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [4 x i32], ptr %153, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !11
  %159 = icmp ne i32 %158, 2147483647
  br i1 %159, label %160, label %177

160:                                              ; preds = %131
  store i32 5, ptr %16, align 4
  br label %394, !llvm.loop !23

161:                                              ; preds = %63
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %6, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %454

165:                                              ; preds = %111
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %6, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %7, align 4
  br label %446

169:                                              ; preds = %124, %112
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %6, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %7, align 4
  br label %445

173:                                              ; preds = %371, %349, %348, %328, %280, %130, %128
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %6, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #9
  br label %445

177:                                              ; preds = %131
  %178 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 5
  %179 = load i32, ptr %178, align 4, !tbaa !21
  %180 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %181 = load i32, ptr %180, align 4, !tbaa !15
  %182 = sext i32 %181 to i64
  %183 = mul nuw i64 %67, %69
  %184 = mul nuw i64 %183, %71
  %185 = mul nsw i64 %182, %184
  %186 = getelementptr inbounds [4 x i32], ptr %75, i64 %185
  %187 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %188 = load i32, ptr %187, align 4, !tbaa !17
  %189 = sext i32 %188 to i64
  %190 = mul nuw i64 %69, %71
  %191 = mul nsw i64 %189, %190
  %192 = getelementptr inbounds [4 x i32], ptr %186, i64 %191
  %193 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %194 = load i32, ptr %193, align 4, !tbaa !18
  %195 = sext i32 %194 to i64
  %196 = mul nsw i64 %195, %71
  %197 = getelementptr inbounds [4 x i32], ptr %192, i64 %196
  %198 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %199 = load i32, ptr %198, align 4, !tbaa !19
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [4 x i32], ptr %197, i64 %200
  %202 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %203 = load i32, ptr %202, align 4, !tbaa !20
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [4 x i32], ptr %201, i64 0, i64 %204
  store i32 %179, ptr %205, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #9
  %206 = getelementptr inbounds %struct.state, ptr %17, i32 0, i32 0
  %207 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %208 = load i32, ptr %207, align 4, !tbaa !15
  %209 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %210 = load i32, ptr %209, align 4, !tbaa !20
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !11
  %214 = add nsw i32 %208, %213
  store i32 %214, ptr %206, align 4, !tbaa !15
  %215 = getelementptr inbounds %struct.state, ptr %17, i32 0, i32 1
  %216 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !17
  %218 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %219 = load i32, ptr %218, align 4, !tbaa !20
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !11
  %223 = add nsw i32 %217, %222
  store i32 %223, ptr %215, align 4, !tbaa !17
  %224 = getelementptr inbounds %struct.state, ptr %17, i32 0, i32 2
  %225 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %226 = load i32, ptr %225, align 4, !tbaa !18
  %227 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %228 = load i32, ptr %227, align 4, !tbaa !20
  %229 = add nsw i32 %228, 1
  %230 = srem i32 %229, 4
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !11
  %234 = add nsw i32 %226, %233
  store i32 %234, ptr %224, align 4, !tbaa !18
  %235 = getelementptr inbounds %struct.state, ptr %17, i32 0, i32 3
  %236 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %237 = load i32, ptr %236, align 4, !tbaa !19
  %238 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %239 = load i32, ptr %238, align 4, !tbaa !20
  %240 = add nsw i32 %239, 1
  %241 = srem i32 %240, 4
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !11
  %245 = add nsw i32 %237, %244
  store i32 %245, ptr %235, align 4, !tbaa !19
  %246 = getelementptr inbounds %struct.state, ptr %17, i32 0, i32 4
  %247 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %248 = load i32, ptr %247, align 4, !tbaa !20
  store i32 %248, ptr %246, align 4, !tbaa !20
  %249 = getelementptr inbounds %struct.state, ptr %17, i32 0, i32 5
  %250 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 5
  %251 = load i32, ptr %250, align 4, !tbaa !21
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %249, align 4, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %17, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #9
  %253 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %254 = load i32, ptr %253, align 4, !tbaa !15
  %255 = icmp eq i32 %254, 0
  br i1 %255, label %256, label %262

256:                                              ; preds = %177
  %257 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %258 = load i32, ptr %257, align 4, !tbaa !17
  %259 = load i32, ptr %2, align 4, !tbaa !11
  %260 = sub nsw i32 %259, 1
  %261 = icmp eq i32 %258, %260
  br i1 %261, label %293, label %262

262:                                              ; preds = %256, %177
  %263 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 0
  %264 = load i32, ptr %263, align 4, !tbaa !15
  %265 = icmp slt i32 %264, 0
  br i1 %265, label %293, label %266

266:                                              ; preds = %262
  %267 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 1
  %268 = load i32, ptr %267, align 4, !tbaa !17
  %269 = icmp slt i32 %268, 0
  br i1 %269, label %293, label %270

270:                                              ; preds = %266
  %271 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 0
  %272 = load i32, ptr %271, align 4, !tbaa !15
  %273 = load i32, ptr %2, align 4, !tbaa !11
  %274 = icmp sge i32 %272, %273
  br i1 %274, label %293, label %275

275:                                              ; preds = %270
  %276 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 1
  %277 = load i32, ptr %276, align 4, !tbaa !17
  %278 = load i32, ptr %2, align 4, !tbaa !11
  %279 = icmp sge i32 %277, %278
  br i1 %279, label %293, label %280

280:                                              ; preds = %275
  %281 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 0
  %282 = load i32, ptr %281, align 4, !tbaa !15
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %36, i64 %283
  %285 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 1
  %286 = load i32, ptr %285, align 4, !tbaa !17
  %287 = sext i32 %286 to i64
  %288 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %284, i64 noundef %287)
          to label %289 unwind label %173

289:                                              ; preds = %280
  %290 = load i8, ptr %288, align 1, !tbaa !24
  %291 = sext i8 %290 to i32
  %292 = icmp eq i32 %291, 72
  br i1 %292, label %293, label %300

293:                                              ; preds = %289, %275, %270, %266, %262, %256
  %294 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %295 = load i32, ptr %294, align 4, !tbaa !15
  %296 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 0
  store i32 %295, ptr %296, align 4, !tbaa !15
  %297 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %298 = load i32, ptr %297, align 4, !tbaa !17
  %299 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 1
  store i32 %298, ptr %299, align 4, !tbaa !17
  br label %300

300:                                              ; preds = %293, %289
  %301 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %302 = load i32, ptr %301, align 4, !tbaa !18
  %303 = icmp eq i32 %302, 0
  br i1 %303, label %304, label %310

304:                                              ; preds = %300
  %305 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %306 = load i32, ptr %305, align 4, !tbaa !19
  %307 = load i32, ptr %2, align 4, !tbaa !11
  %308 = sub nsw i32 %307, 1
  %309 = icmp eq i32 %306, %308
  br i1 %309, label %341, label %310

310:                                              ; preds = %304, %300
  %311 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 2
  %312 = load i32, ptr %311, align 4, !tbaa !18
  %313 = icmp slt i32 %312, 0
  br i1 %313, label %341, label %314

314:                                              ; preds = %310
  %315 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 3
  %316 = load i32, ptr %315, align 4, !tbaa !19
  %317 = icmp slt i32 %316, 0
  br i1 %317, label %341, label %318

318:                                              ; preds = %314
  %319 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 2
  %320 = load i32, ptr %319, align 4, !tbaa !18
  %321 = load i32, ptr %2, align 4, !tbaa !11
  %322 = icmp sge i32 %320, %321
  br i1 %322, label %341, label %323

323:                                              ; preds = %318
  %324 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 3
  %325 = load i32, ptr %324, align 4, !tbaa !19
  %326 = load i32, ptr %2, align 4, !tbaa !11
  %327 = icmp sge i32 %325, %326
  br i1 %327, label %341, label %328

328:                                              ; preds = %323
  %329 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 2
  %330 = load i32, ptr %329, align 4, !tbaa !18
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %36, i64 %331
  %333 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 3
  %334 = load i32, ptr %333, align 4, !tbaa !19
  %335 = sext i32 %334 to i64
  %336 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %332, i64 noundef %335)
          to label %337 unwind label %173

337:                                              ; preds = %328
  %338 = load i8, ptr %336, align 1, !tbaa !24
  %339 = sext i8 %338 to i32
  %340 = icmp eq i32 %339, 72
  br i1 %340, label %341, label %348

341:                                              ; preds = %337, %323, %318, %314, %310, %304
  %342 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %343 = load i32, ptr %342, align 4, !tbaa !18
  %344 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 2
  store i32 %343, ptr %344, align 4, !tbaa !18
  %345 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %346 = load i32, ptr %345, align 4, !tbaa !19
  %347 = getelementptr inbounds %struct.state, ptr %14, i32 0, i32 3
  store i32 %346, ptr %347, align 4, !tbaa !19
  br label %348

348:                                              ; preds = %341, %337
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 4 dereferenceable(24) %14)
          to label %349 unwind label %173

349:                                              ; preds = %348
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #9
  %350 = getelementptr inbounds %struct.state, ptr %18, i32 0, i32 0
  %351 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %352 = load i32, ptr %351, align 4, !tbaa !15
  store i32 %352, ptr %350, align 4, !tbaa !15
  %353 = getelementptr inbounds %struct.state, ptr %18, i32 0, i32 1
  %354 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %355 = load i32, ptr %354, align 4, !tbaa !17
  store i32 %355, ptr %353, align 4, !tbaa !17
  %356 = getelementptr inbounds %struct.state, ptr %18, i32 0, i32 2
  %357 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %358 = load i32, ptr %357, align 4, !tbaa !18
  store i32 %358, ptr %356, align 4, !tbaa !18
  %359 = getelementptr inbounds %struct.state, ptr %18, i32 0, i32 3
  %360 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %361 = load i32, ptr %360, align 4, !tbaa !19
  store i32 %361, ptr %359, align 4, !tbaa !19
  %362 = getelementptr inbounds %struct.state, ptr %18, i32 0, i32 4
  %363 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %364 = load i32, ptr %363, align 4, !tbaa !20
  %365 = add nsw i32 %364, 1
  %366 = srem i32 %365, 4
  store i32 %366, ptr %362, align 4, !tbaa !20
  %367 = getelementptr inbounds %struct.state, ptr %18, i32 0, i32 5
  %368 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 5
  %369 = load i32, ptr %368, align 4, !tbaa !21
  %370 = add nsw i32 %369, 1
  store i32 %370, ptr %367, align 4, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %18, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #9
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 4 dereferenceable(24) %14)
          to label %371 unwind label %173

371:                                              ; preds = %349
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #9
  %372 = getelementptr inbounds %struct.state, ptr %19, i32 0, i32 0
  %373 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 0
  %374 = load i32, ptr %373, align 4, !tbaa !15
  store i32 %374, ptr %372, align 4, !tbaa !15
  %375 = getelementptr inbounds %struct.state, ptr %19, i32 0, i32 1
  %376 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 1
  %377 = load i32, ptr %376, align 4, !tbaa !17
  store i32 %377, ptr %375, align 4, !tbaa !17
  %378 = getelementptr inbounds %struct.state, ptr %19, i32 0, i32 2
  %379 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 2
  %380 = load i32, ptr %379, align 4, !tbaa !18
  store i32 %380, ptr %378, align 4, !tbaa !18
  %381 = getelementptr inbounds %struct.state, ptr %19, i32 0, i32 3
  %382 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 3
  %383 = load i32, ptr %382, align 4, !tbaa !19
  store i32 %383, ptr %381, align 4, !tbaa !19
  %384 = getelementptr inbounds %struct.state, ptr %19, i32 0, i32 4
  %385 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 4
  %386 = load i32, ptr %385, align 4, !tbaa !20
  %387 = add nsw i32 %386, 3
  %388 = srem i32 %387, 4
  store i32 %388, ptr %384, align 4, !tbaa !20
  %389 = getelementptr inbounds %struct.state, ptr %19, i32 0, i32 5
  %390 = getelementptr inbounds %struct.state, ptr %15, i32 0, i32 5
  %391 = load i32, ptr %390, align 4, !tbaa !21
  %392 = add nsw i32 %391, 1
  store i32 %392, ptr %389, align 4, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %19, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #9
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 4 dereferenceable(24) %14)
          to label %393 unwind label %173

393:                                              ; preds = %371
  store i32 0, ptr %16, align 4
  br label %394

394:                                              ; preds = %393, %160
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #9
  %395 = load i32, ptr %16, align 4
  switch i32 %395, label %467 [
    i32 0, label %396
    i32 5, label %124
  ]

396:                                              ; preds = %394
  br label %124, !llvm.loop !23

397:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store i32 2147483647, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %398

398:                                              ; preds = %425, %397
  %399 = load i32, ptr %21, align 4, !tbaa !11
  %400 = icmp slt i32 %399, 4
  br i1 %400, label %402, label %401

401:                                              ; preds = %398
  store i32 7, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %432

402:                                              ; preds = %398
  %403 = mul nuw i64 %67, %69
  %404 = mul nuw i64 %403, %71
  %405 = mul nsw i64 0, %404
  %406 = getelementptr inbounds [4 x i32], ptr %75, i64 %405
  %407 = load i32, ptr %2, align 4, !tbaa !11
  %408 = sub nsw i32 %407, 1
  %409 = sext i32 %408 to i64
  %410 = mul nuw i64 %69, %71
  %411 = mul nsw i64 %409, %410
  %412 = getelementptr inbounds [4 x i32], ptr %406, i64 %411
  %413 = mul nsw i64 0, %71
  %414 = getelementptr inbounds [4 x i32], ptr %412, i64 %413
  %415 = load i32, ptr %2, align 4, !tbaa !11
  %416 = sub nsw i32 %415, 1
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [4 x i32], ptr %414, i64 %417
  %419 = load i32, ptr %21, align 4, !tbaa !11
  %420 = sext i32 %419 to i64
  %421 = getelementptr inbounds [4 x i32], ptr %418, i64 0, i64 %420
  %422 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %421)
          to label %423 unwind label %428

423:                                              ; preds = %402
  %424 = load i32, ptr %422, align 4, !tbaa !11
  store i32 %424, ptr %20, align 4, !tbaa !11
  br label %425

425:                                              ; preds = %423
  %426 = load i32, ptr %21, align 4, !tbaa !11
  %427 = add nsw i32 %426, 1
  store i32 %427, ptr %21, align 4, !tbaa !11
  br label %398, !llvm.loop !25

428:                                              ; preds = %402
  %429 = landingpad { ptr, i32 }
          cleanup
  %430 = extractvalue { ptr, i32 } %429, 0
  store ptr %430, ptr %6, align 8
  %431 = extractvalue { ptr, i32 } %429, 1
  store i32 %431, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %444

432:                                              ; preds = %401
  %433 = load i32, ptr %20, align 4, !tbaa !11
  %434 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %433)
          to label %435 unwind label %440

435:                                              ; preds = %432
  %436 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %434, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %437 unwind label %440

437:                                              ; preds = %435
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  call void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #9
  %438 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %36, i64 %34
  %439 = icmp eq ptr %36, %438
  br i1 %439, label %451, label %447

440:                                              ; preds = %435, %432
  %441 = landingpad { ptr, i32 }
          cleanup
  %442 = extractvalue { ptr, i32 } %441, 0
  store ptr %442, ptr %6, align 8
  %443 = extractvalue { ptr, i32 } %441, 1
  store i32 %443, ptr %7, align 4
  br label %444

444:                                              ; preds = %440, %428
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %445

445:                                              ; preds = %444, %173, %169
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #9
  call void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #9
  br label %446

446:                                              ; preds = %445, %165
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #9
  br label %454

447:                                              ; preds = %447, %437
  %448 = phi ptr [ %438, %437 ], [ %449, %447 ]
  %449 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %448, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %449) #9
  %450 = icmp eq ptr %449, %36
  br i1 %450, label %451, label %447

451:                                              ; preds = %447, %437
  %452 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %452)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %453 = load i32, ptr %1, align 4
  ret i32 %453

454:                                              ; preds = %446, %161, %59
  %455 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %36, i64 %34
  %456 = icmp eq ptr %36, %455
  br i1 %456, label %461, label %457

457:                                              ; preds = %457, %454
  %458 = phi ptr [ %455, %454 ], [ %459, %457 ]
  %459 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %458, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %459) #9
  %460 = icmp eq ptr %459, %36
  br i1 %460, label %461, label %457

461:                                              ; preds = %457, %454
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %462

462:                                              ; preds = %461
  %463 = load ptr, ptr %6, align 8
  %464 = load i32, ptr %7, align 4
  %465 = insertvalue { ptr, i32 } poison, ptr %463, 0
  %466 = insertvalue { ptr, i32 } %465, i32 %464, 1
  resume { ptr, i32 } %466

467:                                              ; preds = %394
  unreachable
}

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

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #8

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

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

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

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

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

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

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

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

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


; 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<state, std::allocator<state>>::_Deque_impl" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl" = type { %"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" }
%"struct.std::_Deque_base<state, std::allocator<state>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.state = type { i32, i32, i32, i32, i32, i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@dy = external dso_local local_unnamed_addr global [4 x i32], align 16
@dx = external dso_local local_unnamed_addr global [4 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca %struct.state, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = load ptr, ptr @stdin, align 8, !tbaa !8
  %13 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %12)
  %14 = load ptr, ptr @stdout, align 8, !tbaa !8
  %15 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %17 = load i32, ptr %1, align 4, !tbaa !11
  %18 = zext i32 %17 to i64
  %19 = call ptr @llvm.stacksave.p0()
  %20 = alloca %"class.std::__cxx11::basic_string", i64 %18, align 16
  %21 = icmp eq i32 %17, 0
  br i1 %21, label %.loopexit93, label %22

22:                                               ; preds = %0
  %23 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 %18
  br label %24

24:                                               ; preds = %24, %22
  %25 = phi ptr [ %20, %22 ], [ %26, %24 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #8
  %26 = getelementptr inbounds i8, ptr %25, i64 32
  %27 = icmp eq ptr %26, %23
  br i1 %27, label %.loopexit93, label %24

.loopexit93:                                      ; preds = %24, %0
  %28 = load i32, ptr %1, align 4, !tbaa !11
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %47, %.loopexit93
  %.lcssa = phi i32 [ %28, %.loopexit93 ], [ %48, %47 ]
  %30 = zext i32 %.lcssa to i64
  %31 = mul nuw i64 %30, %30
  %32 = mul nuw i64 %31, %30
  %33 = mul nuw i64 %32, %30
  %34 = alloca [4 x i32], i64 %33, align 16
  %35 = add nsw i32 %.lcssa, -1
  %36 = sext i32 %35 to i64
  %37 = mul nsw i64 %32, %36
  %38 = getelementptr inbounds [4 x i32], ptr %34, i64 %37
  %39 = mul nsw i64 %31, %36
  %40 = getelementptr inbounds [4 x i32], ptr %38, i64 %39
  %41 = mul nsw i64 %36, %30
  %42 = getelementptr inbounds [4 x i32], ptr %40, i64 %41
  %43 = getelementptr inbounds [4 x i32], ptr %42, i64 %36
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 2147483647, ptr %2, align 4, !tbaa !11
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %34, ptr noundef nonnull %44, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %53 unwind label %77

.lr.ph:                                           ; preds = %.loopexit93, %47
  %indvars.iv = phi i64 [ %indvars.iv.next, %47 ], [ 0, %.loopexit93 ]
  %45 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 %indvars.iv
  %46 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %45)
          to label %47 unwind label %51

47:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr %1, align 4, !tbaa !11
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !13

51:                                               ; preds = %.lr.ph
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %194

53:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #8
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %54 unwind label %79

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  %55 = load i32, ptr %1, align 4, !tbaa !11
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %4, align 4, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 0, ptr %57, align 4, !tbaa !17
  %58 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %56, ptr %58, align 4, !tbaa !18
  %59 = getelementptr inbounds i8, ptr %4, i64 12
  store i32 0, ptr %59, align 4, !tbaa !19
  %60 = getelementptr inbounds i8, ptr %4, i64 16
  store i32 0, ptr %60, align 4, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %4, i64 20
  store i32 0, ptr %61, align 4, !tbaa !21
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(24) %4)
          to label %.preheader92 unwind label %81

.preheader92:                                     ; preds = %54
  %62 = call noundef zeroext i1 @_ZNKSt5queueI5stateSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %62, label %._crit_edge97, label %.lr.ph96

.lr.ph96:                                         ; preds = %.preheader92, %148
  %63 = call noundef nonnull align 4 dereferenceable(24) ptr @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %.sroa.021.0.copyload = load i32, ptr %63, align 4, !tbaa !11
  %.sroa.11.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 4
  %.sroa.11.0.copyload = load i32, ptr %.sroa.11.0..sroa_idx, align 4, !tbaa !11
  %.sroa.18.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 8
  %.sroa.18.0.copyload = load i32, ptr %.sroa.18.0..sroa_idx, align 4, !tbaa !11
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 12
  %.sroa.25.0.copyload = load i32, ptr %.sroa.25.0..sroa_idx, align 4, !tbaa !11
  %.sroa.32.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 16
  %.sroa.32.0.copyload = load i32, ptr %.sroa.32.0..sroa_idx, align 4, !tbaa !11
  %.sroa.41.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 20
  %.sroa.41.0.copyload = load i32, ptr %.sroa.41.0..sroa_idx, align 4, !tbaa !11
  call void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %64 = sext i32 %.sroa.021.0.copyload to i64
  %65 = mul nsw i64 %32, %64
  %66 = getelementptr inbounds [4 x i32], ptr %34, i64 %65
  %67 = sext i32 %.sroa.11.0.copyload to i64
  %68 = mul nsw i64 %31, %67
  %69 = getelementptr inbounds [4 x i32], ptr %66, i64 %68
  %70 = sext i32 %.sroa.18.0.copyload to i64
  %71 = mul nsw i64 %70, %30
  %72 = getelementptr inbounds [4 x i32], ptr %69, i64 %71
  %73 = sext i32 %.sroa.25.0.copyload to i64
  %74 = sext i32 %.sroa.32.0.copyload to i64
  %75 = getelementptr inbounds [4 x i32], ptr %72, i64 %73, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !11
  %.not = icmp eq i32 %76, 2147483647
  br i1 %.not, label %85, label %148, !llvm.loop !22

77:                                               ; preds = %._crit_edge
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  br label %194

79:                                               ; preds = %53
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %190

81:                                               ; preds = %54
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %189

83:                                               ; preds = %145, %144, %143
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %189

85:                                               ; preds = %.lr.ph96
  store i32 %.sroa.41.0.copyload, ptr %75, align 4, !tbaa !11
  %86 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %74
  %87 = load i32, ptr %86, align 4, !tbaa !11
  %88 = add nsw i32 %87, %.sroa.021.0.copyload
  %89 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %74
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = add nsw i32 %90, %.sroa.11.0.copyload
  %92 = add nsw i32 %.sroa.32.0.copyload, 1
  %93 = srem i32 %92, 4
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = add nsw i32 %96, %.sroa.18.0.copyload
  %98 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %94
  %99 = load i32, ptr %98, align 4, !tbaa !11
  %100 = add nsw i32 %99, %.sroa.25.0.copyload
  %101 = add nsw i32 %.sroa.41.0.copyload, 1
  store i32 %88, ptr %4, align 4, !tbaa !11
  store i32 %91, ptr %57, align 4, !tbaa !11
  store i32 %97, ptr %58, align 4, !tbaa !11
  store i32 %100, ptr %59, align 4, !tbaa !11
  store i32 %.sroa.32.0.copyload, ptr %60, align 4, !tbaa !11
  store i32 %101, ptr %61, align 4, !tbaa !11
  %102 = icmp eq i32 %.sroa.021.0.copyload, 0
  br i1 %102, label %103, label %109

103:                                              ; preds = %85
  %104 = load i32, ptr %1, align 4, !tbaa !11
  %105 = add nsw i32 %104, -1
  %106 = icmp eq i32 %.sroa.11.0.copyload, %105
  %107 = icmp slt i32 %88, 0
  %or.cond = select i1 %106, i1 true, i1 %107
  %108 = icmp slt i32 %91, 0
  %or.cond88 = select i1 %or.cond, i1 true, i1 %108
  br i1 %or.cond88, label %119, label %110

109:                                              ; preds = %85
  %.old2 = icmp slt i32 %88, 0
  %.old = icmp slt i32 %91, 0
  %or.cond89 = select i1 %.old2, i1 true, i1 %.old
  br i1 %or.cond89, label %119, label %._crit_edge104

._crit_edge104:                                   ; preds = %109
  %.pre = load i32, ptr %1, align 4, !tbaa !11
  br label %110

110:                                              ; preds = %._crit_edge104, %103
  %111 = phi i32 [ %.pre, %._crit_edge104 ], [ %104, %103 ]
  %.not78 = icmp slt i32 %88, %111
  %.not79 = icmp slt i32 %91, %111
  %or.cond86 = and i1 %.not78, %.not79
  br i1 %or.cond86, label %112, label %119

112:                                              ; preds = %110
  %113 = zext nneg i32 %88 to i64
  %114 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 %113
  %115 = zext nneg i32 %91 to i64
  %116 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %114, i64 noundef %115)
  %117 = load i8, ptr %116, align 1, !tbaa !23
  %118 = icmp eq i8 %117, 72
  br i1 %118, label %119, label %120

119:                                              ; preds = %112, %110, %109, %103
  store i32 %.sroa.021.0.copyload, ptr %4, align 4, !tbaa !15
  store i32 %.sroa.11.0.copyload, ptr %57, align 4, !tbaa !17
  br label %120

120:                                              ; preds = %119, %112
  %121 = icmp eq i32 %.sroa.18.0.copyload, 0
  br i1 %121, label %122, label %128

122:                                              ; preds = %120
  %123 = load i32, ptr %1, align 4, !tbaa !11
  %124 = add nsw i32 %123, -1
  %125 = icmp eq i32 %.sroa.25.0.copyload, %124
  %126 = load i32, ptr %58, align 4
  %127 = icmp slt i32 %126, 0
  %or.cond6 = select i1 %125, i1 true, i1 %127
  br i1 %or.cond6, label %142, label %129

128:                                              ; preds = %120
  %.old4 = load i32, ptr %58, align 4, !tbaa !18
  %.old5 = icmp slt i32 %.old4, 0
  br i1 %.old5, label %142, label %129

129:                                              ; preds = %122, %128
  %130 = phi i32 [ %126, %122 ], [ %.old4, %128 ]
  %131 = load i32, ptr %59, align 4, !tbaa !19
  %132 = icmp slt i32 %131, 0
  br i1 %132, label %142, label %133

133:                                              ; preds = %129
  %134 = load i32, ptr %1, align 4, !tbaa !11
  %.not80 = icmp slt i32 %130, %134
  %.not81 = icmp slt i32 %131, %134
  %or.cond87 = and i1 %.not80, %.not81
  br i1 %or.cond87, label %135, label %142

135:                                              ; preds = %133
  %136 = zext nneg i32 %130 to i64
  %137 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 %136
  %138 = zext nneg i32 %131 to i64
  %139 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %137, i64 noundef %138)
  %140 = load i8, ptr %139, align 1, !tbaa !23
  %141 = icmp eq i8 %140, 72
  br i1 %141, label %142, label %143

142:                                              ; preds = %135, %133, %129, %128, %122
  store i32 %.sroa.18.0.copyload, ptr %58, align 4, !tbaa !18
  store i32 %.sroa.25.0.copyload, ptr %59, align 4, !tbaa !19
  br label %143

143:                                              ; preds = %142, %135
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(24) %4)
          to label %144 unwind label %83

144:                                              ; preds = %143
  store i32 %.sroa.021.0.copyload, ptr %4, align 4, !tbaa !11
  store i32 %.sroa.11.0.copyload, ptr %57, align 4, !tbaa !11
  store i32 %.sroa.18.0.copyload, ptr %58, align 4, !tbaa !11
  store i32 %.sroa.25.0.copyload, ptr %59, align 4, !tbaa !11
  store i32 %93, ptr %60, align 4, !tbaa !11
  store i32 %101, ptr %61, align 4, !tbaa !11
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(24) %4)
          to label %145 unwind label %83

145:                                              ; preds = %144
  %146 = add nsw i32 %.sroa.32.0.copyload, 3
  %147 = srem i32 %146, 4
  store i32 %.sroa.021.0.copyload, ptr %4, align 4, !tbaa !11
  store i32 %.sroa.11.0.copyload, ptr %57, align 4, !tbaa !11
  store i32 %.sroa.18.0.copyload, ptr %58, align 4, !tbaa !11
  store i32 %.sroa.25.0.copyload, ptr %59, align 4, !tbaa !11
  store i32 %147, ptr %60, align 4, !tbaa !11
  store i32 %101, ptr %61, align 4, !tbaa !11
  invoke void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(24) %4)
          to label %148 unwind label %83

148:                                              ; preds = %145, %.lr.ph96
  %149 = call noundef zeroext i1 @_ZNKSt5queueI5stateSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %149, label %._crit_edge97, label %.lr.ph96

._crit_edge97:                                    ; preds = %148, %.preheader92
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 2147483647, ptr %5, align 4, !tbaa !11
  %150 = load i32, ptr %1, align 4, !tbaa !11
  %151 = add nsw i32 %150, -1
  %152 = sext i32 %151 to i64
  %153 = mul nsw i64 %31, %152
  %154 = getelementptr inbounds [4 x i32], ptr %34, i64 %153
  %155 = getelementptr inbounds [4 x i32], ptr %154, i64 %152, i64 0
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %155)
  %157 = load i32, ptr %156, align 4, !tbaa !11
  store i32 %157, ptr %5, align 4, !tbaa !11
  %158 = load i32, ptr %1, align 4, !tbaa !11
  %159 = add nsw i32 %158, -1
  %160 = sext i32 %159 to i64
  %161 = mul nsw i64 %31, %160
  %162 = getelementptr inbounds [4 x i32], ptr %34, i64 %161
  %163 = getelementptr inbounds [4 x i32], ptr %162, i64 %160, i64 1
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %163)
  %165 = load i32, ptr %164, align 4, !tbaa !11
  store i32 %165, ptr %5, align 4, !tbaa !11
  %166 = load i32, ptr %1, align 4, !tbaa !11
  %167 = add nsw i32 %166, -1
  %168 = sext i32 %167 to i64
  %169 = mul nsw i64 %31, %168
  %170 = getelementptr inbounds [4 x i32], ptr %34, i64 %169
  %171 = getelementptr inbounds [4 x i32], ptr %170, i64 %168, i64 2
  %172 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %171)
  %173 = load i32, ptr %172, align 4, !tbaa !11
  store i32 %173, ptr %5, align 4, !tbaa !11
  %174 = load i32, ptr %1, align 4, !tbaa !11
  %175 = add nsw i32 %174, -1
  %176 = sext i32 %175 to i64
  %177 = mul nsw i64 %31, %176
  %178 = getelementptr inbounds [4 x i32], ptr %34, i64 %177
  %179 = getelementptr inbounds [4 x i32], ptr %178, i64 %176, i64 3
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %179)
  %181 = load i32, ptr %180, align 4, !tbaa !11
  store i32 %181, ptr %5, align 4, !tbaa !11
  %182 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %181)
          to label %183 unwind label %187

183:                                              ; preds = %._crit_edge97
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %185 unwind label %187

185:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #8
  br i1 %21, label %.loopexit91, label %.preheader90.preheader

.preheader90.preheader:                           ; preds = %185
  %186 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 %18
  br label %.preheader90

187:                                              ; preds = %183, %._crit_edge97
  %188 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %189

189:                                              ; preds = %187, %83, %81
  %.pn = phi { ptr, i32 } [ %84, %83 ], [ %188, %187 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @_ZNSt5queueI5stateSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #8
  br label %190

190:                                              ; preds = %189, %79
  %.pn.pn = phi { ptr, i32 } [ %.pn, %189 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #8
  br label %194

.preheader90:                                     ; preds = %.preheader90.preheader, %.preheader90
  %191 = phi ptr [ %192, %.preheader90 ], [ %186, %.preheader90.preheader ]
  %192 = getelementptr inbounds i8, ptr %191, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %192) #8
  %193 = icmp eq ptr %192, %20
  br i1 %193, label %.loopexit91, label %.preheader90

.loopexit91:                                      ; preds = %.preheader90, %185
  call void @llvm.stackrestore.p0(ptr %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

194:                                              ; preds = %190, %77, %51
  %.pn84 = phi { ptr, i32 } [ %52, %51 ], [ %.pn.pn, %190 ], [ %78, %77 ]
  br i1 %21, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %194
  %195 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 %18
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %196 = phi ptr [ %197, %.preheader ], [ %195, %.preheader.preheader ]
  %197 = getelementptr inbounds i8, ptr %196, i64 -32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %197) #8
  %198 = icmp eq ptr %197, %20
  br i1 %198, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %.preheader, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn84
}

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

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #7

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

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

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

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

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

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

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

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

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


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