; LLVM IR from eyangch/competitive-programming :: Codeforces/1525 (c)

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

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

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@x = external dso_local global [300000 x i32], align 16
@id = external dso_local global [300000 x i32], align 16
@c = external dso_local global [300000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %class.anon, align 1
  %5 = alloca [2 x %"class.std::stack"], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [2 x %"class.std::queue"], align 16
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %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
  store i32 0, ptr %1, align 4
  %30 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %31 = getelementptr i8, ptr %30, i64 -24
  %32 = load i64, ptr %31, align 8
  %33 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %32
  %34 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %33, ptr noundef null)
  %35 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  br label %37

37:                                               ; preds = %460, %0
  %38 = load i32, ptr @T, align 4, !tbaa !8
  %39 = add nsw i32 %38, -1
  store i32 %39, ptr @T, align 4, !tbaa !8
  %40 = icmp ne i32 %38, 0
  br i1 %40, label %41, label %482

41:                                               ; preds = %37
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %54, %41
  %45 = load i32, ptr %2, align 4, !tbaa !8
  %46 = load i32, ptr @N, align 4, !tbaa !8
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %57

49:                                               ; preds = %44
  %50 = load i32, ptr %2, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %51
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %52)
  br label %54

54:                                               ; preds = %49
  %55 = load i32, ptr %2, align 4, !tbaa !8
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %2, align 4, !tbaa !8
  br label %44, !llvm.loop !11

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %68, %57
  %59 = load i32, ptr %3, align 4, !tbaa !8
  %60 = load i32, ptr @N, align 4, !tbaa !8
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %71

63:                                               ; preds = %58
  %64 = load i32, ptr %3, align 4, !tbaa !8
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [300000 x i8], ptr @c, i64 0, i64 %65
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %66)
  br label %68

68:                                               ; preds = %63
  %69 = load i32, ptr %3, align 4, !tbaa !8
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !8
  br label %58, !llvm.loop !13

71:                                               ; preds = %62
  %72 = load i32, ptr @N, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr @id, i64 %73
  call void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef @id, ptr noundef %74, i32 noundef 0)
  %75 = load i32, ptr @N, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr @id, i64 %76
  call void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef @id, ptr noundef %77)
  call void @llvm.lifetime.start.p0(i64 160, ptr %5) #8
  %78 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i32 0, i32 0
  %79 = getelementptr inbounds %"class.std::stack", ptr %78, i64 2
  br label %80

80:                                               ; preds = %82, %71
  %81 = phi ptr [ %78, %71 ], [ %83, %82 ]
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %81)
          to label %82 unwind label %107

82:                                               ; preds = %80
  %83 = getelementptr inbounds %"class.std::stack", ptr %81, i64 1
  %84 = icmp eq ptr %83, %79
  br i1 %84, label %85, label %80

85:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 160, ptr %8) #8
  %86 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i32 0, i32 0
  %87 = getelementptr inbounds %"class.std::queue", ptr %86, i64 2
  br label %88

88:                                               ; preds = %90, %85
  %89 = phi ptr [ %86, %85 ], [ %91, %90 ]
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %89)
          to label %90 unwind label %117

90:                                               ; preds = %88
  %91 = getelementptr inbounds %"class.std::queue", ptr %89, i64 1
  %92 = icmp eq ptr %91, %87
  br i1 %92, label %93, label %88

93:                                               ; preds = %90
  %94 = load i32, ptr @N, align 4, !tbaa !8
  %95 = zext i32 %94 to i64
  %96 = call ptr @llvm.stacksave.p0()
  store ptr %96, ptr %9, align 8
  %97 = alloca i32, i64 %95, align 16
  store i64 %95, ptr %10, align 8
  %98 = load i32, ptr @N, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %97, i64 %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 -1, ptr %11, align 4, !tbaa !8
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %97, ptr noundef %100, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %101 unwind label %127

101:                                              ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %102

102:                                              ; preds = %200, %101
  %103 = load i32, ptr %12, align 4, !tbaa !8
  %104 = load i32, ptr @N, align 4, !tbaa !8
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %131, label %106

106:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %204

107:                                              ; preds = %80
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %6, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %7, align 4
  %111 = icmp eq ptr %78, %81
  br i1 %111, label %116, label %112

112:                                              ; preds = %112, %107
  %113 = phi ptr [ %81, %107 ], [ %114, %112 ]
  %114 = getelementptr inbounds %"class.std::stack", ptr %113, i64 -1
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %114) #8
  %115 = icmp eq ptr %114, %78
  br i1 %115, label %116, label %112

116:                                              ; preds = %112, %107
  br label %481

117:                                              ; preds = %88
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %6, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %7, align 4
  %121 = icmp eq ptr %86, %89
  br i1 %121, label %126, label %122

122:                                              ; preds = %122, %117
  %123 = phi ptr [ %89, %117 ], [ %124, %122 ]
  %124 = getelementptr inbounds %"class.std::queue", ptr %123, i64 -1
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %124) #8
  %125 = icmp eq ptr %124, %86
  br i1 %125, label %126, label %122

