; LLVM IR from DionysiosB/CodeForces :: 1100-1199 (1105A-SalemAndSticks)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

20:                                               ; preds = %34, %19
  %21 = load i64, ptr %7, align 8, !tbaa !5
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %29, label %24

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

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

29:                                               ; preds = %20
  %30 = load i64, ptr %7, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %30) #6
  %32 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %31)
          to label %33 unwind label %37

33:                                               ; preds = %29
  br label %34

34:                                               ; preds = %33
  %35 = load i64, ptr %7, align 8, !tbaa !5
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %7, align 8, !tbaa !5
  br label %20, !llvm.loop !9

37:                                               ; preds = %29
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %142

41:                                               ; preds = %24
  %42 = call ptr @_ZNSt6vectorIlSaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = call ptr @_ZNSt6vectorIlSaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %45 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %44, ptr %45, align 8
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8
  %48 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEEEvT_S7_(ptr %47, ptr %49)
          to label %50 unwind label %70

50:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %51 = load i64, ptr %2, align 8, !tbaa !5
  %52 = sub nsw i64 %51, 1
  %53 = sdiv i64 %52, 2
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %53) #6
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = load i64, ptr %2, align 8, !tbaa !5
  %57 = sdiv i64 %56, 2
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %57) #6
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = add nsw i64 %55, %59
  %61 = sdiv i64 %60, 2
  store i64 %61, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 10000000000, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %62 = load i64, ptr %10, align 8, !tbaa !5
  %63 = sub nsw i64 %62, 1
  store i64 %63, ptr %13, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %129, %50
  %65 = load i64, ptr %13, align 8, !tbaa !5
  %66 = load i64, ptr %10, align 8, !tbaa !5
  %67 = add nsw i64 %66, 1
  %68 = icmp sle i64 %65, %67
  br i1 %68, label %74, label %69

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

70:                                               ; preds = %41
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %5, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %6, align 4
  br label %142

74:                                               ; preds = %64
  %75 = load i64, ptr %13, align 8, !tbaa !5
  %76 = icmp sle i64 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  br label %129

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %118, %78
  %80 = load i64, ptr %16, align 8, !tbaa !5
  %81 = load i64, ptr %2, align 8, !tbaa !5
  %82 = icmp slt i64 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %121

84:                                               ; preds = %79
  %85 = load i64, ptr %16, align 8, !tbaa !5
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %85) #6
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = load i64, ptr %13, align 8, !tbaa !5
  %89 = sub nsw i64 %88, 1
  %90 = icmp slt i64 %87, %89
  br i1 %90, label %91, label %100

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

100:                                              ; preds = %84
  %101 = load i64, ptr %16, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %101) #6
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = load i64, ptr %13, align 8, !tbaa !5
  %105 = add nsw i64 %104, 1
  %106 = icmp sgt i64 %103, %105
  br i1 %106, label %107, label %116

107:                                              ; preds = %100
  %108 = load i64, ptr %16, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %108) #6
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = load i64, ptr %13, align 8, !tbaa !5
  %112 = sub nsw i64 %110, %111
  %113 = sub nsw i64 %112, 1
  %114 = load i64, ptr %15, align 8, !tbaa !5
  %115 = add nsw i64 %114, %113
  store i64 %115, ptr %15, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %107, %100
  br label %117

117:                                              ; preds = %116, %91
  br label %118

118:                                              ; preds = %117
  %119 = load i64, ptr %16, align 8, !tbaa !5
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %16, align 8, !tbaa !5
  br label %79, !llvm.loop !11

121:                                              ; preds = %83
  %122 = load i64, ptr %15, align 8, !tbaa !5
  %123 = load i64, ptr %12, align 8, !tbaa !5
  %124 = icmp slt i64 %122, %123
  br i1 %124, label %125, label %128

125:                                              ; preds = %121
  %126 = load i64, ptr %15, align 8, !tbaa !5
  store i64 %126, ptr %12, align 8, !tbaa !5
  %127 = load i64, ptr %13, align 8, !tbaa !5
  store i64 %127, ptr %11, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %125, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %129

129:                                              ; preds = %128, %77
  %130 = load i64, ptr %13, align 8, !tbaa !5
  %131 = add nsw i64 %130, 1
  store i64 %131, ptr %13, align 8, !tbaa !5
  br label %64, !llvm.loop !12

132:                                              ; preds = %69
  %133 = load i64, ptr %11, align 8, !tbaa !5
  %134 = load i64, ptr %12, align 8, !tbaa !5
  %135 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %133, i64 noundef %134)
          to label %136 unwind label %138

136:                                              ; preds = %132
  store i32 0, ptr %1, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %137 = load i32, ptr %1, align 4
  ret i32 %137

138:                                              ; preds = %132
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %5, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %142

142:                                              ; preds = %138, %70, %37
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %143

