; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2009-10 (island2)

; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [16 x i64] }
%"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] }
%"class.std::allocator" = type { i8 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.3" = type { %"struct.std::pair", i32 }
%"class.std::bitset<1005>::reference" = type { ptr, i64 }

@H = external dso_local global i32, align 4
@W = external dso_local global i32, align 4
@done = external dso_local global [1000 x [1000 x i8]], align 16
@g = external dso_local global [1000 x [1000 x i8]], align 16
@q = external dso_local global %"class.std::queue", align 8
@cover = external dso_local global [1005 x [4 x %"class.std::bitset"]], align 16
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [97 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z2adSt4pairIiiEi(i64, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3isASt4pairIiiE(i64) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkii(i32 noundef, i32 noundef) #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca %"struct.std::pair.3", align 4
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"class.std::bitset<1005>::reference", align 8
  %26 = alloca %"class.std::bitset<1005>::reference", align 8
  %27 = alloca %"struct.std::pair", align 4
  %28 = alloca %"struct.std::pair", align 4
  %29 = alloca %"struct.std::pair", align 4
  %30 = alloca %"struct.std::pair", align 4
  %31 = alloca %"struct.std::pair", align 4
  %32 = alloca %"struct.std::pair", align 4
  %33 = alloca %"struct.std::pair", align 4
  %34 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %35 unwind label %42

35:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %36 unwind label %46

36:                                               ; preds = %35
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @_ZN2io2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @H, ptr noundef nonnull align 4 dereferenceable(4) @W)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %85, %36
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = load i32, ptr @H, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %51, label %41

41:                                               ; preds = %37
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %88

42:                                               ; preds = %0
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %4, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %5, align 4
  br label %50

46:                                               ; preds = %35
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %4, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #7
  br label %50

50:                                               ; preds = %46, %42
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %278

51:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %81, %51
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = load i32, ptr @W, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1000 x [1000 x i8]], ptr @g, i64 0, i64 %59
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1000 x i8], ptr %60, i64 0, i64 %62
  call void @_ZN2io2reIcEEvRT_(ptr noundef nonnull align 1 dereferenceable(1) %63)
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1000 x [1000 x i8]], ptr @g, i64 0, i64 %65
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1000 x i8], ptr %66, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 65
  br i1 %72, label %73, label %80

73:                                               ; preds = %57
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %75
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1000 x i8], ptr %76, i64 0, i64 %78
  store i8 1, ptr %79, align 1, !tbaa !10
  br label %80

80:                                               ; preds = %73, %57
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !5
  br label %52, !llvm.loop !12

84:                                               ; preds = %56
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %6, align 4, !tbaa !5
  br label %37, !llvm.loop !14

88:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %107, %88
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr @H, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %110

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %103, %94
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = load i32, ptr @W, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %106

100:                                              ; preds = %95
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z5checkii(i32 noundef %101, i32 noundef %102)
  br label %103

103:                                              ; preds = %100
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %10, align 4, !tbaa !5
  br label %95, !llvm.loop !15

106:                                              ; preds = %99
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %9, align 4, !tbaa !5
  br label %89, !llvm.loop !16

110:                                              ; preds = %93
  br label %111

111:                                              ; preds = %150, %110
  %112 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %113 = trunc i64 %112 to i32
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %151

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %116 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %116, i64 8, i1 false)
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %117 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !17
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1000 x [1000 x i8]], ptr @g, i64 0, i64 %119
  %121 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !19
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1000 x i8], ptr %120, i64 0, i64 %123
  store i8 65, ptr %124, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 -1, ptr %12, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %147, %115
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = icmp slt i32 %126, 2
  br i1 %127, label %129, label %128

128:                                              ; preds = %125
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %150

129:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 -1, ptr %13, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %143, %129
  %131 = load i32, ptr %13, align 4, !tbaa !5
  %132 = icmp slt i32 %131, 2
  br i1 %132, label %134, label %133

133:                                              ; preds = %130
  store i32 19, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %146

134:                                              ; preds = %130
  %135 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  %136 = load i32, ptr %135, align 4, !tbaa !17
  %137 = load i32, ptr %12, align 4, !tbaa !5
  %138 = add nsw i32 %136, %137
  %139 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !19
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = add nsw i32 %140, %141
  call void @_Z5checkii(i32 noundef %138, i32 noundef %142)
  br label %143

143:                                              ; preds = %134
  %144 = load i32, ptr %13, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %13, align 4, !tbaa !5
  br label %130, !llvm.loop !20

