; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/139 Division 2/Problem D (D)

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair.0" = type { %"struct.std::pair", i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global [9 x i32], align 16
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@d = external dso_local global [16 x [16 x [65536 x i32]]], align 16
@v = external dso_local global [16 x [16 x [65536 x i32]]], align 16
@inf = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@up = external dso_local global i32, align 4
@g = external dso_local global [20 x [20 x i8]], align 16
@pos = external dso_local global [10 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@__const.main.dx = external hidden unnamed_addr constant [4 x i32], align 16
@__const.main.dy = external hidden unnamed_addr constant [4 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4goodiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3oppi(i32 noundef) #0

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

34:                                               ; preds = %48, %0
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = icmp slt i32 %35, 9
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %51

38:                                               ; preds = %34
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [9 x i32], ptr @p, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = mul nsw i32 %43, 4
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [9 x i32], ptr @p, i64 0, i64 %46
  store i32 %44, ptr %47, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %38
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !9

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

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

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

57:                                               ; preds = %52
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %59
  %61 = getelementptr inbounds [20 x i8], ptr %60, i64 0, i64 0
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %61)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %106, %57
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %63
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %70
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [20 x i8], ptr %71, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = sext i8 %75 to i32
  %77 = icmp sle i32 49, %76
  br i1 %77, label %78, label %105

78:                                               ; preds = %68
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %80
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [20 x i8], ptr %81, i64 0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = sext i8 %85 to i32
  %87 = icmp sle i32 %86, 57
  br i1 %87, label %88, label %105

88:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [20 x i8], ptr %91, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !11
  %96 = sext i8 %95 to i32
  %97 = sub nsw i32 %96, 48
  store i32 %97, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %98 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %98, ptr %7, align 4
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [10 x %"struct.std::pair"], ptr @pos, i64 0, i64 %100
  %102 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %101, ptr noundef nonnull align 4 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %104 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %104, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %105

105:                                              ; preds = %88, %78, %68
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %5, align 4, !tbaa !5
  br label %63, !llvm.loop !12

109:                                              ; preds = %67
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %3, align 4, !tbaa !5
  br label %52, !llvm.loop !13

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

114:                                              ; preds = %153, %113
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %156

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

120:                                              ; preds = %149, %119
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = load i32, ptr @m, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %152

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

126:                                              ; preds = %145, %125
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = load i32, ptr @mx, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 1
  %130 = mul nsw i32 2, %129
  %131 = shl i32 1, %130
  %132 = icmp slt i32 %127, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %126
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %148

134:                                              ; preds = %126
  %135 = load i32, ptr @inf, align 4, !tbaa !5
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %137
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [16 x [65536 x i32]], ptr %138, i64 0, i64 %140
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [65536 x i32], ptr %141, i64 0, i64 %143
  store i32 %135, ptr %144, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %134
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %10, align 4, !tbaa !5
  br label %126, !llvm.loop !14

148:                                              ; preds = %133
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %9, align 4, !tbaa !5
  br label %120, !llvm.loop !15

152:                                              ; preds = %124
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %8, align 4, !tbaa !5
  br label %114, !llvm.loop !16

156:                                              ; preds = %118
  %157 = load i32, ptr @mx, align 4, !tbaa !5
  %158 = mul nsw i32 2, %157
  %159 = sub nsw i32 %158, 2
  %160 = shl i32 1, %159
  %161 = sub nsw i32 %160, 1
  store i32 %161, ptr @up, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 2, ptr %12, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %184, %156
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = load i32, ptr @mx, align 4, !tbaa !5
  %165 = icmp sle i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %187

167:                                              ; preds = %162
  %168 = load i32, ptr %12, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [10 x %"struct.std::pair"], ptr @pos, i64 0, i64 %169
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %170, i64 8, i1 false)
  %171 = load i32, ptr %12, align 4, !tbaa !5
  %172 = sub nsw i32 %171, 1
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [10 x %"struct.std::pair"], ptr @pos, i64 0, i64 %173
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %174, i64 8, i1 false)
  %175 = load i64, ptr %13, align 4
  %176 = load i64, ptr %14, align 4
  %177 = call noundef i32 @_Z6getdirSt4pairIiiES0_(i64 %175, i64 %176)
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = mul nsw i32 2, %178
  %180 = sub nsw i32 %179, 4
  %181 = shl i32 %177, %180
  %182 = load i32, ptr %11, align 4, !tbaa !5
  %183 = or i32 %182, %181
  store i32 %183, ptr %11, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %167
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %12, align 4, !tbaa !5
  br label %162, !llvm.loop !17

187:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %15)
  %188 = load i32, ptr getelementptr inbounds ([10 x %"struct.std::pair"], ptr @pos, i64 0, i64 1), align 8, !tbaa !18
  store i32 %188, ptr @x, align 4, !tbaa !5
  %189 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr getelementptr inbounds ([10 x %"struct.std::pair"], ptr @pos, i64 0, i64 1), i32 0, i32 1), align 4, !tbaa !20
  store i32 %189, ptr @y, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %16) #7
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %190 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @x, ptr noundef nonnull align 4 dereferenceable(4) @y)
          to label %191 unwind label %236

191:                                              ; preds = %187
  store i64 %190, ptr %18, align 4
  %192 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %193 unwind label %236

193:                                              ; preds = %191
  store { i64, i32 } %192, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %21, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %194 unwind label %236

194:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  %195 = load i32, ptr @x, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %196
  %198 = load i32, ptr @y, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [16 x [65536 x i32]], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr %11, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [65536 x i32], ptr %200, i64 0, i64 %202
  store i32 0, ptr %203, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 @__const.main.dx, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 @__const.main.dy, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %204 = load i32, ptr @inf, align 4, !tbaa !5
  store i32 %204, ptr %24, align 4, !tbaa !5
  br label %205

205:                                              ; preds = %360, %235, %194
  %206 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %207 unwind label %240

207:                                              ; preds = %205
  %208 = xor i1 %206, true
  br i1 %208, label %209, label %361

209:                                              ; preds = %207
  %210 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %211 unwind label %240

211:                                              ; preds = %209
  %212 = getelementptr inbounds %"struct.std::pair.0", ptr %210, i32 0, i32 0
  %213 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %212)
          to label %214 unwind label %240

214:                                              ; preds = %211
  %215 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %216 unwind label %240

216:                                              ; preds = %214
  %217 = getelementptr inbounds %"struct.std::pair.0", ptr %215, i32 0, i32 1
  %218 = load i32, ptr %217, align 4, !tbaa !21
  store i32 %218, ptr %11, align 4, !tbaa !5
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
          to label %219 unwind label %240

219:                                              ; preds = %216
  %220 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %221 = load i32, ptr %220, align 4, !tbaa !18
  store i32 %221, ptr @x, align 4, !tbaa !5
  %222 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %223 = load i32, ptr %222, align 4, !tbaa !20
  store i32 %223, ptr @y, align 4, !tbaa !5
  %224 = load i32, ptr @x, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @v, i64 0, i64 %225
  %227 = load i32, ptr @y, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [16 x [65536 x i32]], ptr %226, i64 0, i64 %228
  %230 = load i32, ptr %11, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [65536 x i32], ptr %229, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %244

235:                                              ; preds = %219
  br label %205, !llvm.loop !23

236:                                              ; preds = %193, %191, %187
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %19, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  br label %375

240:                                              ; preds = %368, %365, %263, %216, %214, %211, %209, %205
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %19, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %20, align 4
  br label %374

244:                                              ; preds = %219
  %245 = load i32, ptr @x, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @v, i64 0, i64 %246
  %248 = load i32, ptr @y, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [16 x [65536 x i32]], ptr %247, i64 0, i64 %249
  %251 = load i32, ptr %11, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [65536 x i32], ptr %250, i64 0, i64 %252
  store i32 1, ptr %253, align 4, !tbaa !5
  %254 = load i32, ptr @x, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %255
  %257 = load i32, ptr @y, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [20 x i8], ptr %256, i64 0, i64 %258
  %260 = load i8, ptr %259, align 1, !tbaa !11
  %261 = sext i8 %260 to i32
  %262 = icmp eq i32 %261, 64
  br i1 %262, label %263, label %276

263:                                              ; preds = %244
  %264 = load i32, ptr @x, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %265
  %267 = load i32, ptr @y, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [16 x [65536 x i32]], ptr %266, i64 0, i64 %268
  %270 = load i32, ptr %11, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [65536 x i32], ptr %269, i64 0, i64 %271
  %273 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %272)
          to label %274 unwind label %240

274:                                              ; preds = %263
  %275 = load i32, ptr %273, align 4, !tbaa !5
  store i32 %275, ptr %24, align 4, !tbaa !5
  br label %276

276:                                              ; preds = %274, %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %277

277:                                              ; preds = %348, %276
  %278 = load i32, ptr %25, align 4, !tbaa !5
  %279 = icmp slt i32 %278, 4
  br i1 %279, label %281, label %280

280:                                              ; preds = %277
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %360

281:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %282 = load i32, ptr @x, align 4, !tbaa !5
  %283 = load i32, ptr %25, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [4 x i32], ptr %22, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !5
  %287 = add nsw i32 %282, %286
  store i32 %287, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %288 = load i32, ptr @y, align 4, !tbaa !5
  %289 = load i32, ptr %25, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [4 x i32], ptr %23, i64 0, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !5
  %293 = add nsw i32 %288, %292
  store i32 %293, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %294 = load i32, ptr %11, align 4, !tbaa !5
  %295 = shl i32 %294, 2
  %296 = load i32, ptr %25, align 4, !tbaa !5
  %297 = call noundef i32 @_Z3oppi(i32 noundef %296)
  %298 = or i32 %295, %297
  store i32 %298, ptr %28, align 4, !tbaa !5
  %299 = load i32, ptr @up, align 4, !tbaa !5
  %300 = load i32, ptr %28, align 4, !tbaa !5
  %301 = and i32 %300, %299
  store i32 %301, ptr %28, align 4, !tbaa !5
  %302 = load i32, ptr %26, align 4, !tbaa !5
  %303 = load i32, ptr %27, align 4, !tbaa !5
  %304 = load i32, ptr %28, align 4, !tbaa !5
  %305 = call noundef zeroext i1 @_Z4goodiii(i32 noundef %302, i32 noundef %303, i32 noundef %304)
  br i1 %305, label %307, label %306

306:                                              ; preds = %281
  store i32 27, ptr %4, align 4
  br label %345

307:                                              ; preds = %281
  %308 = load i32, ptr %26, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %309
  %311 = load i32, ptr %27, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [16 x [65536 x i32]], ptr %310, i64 0, i64 %312
  %314 = load i32, ptr %28, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [65536 x i32], ptr %313, i64 0, i64 %315
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %317 = load i32, ptr @x, align 4, !tbaa !5
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %318
  %320 = load i32, ptr @y, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [16 x [65536 x i32]], ptr %319, i64 0, i64 %321
  %323 = load i32, ptr %11, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [65536 x i32], ptr %322, i64 0, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %29, align 4, !tbaa !5
  %328 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %316, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %329 unwind label %351

329:                                              ; preds = %307
  %330 = load i32, ptr %328, align 4, !tbaa !5
  %331 = load i32, ptr %26, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %332
  %334 = load i32, ptr %27, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [16 x [65536 x i32]], ptr %333, i64 0, i64 %335
  %337 = load i32, ptr %28, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [65536 x i32], ptr %336, i64 0, i64 %338
  store i32 %330, ptr %339, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %340 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %341 unwind label %355

341:                                              ; preds = %329
  store i64 %340, ptr %31, align 4
  %342 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %31, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %343 unwind label %355

343:                                              ; preds = %341
  store { i64, i32 } %342, ptr %32, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 8 %32, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 4 dereferenceable(12) %30)
          to label %344 unwind label %355

344:                                              ; preds = %343
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #7
  store i32 0, ptr %4, align 4
  br label %345

345:                                              ; preds = %344, %306
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  %346 = load i32, ptr %4, align 4
  switch i32 %346, label %381 [
    i32 0, label %347
    i32 27, label %348
  ]

347:                                              ; preds = %345
  br label %348

348:                                              ; preds = %347, %345
  %349 = load i32, ptr %25, align 4, !tbaa !5
  %350 = add nsw i32 %349, 1
  store i32 %350, ptr %25, align 4, !tbaa !5
  br label %277, !llvm.loop !24

351:                                              ; preds = %307
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %19, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %359

355:                                              ; preds = %343, %341, %329
  %356 = landingpad { ptr, i32 }
          cleanup
  %357 = extractvalue { ptr, i32 } %356, 0
  store ptr %357, ptr %19, align 8
  %358 = extractvalue { ptr, i32 } %356, 1
  store i32 %358, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #7
  br label %359

359:                                              ; preds = %355, %351
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %374

360:                                              ; preds = %280
  br label %205, !llvm.loop !23

361:                                              ; preds = %207
  %362 = load i32, ptr %24, align 4, !tbaa !5
  %363 = load i32, ptr @inf, align 4, !tbaa !5
  %364 = icmp eq i32 %362, %363
  br i1 %364, label %365, label %368

365:                                              ; preds = %361
  %366 = invoke i32 @puts(ptr noundef @.str.2)
          to label %367 unwind label %240

367:                                              ; preds = %365
  br label %372

368:                                              ; preds = %361
  %369 = load i32, ptr %24, align 4, !tbaa !5
  %370 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %369)
          to label %371 unwind label %240

371:                                              ; preds = %368
  br label %372

