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

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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<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.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local global [200100 x i32], align 16
@visited = external dso_local global [200100 x i32], align 16
@c = external dso_local global [200100 x i32], align 16
@u = external dso_local global [200100 x i32], align 16
@v = external dso_local global [200100 x i32], align 16
@g = external dso_local global [200100 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 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 %"struct.std::pair", align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %79, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %82

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %29
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %32
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %27, ptr noundef %30, ptr noundef %33)
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %42
  %44 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %43, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %44, ptr %3, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %52
  %54 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %54, ptr %4, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = add nsw i32 %65, %58
  store i32 %66, ptr %64, align 4, !tbaa !5
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, %70
  store i32 %78, ptr %76, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %24
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

82:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %94, %82
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %97

88:                                               ; preds = %83
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sdiv i32 %92, 2
  store i32 %93, ptr %91, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %88
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %5, align 4, !tbaa !5
  br label %83, !llvm.loop !11

97:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %98 unwind label %114

98:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  store i32 0, ptr getelementptr inbounds ([200100 x i32], ptr @f, i64 0, i64 1), align 4, !tbaa !5
  br label %99

99:                                               ; preds = %206, %204, %98
  %100 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %101 unwind label %118

101:                                              ; preds = %99
  %102 = xor i1 %100, true
  br i1 %102, label %103, label %208

103:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %104 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %105 unwind label %122

105:                                              ; preds = %103
  %106 = load i32, ptr %104, align 4, !tbaa !5
  store i32 %106, ptr %10, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %107 unwind label %122

107:                                              ; preds = %105
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [200100 x i32], ptr @visited, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %126

113:                                              ; preds = %107
  store i32 8, ptr %11, align 4
  br label %204, !llvm.loop !12

114:                                              ; preds = %97
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %8, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %230

118:                                              ; preds = %99
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %8, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %9, align 4
  br label %230

122:                                              ; preds = %105, %103
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %8, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %9, align 4
  br label %207

126:                                              ; preds = %107
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200100 x i32], ptr @visited, i64 0, i64 %128
  store i32 1, ptr %129, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %131
  %133 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #6
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  br label %135

135:                                              ; preds = %200, %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %137
  %139 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %138) #6
  %140 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %139, ptr %140, align 8
  %141 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br i1 %141, label %143, label %142

142:                                              ; preds = %135
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %203

143:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %144 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %145 = getelementptr inbounds %"struct.std::pair", ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !13
  store i32 %146, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %147 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %148 = getelementptr inbounds %"struct.std::pair", ptr %147, i32 0, i32 0
  %149 = load i32, ptr %148, align 4, !tbaa !15
  store i32 %149, ptr %15, align 4, !tbaa !5
  %150 = load i32, ptr %15, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [200100 x i32], ptr @visited, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %156

155:                                              ; preds = %143
  store i32 12, ptr %11, align 4
  br label %197

156:                                              ; preds = %143
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %15, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sub nsw i32 %164, %160
  store i32 %165, ptr %163, align 4, !tbaa !5
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = icmp eq i32 %169, 0
  br i1 %170, label %171, label %181

171:                                              ; preds = %156
  %172 = load i32, ptr %15, align 4, !tbaa !5
  %173 = load i32, ptr @n, align 4, !tbaa !5
  %174 = icmp ne i32 %172, %173
  br i1 %174, label %175, label %181

175:                                              ; preds = %171
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %176 unwind label %177

176:                                              ; preds = %175
  br label %181

177:                                              ; preds = %175
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %8, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %207

181:                                              ; preds = %176, %171, %156
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = icmp eq i32 %182, %186
  br i1 %187, label %188, label %192

188:                                              ; preds = %181
  %189 = load i32, ptr %14, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %190
  store i32 0, ptr %191, align 4, !tbaa !5
  br label %196

192:                                              ; preds = %181
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %194
  store i32 1, ptr %195, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %192, %188
  store i32 0, ptr %11, align 4
  br label %197