126:                                              ; preds = %122, %117
  br label %473

127:                                              ; preds = %93
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %6, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %465

131:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %132 = load i32, ptr %12, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [300000 x i32], ptr @id, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !8
  store i32 %135, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %136 = load i32, ptr %13, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !8
  %140 = srem i32 %139, 2
  store i32 %140, ptr %14, align 4, !tbaa !8
  %141 = load i32, ptr %13, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [300000 x i8], ptr @c, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !14
  %145 = sext i8 %144 to i32
  %146 = icmp eq i32 %145, 82
  br i1 %146, label %147, label %156

147:                                              ; preds = %131
  %148 = load i32, ptr %14, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %149
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %150, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %151 unwind label %152

151:                                              ; preds = %147
  br label %199

152:                                              ; preds = %162, %156, %147
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %6, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %7, align 4
  br label %203

156:                                              ; preds = %131
  %157 = load i32, ptr %14, align 4, !tbaa !8
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %158
  %160 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %159)
          to label %161 unwind label %152

161:                                              ; preds = %156
  br i1 %160, label %162, label %167

162:                                              ; preds = %161
  %163 = load i32, ptr %14, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %164
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %165, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %166 unwind label %152

166:                                              ; preds = %162
  br label %198

167:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %168 = load i32, ptr %14, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %169
  %171 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %170)
          to label %172 unwind label %194

172:                                              ; preds = %167
  %173 = load i32, ptr %171, align 4, !tbaa !8
  store i32 %173, ptr %15, align 4, !tbaa !8
  %174 = load i32, ptr %14, align 4, !tbaa !8
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %175
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %176)
          to label %177 unwind label %194

177:                                              ; preds = %172
  %178 = load i32, ptr %13, align 4, !tbaa !8
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !8
  %182 = load i32, ptr %15, align 4, !tbaa !8
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !8
  %186 = sub nsw i32 %181, %185
  %187 = sdiv i32 %186, 2
  %188 = load i32, ptr %15, align 4, !tbaa !8
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %97, i64 %189
  store i32 %187, ptr %190, align 4, !tbaa !8
  %191 = load i32, ptr %13, align 4, !tbaa !8
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %97, i64 %192
  store i32 %187, ptr %193, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %198

194:                                              ; preds = %172, %167
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %6, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %203

198:                                              ; preds = %177, %166
  br label %199

199:                                              ; preds = %198, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %12, align 4, !tbaa !8
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %12, align 4, !tbaa !8
  br label %102, !llvm.loop !15

203:                                              ; preds = %194, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %465

204:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %205

205:                                              ; preds = %275, %204
  %206 = load i32, ptr %16, align 4, !tbaa !8
  %207 = icmp slt i32 %206, 2
  br i1 %207, label %209, label %208

208:                                              ; preds = %205
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %279

209:                                              ; preds = %205
  br label %210

210:                                              ; preds = %238, %209
  %211 = load i32, ptr %16, align 4, !tbaa !8
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %212
  %214 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %213)
          to label %215 unwind label %261

215:                                              ; preds = %210
  %216 = trunc i64 %214 to i32
  %217 = icmp sge i32 %216, 2
  br i1 %217, label %218, label %274

218:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %219 = load i32, ptr %16, align 4, !tbaa !8
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %220
  %222 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %221)
          to label %223 unwind label %265

223:                                              ; preds = %218
  %224 = load i32, ptr %222, align 4, !tbaa !8
  store i32 %224, ptr %17, align 4, !tbaa !8
  %225 = load i32, ptr %16, align 4, !tbaa !8
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %226
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %227)
          to label %228 unwind label %265

228:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %229 = load i32, ptr %16, align 4, !tbaa !8
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %230
  %232 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %231)
          to label %233 unwind label %269

233:                                              ; preds = %228
  %234 = load i32, ptr %232, align 4, !tbaa !8
  store i32 %234, ptr %18, align 4, !tbaa !8
  %235 = load i32, ptr %16, align 4, !tbaa !8
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %236
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %237)
          to label %238 unwind label %269

238:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %239 = load i32, ptr @M, align 4, !tbaa !8
  %240 = load i32, ptr @M, align 4, !tbaa !8
  %241 = add nsw i32 %239, %240
  %242 = load i32, ptr %17, align 4, !tbaa !8
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !8
  %246 = sub nsw i32 %241, %245
  store i32 %246, ptr %19, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %247 = load i32, ptr %18, align 4, !tbaa !8
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !8
  store i32 %250, ptr %20, align 4, !tbaa !8
  %251 = load i32, ptr %19, align 4, !tbaa !8
  %252 = load i32, ptr %20, align 4, !tbaa !8
  %253 = sub nsw i32 %251, %252
  %254 = sdiv i32 %253, 2
  %255 = load i32, ptr %18, align 4, !tbaa !8
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds i32, ptr %97, i64 %256
  store i32 %254, ptr %257, align 4, !tbaa !8
  %258 = load i32, ptr %17, align 4, !tbaa !8
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds i32, ptr %97, i64 %259
  store i32 %254, ptr %260, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %210, !llvm.loop !16

