; LLVM IR from DionysiosB/CodeForces :: 1000-1099 (1055B-AliceAndHairdresser)

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

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

17:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %32, %17
  %19 = load i64, ptr %9, align 8, !tbaa !5
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %27, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %39

23:                                               ; preds = %0
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %7, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %178

27:                                               ; preds = %18
  %28 = load i64, ptr %9, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %28) #5
  %30 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %29)
          to label %31 unwind label %35

31:                                               ; preds = %27
  br label %32

32:                                               ; preds = %31
  %33 = load i64, ptr %9, align 8, !tbaa !5
  %34 = add nsw i64 %33, 1
  store i64 %34, ptr %9, align 8, !tbaa !5
  br label %18, !llvm.loop !9

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %7, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %177

39:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %66, %39
  %41 = load i64, ptr %11, align 8, !tbaa !5
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %69

45:                                               ; preds = %40
  %46 = load i64, ptr %11, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %46) #5
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = load i64, ptr %4, align 8, !tbaa !5
  %50 = icmp sle i64 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  br label %66

52:                                               ; preds = %45
  %53 = load i64, ptr %11, align 8, !tbaa !5
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %62, label %55

55:                                               ; preds = %52
  %56 = load i64, ptr %11, align 8, !tbaa !5
  %57 = sub nsw i64 %56, 1
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %57) #5
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = load i64, ptr %4, align 8, !tbaa !5
  %61 = icmp sle i64 %59, %60
  br i1 %61, label %62, label %65

62:                                               ; preds = %55, %52
  %63 = load i64, ptr %10, align 8, !tbaa !5
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %10, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %62, %55
  br label %66

66:                                               ; preds = %65, %51
  %67 = load i64, ptr %11, align 8, !tbaa !5
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %11, align 8, !tbaa !5
  br label %40, !llvm.loop !11

69:                                               ; preds = %44
  br label %70

70:                                               ; preds = %173, %69
  %71 = load i64, ptr %3, align 8, !tbaa !5
  %72 = add nsw i64 %71, -1
  store i64 %72, ptr %3, align 8, !tbaa !5
  %73 = icmp ne i64 %71, 0
  br i1 %73, label %74, label %175

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %75 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %12)
          to label %76 unwind label %134

76:                                               ; preds = %74
  %77 = load i64, ptr %12, align 8, !tbaa !5
  %78 = icmp ne i64 %77, 0
  br i1 %78, label %79, label %169

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %80 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %13, ptr noundef %14)
          to label %81 unwind label %138

81:                                               ; preds = %79
  %82 = load i64, ptr %14, align 8, !tbaa !5
  %83 = load i64, ptr %13, align 8, !tbaa !5
  %84 = add nsw i64 %83, -1
  store i64 %84, ptr %13, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %84) #5
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = add nsw i64 %86, %82
  store i64 %87, ptr %85, align 8, !tbaa !5
  %88 = load i64, ptr %4, align 8, !tbaa !5
  %89 = load i64, ptr %13, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %89) #5
  %91 = load i64, ptr %90, align 8, !tbaa !5
  %92 = icmp slt i64 %88, %91
  br i1 %92, label %93, label %168

93:                                               ; preds = %81
  %94 = load i64, ptr %13, align 8, !tbaa !5
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %94) #5
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = load i64, ptr %4, align 8, !tbaa !5
  %98 = load i64, ptr %14, align 8, !tbaa !5
  %99 = add nsw i64 %97, %98
  %100 = icmp sle i64 %96, %99
  br i1 %100, label %101, label %168

101:                                              ; preds = %93
  %102 = load i64, ptr %13, align 8, !tbaa !5
  %103 = icmp eq i64 %102, 0
  br i1 %103, label %114, label %104

104:                                              ; preds = %101
  %105 = load i64, ptr %13, align 8, !tbaa !5
  %106 = icmp sgt i64 %105, 0
  br i1 %106, label %107, label %142

107:                                              ; preds = %104
  %108 = load i64, ptr %13, align 8, !tbaa !5
  %109 = sub nsw i64 %108, 1
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %109) #5
  %111 = load i64, ptr %110, align 8, !tbaa !5
  %112 = load i64, ptr %4, align 8, !tbaa !5
  %113 = icmp sle i64 %111, %112
  br i1 %113, label %114, label %142

114:                                              ; preds = %107, %101
  %115 = load i64, ptr %13, align 8, !tbaa !5
  %116 = load i64, ptr %2, align 8, !tbaa !5
  %117 = sub nsw i64 %116, 1
  %118 = icmp eq i64 %115, %117
  br i1 %118, label %131, label %119

119:                                              ; preds = %114
  %120 = load i64, ptr %13, align 8, !tbaa !5
  %121 = add nsw i64 %120, 1
  %122 = load i64, ptr %2, align 8, !tbaa !5
  %123 = icmp slt i64 %121, %122
  br i1 %123, label %124, label %142

