; LLVM IR from DionysiosB/CodeForces :: 0600-0699 (698B-FixATree)

; 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 }

@.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 [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z4findRSt6vectorIlSaIlEEl(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0

; 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) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4joinRSt6vectorIlSaIlEEll(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca 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
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = add nsw i64 %17, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %18, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %19 unwind label %28

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

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

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

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

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) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %163

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

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

40:                                               ; preds = %36
  br label %41

41:                                               ; preds = %40
  %42 = load i64, ptr %9, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %9, align 8, !tbaa !5
  br label %23, !llvm.loop !9

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

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

49:                                               ; preds = %58, %48
  %50 = load i64, ptr %10, align 8, !tbaa !5
  %51 = load i64, ptr %2, align 8, !tbaa !5
  %52 = icmp sle i64 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %61

54:                                               ; preds = %49
  %55 = load i64, ptr %10, align 8, !tbaa !5
  %56 = load i64, ptr %10, align 8, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %56) #5
  store i64 %55, ptr %57, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %54
  %59 = load i64, ptr %10, align 8, !tbaa !5
  %60 = add nsw i64 %59, 1
  store i64 %60, ptr %10, align 8, !tbaa !5
  br label %49, !llvm.loop !11

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 1, ptr %12, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %81, %61
  %63 = load i64, ptr %12, align 8, !tbaa !5
  %64 = load i64, ptr %2, align 8, !tbaa !5
  %65 = icmp sle i64 %63, %64
  br i1 %65, label %67, label %66

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

67:                                               ; preds = %62
  %68 = load i64, ptr %12, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %68) #5
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = load i64, ptr %12, align 8, !tbaa !5
  %72 = icmp eq i64 %70, %71
  br i1 %72, label %73, label %75

73:                                               ; preds = %67
  %74 = load i64, ptr %12, align 8, !tbaa !5
  store i64 %74, ptr %11, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %73, %67
  %76 = load i64, ptr %12, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %76) #5
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr %12, align 8, !tbaa !5
  invoke void @_Z4joinRSt6vectorIlSaIlEEll(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %78, i64 noundef %79)
          to label %80 unwind label %84

80:                                               ; preds = %75
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %12, align 8, !tbaa !5
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %12, align 8, !tbaa !5
  br label %62, !llvm.loop !12

84:                                               ; preds = %75
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %5, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %160

88:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  %89 = load i64, ptr %11, align 8, !tbaa !5
  %90 = icmp sle i64 %89, 0
  br i1 %90, label %91, label %103

91:                                               ; preds = %88
  %92 = invoke noundef i64 @_Z4findRSt6vectorIlSaIlEEl(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 1)
          to label %93 unwind label %99

93:                                               ; preds = %91
  store i64 %92, ptr %11, align 8, !tbaa !5
  %94 = load i64, ptr %11, align 8, !tbaa !5
  %95 = load i64, ptr %11, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %95) #5
  store i64 %94, ptr %96, align 8, !tbaa !5
  %97 = load i64, ptr %13, align 8, !tbaa !5
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %13, align 8, !tbaa !5
  br label %103

99:                                               ; preds = %155, %133, %91
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %5, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %6, align 4
  br label %159

103:                                              ; preds = %93, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 1, ptr %14, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %130, %103
  %105 = load i64, ptr %14, align 8, !tbaa !5
  %106 = load i64, ptr %2, align 8, !tbaa !5
  %107 = icmp sle i64 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %133

109:                                              ; preds = %104
  %110 = load i64, ptr %14, align 8, !tbaa !5
  %111 = invoke noundef i64 @_Z4findRSt6vectorIlSaIlEEl(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %110)
          to label %112 unwind label %120

112:                                              ; preds = %109
  %113 = load i64, ptr %14, align 8, !tbaa !5
  %114 = icmp ne i64 %111, %113
  br i1 %114, label %119, label %115

115:                                              ; preds = %112
  %116 = load i64, ptr %14, align 8, !tbaa !5
  %117 = load i64, ptr %11, align 8, !tbaa !5
  %118 = icmp eq i64 %116, %117
  br i1 %118, label %119, label %124

119:                                              ; preds = %115, %112
  br label %130