146:                                              ; preds = %133
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %12, align 4, !tbaa !5
  br label %125, !llvm.loop !21

150:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %111, !llvm.loop !22

151:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 -1, ptr %16, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %180, %151
  %153 = load i32, ptr %17, align 4, !tbaa !5
  %154 = load i32, ptr @H, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 22, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %183

157:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %176, %157
  %159 = load i32, ptr %18, align 4, !tbaa !5
  %160 = load i32, ptr @W, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %158
  store i32 25, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %179

163:                                              ; preds = %158
  %164 = load i32, ptr %17, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %165
  %167 = load i32, ptr %18, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [1000 x i8], ptr %166, i64 0, i64 %168
  %170 = load i8, ptr %169, align 1, !tbaa !10, !range !23, !noundef !24
  %171 = trunc i8 %170 to i1
  br i1 %171, label %172, label %175

172:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %173 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZSt3maxISt4pairIiiEERKT_S4_S4_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %19)
  %174 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %173)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %175

175:                                              ; preds = %172, %163
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %18, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %18, align 4, !tbaa !5
  br label %158, !llvm.loop !25

179:                                              ; preds = %162
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %17, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %17, align 4, !tbaa !5
  br label %152, !llvm.loop !26

183:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %184 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %185 = load i32, ptr %184, align 4, !tbaa !17
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %22, align 4, !tbaa !5
  %187 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %187)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 1, ptr %23, align 4, !tbaa !5
  call void @_ZNSt4pairIS_IiiEiEC2IS0_iTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS0_RKi(ptr noundef nonnull align 4 dereferenceable(12) %20, ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %23)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %275, %183
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %189 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  %190 = getelementptr inbounds %"struct.std::pair", ptr %189, i32 0, i32 0
  %191 = load i32, ptr %190, align 4, !tbaa !27
  %192 = add nsw i32 %191, 2
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [1005 x [4 x %"class.std::bitset"]], ptr @cover, i64 0, i64 %193
  %195 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !29
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [4 x %"class.std::bitset"], ptr %194, i64 0, i64 %197
  %199 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  %200 = getelementptr inbounds %"struct.std::pair", ptr %199, i32 0, i32 1
  %201 = load i32, ptr %200, align 4, !tbaa !30
  %202 = add nsw i32 %201, 2
  %203 = sext i32 %202 to i64
  call void @_ZNSt6bitsetILm1005EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1005>::reference") align 8 %25, ptr noundef nonnull align 8 dereferenceable(128) %198, i64 noundef %203)
  %204 = call noundef zeroext i1 @_ZNKSt6bitsetILm1005EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %25) #7
  %205 = xor i1 %204, true
  call void @_ZNSt6bitsetILm1005EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  br i1 %205, label %206, label %276

206:                                              ; preds = %188
  %207 = load i32, ptr %24, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %209 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  %210 = getelementptr inbounds %"struct.std::pair", ptr %209, i32 0, i32 0
  %211 = load i32, ptr %210, align 4, !tbaa !27
  %212 = add nsw i32 %211, 2
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [1005 x [4 x %"class.std::bitset"]], ptr @cover, i64 0, i64 %213
  %215 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %216 = load i32, ptr %215, align 4, !tbaa !29
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [4 x %"class.std::bitset"], ptr %214, i64 0, i64 %217
  %219 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  %220 = getelementptr inbounds %"struct.std::pair", ptr %219, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !30
  %222 = add nsw i32 %221, 2
  %223 = sext i32 %222 to i64
  call void @_ZNSt6bitsetILm1005EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<1005>::reference") align 8 %26, ptr noundef nonnull align 8 dereferenceable(128) %218, i64 noundef %223)
  %224 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1005EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %26, i1 noundef zeroext true) #7
  call void @_ZNSt6bitsetILm1005EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %225 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %225, i64 8, i1 false)
  %226 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %227 = load i32, ptr %226, align 4, !tbaa !29
  %228 = load i64, ptr %28, align 4
  %229 = call i64 @_Z2adSt4pairIiiEi(i64 %228, i32 noundef %227)
  store i64 %229, ptr %27, align 4
  %230 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  %231 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %230, ptr noundef nonnull align 4 dereferenceable(8) %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  %232 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %232, i64 8, i1 false)
  %233 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !29
  %235 = add nsw i32 %234, 1
  %236 = load i64, ptr %30, align 4
  %237 = call i64 @_Z2adSt4pairIiiEi(i64 %236, i32 noundef %235)
  store i64 %237, ptr %29, align 4
  %238 = load i64, ptr %29, align 4
  %239 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %238)
  br i1 %239, label %246, label %240