261:                                              ; preds = %210
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %6, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %7, align 4
  br label %278

265:                                              ; preds = %223, %218
  %266 = landingpad { ptr, i32 }
          cleanup
  %267 = extractvalue { ptr, i32 } %266, 0
  store ptr %267, ptr %6, align 8
  %268 = extractvalue { ptr, i32 } %266, 1
  store i32 %268, ptr %7, align 4
  br label %273

269:                                              ; preds = %233, %228
  %270 = landingpad { ptr, i32 }
          cleanup
  %271 = extractvalue { ptr, i32 } %270, 0
  store ptr %271, ptr %6, align 8
  %272 = extractvalue { ptr, i32 } %270, 1
  store i32 %272, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %273

273:                                              ; preds = %269, %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %278

274:                                              ; preds = %215
  br label %275

275:                                              ; preds = %274
  %276 = load i32, ptr %16, align 4, !tbaa !8
  %277 = add nsw i32 %276, 1
  store i32 %277, ptr %16, align 4, !tbaa !8
  br label %205, !llvm.loop !17

278:                                              ; preds = %273, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %465

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

280:                                              ; preds = %347, %279
  %281 = load i32, ptr %21, align 4, !tbaa !8
  %282 = icmp slt i32 %281, 2
  br i1 %282, label %284, label %283

283:                                              ; preds = %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %351

284:                                              ; preds = %280
  br label %285

285:                                              ; preds = %313, %284
  %286 = load i32, ptr %21, align 4, !tbaa !8
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %287
  %289 = invoke noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %288)
          to label %290 unwind label %333

290:                                              ; preds = %285
  %291 = trunc i64 %289 to i32
  %292 = icmp sge i32 %291, 2
  br i1 %292, label %293, label %346

293:                                              ; preds = %290
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %294 = load i32, ptr %21, align 4, !tbaa !8
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %295
  %297 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %296)
          to label %298 unwind label %337

298:                                              ; preds = %293
  %299 = load i32, ptr %297, align 4, !tbaa !8
  store i32 %299, ptr %22, align 4, !tbaa !8
  %300 = load i32, ptr %21, align 4, !tbaa !8
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %301
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %302)
          to label %303 unwind label %337

303:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %304 = load i32, ptr %21, align 4, !tbaa !8
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %305
  %307 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %306)
          to label %308 unwind label %341

308:                                              ; preds = %303
  %309 = load i32, ptr %307, align 4, !tbaa !8
  store i32 %309, ptr %23, align 4, !tbaa !8
  %310 = load i32, ptr %21, align 4, !tbaa !8
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %311
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %312)
          to label %313 unwind label %341

313:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %314 = load i32, ptr %22, align 4, !tbaa !8
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %315
  %317 = load i32, ptr %316, align 4, !tbaa !8
  %318 = sub nsw i32 0, %317
  store i32 %318, ptr %24, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %319 = load i32, ptr %23, align 4, !tbaa !8
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %320
  %322 = load i32, ptr %321, align 4, !tbaa !8
  store i32 %322, ptr %25, align 4, !tbaa !8
  %323 = load i32, ptr %25, align 4, !tbaa !8
  %324 = load i32, ptr %24, align 4, !tbaa !8
  %325 = sub nsw i32 %323, %324
  %326 = sdiv i32 %325, 2
  %327 = load i32, ptr %23, align 4, !tbaa !8
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds i32, ptr %97, i64 %328
  store i32 %326, ptr %329, align 4, !tbaa !8
  %330 = load i32, ptr %22, align 4, !tbaa !8
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds i32, ptr %97, i64 %331
  store i32 %326, ptr %332, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %285, !llvm.loop !18

333:                                              ; preds = %285
  %334 = landingpad { ptr, i32 }
          cleanup
  %335 = extractvalue { ptr, i32 } %334, 0
  store ptr %335, ptr %6, align 8
  %336 = extractvalue { ptr, i32 } %334, 1
  store i32 %336, ptr %7, align 4
  br label %350

337:                                              ; preds = %298, %293
  %338 = landingpad { ptr, i32 }
          cleanup
  %339 = extractvalue { ptr, i32 } %338, 0
  store ptr %339, ptr %6, align 8
  %340 = extractvalue { ptr, i32 } %338, 1
  store i32 %340, ptr %7, align 4
  br label %345

341:                                              ; preds = %308, %303
  %342 = landingpad { ptr, i32 }
          cleanup
  %343 = extractvalue { ptr, i32 } %342, 0
  store ptr %343, ptr %6, align 8
  %344 = extractvalue { ptr, i32 } %342, 1
  store i32 %344, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %345

345:                                              ; preds = %341, %337
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %350

346:                                              ; preds = %290
  br label %347