120:                                              ; preds = %109
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %5, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %159

124:                                              ; preds = %115
  %125 = load i64, ptr %13, align 8, !tbaa !5
  %126 = add nsw i64 %125, 1
  store i64 %126, ptr %13, align 8, !tbaa !5
  %127 = load i64, ptr %11, align 8, !tbaa !5
  %128 = load i64, ptr %14, align 8, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %128) #5
  store i64 %127, ptr %129, align 8, !tbaa !5
  br label %130

130:                                              ; preds = %124, %119
  %131 = load i64, ptr %14, align 8, !tbaa !5
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %14, align 8, !tbaa !5
  br label %104, !llvm.loop !13

133:                                              ; preds = %108
  %134 = load i64, ptr %13, align 8, !tbaa !5
  %135 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %134)
          to label %136 unwind label %99

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

137:                                              ; preds = %148, %136
  %138 = load i64, ptr %15, align 8, !tbaa !5
  %139 = load i64, ptr %2, align 8, !tbaa !5
  %140 = icmp sle i64 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %155

142:                                              ; preds = %137
  %143 = load i64, ptr %15, align 8, !tbaa !5
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %143) #5
  %145 = load i64, ptr %144, align 8, !tbaa !5
  %146 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %145)
          to label %147 unwind label %151

147:                                              ; preds = %142
  br label %148

148:                                              ; preds = %147
  %149 = load i64, ptr %15, align 8, !tbaa !5
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %15, align 8, !tbaa !5
  br label %137, !llvm.loop !14

151:                                              ; preds = %142
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %5, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %159

155:                                              ; preds = %141
  %156 = invoke i32 @puts(ptr noundef @.str.3)
          to label %157 unwind label %99

157:                                              ; preds = %155
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %158 = load i32, ptr %1, align 4
  ret i32 %158

159:                                              ; preds = %151, %120, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %160

160:                                              ; preds = %159, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %161

161:                                              ; preds = %160, %44
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %162

162:                                              ; preds = %161, %32
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %163

163:                                              ; preds = %162, %28
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr %5, align 8
  %166 = load i32, ptr %6, align 4
  %167 = insertvalue { ptr, i32 } poison, ptr %165, 0
  %168 = insertvalue { ptr, i32 } %167, i32 %166, 1
  resume { ptr, i32 } %168
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 #0 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) #3

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

declare i32 @puts(ptr noundef) #4

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; 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 }

@.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 [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z4findRSt6vectorIlSaIlEEl(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0

; 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4joinRSt6vectorIlSaIlEEll(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = add nsw i64 %7, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %9 unwind label %14

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

12:                                               ; preds = %9
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  %13 = load i64, ptr %1, align 8, !tbaa !5
  %.not61 = icmp slt i64 %13, 1
  br i1 %.not61, label %._crit_edge.thread, label %.lr.ph

.preheader58:                                     ; preds = %.lr.ph
  %.not4863 = icmp slt i64 %21, 1
  br i1 %.not4863, label %._crit_edge.thread, label %.lr.ph65

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

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

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

.preheader:                                       ; preds = %.lr.ph65
  %.not4966 = icmp slt i64 %24, 1
  br i1 %.not4966, label %._crit_edge.thread, label %.lr.ph69

.lr.ph65:                                         ; preds = %.preheader58, %.lr.ph65
  %.03964 = phi i64 [ %23, %.lr.ph65 ], [ 1, %.preheader58 ]
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.03964) #5
  store i64 %.03964, ptr %22, align 8, !tbaa !5
  %23 = add nuw nsw i64 %.03964, 1
  %24 = load i64, ptr %1, align 8, !tbaa !5
  %.not48.not = icmp slt i64 %.03964, %24
  br i1 %.not48.not, label %.lr.ph65, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %30
  %25 = icmp slt i64 %spec.select, 1
  br i1 %25, label %._crit_edge.thread, label %41

.lr.ph69:                                         ; preds = %.preheader, %30
  %.03568 = phi i64 [ %32, %30 ], [ 1, %.preheader ]
  %.03667 = phi i64 [ %spec.select, %30 ], [ 0, %.preheader ]
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03568) #5
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03568) #5
  %29 = load i64, ptr %28, align 8, !tbaa !5
  invoke void @_Z4joinRSt6vectorIlSaIlEEll(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %29, i64 noundef %.03568)
          to label %30 unwind label %34

