; LLVM IR from DionysiosB/CodeForces :: 0400-0499 (414B-MashmokhAndACM)

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

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

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

24:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  call void @_ZNSaISt6vectorIxSaIxEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt6vectorIS_IxSaIxEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %21, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %25 unwind label %35

25:                                               ; preds = %24
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 1, ptr %12, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %44, %25
  %27 = load i64, ptr %12, align 8, !tbaa !5
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = icmp sle i64 %27, %28
  br i1 %29, label %40, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %47

31:                                               ; preds = %0
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  br label %39

35:                                               ; preds = %24
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %39

39:                                               ; preds = %35, %31
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  br label %125

40:                                               ; preds = %26
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1) #5
  %42 = load i64, ptr %12, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %42) #5
  store i64 1, ptr %43, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %40
  %45 = load i64, ptr %12, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %12, align 8, !tbaa !5
  br label %26, !llvm.loop !9

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 2, ptr %13, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %94, %47
  %49 = load i64, ptr %13, align 8, !tbaa !5
  %50 = load i64, ptr %4, align 8, !tbaa !5
  %51 = icmp sle i64 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %97

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

54:                                               ; preds = %90, %53
  %55 = load i64, ptr %15, align 8, !tbaa !5
  %56 = load i64, ptr %3, align 8, !tbaa !5
  %57 = icmp sle i64 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %93

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %60 = load i64, ptr %15, align 8, !tbaa !5
  store i64 %60, ptr %16, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %85, %59
  %62 = load i64, ptr %16, align 8, !tbaa !5
  %63 = load i64, ptr %3, align 8, !tbaa !5
  %64 = icmp sle i64 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %89

66:                                               ; preds = %61
  %67 = load i64, ptr %13, align 8, !tbaa !5
  %68 = sub nsw i64 %67, 1
  %69 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %68) #5
  %70 = load i64, ptr %15, align 8, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %70) #5
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = load i64, ptr %13, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %73) #5
  %75 = load i64, ptr %16, align 8, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %75) #5
  %77 = load i64, ptr %76, align 8, !tbaa !5
  %78 = add nsw i64 %77, %72
  store i64 %78, ptr %76, align 8, !tbaa !5
  %79 = load i64, ptr %13, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %79) #5
  %81 = load i64, ptr %16, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %80, i64 noundef %81) #5
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = srem i64 %83, 1000000007
  store i64 %84, ptr %82, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %66
  %86 = load i64, ptr %15, align 8, !tbaa !5
  %87 = load i64, ptr %16, align 8, !tbaa !5
  %88 = add nsw i64 %87, %86
  store i64 %88, ptr %16, align 8, !tbaa !5
  br label %61, !llvm.loop !11

89:                                               ; preds = %65
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %15, align 8, !tbaa !5
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %15, align 8, !tbaa !5
  br label %54, !llvm.loop !12

93:                                               ; preds = %58
  br label %94

94:                                               ; preds = %93
  %95 = load i64, ptr %13, align 8, !tbaa !5
  %96 = add nsw i64 %95, 1
  store i64 %96, ptr %13, align 8, !tbaa !5
  br label %48, !llvm.loop !13

97:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store i64 1, ptr %18, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %113, %97
  %99 = load i64, ptr %18, align 8, !tbaa !5
  %100 = load i64, ptr %3, align 8, !tbaa !5
  %101 = icmp sle i64 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 14, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %116

103:                                              ; preds = %98
  %104 = load i64, ptr %4, align 8, !tbaa !5
  %105 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %104) #5
  %106 = load i64, ptr %18, align 8, !tbaa !5
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %106) #5
  %108 = load i64, ptr %107, align 8, !tbaa !5
  %109 = load i64, ptr %17, align 8, !tbaa !5
  %110 = add nsw i64 %109, %108
  store i64 %110, ptr %17, align 8, !tbaa !5
  %111 = load i64, ptr %17, align 8, !tbaa !5
  %112 = srem i64 %111, 1000000007
  store i64 %112, ptr %17, align 8, !tbaa !5
  br label %113

113:                                              ; preds = %103
  %114 = load i64, ptr %18, align 8, !tbaa !5
  %115 = add nsw i64 %114, 1
  store i64 %115, ptr %18, align 8, !tbaa !5
  br label %98, !llvm.loop !14

116:                                              ; preds = %102
  %117 = load i64, ptr %17, align 8, !tbaa !5
  %118 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %117)
          to label %119 unwind label %121

119:                                              ; preds = %116
  store i32 0, ptr %1, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(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
  %120 = load i32, ptr %1, align 4
  ret i32 %120

121:                                              ; preds = %116
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %9, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %125

125:                                              ; preds = %121, %39
  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 %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %9, align 8
  %128 = load i32, ptr %10, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

; 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 @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(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

declare i32 @__gxx_personality_v0(...)

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

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

; 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 void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

; 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 @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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

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

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

12:                                               ; preds = %0
  %13 = add nsw i64 %9, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #5
  call void @_ZNSaISt6vectorIxSaIxEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  invoke void @_ZNSt6vectorIS_IxSaIxEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %13, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %14 unwind label %21

14:                                               ; preds = %12
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %.not40 = icmp slt i64 %15, 1
  br i1 %.not40, label %.preheader39, label %.lr.ph

.preheader39:                                     ; preds = %.lr.ph, %14
  %16 = phi i64 [ %15, %14 ], [ %27, %.lr.ph ]
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %.not3348 = icmp slt i64 %17, 2
  br i1 %.not3348, label %.preheader, label %.preheader38.lr.ph

.preheader38.lr.ph:                               ; preds = %.preheader39
  %18 = icmp slt i64 %16, 1
  br i1 %18, label %._crit_edge54, label %.preheader38

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %23

21:                                               ; preds = %12
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %23

23:                                               ; preds = %21, %19
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %20, %19 ]
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 24, 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 } %.pn