143:                                              ; preds = %142, %25
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %5, align 8
  %146 = load i32, ptr %6, align 4
  %147 = insertvalue { ptr, i32 } poison, ptr %145, 0
  %148 = insertvalue { ptr, i32 } %147, i32 %146, 1
  resume { ptr, i32 } %148
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEEEvT_S7_(ptr, ptr) #5

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

._crit_edge:                                      ; preds = %.lr.ph, %6
  %9 = call ptr @_ZNSt6vectorIlSaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %10 = call ptr @_ZNSt6vectorIlSaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEEEvT_S7_(ptr %9, ptr %10)
          to label %18 unwind label %32

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

.lr.ph:                                           ; preds = %6, %.lr.ph
  %.03842 = phi i64 [ %15, %.lr.ph ], [ 0, %6 ]
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03842) #7
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %13)
  %15 = add nuw nsw i64 %.03842, 1
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = icmp slt i64 %15, %16
  br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !9

18:                                               ; preds = %._crit_edge
  %19 = load i64, ptr %1, align 8, !tbaa !5
  %20 = add nsw i64 %19, -1
  %21 = sdiv i64 %20, 2
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %21) #7
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = load i64, ptr %1, align 8, !tbaa !5
  %25 = sdiv i64 %24, 2
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %25) #7
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = add nsw i64 %27, %23
  %29 = sdiv i64 %28, 2
  %30 = add nsw i64 %29, -1
  %31 = icmp slt i64 %28, 4
  br i1 %31, label %59, label %.preheader

32:                                               ; preds = %._crit_edge
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  br label %115

.preheader:                                       ; preds = %18
  %34 = load i64, ptr %1, align 8, !tbaa !5
  %35 = icmp sgt i64 %34, 0
  br i1 %35, label %.lr.ph45, label %._crit_edge46.thread

.lr.ph45:                                         ; preds = %.preheader
  %36 = add nsw i64 %29, -2
  br label %39

._crit_edge46:                                    ; preds = %55
  %37 = icmp slt i64 %.1.fr, 10000000000
  %spec.select = select i1 %37, i64 %30, i64 0
  br label %._crit_edge46.thread

._crit_edge46.thread:                             ; preds = %._crit_edge46, %.preheader
  %.029.lcssa52 = phi i64 [ 0, %.preheader ], [ %.1.fr, %._crit_edge46 ]
  %38 = phi i64 [ %30, %.preheader ], [ %spec.select, %._crit_edge46 ]
  %spec.select41 = call i64 @llvm.smin.i64(i64 %.029.lcssa52, i64 10000000000)
  br label %59

39:                                               ; preds = %.lr.ph45, %55
  %.044 = phi i64 [ 0, %.lr.ph45 ], [ %56, %55 ]
  %.02943 = phi i64 [ 0, %.lr.ph45 ], [ %.1.fr, %55 ]
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044) #7
  %41 = load i64, ptr %40, align 8, !tbaa !5
  %42 = icmp slt i64 %41, %36
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044) #7
  %44 = load i64, ptr %43, align 8, !tbaa !5
  br i1 %42, label %45, label %48

45:                                               ; preds = %39
  %46 = add i64 %.02943, %36
  %47 = sub i64 %46, %44
  br label %55

48:                                               ; preds = %39
  %49 = icmp sgt i64 %44, %29
  br i1 %49, label %50, label %55

50:                                               ; preds = %48
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044) #7
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = sub i64 %.02943, %29
  %54 = add i64 %53, %52
  br label %55

55:                                               ; preds = %45, %50, %48
  %.1 = phi i64 [ %47, %45 ], [ %54, %50 ], [ %.02943, %48 ]
  %.1.fr = freeze i64 %.1
  %56 = add nuw nsw i64 %.044, 1
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %39, label %._crit_edge46, !llvm.loop !11

59:                                               ; preds = %18, %._crit_edge46.thread
  %.235 = phi i64 [ 0, %18 ], [ %38, %._crit_edge46.thread ]
  %.2 = phi i64 [ 10000000000, %18 ], [ %spec.select41, %._crit_edge46.thread ]
  %60 = icmp slt i64 %28, 2
  br i1 %60, label %86, label %.preheader.1

.preheader.1:                                     ; preds = %59
  %61 = load i64, ptr %1, align 8, !tbaa !5
  %62 = icmp sgt i64 %61, 0
  br i1 %62, label %.lr.ph45.1, label %._crit_edge46.1

.lr.ph45.1:                                       ; preds = %.preheader.1
  %63 = add nuw nsw i64 %29, 1
  %64 = xor i64 %29, -1
  br label %65