30:                                               ; preds = %.lr.ph69
  %31 = icmp eq i64 %27, %.03568
  %spec.select = select i1 %31, i64 %.03568, i64 %.03667
  %32 = add nuw nsw i64 %.03568, 1
  %33 = load i64, ptr %1, align 8, !tbaa !5
  %.not49.not = icmp slt i64 %.03568, %33
  br i1 %.not49.not, label %.lr.ph69, label %._crit_edge, !llvm.loop !12

34:                                               ; preds = %.lr.ph69
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %62

._crit_edge.thread:                               ; preds = %12, %.preheader58, %.preheader, %._crit_edge
  %36 = invoke noundef i64 @_Z4findRSt6vectorIlSaIlEEl(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 1)
          to label %37 unwind label %39

37:                                               ; preds = %._crit_edge.thread
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %36) #5
  store i64 %36, ptr %38, align 8, !tbaa !5
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  br label %41

39:                                               ; preds = %._crit_edge.thread
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %62

41:                                               ; preds = %37, %._crit_edge
  %42 = phi i64 [ %.pre, %37 ], [ %33, %._crit_edge ]
  %.238 = phi i64 [ %36, %37 ], [ %spec.select, %._crit_edge ]
  %.034 = phi i64 [ 1, %37 ], [ 0, %._crit_edge ]
  %.not5070 = icmp slt i64 %42, 1
  br i1 %.not5070, label %._crit_edge75, label %.lr.ph74

._crit_edge75:                                    ; preds = %53, %41
  %.1.lcssa = phi i64 [ %.034, %41 ], [ %.2, %53 ]
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.1.lcssa)
  %44 = load i64, ptr %1, align 8, !tbaa !5
  %.not5177 = icmp slt i64 %44, 1
  br i1 %.not5177, label %._crit_edge81, label %.lr.ph80

.lr.ph74:                                         ; preds = %41, %53
  %.03372 = phi i64 [ %54, %53 ], [ 1, %41 ]
  %.171 = phi i64 [ %.2, %53 ], [ %.034, %41 ]
  %45 = invoke noundef i64 @_Z4findRSt6vectorIlSaIlEEl(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.03372)
          to label %46 unwind label %48

46:                                               ; preds = %.lr.ph74
  %.not53 = icmp ne i64 %45, %.03372
  %47 = icmp eq i64 %.03372, %.238
  %or.cond = or i1 %.not53, %47
  br i1 %or.cond, label %53, label %50

48:                                               ; preds = %.lr.ph74
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %62

50:                                               ; preds = %46
  %51 = add nsw i64 %.171, 1
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03372) #5
  store i64 %.238, ptr %52, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %46, %50
  %.2 = phi i64 [ %.171, %46 ], [ %51, %50 ]
  %54 = add nuw nsw i64 %.03372, 1
  %55 = load i64, ptr %1, align 8, !tbaa !5
  %.not50.not = icmp slt i64 %.03372, %55
  br i1 %.not50.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !13

._crit_edge81:                                    ; preds = %.lr.ph80, %._crit_edge75
  %56 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph80:                                         ; preds = %._crit_edge75, %.lr.ph80
  %.078 = phi i64 [ %60, %.lr.ph80 ], [ 1, %._crit_edge75 ]
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.078) #5
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %58)
  %60 = add nuw nsw i64 %.078, 1
  %61 = load i64, ptr %1, align 8, !tbaa !5
  %.not51.not = icmp slt i64 %.078, %61
  br i1 %.not51.not, label %.lr.ph80, label %._crit_edge81, !llvm.loop !14

62:                                               ; preds = %39, %48, %34
  %.pn54 = phi { ptr, i32 } [ %35, %34 ], [ %49, %48 ], [ %40, %39 ]
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %63

63:                                               ; preds = %62, %16
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %62 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  br label %64

64:                                               ; preds = %63, %14
  %.pn54.pn.pn = phi { ptr, i32 } [ %.pn54.pn, %63 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn54.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 #0 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) #3

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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