347:                                              ; preds = %346
  %348 = load i32, ptr %21, align 4, !tbaa !8
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %21, align 4, !tbaa !8
  br label %280, !llvm.loop !19

350:                                              ; preds = %345, %333
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %465

351:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !8
  br label %352

352:                                              ; preds = %417, %351
  %353 = load i32, ptr %26, align 4, !tbaa !8
  %354 = icmp slt i32 %353, 2
  br i1 %354, label %356, label %355

355:                                              ; preds = %352
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %421

356:                                              ; preds = %352
  %357 = load i32, ptr %26, align 4, !tbaa !8
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %358
  %360 = invoke noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %359)
          to label %361 unwind label %403

361:                                              ; preds = %356
  %362 = icmp ne i64 %360, 0
  br i1 %362, label %363, label %416

363:                                              ; preds = %361
  %364 = load i32, ptr %26, align 4, !tbaa !8
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %365
  %367 = invoke noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %366)
          to label %368 unwind label %403

368:                                              ; preds = %363
  %369 = icmp ne i64 %367, 0
  br i1 %369, label %370, label %416

370:                                              ; preds = %368
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %371 = load i32, ptr %26, align 4, !tbaa !8
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i64 0, i64 %372
  %374 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %373)
          to label %375 unwind label %407

375:                                              ; preds = %370
  %376 = load i32, ptr %374, align 4, !tbaa !8
  store i32 %376, ptr %27, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %377 = load i32, ptr %26, align 4, !tbaa !8
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i64 0, i64 %378
  %380 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %379)
          to label %381 unwind label %411

381:                                              ; preds = %375
  %382 = load i32, ptr %380, align 4, !tbaa !8
  store i32 %382, ptr %28, align 4, !tbaa !8
  %383 = load i32, ptr @M, align 4, !tbaa !8
  %384 = load i32, ptr @M, align 4, !tbaa !8
  %385 = add nsw i32 %383, %384
  %386 = load i32, ptr %28, align 4, !tbaa !8
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %387
  %389 = load i32, ptr %388, align 4, !tbaa !8
  %390 = sub nsw i32 %385, %389
  %391 = load i32, ptr %27, align 4, !tbaa !8
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %392
  %394 = load i32, ptr %393, align 4, !tbaa !8
  %395 = add nsw i32 %390, %394
  %396 = sdiv i32 %395, 2
  %397 = load i32, ptr %28, align 4, !tbaa !8
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds i32, ptr %97, i64 %398
  store i32 %396, ptr %399, align 4, !tbaa !8
  %400 = load i32, ptr %27, align 4, !tbaa !8
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds i32, ptr %97, i64 %401
  store i32 %396, ptr %402, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %416

403:                                              ; preds = %363, %356
  %404 = landingpad { ptr, i32 }
          cleanup
  %405 = extractvalue { ptr, i32 } %404, 0
  store ptr %405, ptr %6, align 8
  %406 = extractvalue { ptr, i32 } %404, 1
  store i32 %406, ptr %7, align 4
  br label %420

407:                                              ; preds = %370
  %408 = landingpad { ptr, i32 }
          cleanup
  %409 = extractvalue { ptr, i32 } %408, 0
  store ptr %409, ptr %6, align 8
  %410 = extractvalue { ptr, i32 } %408, 1
  store i32 %410, ptr %7, align 4
  br label %415

411:                                              ; preds = %375
  %412 = landingpad { ptr, i32 }
          cleanup
  %413 = extractvalue { ptr, i32 } %412, 0
  store ptr %413, ptr %6, align 8
  %414 = extractvalue { ptr, i32 } %412, 1
  store i32 %414, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %415

415:                                              ; preds = %411, %407
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %420

416:                                              ; preds = %381, %368, %361
  br label %417

417:                                              ; preds = %416
  %418 = load i32, ptr %26, align 4, !tbaa !8
  %419 = add nsw i32 %418, 1
  store i32 %419, ptr %26, align 4, !tbaa !8
  br label %352, !llvm.loop !20

420:                                              ; preds = %415, %403
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %465

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

422:                                              ; preds = %436, %421
  %423 = load i32, ptr %29, align 4, !tbaa !8
  %424 = load i32, ptr @N, align 4, !tbaa !8
  %425 = icmp slt i32 %423, %424
  br i1 %425, label %427, label %426

426:                                              ; preds = %422
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %443

427:                                              ; preds = %422
  %428 = load i32, ptr %29, align 4, !tbaa !8
  %429 = sext i32 %428 to i64
  %430 = getelementptr inbounds i32, ptr %97, i64 %429
  %431 = load i32, ptr %430, align 4, !tbaa !8
  %432 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %431)
          to label %433 unwind label %439

433:                                              ; preds = %427
  %434 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %432, ptr noundef @.str)
          to label %435 unwind label %439

435:                                              ; preds = %433
  br label %436

