; LLVM IR from DionysiosB/CodeForces :: 0600-0699 (689B-MikeAndShortcuts)

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

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

23:                                               ; preds = %37, %22
  %24 = load i64, ptr %7, align 8, !tbaa !5
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = icmp sle i64 %24, %25
  br i1 %26, label %32, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %44

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

32:                                               ; preds = %23
  %33 = load i64, ptr %7, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %33) #6
  %35 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %34)
          to label %36 unwind label %40

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %36
  %38 = load i64, ptr %7, align 8, !tbaa !5
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %7, align 8, !tbaa !5
  br label %23, !llvm.loop !9

40:                                               ; preds = %32
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %177

44:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  %45 = load i64, ptr %2, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 -1, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %46, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %47 unwind label %89

47:                                               ; preds = %44
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 1) #6
  store i64 0, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %11) #6
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %49 unwind label %93

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 1, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushEOl(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %50 unwind label %97

50:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %51

51:                                               ; preds = %149, %50
  %52 = invoke noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %53 unwind label %101

53:                                               ; preds = %51
  %54 = xor i1 %52, true
  br i1 %54, label %55, label %151

55:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIlSt5dequeIlSaIlEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %57 unwind label %105

57:                                               ; preds = %55
  %58 = load i64, ptr %56, align 8, !tbaa !5
  store i64 %58, ptr %13, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %59 unwind label %105

59:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %60 = load i64, ptr %13, align 8, !tbaa !5
  %61 = sub nsw i64 %60, 1
  store i64 %61, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %62 = load i64, ptr %13, align 8, !tbaa !5
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %64 = load i64, ptr %13, align 8, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %64) #6
  %66 = load i64, ptr %65, align 8, !tbaa !5
  store i64 %66, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %67 = load i64, ptr %13, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %67) #6
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = add nsw i64 1, %69
  store i64 %70, ptr %17, align 8, !tbaa !5
  %71 = load i64, ptr %14, align 8, !tbaa !5
  %72 = icmp sge i64 %71, 1
  br i1 %72, label %73, label %113

73:                                               ; preds = %59
  %74 = load i64, ptr %14, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %74) #6
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = icmp slt i64 %76, 0
  br i1 %77, label %84, label %78

78:                                               ; preds = %73
  %79 = load i64, ptr %14, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %79) #6
  %81 = load i64, ptr %80, align 8, !tbaa !5
  %82 = load i64, ptr %17, align 8, !tbaa !5
  %83 = icmp sgt i64 %81, %82
  br i1 %83, label %84, label %113

84:                                               ; preds = %78, %73
  %85 = load i64, ptr %17, align 8, !tbaa !5
  %86 = load i64, ptr %14, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %86) #6
  store i64 %85, ptr %87, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %88 unwind label %109

88:                                               ; preds = %84
  br label %113

89:                                               ; preds = %44
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %5, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %176

93:                                               ; preds = %47
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %5, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %6, align 4
  br label %175

97:                                               ; preds = %49
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %5, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %174

101:                                              ; preds = %170, %51
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %5, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %6, align 4
  br label %174

105:                                              ; preds = %57, %55
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %5, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %6, align 4
  br label %150

109:                                              ; preds = %144, %128, %84
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %5, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %150

113:                                              ; preds = %88, %78, %59
  %114 = load i64, ptr %15, align 8, !tbaa !5
  %115 = load i64, ptr %2, align 8, !tbaa !5
  %116 = icmp sle i64 %114, %115
  br i1 %116, label %117, label %133

117:                                              ; preds = %113
  %118 = load i64, ptr %15, align 8, !tbaa !5
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %118) #6
  %120 = load i64, ptr %119, align 8, !tbaa !5
  %121 = icmp slt i64 %120, 0
  br i1 %121, label %128, label %122

122:                                              ; preds = %117
  %123 = load i64, ptr %15, align 8, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %123) #6
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = load i64, ptr %17, align 8, !tbaa !5
  %127 = icmp sgt i64 %125, %126
  br i1 %127, label %128, label %133