124:                                              ; preds = %119
  %125 = load i64, ptr %13, align 8, !tbaa !5
  %126 = add nsw i64 %125, 1
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %126) #5
  %128 = load i64, ptr %127, align 8, !tbaa !5
  %129 = load i64, ptr %4, align 8, !tbaa !5
  %130 = icmp sle i64 %128, %129
  br i1 %130, label %131, label %142

131:                                              ; preds = %124, %114
  %132 = load i64, ptr %10, align 8, !tbaa !5
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %10, align 8, !tbaa !5
  br label %142

134:                                              ; preds = %169, %74
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %7, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %8, align 4
  br label %174

138:                                              ; preds = %79
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %7, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %174

142:                                              ; preds = %131, %124, %119, %107, %104
  %143 = load i64, ptr %13, align 8, !tbaa !5
  %144 = icmp sgt i64 %143, 0
  br i1 %144, label %145, label %167

145:                                              ; preds = %142
  %146 = load i64, ptr %13, align 8, !tbaa !5
  %147 = sub nsw i64 %146, 1
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %147) #5
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = load i64, ptr %4, align 8, !tbaa !5
  %151 = icmp sgt i64 %149, %150
  br i1 %151, label %152, label %167

152:                                              ; preds = %145
  %153 = load i64, ptr %13, align 8, !tbaa !5
  %154 = add nsw i64 %153, 1
  %155 = load i64, ptr %2, align 8, !tbaa !5
  %156 = icmp slt i64 %154, %155
  br i1 %156, label %157, label %167

157:                                              ; preds = %152
  %158 = load i64, ptr %13, align 8, !tbaa !5
  %159 = add nsw i64 %158, 1
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %159) #5
  %161 = load i64, ptr %160, align 8, !tbaa !5
  %162 = load i64, ptr %4, align 8, !tbaa !5
  %163 = icmp sgt i64 %161, %162
  br i1 %163, label %164, label %167

164:                                              ; preds = %157
  %165 = load i64, ptr %10, align 8, !tbaa !5
  %166 = add nsw i64 %165, -1
  store i64 %166, ptr %10, align 8, !tbaa !5
  br label %167

167:                                              ; preds = %164, %157, %152, %145, %142
  br label %168

168:                                              ; preds = %167, %93, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %173

169:                                              ; preds = %76
  %170 = load i64, ptr %10, align 8, !tbaa !5
  %171 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %170)
          to label %172 unwind label %134

172:                                              ; preds = %169
  br label %173

173:                                              ; preds = %172, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %70, !llvm.loop !12

174:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %177

175:                                              ; preds = %70
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %176 = load i32, ptr %1, align 4
  ret i32 %176

177:                                              ; preds = %174, %35
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %178

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

179:                                              ; preds = %178
  %180 = load ptr, ptr %7, align 8
  %181 = load i32, ptr %8, 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 @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(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 @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(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 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 long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

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

.preheader28:                                     ; preds = %.lr.ph
  %14 = icmp sgt i64 %25, 0
  br i1 %14, label %.lr.ph33.preheader, label %.preheader

.lr.ph33.preheader:                               ; preds = %.preheader28
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #5
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = load i64, ptr %3, align 8, !tbaa !5
  %.not25.peel = icmp sgt i64 %16, %17
  %spec.select42 = zext i1 %.not25.peel to i64
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %19 = icmp sgt i64 %18, 1
  br i1 %19, label %.lr.ph33, label %.preheader

20:                                               ; preds = %0
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %21

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.01529 = phi i64 [ %24, %.lr.ph ], [ 0, %11 ]
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.01529) #5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %22)
  %24 = add nuw nsw i64 %.01529, 1
  %25 = load i64, ptr %1, align 8, !tbaa !5
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %.lr.ph, label %.preheader28, !llvm.loop !9

.preheader:                                       ; preds = %38, %11, %.lr.ph33.preheader, %.preheader28
  %.014.lcssa = phi i64 [ 0, %.preheader28 ], [ %spec.select42, %.lr.ph33.preheader ], [ 0, %11 ], [ %.1, %38 ]
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = add nsw i64 %27, -1
  store i64 %28, ptr %2, align 8, !tbaa !5
  %.not34 = icmp eq i64 %27, 0
  br i1 %.not34, label %._crit_edge, label %.lr.ph36

.lr.ph33:                                         ; preds = %.lr.ph33.preheader, %38
  %.031 = phi i64 [ %39, %38 ], [ 1, %.lr.ph33.preheader ]
  %.01430 = phi i64 [ %.1, %38 ], [ %spec.select42, %.lr.ph33.preheader ]
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.031) #5
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %.not25 = icmp sgt i64 %30, %31
  br i1 %.not25, label %32, label %38

32:                                               ; preds = %.lr.ph33
  %33 = add nsw i64 %.031, -1
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %33) #5
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %.not26 = icmp sle i64 %35, %36
  %37 = zext i1 %.not26 to i64
  %spec.select43 = add nsw i64 %.01430, %37
  br label %38

38:                                               ; preds = %32, %.lr.ph33
  %.1 = phi i64 [ %.01430, %.lr.ph33 ], [ %spec.select43, %32 ]
  %39 = add nuw nsw i64 %.031, 1
  %40 = load i64, ptr %1, align 8, !tbaa !5
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %.lr.ph33, label %.preheader, !llvm.loop !11