436:                                              ; preds = %435
  %437 = load i32, ptr %29, align 4, !tbaa !8
  %438 = add nsw i32 %437, 1
  store i32 %438, ptr %29, align 4, !tbaa !8
  br label %422, !llvm.loop !21

439:                                              ; preds = %433, %427
  %440 = landingpad { ptr, i32 }
          cleanup
  %441 = extractvalue { ptr, i32 } %440, 0
  store ptr %441, ptr %6, align 8
  %442 = extractvalue { ptr, i32 } %440, 1
  store i32 %442, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %465

443:                                              ; preds = %426
  %444 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %445 unwind label %461

445:                                              ; preds = %443
  %446 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %446)
  %447 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i32 0, i32 0
  %448 = getelementptr inbounds %"class.std::queue", ptr %447, i64 2
  br label %449

449:                                              ; preds = %449, %445
  %450 = phi ptr [ %448, %445 ], [ %451, %449 ]
  %451 = getelementptr inbounds %"class.std::queue", ptr %450, i64 -1
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %451) #8
  %452 = icmp eq ptr %451, %447
  br i1 %452, label %453, label %449

453:                                              ; preds = %449
  call void @llvm.lifetime.end.p0(i64 160, ptr %8) #8
  %454 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i32 0, i32 0
  %455 = getelementptr inbounds %"class.std::stack", ptr %454, i64 2
  br label %456

456:                                              ; preds = %456, %453
  %457 = phi ptr [ %455, %453 ], [ %458, %456 ]
  %458 = getelementptr inbounds %"class.std::stack", ptr %457, i64 -1
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %458) #8
  %459 = icmp eq ptr %458, %454
  br i1 %459, label %460, label %456

460:                                              ; preds = %456
  call void @llvm.lifetime.end.p0(i64 160, ptr %5) #8
  br label %37, !llvm.loop !22

461:                                              ; preds = %443
  %462 = landingpad { ptr, i32 }
          cleanup
  %463 = extractvalue { ptr, i32 } %462, 0
  store ptr %463, ptr %6, align 8
  %464 = extractvalue { ptr, i32 } %462, 1
  store i32 %464, ptr %7, align 4
  br label %465

465:                                              ; preds = %461, %439, %420, %350, %278, %203, %127
  %466 = getelementptr inbounds [2 x %"class.std::queue"], ptr %8, i32 0, i32 0
  %467 = getelementptr inbounds %"class.std::queue", ptr %466, i64 2
  br label %468

468:                                              ; preds = %468, %465
  %469 = phi ptr [ %467, %465 ], [ %470, %468 ]
  %470 = getelementptr inbounds %"class.std::queue", ptr %469, i64 -1
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %470) #8
  %471 = icmp eq ptr %470, %466
  br i1 %471, label %472, label %468

472:                                              ; preds = %468
  br label %473

473:                                              ; preds = %472, %126
  call void @llvm.lifetime.end.p0(i64 160, ptr %8) #8
  %474 = getelementptr inbounds [2 x %"class.std::stack"], ptr %5, i32 0, i32 0
  %475 = getelementptr inbounds %"class.std::stack", ptr %474, i64 2
  br label %476

476:                                              ; preds = %476, %473
  %477 = phi ptr [ %475, %473 ], [ %478, %476 ]
  %478 = getelementptr inbounds %"class.std::stack", ptr %477, i64 -1
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %478) #8
  %479 = icmp eq ptr %478, %474
  br i1 %479, label %480, label %476

480:                                              ; preds = %476
  br label %481

481:                                              ; preds = %480, %116
  call void @llvm.lifetime.end.p0(i64 160, ptr %5) #8
  br label %484

482:                                              ; preds = %37
  %483 = load i32, ptr %1, align 4
  ret i32 %483

484:                                              ; preds = %481
  %485 = load ptr, ptr %6, align 8
  %486 = load i32, ptr %7, align 4
  %487 = insertvalue { ptr, i32 } poison, ptr %485, 0
  %488 = insertvalue { ptr, i32 } %487, i32 %486, 1
  resume { ptr, i32 } %488
}

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