65:                                               ; preds = %81, %.lr.ph45.1
  %.044.1 = phi i64 [ 0, %.lr.ph45.1 ], [ %82, %81 ]
  %.02943.1 = phi i64 [ 0, %.lr.ph45.1 ], [ %.1.1, %81 ]
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044.1) #7
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = icmp slt i64 %67, %30
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044.1) #7
  %70 = load i64, ptr %69, align 8, !tbaa !5
  br i1 %68, label %78, label %71

71:                                               ; preds = %65
  %72 = icmp sgt i64 %70, %63
  br i1 %72, label %73, label %81

73:                                               ; preds = %71
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044.1) #7
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = add i64 %.02943.1, %64
  %77 = add i64 %76, %75
  br label %81

78:                                               ; preds = %65
  %79 = add i64 %.02943.1, %30
  %80 = sub i64 %79, %70
  br label %81

81:                                               ; preds = %78, %73, %71
  %.1.1 = phi i64 [ %80, %78 ], [ %77, %73 ], [ %.02943.1, %71 ]
  %82 = add nuw nsw i64 %.044.1, 1
  %83 = load i64, ptr %1, align 8, !tbaa !5
  %84 = icmp slt i64 %82, %83
  br i1 %84, label %65, label %._crit_edge46.1, !llvm.loop !11

._crit_edge46.1:                                  ; preds = %81, %.preheader.1
  %.029.lcssa.1 = phi i64 [ 0, %.preheader.1 ], [ %.1.1, %81 ]
  %85 = icmp slt i64 %.029.lcssa.1, %.2
  %spec.select.1 = select i1 %85, i64 %29, i64 %.235
  %spec.select41.1 = call i64 @llvm.smin.i64(i64 %.029.lcssa.1, i64 %.2)
  br label %86

86:                                               ; preds = %._crit_edge46.1, %59
  %.235.1 = phi i64 [ %.235, %59 ], [ %spec.select.1, %._crit_edge46.1 ]
  %.2.1 = phi i64 [ %.2, %59 ], [ %spec.select41.1, %._crit_edge46.1 ]
  %87 = add nsw i64 %29, 1
  %88 = icmp slt i64 %28, -1
  br i1 %88, label %113, label %.preheader.2

.preheader.2:                                     ; preds = %86
  %89 = load i64, ptr %1, align 8, !tbaa !5
  %90 = icmp sgt i64 %89, 0
  br i1 %90, label %.lr.ph45.2, label %._crit_edge46.2

.lr.ph45.2:                                       ; preds = %.preheader.2
  %91 = add nsw i64 %29, 2
  br label %92

92:                                               ; preds = %108, %.lr.ph45.2
  %.044.2 = phi i64 [ 0, %.lr.ph45.2 ], [ %109, %108 ]
  %.02943.2 = phi i64 [ 0, %.lr.ph45.2 ], [ %.1.2, %108 ]
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044.2) #7
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = icmp slt i64 %94, %29
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044.2) #7
  %97 = load i64, ptr %96, align 8, !tbaa !5
  br i1 %95, label %105, label %98

98:                                               ; preds = %92
  %99 = icmp sgt i64 %97, %91
  br i1 %99, label %100, label %108

100:                                              ; preds = %98
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.044.2) #7
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %reass.sub = sub i64 %.02943.2, %29
  %103 = add i64 %reass.sub, -2
  %104 = add i64 %103, %102
  br label %108

105:                                              ; preds = %92
  %106 = add i64 %.02943.2, %29
  %107 = sub i64 %106, %97
  br label %108

108:                                              ; preds = %105, %100, %98
  %.1.2 = phi i64 [ %107, %105 ], [ %104, %100 ], [ %.02943.2, %98 ]
  %109 = add nuw nsw i64 %.044.2, 1
  %110 = load i64, ptr %1, align 8, !tbaa !5
  %111 = icmp slt i64 %109, %110
  br i1 %111, label %92, label %._crit_edge46.2, !llvm.loop !11

._crit_edge46.2:                                  ; preds = %108, %.preheader.2
  %.029.lcssa.2 = phi i64 [ 0, %.preheader.2 ], [ %.1.2, %108 ]
  %112 = icmp slt i64 %.029.lcssa.2, %.2.1
  %spec.select.2 = select i1 %112, i64 %87, i64 %.235.1
  %spec.select41.2 = call i64 @llvm.smin.i64(i64 %.029.lcssa.2, i64 %.2.1)
  br label %113

113:                                              ; preds = %._crit_edge46.2, %86
  %.235.2 = phi i64 [ %.235.1, %86 ], [ %spec.select.2, %._crit_edge46.2 ]
  %.2.2 = phi i64 [ %.2.1, %86 ], [ %spec.select41.2, %._crit_edge46.2 ]
  %114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.235.2, i64 noundef %.2.2)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

115:                                              ; preds = %32, %11
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %12, %11 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPlSt6vectorIlSaIlEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIlSaIlEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) 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 @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6

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


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