; LLVM IR from DionysiosB/CodeForces :: 0600-0699 (689D-FriendsAndSubsequences)

; 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<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 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 i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::deque", align 8
  %14 = alloca %"class.std::deque", align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %19 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %20 unwind label %29

20:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %21 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %22 unwind label %33

22:                                               ; preds = %20
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %43, %22
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %37, label %28

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

29:                                               ; preds = %0
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %5, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %228

33:                                               ; preds = %20
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %5, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  br label %227

37:                                               ; preds = %23
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %39) #5
  %41 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %40)
          to label %42 unwind label %46

42:                                               ; preds = %37
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %9, align 4, !tbaa !9
  br label %23, !llvm.loop !11

46:                                               ; preds = %37
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %226

50:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %63, %50
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = load i64, ptr %2, align 8, !tbaa !5
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %70

57:                                               ; preds = %51
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %59) #5
  %61 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %60)
          to label %62 unwind label %66

62:                                               ; preds = %57
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %10, align 4, !tbaa !9
  br label %51, !llvm.loop !13

66:                                               ; preds = %57
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %226

70:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #5
  invoke void @_ZNSt5dequeIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13)
          to label %71 unwind label %79

71:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 80, ptr %14) #5
  invoke void @_ZNSt5dequeIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %72 unwind label %83

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %210, %72
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = load i64, ptr %2, align 8, !tbaa !5
  %77 = icmp slt i64 %75, %76
  br i1 %77, label %87, label %78

78:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %214

79:                                               ; preds = %70
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %5, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %6, align 4
  br label %225

83:                                               ; preds = %71
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %5, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %6, align 4
  br label %224

87:                                               ; preds = %73
  br label %88

88:                                               ; preds = %102, %87
  %89 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  br i1 %89, label %100, label %90

90:                                               ; preds = %88
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %92) #5
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = load i32, ptr %15, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %96) #5
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = icmp sle i64 %94, %98
  br label %100

100:                                              ; preds = %90, %88
  %101 = phi i1 [ false, %88 ], [ %99, %90 ]
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  call void @_ZNSt5dequeIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  br label %88, !llvm.loop !16

103:                                              ; preds = %100
  br label %104

104:                                              ; preds = %118, %103
  %105 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br i1 %105, label %116, label %106

106:                                              ; preds = %104
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  %108 = load i64, ptr %107, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %108) #5
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = load i32, ptr %15, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %112) #5
  %114 = load i64, ptr %113, align 8, !tbaa !5
  %115 = icmp sge i64 %110, %114
  br label %116

116:                                              ; preds = %106, %104
  %117 = phi i1 [ false, %104 ], [ %115, %106 ]
  br i1 %117, label %118, label %119

118:                                              ; preds = %116
  call void @_ZNSt5dequeIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br label %104, !llvm.loop !17

119:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %120 = load i32, ptr %15, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  store i64 %121, ptr %16, align 8, !tbaa !5
  invoke void @_ZNSt5dequeIlSaIlEE9push_backEOl(ptr noundef nonnull align 8 dereferenceable(80) %13, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %122 unwind label %156

122:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %123 = load i32, ptr %15, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  store i64 %124, ptr %17, align 8, !tbaa !5
  invoke void @_ZNSt5dequeIlSaIlEE9push_backEOl(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %125 unwind label %160

125:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %126

126:                                              ; preds = %175, %125
  %127 = load i64, ptr %12, align 8, !tbaa !5
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = icmp sle i64 %127, %129
  br i1 %130, label %131, label %141

131:                                              ; preds = %126
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  %133 = load i64, ptr %132, align 8, !tbaa !5
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %133) #5
  %135 = load i64, ptr %134, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  %137 = load i64, ptr %136, align 8, !tbaa !5
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %137) #5
  %139 = load i64, ptr %138, align 8, !tbaa !5
  %140 = icmp sgt i64 %135, %139
  br label %141

141:                                              ; preds = %131, %126
  %142 = phi i1 [ false, %126 ], [ %140, %131 ]
  br i1 %142, label %143, label %176