.lr.ph36:                                         ; preds = %.preheader, %109
  %.235 = phi i64 [ %.5, %109 ], [ %.014.lcssa, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %43 = load i64, ptr %6, align 8, !tbaa !5
  %.not21 = icmp eq i64 %43, 0
  br i1 %.not21, label %107, label %44

44:                                               ; preds = %.lr.ph36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %46 = load i64, ptr %8, align 8, !tbaa !5
  %47 = load i64, ptr %7, align 8, !tbaa !5
  %48 = add nsw i64 %47, -1
  store i64 %48, ptr %7, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %48) #5
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = add nsw i64 %50, %46
  store i64 %51, ptr %49, align 8, !tbaa !5
  %52 = load i64, ptr %3, align 8, !tbaa !5
  %53 = load i64, ptr %7, align 8, !tbaa !5
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %53) #5
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = icmp slt i64 %52, %55
  br i1 %56, label %57, label %.thread

57:                                               ; preds = %44
  %58 = load i64, ptr %7, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %58) #5
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = load i64, ptr %3, align 8, !tbaa !5
  %62 = load i64, ptr %8, align 8, !tbaa !5
  %63 = add nsw i64 %62, %61
  %.not22 = icmp sgt i64 %60, %63
  br i1 %.not22, label %.thread, label %64

64:                                               ; preds = %57
  %65 = load i64, ptr %7, align 8, !tbaa !5
  %66 = icmp eq i64 %65, 0
  br i1 %66, label %74, label %67

67:                                               ; preds = %64
  %68 = icmp sgt i64 %65, 0
  br i1 %68, label %69, label %.thread

69:                                               ; preds = %67
  %70 = add nsw i64 %65, -1
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %70) #5
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = load i64, ptr %3, align 8, !tbaa !5
  %.not23 = icmp sgt i64 %72, %73
  br i1 %.not23, label %88, label %._crit_edge41

._crit_edge41:                                    ; preds = %69
  %.pre = load i64, ptr %7, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %._crit_edge41, %64
  %75 = phi i64 [ %.pre, %._crit_edge41 ], [ 0, %64 ]
  %76 = load i64, ptr %1, align 8, !tbaa !5
  %77 = add nsw i64 %76, -1
  %78 = icmp eq i64 %75, %77
  br i1 %78, label %86, label %79

79:                                               ; preds = %74
  %80 = add nsw i64 %75, 1
  %81 = icmp slt i64 %80, %76
  br i1 %81, label %82, label %88

82:                                               ; preds = %79
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %80) #5
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = load i64, ptr %3, align 8, !tbaa !5
  %.not24 = icmp sgt i64 %84, %85
  br i1 %.not24, label %88, label %86

86:                                               ; preds = %82, %74
  %87 = add nsw i64 %.235, 1
  br label %88

88:                                               ; preds = %86, %82, %79, %69
  %.3.ph = phi i64 [ %.235, %69 ], [ %.235, %79 ], [ %.235, %82 ], [ %87, %86 ]
  %.pr = load i64, ptr %7, align 8, !tbaa !5
  %89 = icmp sgt i64 %.pr, 0
  br i1 %89, label %90, label %.thread

90:                                               ; preds = %88
  %91 = add nsw i64 %.pr, -1
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %91) #5
  %93 = load i64, ptr %92, align 8, !tbaa !5
  %94 = load i64, ptr %3, align 8, !tbaa !5
  %95 = icmp sgt i64 %93, %94
  br i1 %95, label %96, label %.thread

96:                                               ; preds = %90
  %97 = load i64, ptr %7, align 8, !tbaa !5
  %98 = add nsw i64 %97, 1
  %99 = load i64, ptr %1, align 8, !tbaa !5
  %100 = icmp slt i64 %98, %99
  br i1 %100, label %101, label %.thread

101:                                              ; preds = %96
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %98) #5
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = load i64, ptr %3, align 8, !tbaa !5
  %105 = icmp sgt i64 %103, %104
  %106 = sext i1 %105 to i64
  %spec.select = add nsw i64 %.3.ph, %106
  br label %.thread

.thread:                                          ; preds = %67, %101, %88, %90, %96, %57, %44
  %.4 = phi i64 [ %.3.ph, %96 ], [ %.3.ph, %90 ], [ %.3.ph, %88 ], [ %.235, %57 ], [ %.235, %44 ], [ %spec.select, %101 ], [ %.235, %67 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %109

107:                                              ; preds = %.lr.ph36
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.235)
  br label %109

109:                                              ; preds = %107, %.thread
  %.5 = phi i64 [ %.4, %.thread ], [ %.235, %107 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %110 = load i64, ptr %2, align 8, !tbaa !5
  %111 = add nsw i64 %110, -1
  store i64 %111, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %110, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph36, !llvm.loop !13

._crit_edge:                                      ; preds = %109, %.preheader
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(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 @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) 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 @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(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 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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10}


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