240:                                              ; preds = %206
  %241 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %242 = load i32, ptr %241, align 4, !tbaa !29
  %243 = add nsw i32 %242, 1
  %244 = srem i32 %243, 4
  %245 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  store i32 %244, ptr %245, align 4, !tbaa !29
  br label %275

246:                                              ; preds = %206
  %247 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %247, i64 8, i1 false)
  %248 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %249 = load i32, ptr %248, align 4, !tbaa !29
  %250 = load i64, ptr %32, align 4
  %251 = call i64 @_Z2adSt4pairIiiEi(i64 %250, i32 noundef %249)
  store i64 %251, ptr %31, align 4
  %252 = load i64, ptr %31, align 4
  %253 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %252)
  br i1 %253, label %255, label %254

254:                                              ; preds = %246
  br label %274

255:                                              ; preds = %246
  %256 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %256, i64 8, i1 false)
  %257 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %258 = load i32, ptr %257, align 4, !tbaa !29
  %259 = add nsw i32 %258, 3
  %260 = load i64, ptr %34, align 4
  %261 = call i64 @_Z2adSt4pairIiiEi(i64 %260, i32 noundef %259)
  store i64 %261, ptr %33, align 4
  %262 = load i64, ptr %33, align 4
  %263 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %262)
  %264 = xor i1 %263, true
  br i1 %264, label %265, label %266

265:                                              ; preds = %255
  br label %268

266:                                              ; preds = %255
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 201, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

267:                                              ; No predecessors!
  br label %268

268:                                              ; preds = %267, %265
  %269 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  %270 = load i32, ptr %269, align 4, !tbaa !29
  %271 = add nsw i32 %270, 3
  %272 = srem i32 %271, 4
  %273 = getelementptr inbounds %"struct.std::pair.3", ptr %20, i32 0, i32 1
  store i32 %272, ptr %273, align 4, !tbaa !29
  br label %274

274:                                              ; preds = %268, %254
  br label %275

275:                                              ; preds = %274, %240
  br label %188, !llvm.loop !31

276:                                              ; preds = %188
  call void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %24)
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %277 = load i32, ptr %1, align 4
  ret i32 %277

278:                                              ; preds = %50
  %279 = load ptr, ptr %4, align 8
  %280 = load i32, ptr %5, align 4
  %281 = insertvalue { ptr, i32 } poison, ptr %279, 0
  %282 = insertvalue { ptr, i32 } %281, i32 %280, 1
  resume { ptr, i32 } %282
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reIcEEvRT_(ptr noundef nonnull align 1 dereferenceable(1)) #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm1005EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<1005>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(128), i64 noundef) #1 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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

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

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


; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [16 x i64] }
%"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] }
%"class.std::allocator" = type { i8 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.3" = type { %"struct.std::pair", i32 }
%"class.std::bitset<1005>::reference" = type { ptr, i64 }

@H = external dso_local global i32, align 4
@W = external dso_local global i32, align 4
@done = external dso_local local_unnamed_addr global [1000 x [1000 x i8]], align 16
@g = external dso_local global [1000 x [1000 x i8]], align 16
@q = external dso_local global %"class.std::queue", align 8
@cover = external dso_local global [1005 x [4 x %"class.std::bitset"]], align 16
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [97 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z2adSt4pairIiiEi(i64, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3isASt4pairIiiE(i64) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5checkii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair.3", align 8
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::bitset<1005>::reference", align 8
  %15 = alloca %"class.std::bitset<1005>::reference", align 8
  %16 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.6, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %17 unwind label %28

17:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %18 unwind label %30

18:                                               ; preds = %17
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  call void @_ZN2io2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @H, ptr noundef nonnull align 4 dereferenceable(4) @W)
  %19 = load i32, ptr @H, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  %21 = load i32, ptr @W, align 4
  %22 = icmp sgt i32 %21, 0
  %or.cond = select i1 %20, i1 %22, i1 false
  br i1 %or.cond, label %.preheader46, label %.preheader43

.preheader46:                                     ; preds = %18, %._crit_edge
  %23 = phi i32 [ %33, %._crit_edge ], [ %19, %18 ]
  %24 = phi i32 [ %34, %._crit_edge ], [ %21, %18 ]
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %._crit_edge ], [ 0, %18 ]
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

.preheader45:                                     ; preds = %._crit_edge
  %26 = icmp sgt i32 %33, 0
  %.pr = load i32, ptr @W, align 4
  %27 = icmp sgt i32 %.pr, 0
  %or.cond83 = select i1 %26, i1 %27, i1 false
  br i1 %or.cond83, label %.preheader44, label %.preheader43

28:                                               ; preds = %0
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %32

30:                                               ; preds = %17
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  br label %32

32:                                               ; preds = %30, %28
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %29, %28 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn

._crit_edge.loopexit:                             ; preds = %42
  %.pre = load i32, ptr @H, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader46
  %33 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %23, %.preheader46 ]
  %34 = phi i32 [ %43, %._crit_edge.loopexit ], [ %24, %.preheader46 ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %35 = sext i32 %33 to i64
  %36 = icmp slt i64 %indvars.iv.next69, %35
  br i1 %36, label %.preheader46, label %.preheader45, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader46, %42
  %indvars.iv = phi i64 [ %indvars.iv.next, %42 ], [ 0, %.preheader46 ]
  %37 = getelementptr inbounds [1000 x [1000 x i8]], ptr @g, i64 0, i64 %indvars.iv68, i64 %indvars.iv
  call void @_ZN2io2reIcEEvRT_(ptr noundef nonnull align 1 dereferenceable(1) %37)
  %38 = load i8, ptr %37, align 1, !tbaa !12
  %39 = icmp eq i8 %38, 65
  br i1 %39, label %40, label %42

40:                                               ; preds = %.lr.ph
  %41 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %indvars.iv68, i64 %indvars.iv
  store i8 1, ptr %41, align 1, !tbaa !13
  br label %42

42:                                               ; preds = %.lr.ph, %40
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = load i32, ptr @W, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next, %44
  br i1 %45, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !15

.preheader44:                                     ; preds = %.preheader45, %._crit_edge51
  %46 = phi i32 [ %51, %._crit_edge51 ], [ %33, %.preheader45 ]
  %47 = phi i32 [ %52, %._crit_edge51 ], [ %.pr, %.preheader45 ]
  %.03652 = phi i32 [ %53, %._crit_edge51 ], [ 0, %.preheader45 ]
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph50, label %._crit_edge51

.preheader43:                                     ; preds = %._crit_edge51, %18, %.preheader45
  %49 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %50 = and i64 %49, 4294967295
  %.not55 = icmp eq i64 %50, 0
  br i1 %.not55, label %._crit_edge57, label %.lr.ph56

._crit_edge51.loopexit:                           ; preds = %.lr.ph50
  %.pre71 = load i32, ptr @H, align 4, !tbaa !5
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %._crit_edge51.loopexit, %.preheader44
  %51 = phi i32 [ %.pre71, %._crit_edge51.loopexit ], [ %46, %.preheader44 ]
  %52 = phi i32 [ %56, %._crit_edge51.loopexit ], [ %47, %.preheader44 ]
  %53 = add nuw nsw i32 %.03652, 1
  %54 = icmp slt i32 %53, %51
  br i1 %54, label %.preheader44, label %.preheader43, !llvm.loop !16

.lr.ph50:                                         ; preds = %.preheader44, %.lr.ph50
  %.03749 = phi i32 [ %55, %.lr.ph50 ], [ 0, %.preheader44 ]
  call void @_Z5checkii(i32 noundef %.03652, i32 noundef %.03749)
  %55 = add nuw nsw i32 %.03749, 1
  %56 = load i32, ptr @W, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %.lr.ph50, label %._crit_edge51.loopexit, !llvm.loop !17

.lr.ph56:                                         ; preds = %.preheader43, %.lr.ph56
  %58 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %.sroa.012.0.copyload = load i32, ptr %58, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %58, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %59 = sext i32 %.sroa.012.0.copyload to i64
  %60 = sext i32 %.sroa.5.0.copyload to i64
  %61 = getelementptr inbounds [1000 x [1000 x i8]], ptr @g, i64 0, i64 %59, i64 %60
  store i8 65, ptr %61, align 1, !tbaa !12
  %62 = add nsw i32 %.sroa.5.0.copyload, -1
  %63 = add nsw i32 %.sroa.012.0.copyload, -1
  call void @_Z5checkii(i32 noundef %63, i32 noundef %62)
  call void @_Z5checkii(i32 noundef %63, i32 noundef %.sroa.5.0.copyload)
  %64 = add nsw i32 %.sroa.5.0.copyload, 1
  call void @_Z5checkii(i32 noundef %63, i32 noundef %64)
  call void @_Z5checkii(i32 noundef %.sroa.012.0.copyload, i32 noundef %62)
  call void @_Z5checkii(i32 noundef %.sroa.012.0.copyload, i32 noundef %.sroa.5.0.copyload)
  call void @_Z5checkii(i32 noundef %.sroa.012.0.copyload, i32 noundef %64)
  %65 = add nsw i32 %.sroa.012.0.copyload, 1
  call void @_Z5checkii(i32 noundef %65, i32 noundef %62)
  call void @_Z5checkii(i32 noundef %65, i32 noundef %.sroa.5.0.copyload)
  call void @_Z5checkii(i32 noundef %65, i32 noundef %64)
  %66 = call noundef i64 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) @q)
  %67 = and i64 %66, 4294967295
  %.not = icmp eq i64 %67, 0
  br i1 %.not, label %._crit_edge57, label %.lr.ph56, !llvm.loop !18