372:                                              ; preds = %371, %367
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %373 = load i32, ptr %1, align 4
  ret i32 %373

374:                                              ; preds = %359, %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  br label %375

375:                                              ; preds = %374, %236
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %376

376:                                              ; preds = %375
  %377 = load ptr, ptr %19, align 8
  %378 = load i32, ptr %20, align 4
  %379 = insertvalue { ptr, i32 } poison, ptr %377, 0
  %380 = insertvalue { ptr, i32 } %379, i32 %378, 1
  resume { ptr, i32 } %380

381:                                              ; preds = %345
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

; 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)) #0 align 2

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 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)) #5

declare i32 @puts(ptr noundef) #3

declare i32 @printf(ptr noundef, ...) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { 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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }

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

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


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

%"struct.std::pair" = type { i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair.0" = type { %"struct.std::pair", i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local local_unnamed_addr global [9 x i32], align 16
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@d = external dso_local global [16 x [16 x [65536 x i32]]], align 16
@v = external dso_local local_unnamed_addr global [16 x [16 x [65536 x i32]]], align 16
@inf = external dso_local local_unnamed_addr global i32, align 4
@mx = external dso_local global i32, align 4
@up = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [20 x [20 x i8]], align 16
@pos = external dso_local global [10 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@__const.main.dx = external hidden unnamed_addr constant [4 x i32], align 16
@__const.main.dy = external hidden unnamed_addr constant [4 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4goodiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3oppi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"class.std::queue", align 8
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair.0", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store <4 x i32> <i32 1, i32 4, i32 16, i32 64>, ptr @p, align 16, !tbaa !5
  store <4 x i32> <i32 256, i32 1024, i32 4096, i32 16384>, ptr getelementptr inbounds (i8, ptr @p, i64 16), align 16, !tbaa !5
  store i32 65536, ptr getelementptr inbounds (i8, ptr @p, i64 32), align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph50, label %._crit_edge51.thread

._crit_edge51.thread:                             ; preds = %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.pre8694 = load i32, ptr @mx, align 4
  br label %._crit_edge51.._crit_edge56_crit_edge

._crit_edge51:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %20 = icmp sgt i32 %46, 0
  %.pre86 = load i32, ptr @mx, align 4
  br i1 %20, label %.preheader45.lr.ph, label %._crit_edge51.._crit_edge56_crit_edge

._crit_edge51.._crit_edge56_crit_edge:            ; preds = %._crit_edge51.thread, %._crit_edge51
  %.pre8696 = phi i32 [ %.pre8694, %._crit_edge51.thread ], [ %.pre86, %._crit_edge51 ]
  %.pre90 = shl nsw i32 %.pre8696, 1
  %.pre91 = add nsw i32 %.pre90, -2
  br label %._crit_edge56

.preheader45.lr.ph:                               ; preds = %._crit_edge51
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  %23 = shl i32 %.pre86, 1
  %24 = add i32 %23, -2
  %25 = load i32, ptr @inf, align 4
  br i1 %22, label %.preheader45.us.preheader, label %._crit_edge56

.preheader45.us.preheader:                        ; preds = %.preheader45.lr.ph
  %wide.trip.count76 = zext nneg i32 %46 to i64
  %wide.trip.count = zext nneg i32 %21 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %26 = icmp eq i32 %21, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader45.us

.preheader45.us:                                  ; preds = %.preheader45.us.preheader, %._crit_edge54.us
  %indvars.iv73 = phi i64 [ 0, %.preheader45.us.preheader ], [ %indvars.iv.next74, %._crit_edge54.us ]
  br i1 %26, label %._crit_edge54.us.unr-lcssa, label %.preheader.us

.preheader.us.1:                                  ; preds = %32
  %indvars.iv.next71 = or disjoint i64 %indvars.iv70, 1
  br label %27

27:                                               ; preds = %27, %.preheader.us.1
  %indvars.iv.1 = phi i64 [ 0, %.preheader.us.1 ], [ %indvars.iv.next.1, %27 ]
  %28 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %indvars.iv73, i64 %indvars.iv.next71, i64 %indvars.iv.1
  store i32 %25, ptr %28, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %29 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  %.036.highbits.us.1 = lshr i32 %29, %24
  %30 = icmp eq i32 %.036.highbits.us.1, 0
  br i1 %30, label %27, label %31, !llvm.loop !9

31:                                               ; preds = %27
  %indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge54.us.unr-lcssa, label %.preheader.us, !llvm.loop !11

32:                                               ; preds = %.preheader.us, %32
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %32 ]
  %33 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %indvars.iv73, i64 %indvars.iv70, i64 %indvars.iv
  store i32 %25, ptr %33, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = trunc nuw nsw i64 %indvars.iv.next to i32
  %.036.highbits.us = lshr i32 %34, %24
  %35 = icmp eq i32 %.036.highbits.us, 0
  br i1 %35, label %32, label %.preheader.us.1, !llvm.loop !9

.preheader.us:                                    ; preds = %.preheader45.us, %31
  %indvars.iv70 = phi i64 [ %indvars.iv.next71.1, %31 ], [ 0, %.preheader45.us ]
  %niter = phi i64 [ %niter.next.1, %31 ], [ 0, %.preheader45.us ]
  br label %32

._crit_edge54.us.unr-lcssa:                       ; preds = %31, %.preheader45.us
  %indvars.iv70.unr = phi i64 [ 0, %.preheader45.us ], [ %indvars.iv.next71.1, %31 ]
  br i1 %lcmp.mod.not, label %._crit_edge54.us, label %.preheader.us.epil

.preheader.us.epil:                               ; preds = %._crit_edge54.us.unr-lcssa, %.preheader.us.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.preheader.us.epil ], [ 0, %._crit_edge54.us.unr-lcssa ]
  %36 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %indvars.iv73, i64 %indvars.iv70.unr, i64 %indvars.iv.epil
  store i32 %25, ptr %36, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %37 = trunc nuw nsw i64 %indvars.iv.next.epil to i32
  %.036.highbits.us.epil = lshr i32 %37, %24
  %38 = icmp eq i32 %.036.highbits.us.epil, 0
  br i1 %38, label %.preheader.us.epil, label %._crit_edge54.us, !llvm.loop !9

._crit_edge54.us:                                 ; preds = %.preheader.us.epil, %._crit_edge54.us.unr-lcssa
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
  br i1 %exitcond77.not, label %._crit_edge56, label %.preheader45.us, !llvm.loop !12

.lr.ph50:                                         ; preds = %0, %._crit_edge
  %storemerge48 = phi i32 [ %45, %._crit_edge ], [ 0, %0 ]
  %39 = sext i32 %storemerge48 to i64
  %40 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %39
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %40)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %65, %.lr.ph50
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %1, align 4, !tbaa !5
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph50, label %._crit_edge51, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph50, %65
  %48 = phi i32 [ %66, %65 ], [ %42, %.lr.ph50 ]
  %storemerge4447 = phi i32 [ %68, %65 ], [ 0, %.lr.ph50 ]
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = sext i32 %storemerge4447 to i64
  %52 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %50, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !14
  %54 = add i8 %53, -49
  %or.cond = icmp ult i8 %54, 9
  br i1 %or.cond, label %55, label %65

55:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %56 = zext nneg i8 %53 to i32
  %57 = add nsw i32 %56, -48
  store i32 %57, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %58 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %58, ptr %4, align 8
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [10 x %"struct.std::pair"], ptr @pos, i64 0, i64 %60
  %62 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %61, ptr noundef nonnull align 4 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre85 = load i32, ptr @m, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %.lr.ph, %55
  %66 = phi i32 [ %48, %.lr.ph ], [ %.pre85, %55 ]
  %67 = phi i32 [ %storemerge4447, %.lr.ph ], [ %.pre, %55 ]
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %2, align 4, !tbaa !5
  %69 = icmp slt i32 %68, %66
  br i1 %69, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge56:                                    ; preds = %._crit_edge54.us, %.preheader45.lr.ph, %._crit_edge51.._crit_edge56_crit_edge
  %.pre8695 = phi i32 [ %.pre8696, %._crit_edge51.._crit_edge56_crit_edge ], [ %.pre86, %.preheader45.lr.ph ], [ %.pre86, %._crit_edge54.us ]
  %.pre-phi92 = phi i32 [ %.pre91, %._crit_edge51.._crit_edge56_crit_edge ], [ %24, %.preheader45.lr.ph ], [ %24, %._crit_edge54.us ]
  %notmask = shl nsw i32 -1, %.pre-phi92
  %70 = xor i32 %notmask, -1
  store i32 %70, ptr @up, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  %.not57 = icmp slt i32 %.pre8695, 2
  br i1 %.not57, label %._crit_edge61, label %.lr.ph60

._crit_edge61:                                    ; preds = %.lr.ph60, %._crit_edge56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 8), align 8, !tbaa !16
  store i32 %71, ptr @x, align 4, !tbaa !5
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 12), align 4, !tbaa !18
  store i32 %72, ptr @y, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #6
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %73 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @x, ptr noundef nonnull align 4 dereferenceable(4) @y)
          to label %85 unwind label %122