@T = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@x = external dso_local global [300000 x i32], align 16
@id = external dso_local global [300000 x i32], align 16
@c = external dso_local global [300000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca [2 x %"class.std::stack"], align 16
  %2 = alloca [2 x %"class.std::queue"], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  %12 = load i32, ptr @T, align 4, !tbaa !8
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @T, align 4, !tbaa !8
  %.not132 = icmp eq i32 %12, 0
  br i1 %.not132, label %._crit_edge135, label %.lr.ph134

.lr.ph134:                                        ; preds = %0
  %.ptr.1 = getelementptr inbounds i8, ptr %1, i64 80
  %.ptr80.1 = getelementptr inbounds i8, ptr %2, i64 80
  %14 = getelementptr inbounds i8, ptr %2, i64 80
  %15 = getelementptr inbounds i8, ptr %1, i64 80
  br label %16

16:                                               ; preds = %.lr.ph134, %233
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %19 = load i32, ptr @N, align 4, !tbaa !8
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %.preheader100.._crit_edge_crit_edge

.preheader100:                                    ; preds = %.lr.ph
  %21 = icmp sgt i32 %25, 0
  br i1 %21, label %.lr.ph118, label %.preheader100.._crit_edge_crit_edge

.preheader100.._crit_edge_crit_edge:              ; preds = %16, %.preheader100
  %22 = phi i32 [ %25, %.preheader100 ], [ %19, %16 ]
  %.pre = sext i32 %22 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %16, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %16 ]
  %23 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %indvars.iv
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr @N, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next, %26
  br i1 %27, label %.lr.ph, label %.preheader100, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph118, %.preheader100.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader100.._crit_edge_crit_edge ], [ %35, %.lr.ph118 ]
  %28 = getelementptr inbounds i32, ptr @id, i64 %.pre-phi
  call void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef nonnull @id, ptr noundef nonnull %28, i32 noundef 0)
  %29 = load i32, ptr @N, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr @id, i64 %30
  call void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @id, ptr noundef nonnull %31)
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %1) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
          to label %37 unwind label %.preheader92.preheader

.lr.ph118:                                        ; preds = %.preheader100, %.lr.ph118
  %indvars.iv144 = phi i64 [ %indvars.iv.next145, %.lr.ph118 ], [ 0, %.preheader100 ]
  %32 = getelementptr inbounds [300000 x i8], ptr @c, i64 0, i64 %indvars.iv144
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %32)
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  %34 = load i32, ptr @N, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next145, %35
  br i1 %36, label %.lr.ph118, label %._crit_edge, !llvm.loop !13

37:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %2) #8
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %39 unwind label %.thread163

.thread163:                                       ; preds = %37
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit90

39:                                               ; preds = %37
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
          to label %40 unwind label %.preheader.preheader

40:                                               ; preds = %39
  %41 = load i32, ptr @N, align 4, !tbaa !8
  %42 = zext i32 %41 to i64
  %43 = call ptr @llvm.stacksave.p0()
  %44 = alloca i32, i64 %42, align 16
  %45 = load i32, ptr @N, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 -1, ptr %3, align 4, !tbaa !8
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %44, ptr noundef nonnull %47, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %48 unwind label %56

48:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %49 = load i32, ptr @N, align 4, !tbaa !8
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph121, label %.preheader99

.preheader99:                                     ; preds = %90, %48
  %51 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %52 = trunc i64 %51 to i32
  %53 = icmp sgt i32 %52, 1
  br i1 %53, label %.lr.ph122, label %._crit_edge123

.preheader92.preheader:                           ; preds = %._crit_edge
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.preheader.preheader:                             ; preds = %39
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #8
  br label %.loopexit90

56:                                               ; preds = %40
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %.loopexit90.loopexit

.lr.ph121:                                        ; preds = %48, %90
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %90 ], [ 0, %48 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %58 = getelementptr inbounds [300000 x i32], ptr @id, i64 0, i64 %indvars.iv147
  %59 = load i32, ptr %58, align 4, !tbaa !8
  store i32 %59, ptr %4, align 4, !tbaa !8
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !8
  %63 = srem i32 %62, 2
  %64 = getelementptr inbounds [300000 x i8], ptr @c, i64 0, i64 %60
  %65 = load i8, ptr %64, align 1, !tbaa !14
  %66 = icmp eq i8 %65, 82
  %67 = sext i32 %63 to i64
  %68 = getelementptr inbounds [2 x %"class.std::stack"], ptr %1, i64 0, i64 %67
  br i1 %66, label %69, label %72

69:                                               ; preds = %.lr.ph121
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %68, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %90 unwind label %70

70:                                               ; preds = %74, %69
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %.loopexit90.loopexit

72:                                               ; preds = %.lr.ph121
  %73 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %68)
  br i1 %73, label %74, label %76

74:                                               ; preds = %72
  %75 = getelementptr inbounds [2 x %"class.std::queue"], ptr %2, i64 0, i64 %67
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %75, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %90 unwind label %70

76:                                               ; preds = %72
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %68)
  %78 = load i32, ptr %77, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %68)
  %79 = load i32, ptr %4, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %83 = sext i32 %78 to i64
  %84 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = sub nsw i32 %82, %85
  %87 = sdiv i32 %86, 2
  %88 = getelementptr inbounds i32, ptr %44, i64 %83
  store i32 %87, ptr %88, align 4, !tbaa !8
  %89 = getelementptr inbounds i32, ptr %44, i64 %80
  store i32 %87, ptr %89, align 4, !tbaa !8
  br label %90

90:                                               ; preds = %76, %74, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %91 = load i32, ptr @N, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = icmp slt i64 %indvars.iv.next148, %92
  br i1 %93, label %.lr.ph121, label %.preheader99, !llvm.loop !15