._crit_edge57:                                    ; preds = %.lr.ph56, %.preheader43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %68 = load i32, ptr @H, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, 0
  %70 = load i32, ptr @W, align 4
  %71 = icmp sgt i32 %70, 0
  %or.cond89 = select i1 %69, i1 %71, i1 false
  br i1 %or.cond89, label %.lr.ph63.split, label %._crit_edge64

._crit_edge64:                                    ; preds = %._crit_edge61, %._crit_edge57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %72 = load i32, ptr %3, align 4, !tbaa !19
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %11, align 4, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %3, i64 4
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %74)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @_ZNSt4pairIS_IiiEiEC2IS0_iTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS0_RKi(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %9, i64 8
  %76 = getelementptr inbounds i8, ptr %9, i64 4
  br label %103

.lr.ph63.split:                                   ; preds = %._crit_edge57, %._crit_edge61
  %77 = phi i32 [ %82, %._crit_edge61 ], [ %68, %._crit_edge57 ]
  %78 = phi i32 [ %86, %._crit_edge61 ], [ 0, %._crit_edge57 ]
  %79 = phi i32 [ %84, %._crit_edge61 ], [ %70, %._crit_edge57 ]
  %80 = phi i32 [ %85, %._crit_edge61 ], [ %70, %._crit_edge57 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph60, label %._crit_edge61

._crit_edge61.loopexit:                           ; preds = %98
  %.pre74 = load i32, ptr %6, align 4, !tbaa !5
  %.pre75 = load i32, ptr @H, align 4, !tbaa !5
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit, %.lr.ph63.split
  %82 = phi i32 [ %.pre75, %._crit_edge61.loopexit ], [ %77, %.lr.ph63.split ]
  %83 = phi i32 [ %.pre74, %._crit_edge61.loopexit ], [ %78, %.lr.ph63.split ]
  %84 = phi i32 [ %99, %._crit_edge61.loopexit ], [ %79, %.lr.ph63.split ]
  %85 = phi i32 [ %99, %._crit_edge61.loopexit ], [ %80, %.lr.ph63.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %86 = add nsw i32 %83, 1
  store i32 %86, ptr %6, align 4, !tbaa !5
  %87 = icmp slt i32 %86, %82
  br i1 %87, label %.lr.ph63.split, label %._crit_edge64, !llvm.loop !21

.lr.ph60:                                         ; preds = %.lr.ph63.split, %98
  %88 = phi i32 [ %99, %98 ], [ %79, %.lr.ph63.split ]
  %storemerge4258 = phi i32 [ %101, %98 ], [ 0, %.lr.ph63.split ]
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = sext i32 %storemerge4258 to i64
  %92 = getelementptr inbounds [1000 x [1000 x i8]], ptr @done, i64 0, i64 %90, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !13, !range !22, !noundef !23
  %94 = trunc nuw i8 %93 to i1
  br i1 %94, label %95, label %98

95:                                               ; preds = %.lr.ph60
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZSt3maxISt4pairIiiEERKT_S4_S4_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %97 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %96)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %.pre72 = load i32, ptr %7, align 4, !tbaa !5
  %.pre73 = load i32, ptr @W, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %.lr.ph60, %95
  %99 = phi i32 [ %88, %.lr.ph60 ], [ %.pre73, %95 ]
  %100 = phi i32 [ %storemerge4258, %.lr.ph60 ], [ %.pre72, %95 ]
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %7, align 4, !tbaa !5
  %102 = icmp slt i32 %101, %99
  br i1 %102, label %.lr.ph60, label %._crit_edge61.loopexit, !llvm.loop !24

103:                                              ; preds = %.backedge, %._crit_edge64
  %104 = phi i32 [ 0, %._crit_edge64 ], [ %116, %.backedge ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  %105 = load i32, ptr %9, align 8, !tbaa !25
  %106 = add nsw i32 %105, 2
  %107 = sext i32 %106 to i64
  %108 = load i32, ptr %75, align 8, !tbaa !27
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1005 x [4 x %"class.std::bitset"]], ptr @cover, i64 0, i64 %107, i64 %109
  %111 = load i32, ptr %76, align 4, !tbaa !28
  %112 = add nsw i32 %111, 2
  %113 = sext i32 %112 to i64
  call void @_ZNSt6bitsetILm1005EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1005>::reference") align 8 %14, ptr noundef nonnull align 8 dereferenceable(128) %110, i64 noundef %113)
  %114 = call noundef zeroext i1 @_ZNKSt6bitsetILm1005EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @_ZNSt6bitsetILm1005EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  br i1 %114, label %147, label %115

115:                                              ; preds = %103
  %116 = add nuw nsw i32 %104, 1
  store i32 %116, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  %117 = load i32, ptr %9, align 8, !tbaa !25
  %118 = add nsw i32 %117, 2
  %119 = sext i32 %118 to i64
  %120 = load i32, ptr %75, align 8, !tbaa !27
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1005 x [4 x %"class.std::bitset"]], ptr @cover, i64 0, i64 %119, i64 %121
  %123 = load i32, ptr %76, align 4, !tbaa !28
  %124 = add nsw i32 %123, 2
  %125 = sext i32 %124 to i64
  call void @_ZNSt6bitsetILm1005EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<1005>::reference") align 8 %15, ptr noundef nonnull align 8 dereferenceable(128) %122, i64 noundef %125)
  %126 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm1005EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %15, i1 noundef zeroext true) #6
  call void @_ZNSt6bitsetILm1005EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %.sroa.06.0.copyload = load i64, ptr %9, align 8
  %127 = load i32, ptr %75, align 8, !tbaa !27
  %128 = call i64 @_Z2adSt4pairIiiEi(i64 %.sroa.06.0.copyload, i32 noundef %127)
  store i64 %128, ptr %16, align 8
  %129 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  %.sroa.04.0.copyload = load i64, ptr %9, align 8
  %130 = load i32, ptr %75, align 8, !tbaa !27
  %131 = add nsw i32 %130, 1
  %132 = call i64 @_Z2adSt4pairIiiEi(i64 %.sroa.04.0.copyload, i32 noundef %131)
  %133 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %132)
  br i1 %133, label %134, label %.sink.split