.lr.ph60:                                         ; preds = %._crit_edge56, %.lr.ph60
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph60 ], [ 2, %._crit_edge56 ]
  %74 = getelementptr inbounds [10 x %"struct.std::pair"], ptr @pos, i64 0, i64 %indvars.iv78
  %.sroa.011.0.copyload = load i64, ptr %74, align 8
  %75 = add nsw i64 %indvars.iv78, -1
  %76 = getelementptr inbounds [10 x %"struct.std::pair"], ptr @pos, i64 0, i64 %75
  %.sroa.010.0.copyload = load i64, ptr %76, align 8
  %77 = call noundef i32 @_Z6getdirSt4pairIiiES0_(i64 %.sroa.011.0.copyload, i64 %.sroa.010.0.copyload)
  %indvars.iv78.tr = trunc i64 %indvars.iv78 to i32
  %78 = shl i32 %indvars.iv78.tr, 1
  %79 = add i32 %78, -4
  %80 = shl i32 %77, %79
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = or i32 %81, %80
  store i32 %82, ptr %5, align 4, !tbaa !5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %83 = load i32, ptr @mx, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %.not.not = icmp slt i64 %indvars.iv78, %84
  br i1 %.not.not, label %.lr.ph60, label %._crit_edge61, !llvm.loop !19

85:                                               ; preds = %._crit_edge61
  store i64 %73, ptr %9, align 8
  %86 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %87 unwind label %122

87:                                               ; preds = %85
  %.fca.0.extract5 = extractvalue { i64, i32 } %86, 0
  %.fca.1.extract6 = extractvalue { i64, i32 } %86, 1
  store i64 %.fca.0.extract5, ptr %8, align 8
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %.fca.1.extract6, ptr %.sroa.28.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %88 unwind label %122

88:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  %89 = load i32, ptr @x, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = load i32, ptr @y, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %90, i64 %92, i64 %94
  store i32 0, ptr %95, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %96 = load i32, ptr @inf, align 4, !tbaa !5
  store i32 %96, ptr %10, align 4, !tbaa !5
  %97 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %97, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %88
  %98 = getelementptr inbounds i8, ptr %6, i64 4
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %99 = load i32, ptr @__const.main.dx, align 16
  %100 = load i32, ptr @__const.main.dy, align 16
  %101 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.dx, i64 4), align 4
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.dy, i64 4), align 4
  %103 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.dx, i64 8), align 8
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.dy, i64 8), align 8
  %105 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.dx, i64 12), align 4
  %106 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.dy, i64 12), align 4
  br label %107

107:                                              ; preds = %.lr.ph64, %.backedge
  %108 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %109 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %108)
  %110 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %111 = getelementptr inbounds i8, ptr %110, i64 8
  %112 = load i32, ptr %111, align 4, !tbaa !20
  store i32 %112, ptr %5, align 4, !tbaa !5
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %113 = load i32, ptr %6, align 4, !tbaa !16
  store i32 %113, ptr @x, align 4, !tbaa !5
  %114 = load i32, ptr %98, align 4, !tbaa !18
  store i32 %114, ptr @y, align 4, !tbaa !5
  %115 = sext i32 %113 to i64
  %116 = sext i32 %114 to i64
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @v, i64 0, i64 %115, i64 %116, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %.not42 = icmp eq i32 %120, 0
  br i1 %.not42, label %124, label %.backedge

.backedge:                                        ; preds = %.backedge.loopexit, %107
  %121 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %121, label %._crit_edge65, label %107, !llvm.loop !22

122:                                              ; preds = %87, %85, %._crit_edge61
  %123 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  br label %322

124:                                              ; preds = %107
  store i32 1, ptr %119, align 4, !tbaa !5
  %125 = getelementptr inbounds [20 x [20 x i8]], ptr @g, i64 0, i64 %115, i64 %116
  %126 = load i8, ptr %125, align 1, !tbaa !14
  %127 = icmp eq i8 %126, 64
  br i1 %127, label %128, label %132