.lr.ph:                                           ; preds = %14, %.lr.ph
  %.02941 = phi i64 [ %26, %.lr.ph ], [ 1, %14 ]
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1) #5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %.02941) #5
  store i64 1, ptr %25, align 8, !tbaa !5
  %26 = add nuw nsw i64 %.02941, 1
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp slt i64 %.02941, %27
  br i1 %.not.not, label %.lr.ph, label %.preheader39, !llvm.loop !9

.preheader38:                                     ; preds = %.preheader38.lr.ph, %._crit_edge47
  %28 = phi i64 [ %35, %._crit_edge47 ], [ %17, %.preheader38.lr.ph ]
  %29 = phi i64 [ %36, %._crit_edge47 ], [ %16, %.preheader38.lr.ph ]
  %30 = phi i64 [ %37, %._crit_edge47 ], [ %16, %.preheader38.lr.ph ]
  %.02849 = phi i64 [ %38, %._crit_edge47 ], [ 2, %.preheader38.lr.ph ]
  %.not3545 = icmp slt i64 %30, 1
  br i1 %.not3545, label %._crit_edge47, label %.preheader37.lr.ph

.preheader37.lr.ph:                               ; preds = %.preheader38
  %31 = add nsw i64 %.02849, -1
  br label %.preheader37

.preheader:                                       ; preds = %._crit_edge47, %.preheader39
  %32 = phi i64 [ %16, %.preheader39 ], [ %36, %._crit_edge47 ]
  %.not3450 = icmp slt i64 %32, 1
  br i1 %.not3450, label %._crit_edge54, label %.lr.ph53

.preheader37:                                     ; preds = %.preheader37.lr.ph, %._crit_edge
  %33 = phi i64 [ %29, %.preheader37.lr.ph ], [ %39, %._crit_edge ]
  %34 = phi i64 [ %30, %.preheader37.lr.ph ], [ %39, %._crit_edge ]
  %.02746 = phi i64 [ 1, %.preheader37.lr.ph ], [ %40, %._crit_edge ]
  %.not3642 = icmp sgt i64 %.02746, %34
  br i1 %.not3642, label %._crit_edge, label %.lr.ph44

._crit_edge47.loopexit:                           ; preds = %._crit_edge
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %._crit_edge47.loopexit, %.preheader38
  %35 = phi i64 [ %.pre, %._crit_edge47.loopexit ], [ %28, %.preheader38 ]
  %36 = phi i64 [ %39, %._crit_edge47.loopexit ], [ %29, %.preheader38 ]
  %37 = phi i64 [ %39, %._crit_edge47.loopexit ], [ %30, %.preheader38 ]
  %38 = add nuw nsw i64 %.02849, 1
  %.not33.not = icmp slt i64 %.02849, %35
  br i1 %.not33.not, label %.preheader38, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph44, %.preheader37
  %39 = phi i64 [ %33, %.preheader37 ], [ %53, %.lr.ph44 ]
  %40 = add nuw nsw i64 %.02746, 1
  %.not35.not = icmp slt i64 %.02746, %39
  br i1 %.not35.not, label %.preheader37, label %._crit_edge47.loopexit, !llvm.loop !13

.lr.ph44:                                         ; preds = %.preheader37, %.lr.ph44
  %.02643 = phi i64 [ %52, %.lr.ph44 ], [ %.02746, %.preheader37 ]
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %31) #5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %.02746) #5
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02849) #5
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %.02643) #5
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = add nsw i64 %46, %43
  store i64 %47, ptr %45, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02849) #5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %.02643) #5
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = srem i64 %50, 1000000007
  store i64 %51, ptr %49, align 8, !tbaa !5
  %52 = add nuw nsw i64 %.02643, %.02746
  %53 = load i64, ptr %1, align 8, !tbaa !5
  %.not36 = icmp sgt i64 %52, %53
  br i1 %.not36, label %._crit_edge, label %.lr.ph44, !llvm.loop !14

._crit_edge54:                                    ; preds = %.lr.ph53, %.preheader38.lr.ph, %.preheader
  %.025.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader38.lr.ph ], [ %60, %.lr.ph53 ]
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.025.lcssa)
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, 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

.lr.ph53:                                         ; preds = %.preheader, %.lr.ph53
  %.052 = phi i64 [ %61, %.lr.ph53 ], [ 1, %.preheader ]
  %.02551 = phi i64 [ %60, %.lr.ph53 ], [ 0, %.preheader ]
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %55) #5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %.052) #5
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = add nsw i64 %58, %.02551
  %60 = srem i64 %59, 1000000007
  %61 = add nuw nsw i64 %.052, 1
  %62 = load i64, ptr %1, align 8, !tbaa !5
  %.not34.not = icmp slt i64 %.052, %62
  br i1 %.not34.not, label %.lr.ph53, label %._crit_edge54, !llvm.loop !15
}

; 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 @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(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

declare i32 @__gxx_personality_v0(...)

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

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

; 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 void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

; 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 @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(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.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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