134:                                              ; preds = %115
  %.sroa.02.0.copyload = load i64, ptr %9, align 8
  %135 = load i32, ptr %75, align 8, !tbaa !27
  %136 = call i64 @_Z2adSt4pairIiiEi(i64 %.sroa.02.0.copyload, i32 noundef %135)
  %137 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %136)
  br i1 %137, label %138, label %.backedge

138:                                              ; preds = %134
  %.sroa.0.0.copyload = load i64, ptr %9, align 8
  %139 = load i32, ptr %75, align 8, !tbaa !27
  %140 = add nsw i32 %139, 3
  %141 = call i64 @_Z2adSt4pairIiiEi(i64 %.sroa.0.0.copyload, i32 noundef %140)
  %142 = call noundef zeroext i1 @_Z3isASt4pairIiiE(i64 %141)
  br i1 %142, label %143, label %.sink.split

143:                                              ; preds = %138
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 201, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

.sink.split:                                      ; preds = %138, %115
  %.sink81 = phi i32 [ 1, %115 ], [ 3, %138 ]
  %144 = load i32, ptr %75, align 8, !tbaa !27
  %145 = add nsw i32 %144, %.sink81
  %146 = srem i32 %145, 4
  store i32 %146, ptr %75, align 8, !tbaa !27
  br label %.backedge

.backedge:                                        ; preds = %.sink.split, %134
  br label %103, !llvm.loop !29

147:                                              ; preds = %103
  call void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2reIcEEvRT_(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm1005EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<1005>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(128), i64 noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io2prIiEEvRKT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

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

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

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


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