128:                                              ; preds = %122, %117
  %129 = load i64, ptr %17, align 8, !tbaa !5
  %130 = load i64, ptr %15, align 8, !tbaa !5
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %130) #6
  store i64 %129, ptr %131, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %132 unwind label %109

132:                                              ; preds = %128
  br label %133

133:                                              ; preds = %132, %122, %113
  %134 = load i64, ptr %16, align 8, !tbaa !5
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %134) #6
  %136 = load i64, ptr %135, align 8, !tbaa !5
  %137 = icmp slt i64 %136, 0
  br i1 %137, label %144, label %138

138:                                              ; preds = %133
  %139 = load i64, ptr %16, align 8, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %139) #6
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = load i64, ptr %17, align 8, !tbaa !5
  %143 = icmp sgt i64 %141, %142
  br i1 %143, label %144, label %149

144:                                              ; preds = %138, %133
  %145 = load i64, ptr %17, align 8, !tbaa !5
  %146 = load i64, ptr %16, align 8, !tbaa !5
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %146) #6
  store i64 %145, ptr %147, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %148 unwind label %109

148:                                              ; preds = %144
  br label %149

149:                                              ; preds = %148, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %51, !llvm.loop !11

150:                                              ; preds = %109, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %174

151:                                              ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 1, ptr %18, align 8, !tbaa !5
  br label %152

152:                                              ; preds = %163, %151
  %153 = load i64, ptr %18, align 8, !tbaa !5
  %154 = load i64, ptr %2, align 8, !tbaa !5
  %155 = icmp sle i64 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %170

157:                                              ; preds = %152
  %158 = load i64, ptr %18, align 8, !tbaa !5
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %158) #6
  %160 = load i64, ptr %159, align 8, !tbaa !5
  %161 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %160)
          to label %162 unwind label %166

162:                                              ; preds = %157
  br label %163

163:                                              ; preds = %162
  %164 = load i64, ptr %18, align 8, !tbaa !5
  %165 = add nsw i64 %164, 1
  store i64 %165, ptr %18, align 8, !tbaa !5
  br label %152, !llvm.loop !12

166:                                              ; preds = %157
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %5, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %174

170:                                              ; preds = %156
  %171 = invoke i32 @puts(ptr noundef @.str.2)
          to label %172 unwind label %101

172:                                              ; preds = %170
  store i32 0, ptr %1, align 4
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %173 = load i32, ptr %1, align 4
  ret i32 %173

174:                                              ; preds = %166, %150, %101, %97
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #6
  br label %175

175:                                              ; preds = %174, %93
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  br label %176

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

177:                                              ; preds = %176, %40
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %178

178:                                              ; preds = %177, %28
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %5, align 8
  %181 = load i32, ptr %6, align 4
  %182 = insertvalue { ptr, i32 } poison, ptr %180, 0
  %183 = insertvalue { ptr, i32 } %182, i32 %181, 1
  resume { ptr, i32 } %183
}

; 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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushEOl(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 zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(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 @_ZNSt5queueIlSt5dequeIlSaIlEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

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

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

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 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 = { 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 = !{!"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}


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

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

._crit_edge:                                      ; preds = %.lr.ph, %15
  %.lcssa = phi i64 [ %16, %15 ], [ %23, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  %17 = add nsw i64 %.lcssa, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store i64 -1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %17, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %24 unwind label %53

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

.lr.ph:                                           ; preds = %15, %.lr.ph
  %.01933 = phi i64 [ %22, %.lr.ph ], [ 1, %15 ]
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.01933) #6
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %20)
  %22 = add nuw nsw i64 %.01933, 1
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp slt i64 %.01933, %23
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

24:                                               ; preds = %._crit_edge
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 1) #6
  store i64 0, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #6
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %26 unwind label %55

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store i64 1, ptr %8, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushEOl(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %27 unwind label %57

27:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %28 = call noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %28, label %.preheader, label %.lr.ph35

.preheader:                                       ; preds = %89, %27
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %.not2636 = icmp slt i64 %29, 1
  br i1 %.not2636, label %._crit_edge39, label %.lr.ph38

.lr.ph35:                                         ; preds = %27, %89
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIlSt5dequeIlSaIlEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %31 = load i64, ptr %30, align 8, !tbaa !5
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %32 = add nsw i64 %31, -1
  store i64 %32, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %33 = add nsw i64 %31, 1
  store i64 %33, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %31) #6
  %35 = load i64, ptr %34, align 8, !tbaa !5
  store i64 %35, ptr %11, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %31) #6
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  %39 = load i64, ptr %9, align 8, !tbaa !5
  %40 = icmp sgt i64 %39, 0
  br i1 %40, label %41, label %61

41:                                               ; preds = %.lr.ph35
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %39) #6
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = icmp slt i64 %43, 0
  br i1 %44, label %50, label %45