197:                                              ; preds = %196, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %198 = load i32, ptr %11, align 4
  switch i32 %198, label %236 [
    i32 0, label %199
    i32 12, label %200
  ]

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %199, %197
  %201 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #6
  %202 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %201, ptr %202, align 8
  br label %135, !llvm.loop !16

203:                                              ; preds = %142
  store i32 0, ptr %11, align 4
  br label %204

204:                                              ; preds = %203, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %205 = load i32, ptr %11, align 4
  switch i32 %205, label %236 [
    i32 0, label %206
    i32 8, label %99
  ]

206:                                              ; preds = %204
  br label %99, !llvm.loop !12

207:                                              ; preds = %177, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %230

208:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %221, %208
  %210 = load i32, ptr %17, align 4, !tbaa !5
  %211 = load i32, ptr @m, align 4, !tbaa !5
  %212 = icmp slt i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 13, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %228

214:                                              ; preds = %209
  %215 = load i32, ptr %17, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %218)
          to label %220 unwind label %224

220:                                              ; preds = %214
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %17, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %17, align 4, !tbaa !5
  br label %209, !llvm.loop !17

224:                                              ; preds = %214
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %8, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %230

228:                                              ; preds = %213
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #6
  %229 = load i32, ptr %1, align 4
  ret i32 %229

230:                                              ; preds = %224, %207, %118, %114
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #6
  br label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %8, align 8
  %233 = load i32, ptr %9, align 4
  %234 = insertvalue { ptr, i32 } poison, ptr %232, 0
  %235 = insertvalue { ptr, i32 } %234, i32 %233, 1
  resume { ptr, i32 } %235

236:                                              ; preds = %204, %197
  unreachable
}

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 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)) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 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)) #3 align 2

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

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

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

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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<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.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [200100 x i32], align 16
@visited = external dso_local local_unnamed_addr global [200100 x i32], align 16
@c = external dso_local global [200100 x i32], align 16
@u = external dso_local global [200100 x i32], align 16
@v = external dso_local global [200100 x i32], align 16
@g = external dso_local global [200100 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 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 i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"class.std::queue", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not27 = icmp slt i32 %12, 1
  br i1 %.not27, label %._crit_edge31, label %.lr.ph30.preheader

.lr.ph30.preheader:                               ; preds = %._crit_edge
  %13 = add nuw i32 %12, 1
  %wide.trip.count = zext i32 %13 to i64
  %14 = zext nneg i32 %12 to i64
  %min.iters.check = icmp ult i32 %12, 8
  br i1 %min.iters.check, label %.lr.ph30.preheader45, label %vector.ph

.lr.ph30.preheader45:                             ; preds = %middle.block, %.lr.ph30.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph30.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph30

vector.ph:                                        ; preds = %.lr.ph30.preheader
  %n.vec = and i64 %14, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %15 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %offset.idx
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5
  %wide.load44 = load <4 x i32>, ptr %16, align 4, !tbaa !5
  %17 = sdiv <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
  %18 = sdiv <4 x i32> %wide.load44, <i32 2, i32 2, i32 2, i32 2>
  store <4 x i32> %17, ptr %15, align 4, !tbaa !5
  store <4 x i32> %18, ptr %16, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %19 = icmp eq i64 %index.next, %n.vec
  br i1 %19, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %14
  br i1 %cmp.n, label %._crit_edge31, label %.lr.ph30.preheader45

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge26 = phi i32 [ %57, %.lr.ph ], [ 0, %0 ]
  %20 = sext i32 %storemerge26 to i64
  %21 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %20
  %22 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %20
  %23 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %20
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull %23)
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %31 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %26
  %32 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %32, ptr %2, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %39 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %34
  %40 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %40, ptr %3, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %42
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, %44
  store i32 %50, ptr %48, align 4, !tbaa !5
  %51 = getelementptr inbounds [200100 x i32], ptr @v, i64 0, i64 %42
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %55, %44
  store i32 %56, ptr %54, align 4, !tbaa !5
  %57 = add nsw i32 %41, 1
  store i32 %57, ptr %1, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge31:                                    ; preds = %.lr.ph30, %middle.block, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %63 unwind label %72