128:                                              ; preds = %124
  %129 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %115, i64 %116, i64 %118
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %129)
  %131 = load i32, ptr %130, align 4, !tbaa !5
  store i32 %131, ptr %10, align 4, !tbaa !5
  %.pre87 = load i32, ptr @x, align 4, !tbaa !5
  %.pre88 = load i32, ptr @y, align 4, !tbaa !5
  %.pre89 = load i32, ptr %5, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %128, %124
  %133 = phi i32 [ %.pre89, %128 ], [ %117, %124 ]
  %134 = phi i32 [ %.pre88, %128 ], [ %114, %124 ]
  %135 = phi i32 [ %.pre87, %128 ], [ %113, %124 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %136 = add nsw i32 %99, %135
  store i32 %136, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %137 = add nsw i32 %100, %134
  store i32 %137, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %138 = shl i32 %133, 2
  %139 = call noundef i32 @_Z3oppi(i32 noundef 0)
  %140 = or i32 %138, %139
  %141 = load i32, ptr @up, align 4, !tbaa !5
  %142 = and i32 %141, %140
  store i32 %142, ptr %13, align 4, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = load i32, ptr %12, align 4, !tbaa !5
  %145 = call noundef zeroext i1 @_Z4goodiii(i32 noundef %143, i32 noundef %144, i32 noundef %142)
  br i1 %145, label %146, label %177

146:                                              ; preds = %132
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = load i32, ptr %13, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %148, i64 %150, i64 %152
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %154 = load i32, ptr @x, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = load i32, ptr @y, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %155, i64 %157, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %14, align 4, !tbaa !5
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %153, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = load i32, ptr %12, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = load i32, ptr %13, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %166, i64 %168, i64 %170
  store i32 %164, ptr %171, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %172 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %173 unwind label %312

173:                                              ; preds = %146
  store i64 %172, ptr %16, align 8
  %174 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %175 unwind label %312

175:                                              ; preds = %173
  %.fca.0.extract = extractvalue { i64, i32 } %174, 0
  %.fca.1.extract = extractvalue { i64, i32 } %174, 1
  store i64 %.fca.0.extract, ptr %15, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %176 unwind label %312

176:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #6
  br label %177

177:                                              ; preds = %132, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  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.start.p0(i64 4, ptr nonnull %11) #6
  %178 = load i32, ptr @x, align 4, !tbaa !5
  %179 = add nsw i32 %101, %178
  store i32 %179, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %180 = load i32, ptr @y, align 4, !tbaa !5
  %181 = add nsw i32 %102, %180
  store i32 %181, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %182 = load i32, ptr %5, align 4, !tbaa !5
  %183 = shl i32 %182, 2
  %184 = call noundef i32 @_Z3oppi(i32 noundef 1)
  %185 = or i32 %183, %184
  %186 = load i32, ptr @up, align 4, !tbaa !5
  %187 = and i32 %186, %185
  store i32 %187, ptr %13, align 4, !tbaa !5
  %188 = load i32, ptr %11, align 4, !tbaa !5
  %189 = load i32, ptr %12, align 4, !tbaa !5
  %190 = call noundef zeroext i1 @_Z4goodiii(i32 noundef %188, i32 noundef %189, i32 noundef %187)
  br i1 %190, label %191, label %222

191:                                              ; preds = %177
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = load i32, ptr %12, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = load i32, ptr %13, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %193, i64 %195, i64 %197
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %199 = load i32, ptr @x, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = load i32, ptr @y, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = load i32, ptr %5, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %200, i64 %202, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %14, align 4, !tbaa !5
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %198, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = load i32, ptr %11, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = load i32, ptr %12, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = load i32, ptr %13, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %211, i64 %213, i64 %215
  store i32 %209, ptr %216, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %217 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %218 unwind label %312

218:                                              ; preds = %191
  store i64 %217, ptr %16, align 8
  %219 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %220 unwind label %312

220:                                              ; preds = %218
  %.fca.0.extract.1 = extractvalue { i64, i32 } %219, 0
  %.fca.1.extract.1 = extractvalue { i64, i32 } %219, 1
  store i64 %.fca.0.extract.1, ptr %15, align 8
  store i32 %.fca.1.extract.1, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %221 unwind label %312

221:                                              ; preds = %220
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #6
  br label %222

222:                                              ; preds = %221, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  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.start.p0(i64 4, ptr nonnull %11) #6
  %223 = load i32, ptr @x, align 4, !tbaa !5
  %224 = add nsw i32 %103, %223
  store i32 %224, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %225 = load i32, ptr @y, align 4, !tbaa !5
  %226 = add nsw i32 %104, %225
  store i32 %226, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %227 = load i32, ptr %5, align 4, !tbaa !5
  %228 = shl i32 %227, 2
  %229 = call noundef i32 @_Z3oppi(i32 noundef 2)
  %230 = or i32 %228, %229
  %231 = load i32, ptr @up, align 4, !tbaa !5
  %232 = and i32 %231, %230
  store i32 %232, ptr %13, align 4, !tbaa !5
  %233 = load i32, ptr %11, align 4, !tbaa !5
  %234 = load i32, ptr %12, align 4, !tbaa !5
  %235 = call noundef zeroext i1 @_Z4goodiii(i32 noundef %233, i32 noundef %234, i32 noundef %232)
  br i1 %235, label %236, label %267

236:                                              ; preds = %222
  %237 = load i32, ptr %11, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = load i32, ptr %12, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = load i32, ptr %13, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %238, i64 %240, i64 %242
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %244 = load i32, ptr @x, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = load i32, ptr @y, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = load i32, ptr %5, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %245, i64 %247, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %14, align 4, !tbaa !5
  %253 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %243, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = load i32, ptr %11, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = load i32, ptr %12, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = load i32, ptr %13, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %256, i64 %258, i64 %260
  store i32 %254, ptr %261, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %262 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %263 unwind label %312

263:                                              ; preds = %236
  store i64 %262, ptr %16, align 8
  %264 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %265 unwind label %312

265:                                              ; preds = %263
  %.fca.0.extract.2 = extractvalue { i64, i32 } %264, 0
  %.fca.1.extract.2 = extractvalue { i64, i32 } %264, 1
  store i64 %.fca.0.extract.2, ptr %15, align 8
  store i32 %.fca.1.extract.2, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %266 unwind label %312

266:                                              ; preds = %265
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #6
  br label %267

267:                                              ; preds = %266, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  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.start.p0(i64 4, ptr nonnull %11) #6
  %268 = load i32, ptr @x, align 4, !tbaa !5
  %269 = add nsw i32 %105, %268
  store i32 %269, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %270 = load i32, ptr @y, align 4, !tbaa !5
  %271 = add nsw i32 %106, %270
  store i32 %271, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %272 = load i32, ptr %5, align 4, !tbaa !5
  %273 = shl i32 %272, 2
  %274 = call noundef i32 @_Z3oppi(i32 noundef 3)
  %275 = or i32 %273, %274
  %276 = load i32, ptr @up, align 4, !tbaa !5
  %277 = and i32 %276, %275
  store i32 %277, ptr %13, align 4, !tbaa !5
  %278 = load i32, ptr %11, align 4, !tbaa !5
  %279 = load i32, ptr %12, align 4, !tbaa !5
  %280 = call noundef zeroext i1 @_Z4goodiii(i32 noundef %278, i32 noundef %279, i32 noundef %277)
  br i1 %280, label %281, label %.backedge.loopexit

281:                                              ; preds = %267
  %282 = load i32, ptr %11, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = load i32, ptr %12, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = load i32, ptr %13, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %283, i64 %285, i64 %287
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  %289 = load i32, ptr @x, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = load i32, ptr @y, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = load i32, ptr %5, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %290, i64 %292, i64 %294
  %296 = load i32, ptr %295, align 4, !tbaa !5
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %14, align 4, !tbaa !5
  %298 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %288, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %299 = load i32, ptr %298, align 4, !tbaa !5
  %300 = load i32, ptr %11, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = load i32, ptr %12, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = load i32, ptr %13, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [16 x [16 x [65536 x i32]]], ptr @d, i64 0, i64 %301, i64 %303, i64 %305
  store i32 %299, ptr %306, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %307 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %308 unwind label %312

308:                                              ; preds = %281
  store i64 %307, ptr %16, align 8
  %309 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %310 unwind label %312

310:                                              ; preds = %308
  %.fca.0.extract.3 = extractvalue { i64, i32 } %309, 0
  %.fca.1.extract.3 = extractvalue { i64, i32 } %309, 1
  store i64 %.fca.0.extract.3, ptr %15, align 8
  store i32 %.fca.1.extract.3, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %311 unwind label %312

311:                                              ; preds = %310
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #6
  br label %.backedge.loopexit

.backedge.loopexit:                               ; preds = %311, %267
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %.backedge

312:                                              ; preds = %310, %308, %281, %265, %263, %236, %220, %218, %191, %175, %173, %146
  %313 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  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 4, ptr nonnull %10) #6
  br label %322

._crit_edge65:                                    ; preds = %.backedge, %88
  %314 = load i32, ptr %10, align 4, !tbaa !5
  %315 = load i32, ptr @inf, align 4, !tbaa !5
  %316 = icmp eq i32 %314, %315
  br i1 %316, label %317, label %319

317:                                              ; preds = %._crit_edge65
  %318 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %321

319:                                              ; preds = %._crit_edge65
  %320 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %314)
  br label %321

321:                                              ; preds = %319, %317
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  ret i32 0

322:                                              ; preds = %312, %122
  %.pn = phi { ptr, i32 } [ %313, %312 ], [ %123, %122 ]
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; 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 #0 align 2

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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 #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 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 #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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


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