143:                                              ; preds = %141
  %144 = load i64, ptr %12, align 8, !tbaa !5
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %12, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %155, %143
  %147 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  br i1 %147, label %153, label %148

148:                                              ; preds = %146
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  %150 = load i64, ptr %149, align 8, !tbaa !5
  %151 = load i64, ptr %12, align 8, !tbaa !5
  %152 = icmp slt i64 %150, %151
  br label %153

153:                                              ; preds = %148, %146
  %154 = phi i1 [ false, %146 ], [ %152, %148 ]
  br i1 %154, label %155, label %164

155:                                              ; preds = %153
  call void @_ZNSt5dequeIlSaIlEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  br label %146, !llvm.loop !18

156:                                              ; preds = %119
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %5, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %213

160:                                              ; preds = %122
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %5, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %213

164:                                              ; preds = %153
  br label %165

165:                                              ; preds = %174, %164
  %166 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br i1 %166, label %172, label %167

167:                                              ; preds = %165
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  %169 = load i64, ptr %168, align 8, !tbaa !5
  %170 = load i64, ptr %12, align 8, !tbaa !5
  %171 = icmp slt i64 %169, %170
  br label %172

172:                                              ; preds = %167, %165
  %173 = phi i1 [ false, %165 ], [ %171, %167 ]
  br i1 %173, label %174, label %175

174:                                              ; preds = %172
  call void @_ZNSt5dequeIlSaIlEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br label %165, !llvm.loop !19

175:                                              ; preds = %172
  br label %126, !llvm.loop !20

176:                                              ; preds = %141
  %177 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  br i1 %177, label %209, label %178

178:                                              ; preds = %176
  %179 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br i1 %179, label %209, label %180

180:                                              ; preds = %178
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  %182 = load i64, ptr %181, align 8, !tbaa !5
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %182) #5
  %184 = load i64, ptr %183, align 8, !tbaa !5
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  %186 = load i64, ptr %185, align 8, !tbaa !5
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %186) #5
  %188 = load i64, ptr %187, align 8, !tbaa !5
  %189 = icmp eq i64 %184, %188
  br i1 %189, label %190, label %209

190:                                              ; preds = %180
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  %192 = load i64, ptr %191, align 8, !tbaa !5
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  %194 = load i64, ptr %193, align 8, !tbaa !5
  %195 = icmp slt i64 %192, %194
  br i1 %195, label %196, label %199

196:                                              ; preds = %190
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  %198 = load i64, ptr %197, align 8, !tbaa !5
  br label %202

199:                                              ; preds = %190
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  %201 = load i64, ptr %200, align 8, !tbaa !5
  br label %202

202:                                              ; preds = %199, %196
  %203 = phi i64 [ %198, %196 ], [ %201, %199 ]
  %204 = load i64, ptr %12, align 8, !tbaa !5
  %205 = sub nsw i64 %203, %204
  %206 = add nsw i64 %205, 1
  %207 = load i64, ptr %11, align 8, !tbaa !14
  %208 = add nsw i64 %207, %206
  store i64 %208, ptr %11, align 8, !tbaa !14
  br label %209

209:                                              ; preds = %202, %180, %178, %176
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr %15, align 4, !tbaa !9
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %15, align 4, !tbaa !9
  br label %73, !llvm.loop !21

213:                                              ; preds = %160, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %223

214:                                              ; preds = %78
  %215 = load i64, ptr %11, align 8, !tbaa !14
  %216 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %215)
          to label %217 unwind label %219

217:                                              ; preds = %214
  store i32 0, ptr %1, align 4
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #5
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %218 = load i32, ptr %1, align 4
  ret i32 %218

219:                                              ; preds = %214
  %220 = landingpad { ptr, i32 }
          cleanup
  %221 = extractvalue { ptr, i32 } %220, 0
  store ptr %221, ptr %5, align 8
  %222 = extractvalue { ptr, i32 } %220, 1
  store i32 %222, ptr %6, align 4
  br label %223

223:                                              ; preds = %219, %213
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #5
  br label %224