45:                                               ; preds = %41
  %46 = load i64, ptr %9, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %46) #6
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = icmp sgt i64 %48, %38
  br i1 %49, label %50, label %61

50:                                               ; preds = %45, %41
  %51 = load i64, ptr %9, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %51) #6
  store i64 %38, ptr %52, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %61 unwind label %59

53:                                               ; preds = %._crit_edge
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %99

55:                                               ; preds = %24
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %98

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

59:                                               ; preds = %86, %73, %50
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %97

61:                                               ; preds = %50, %45, %.lr.ph35
  %62 = load i64, ptr %10, align 8, !tbaa !5
  %63 = load i64, ptr %1, align 8, !tbaa !5
  %.not27 = icmp sgt i64 %62, %63
  br i1 %.not27, label %76, label %64

64:                                               ; preds = %61
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %62) #6
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = icmp slt i64 %66, 0
  br i1 %67, label %73, label %68

68:                                               ; preds = %64
  %69 = load i64, ptr %10, align 8, !tbaa !5
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %69) #6
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = icmp sgt i64 %71, %38
  br i1 %72, label %73, label %76

73:                                               ; preds = %68, %64
  %74 = load i64, ptr %10, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %74) #6
  store i64 %38, ptr %75, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %76 unwind label %59

76:                                               ; preds = %73, %68, %61
  %77 = load i64, ptr %11, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %77) #6
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = icmp slt i64 %79, 0
  br i1 %80, label %86, label %81

81:                                               ; preds = %76
  %82 = load i64, ptr %11, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %82) #6
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = icmp sgt i64 %84, %38
  br i1 %85, label %86, label %89

86:                                               ; preds = %81, %76
  %87 = load i64, ptr %11, align 8, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %87) #6
  store i64 %38, ptr %88, align 8, !tbaa !5
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %89 unwind label %59

89:                                               ; preds = %86, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %90 = call noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br i1 %90, label %.preheader, label %.lr.ph35, !llvm.loop !11

._crit_edge39:                                    ; preds = %.lr.ph38, %.preheader
  %91 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph38:                                         ; preds = %.preheader, %.lr.ph38
  %.037 = phi i64 [ %95, %.lr.ph38 ], [ 1, %.preheader ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #6
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %93)
  %95 = add nuw nsw i64 %.037, 1
  %96 = load i64, ptr %1, align 8, !tbaa !5
  %.not26.not = icmp slt i64 %.037, %96
  br i1 %.not26.not, label %.lr.ph38, label %._crit_edge39, !llvm.loop !12

97:                                               ; preds = %59, %57
  %.pn = phi { ptr, i32 } [ %60, %59 ], [ %58, %57 ]
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  br label %98

98:                                               ; preds = %97, %55
  %.pn.pn = phi { ptr, i32 } [ %.pn, %97 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %99

99:                                               ; preds = %98, %53
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %98 ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %100

100:                                              ; preds = %99, %18
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %99 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushEOl(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 zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(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 @_ZNSt5queueIlSt5dequeIlSaIlEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 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 = { 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 = !{!"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}


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