.lr.ph122:                                        ; preds = %.preheader99, %.lr.ph122
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %95 = load i32, ptr %94, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %97 = load i32, ptr %96, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %98 = load i32, ptr @M, align 4, !tbaa !8
  %99 = shl nsw i32 %98, 1
  %100 = sext i32 %95 to i64
  %101 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %103 = sext i32 %97 to i64
  %104 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !8
  %106 = add i32 %102, %105
  %107 = sub i32 %99, %106
  %108 = sdiv i32 %107, 2
  %109 = getelementptr inbounds i32, ptr %44, i64 %103
  store i32 %108, ptr %109, align 4, !tbaa !8
  %110 = getelementptr inbounds i32, ptr %44, i64 %100
  store i32 %108, ptr %110, align 4, !tbaa !8
  %111 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %112 = trunc i64 %111 to i32
  %113 = icmp sgt i32 %112, 1
  br i1 %113, label %.lr.ph122, label %._crit_edge123, !llvm.loop !16

._crit_edge123:                                   ; preds = %.lr.ph122, %.preheader99
  %114 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %115 = trunc i64 %114 to i32
  %116 = icmp sgt i32 %115, 1
  br i1 %116, label %.lr.ph122.1, label %._crit_edge123.1

.lr.ph122.1:                                      ; preds = %._crit_edge123, %.lr.ph122.1
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %118 = load i32, ptr %117, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %120 = load i32, ptr %119, align 4, !tbaa !8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %121 = load i32, ptr @M, align 4, !tbaa !8
  %122 = shl nsw i32 %121, 1
  %123 = sext i32 %118 to i64
  %124 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !8
  %126 = sext i32 %120 to i64
  %127 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !8
  %129 = add i32 %125, %128
  %130 = sub i32 %122, %129
  %131 = sdiv i32 %130, 2
  %132 = getelementptr inbounds i32, ptr %44, i64 %126
  store i32 %131, ptr %132, align 4, !tbaa !8
  %133 = getelementptr inbounds i32, ptr %44, i64 %123
  store i32 %131, ptr %133, align 4, !tbaa !8
  %134 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %135 = trunc i64 %134 to i32
  %136 = icmp sgt i32 %135, 1
  br i1 %136, label %.lr.ph122.1, label %._crit_edge123.1, !llvm.loop !16

._crit_edge123.1:                                 ; preds = %.lr.ph122.1, %._crit_edge123
  %137 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %138 = trunc i64 %137 to i32
  %139 = icmp sgt i32 %138, 1
  br i1 %139, label %.lr.ph125, label %._crit_edge126

.lr.ph125:                                        ; preds = %._crit_edge123.1, %.lr.ph125
  %140 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %141 = load i32, ptr %140, align 4, !tbaa !8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %143 = load i32, ptr %142, align 4, !tbaa !8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %144 = sext i32 %141 to i64
  %145 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = sext i32 %143 to i64
  %148 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = add nsw i32 %149, %146
  %151 = sdiv i32 %150, 2
  %152 = getelementptr inbounds i32, ptr %44, i64 %147
  store i32 %151, ptr %152, align 4, !tbaa !8
  %153 = getelementptr inbounds i32, ptr %44, i64 %144
  store i32 %151, ptr %153, align 4, !tbaa !8
  %154 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %155 = trunc i64 %154 to i32
  %156 = icmp sgt i32 %155, 1
  br i1 %156, label %.lr.ph125, label %._crit_edge126, !llvm.loop !17

._crit_edge126:                                   ; preds = %.lr.ph125, %._crit_edge123.1
  %157 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %158 = trunc i64 %157 to i32
  %159 = icmp sgt i32 %158, 1
  br i1 %159, label %.lr.ph125.1, label %._crit_edge126.1

.lr.ph125.1:                                      ; preds = %._crit_edge126, %.lr.ph125.1
  %160 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %161 = load i32, ptr %160, align 4, !tbaa !8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %163 = load i32, ptr %162, align 4, !tbaa !8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %164 = sext i32 %161 to i64
  %165 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !8
  %167 = sext i32 %163 to i64
  %168 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !8
  %170 = add nsw i32 %169, %166
  %171 = sdiv i32 %170, 2
  %172 = getelementptr inbounds i32, ptr %44, i64 %167
  store i32 %171, ptr %172, align 4, !tbaa !8
  %173 = getelementptr inbounds i32, ptr %44, i64 %164
  store i32 %171, ptr %173, align 4, !tbaa !8
  %174 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %175 = trunc i64 %174 to i32
  %176 = icmp sgt i32 %175, 1
  br i1 %176, label %.lr.ph125.1, label %._crit_edge126.1, !llvm.loop !17

._crit_edge126.1:                                 ; preds = %.lr.ph125.1, %._crit_edge126
  %177 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not82 = icmp eq i64 %177, 0
  br i1 %.not82, label %.preheader97.1, label %178

178:                                              ; preds = %._crit_edge126.1
  %179 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.not83 = icmp eq i64 %179, 0
  br i1 %.not83, label %.preheader97.1, label %180

180:                                              ; preds = %178
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %182 = load i32, ptr %181, align 4, !tbaa !8
  %183 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %184 = load i32, ptr %183, align 4, !tbaa !8
  %185 = load i32, ptr @M, align 4, !tbaa !8
  %186 = shl nsw i32 %185, 1
  %187 = sext i32 %184 to i64
  %188 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !8
  %190 = sub i32 %186, %189
  %191 = sext i32 %182 to i64
  %192 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !8
  %194 = add nsw i32 %190, %193
  %195 = sdiv i32 %194, 2
  %196 = getelementptr inbounds i32, ptr %44, i64 %187
  store i32 %195, ptr %196, align 4, !tbaa !8
  %197 = getelementptr inbounds i32, ptr %44, i64 %191
  store i32 %195, ptr %197, align 4, !tbaa !8
  br label %.preheader97.1

.preheader97.1:                                   ; preds = %._crit_edge126.1, %178, %180
  %198 = call noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %.not82.1 = icmp eq i64 %198, 0
  br i1 %.not82.1, label %.preheader96, label %199

199:                                              ; preds = %.preheader97.1
  %200 = call noundef i64 @_ZNKSt5stackIiSt5dequeIiSaIiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %.not83.1 = icmp eq i64 %200, 0
  br i1 %.not83.1, label %.preheader96, label %201

201:                                              ; preds = %199
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr80.1)
  %203 = load i32, ptr %202, align 4, !tbaa !8
  %204 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
  %205 = load i32, ptr %204, align 4, !tbaa !8
  %206 = load i32, ptr @M, align 4, !tbaa !8
  %207 = shl nsw i32 %206, 1
  %208 = sext i32 %205 to i64
  %209 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !8
  %211 = sub i32 %207, %210
  %212 = sext i32 %203 to i64
  %213 = getelementptr inbounds [300000 x i32], ptr @x, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !8
  %215 = add nsw i32 %211, %214
  %216 = sdiv i32 %215, 2
  %217 = getelementptr inbounds i32, ptr %44, i64 %208
  store i32 %216, ptr %217, align 4, !tbaa !8
  %218 = getelementptr inbounds i32, ptr %44, i64 %212
  store i32 %216, ptr %218, align 4, !tbaa !8
  br label %.preheader96

.preheader96:                                     ; preds = %201, %199, %.preheader97.1
  %219 = load i32, ptr @N, align 4, !tbaa !8
  %220 = icmp sgt i32 %219, 0
  br i1 %220, label %.lr.ph130, label %._crit_edge131

._crit_edge131:                                   ; preds = %227, %.preheader96
  %221 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %233 unwind label %236

.lr.ph130:                                        ; preds = %.preheader96, %227
  %indvars.iv159 = phi i64 [ %indvars.iv.next160, %227 ], [ 0, %.preheader96 ]
  %222 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv159
  %223 = load i32, ptr %222, align 4, !tbaa !8
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %223)
          to label %225 unwind label %231

225:                                              ; preds = %.lr.ph130
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %224, ptr noundef nonnull @.str)
          to label %227 unwind label %231

227:                                              ; preds = %225
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %228 = load i32, ptr @N, align 4, !tbaa !8
  %229 = sext i32 %228 to i64
  %230 = icmp slt i64 %indvars.iv.next160, %229
  br i1 %230, label %.lr.ph130, label %._crit_edge131, !llvm.loop !18

231:                                              ; preds = %225, %.lr.ph130
  %232 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit90.loopexit

233:                                              ; preds = %._crit_edge131
  call void @llvm.stackrestore.p0(ptr %43)
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #8
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %2) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %1) #8
  %234 = load i32, ptr @T, align 4, !tbaa !8
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr @T, align 4, !tbaa !8
  %.not = icmp eq i32 %234, 0
  br i1 %.not, label %._crit_edge135, label %16, !llvm.loop !19

236:                                              ; preds = %._crit_edge131
  %237 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit90.loopexit

.loopexit90.loopexit:                             ; preds = %236, %231, %70, %56
  %.pn = phi { ptr, i32 } [ %71, %70 ], [ %232, %231 ], [ %237, %236 ], [ %57, %56 ]
  %238 = getelementptr inbounds i8, ptr %2, i64 80
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %238) #8
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #8
  br label %.loopexit90

.loopexit90:                                      ; preds = %.preheader.preheader, %.thread163, %.loopexit90.loopexit
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.loopexit90.loopexit ], [ %38, %.thread163 ], [ %55, %.preheader.preheader ]
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %2) #8
  %239 = getelementptr inbounds i8, ptr %1, i64 80
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %239) #8
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader92.preheader, %.loopexit90
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %.loopexit90 ], [ %54, %.preheader92.preheader ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn.pn.pn

._crit_edge135:                                   ; preds = %233, %0
  ret i32 0
}

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPiiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIPiZ4mainE3$_0EvT_S2_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt5queueIiSt5dequeIiSaIiEEE4sizeEv(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(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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


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