224:                                              ; preds = %223, %83
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #5
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %13) #5
  br label %225

225:                                              ; preds = %224, %79
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %226

226:                                              ; preds = %225, %66, %46
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %227

227:                                              ; preds = %226, %33
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %228

228:                                              ; preds = %227, %29
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %229

229:                                              ; preds = %228
  %230 = load ptr, ptr %5, align 8
  %231 = load i32, ptr %6, align 4
  %232 = insertvalue { ptr, i32 } poison, ptr %230, 0
  %233 = insertvalue { ptr, i32 } %232, i32 %231, 1
  resume { ptr, i32 } %233
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 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 i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca %"class.std::deque", align 8
  %7 = alloca %"class.std::deque", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %11 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %12 unwind label %18

12:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %13 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %13, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %14 unwind label %20

14:                                               ; preds = %12
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.preheader54:                                     ; preds = %.lr.ph
  %17 = icmp sgt i64 %24, 0
  br i1 %17, label %.lr.ph59, label %._crit_edge

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  br label %114

20:                                               ; preds = %12
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  br label %113

.lr.ph:                                           ; preds = %14, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %14 ]
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %22)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i64, ptr %1, align 8, !tbaa !5
  %25 = icmp sgt i64 %24, %indvars.iv.next
  br i1 %25, label %.lr.ph, label %.preheader54, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph59, %14, %.preheader54
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #5
  invoke void @_ZNSt5dequeIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %30 unwind label %35

.lr.ph59:                                         ; preds = %.preheader54, %.lr.ph59
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph59 ], [ 0, %.preheader54 ]
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv81) #5
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %26)
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %28 = load i64, ptr %1, align 8, !tbaa !5
  %29 = icmp sgt i64 %28, %indvars.iv.next82
  br i1 %29, label %.lr.ph59, label %._crit_edge, !llvm.loop !11

30:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #5
  invoke void @_ZNSt5dequeIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %.preheader53 unwind label %37

.preheader53:                                     ; preds = %30
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %.preheader, label %._crit_edge78

.preheader:                                       ; preds = %.preheader53, %107
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %107 ], [ 0, %.preheader53 ]
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %107 ], [ 1, %.preheader53 ]
  %.03076 = phi i64 [ %.1.lcssa, %107 ], [ 0, %.preheader53 ]
  %.03175 = phi i64 [ %.132, %107 ], [ 0, %.preheader53 ]
  %33 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br i1 %33, label %.critedge, label %.lr.ph60

._crit_edge78:                                    ; preds = %107, %.preheader53
  %.031.lcssa = phi i64 [ 0, %.preheader53 ], [ %.132, %107 ]
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.031.lcssa)
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #5
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

35:                                               ; preds = %._crit_edge
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %112

37:                                               ; preds = %30
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %111

.lr.ph60:                                         ; preds = %.preheader, %45
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %40) #5
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv86) #5
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %.not = icmp sgt i64 %42, %44
  br i1 %.not, label %.critedge, label %45

45:                                               ; preds = %.lr.ph60
  call void @_ZNSt5dequeIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %46 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br i1 %46, label %.critedge, label %.lr.ph60, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph60, %45, %.preheader
  %47 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  br i1 %47, label %.critedge2, label %.lr.ph62

.lr.ph62:                                         ; preds = %.critedge, %54
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %49) #5
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv86) #5
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %.not44 = icmp slt i64 %51, %53
  br i1 %.not44, label %.critedge2, label %54

54:                                               ; preds = %.lr.ph62
  call void @_ZNSt5dequeIlSaIlEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %55 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  br i1 %55, label %.critedge2, label %.lr.ph62, !llvm.loop !13

.critedge2:                                       ; preds = %.lr.ph62, %54, %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store i64 %indvars.iv86, ptr %8, align 8, !tbaa !5
  invoke void @_ZNSt5dequeIlSaIlEE9push_backEOl(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %56 unwind label %74

56:                                               ; preds = %.critedge2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store i64 %indvars.iv86, ptr %9, align 8, !tbaa !5
  invoke void @_ZNSt5dequeIlSaIlEE9push_backEOl(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %57 unwind label %76

57:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  %.not5069 = icmp sgt i64 %.03076, %indvars.iv86
  br i1 %.not5069, label %.critedge4, label %.lr.ph72

.lr.ph72:                                         ; preds = %57, %.critedge8
  %.170 = phi i64 [ %68, %.critedge8 ], [ %.03076, %57 ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %59) #5
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %63) #5
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = icmp sgt i64 %61, %65
  br i1 %66, label %67, label %.critedge4

67:                                               ; preds = %.lr.ph72
  %68 = add i64 %.170, 1
  %69 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br i1 %69, label %.critedge6, label %.lr.ph65

.lr.ph65:                                         ; preds = %67, %72
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %.not51 = icmp sgt i64 %71, %.170
  br i1 %.not51, label %.critedge6, label %72

72:                                               ; preds = %.lr.ph65
  call void @_ZNSt5dequeIlSaIlEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %73 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br i1 %73, label %.critedge6, label %.lr.ph65, !llvm.loop !14

74:                                               ; preds = %.critedge2
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %110

76:                                               ; preds = %56
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %110

.critedge6:                                       ; preds = %.lr.ph65, %72, %67
  %78 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  br i1 %78, label %.critedge8, label %.lr.ph67

.lr.ph67:                                         ; preds = %.critedge6, %81
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %.not52 = icmp sgt i64 %80, %.170
  br i1 %.not52, label %.critedge8, label %81

81:                                               ; preds = %.lr.ph67
  call void @_ZNSt5dequeIlSaIlEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %82 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  br i1 %82, label %.critedge8, label %.lr.ph67, !llvm.loop !15

.critedge8:                                       ; preds = %.lr.ph67, %81, %.critedge6
  %exitcond.not = icmp eq i64 %68, %indvars.iv84
  br i1 %exitcond.not, label %.critedge4, label %.lr.ph72, !llvm.loop !16

.critedge4:                                       ; preds = %.lr.ph72, %.critedge8, %57
  %.1.lcssa = phi i64 [ %.03076, %57 ], [ %indvars.iv84, %.critedge8 ], [ %.170, %.lr.ph72 ]
  %83 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br i1 %83, label %107, label %84

84:                                               ; preds = %.critedge4
  %85 = call noundef zeroext i1 @_ZNKSt5dequeIlSaIlEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  br i1 %85, label %107, label %86

86:                                               ; preds = %84
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %88) #5
  %90 = load i64, ptr %89, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %92) #5
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = icmp eq i64 %90, %94
  br i1 %95, label %96, label %107

96:                                               ; preds = %86
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = icmp slt i64 %98, %100
  %. = select i1 %101, ptr %6, ptr %7
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeIlSaIlEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %.) #5
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = add i64 %.03175, 1
  %105 = sub i64 %104, %.1.lcssa
  %106 = add i64 %105, %103
  br label %107

107:                                              ; preds = %.critedge4, %84, %86, %96
  %.132 = phi i64 [ %.03175, %.critedge4 ], [ %.03175, %84 ], [ %106, %96 ], [ %.03175, %86 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %108 = load i64, ptr %1, align 8, !tbaa !5
  %109 = icmp sgt i64 %108, %indvars.iv.next87
  %indvars.iv.next85 = add i64 %indvars.iv84, 1
  br i1 %109, label %.preheader, label %._crit_edge78, !llvm.loop !17

110:                                              ; preds = %76, %74
  %.pn = phi { ptr, i32 } [ %77, %76 ], [ %75, %74 ]
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #5
  br label %111

111:                                              ; preds = %110, %37
  %.pn.pn = phi { ptr, i32 } [ %.pn, %110 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #5
  call void @_ZNSt5dequeIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  br label %112

112:                                              ; preds = %111, %35
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %111 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %113

113:                                              ; preds = %112, %20
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %112 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  br label %114

114:                                              ; preds = %113, %18
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %113 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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