.lr.ph30:                                         ; preds = %.lr.ph30.preheader45, %.lr.ph30
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph30 ], [ %indvars.iv.ph, %.lr.ph30.preheader45 ]
  %60 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %indvars.iv
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sdiv i32 %61, 2
  store i32 %62, ptr %60, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge31, label %.lr.ph30, !llvm.loop !14

63:                                               ; preds = %._crit_edge31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  %64 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %64, label %.preheader, label %.lr.ph36

.preheader:                                       ; preds = %107, %63
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph38, label %._crit_edge39

.lr.ph36:                                         ; preds = %63, %107
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %68 = load i32, ptr %67, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200100 x i32], ptr @visited, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %.not21 = icmp eq i32 %71, 0
  br i1 %.not21, label %74, label %107, !llvm.loop !15

72:                                               ; preds = %._crit_edge31
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %115

74:                                               ; preds = %.lr.ph36
  store i32 1, ptr %70, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %75 = getelementptr inbounds [200100 x %"class.std::vector"], ptr @g, i64 0, i64 %69
  %76 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #6
  store ptr %76, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %77 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #6
  store ptr %77, ptr %7, align 8
  %78 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br i1 %78, label %.lr.ph33, label %._crit_edge34

._crit_edge34:                                    ; preds = %103, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %107

.lr.ph33:                                         ; preds = %74, %103
  %79 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %80 = getelementptr inbounds i8, ptr %79, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %82 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %83 = load i32, ptr %82, align 4, !tbaa !18
  store i32 %83, ptr %8, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200100 x i32], ptr @visited, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %.not22 = icmp eq i32 %86, 0
  br i1 %.not22, label %87, label %103

87:                                               ; preds = %.lr.ph33
  %88 = sext i32 %81 to i64
  %89 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = getelementptr inbounds [200100 x i32], ptr @f, i64 0, i64 %84
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sub nsw i32 %92, %90
  store i32 %93, ptr %91, align 4, !tbaa !5
  %94 = icmp ne i32 %92, %90
  %95 = load i32, ptr @n, align 4
  %.not23 = icmp eq i32 %83, %95
  %or.cond = select i1 %94, i1 true, i1 %.not23
  br i1 %or.cond, label %99, label %96

96:                                               ; preds = %87
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %99 unwind label %97

97:                                               ; preds = %96
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %115

99:                                               ; preds = %96, %87
  %100 = getelementptr inbounds [200100 x i32], ptr @u, i64 0, i64 %88
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp ne i32 %68, %101
  %. = zext i1 %102 to i32
  store i32 %., ptr %89, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %.lr.ph33, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %104 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %105 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #6
  store ptr %105, ptr %7, align 8
  %106 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br i1 %106, label %.lr.ph33, label %._crit_edge34, !llvm.loop !19

107:                                              ; preds = %.lr.ph36, %._crit_edge34
  %108 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %108, label %.preheader, label %.lr.ph36

._crit_edge39:                                    ; preds = %.lr.ph38, %.preheader
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  ret i32 0

.lr.ph38:                                         ; preds = %.preheader, %.lr.ph38
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %.lr.ph38 ], [ 0, %.preheader ]
  %109 = getelementptr inbounds [200100 x i32], ptr @c, i64 0, i64 %indvars.iv41
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %110)
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %112 = load i32, ptr @m, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv.next42, %113
  br i1 %114, label %.lr.ph38, label %._crit_edge39, !llvm.loop !20

115:                                              ; preds = %97, %72
  %.pn = phi { ptr, i32 } [ %98, %97 ], [ %73, %72 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn
}

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

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

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

; 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 #3

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass