; LLVM IR from DionysiosB/CodeForces :: 1600-1699 (1661A-ArrayBalancing)

; 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 [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 %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::allocator", align 1
  %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
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %19

19:                                               ; preds = %158, %0
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = add nsw i64 %20, -1
  store i64 %21, ptr %2, align 8, !tbaa !5
  %22 = icmp ne i64 %20, 0
  br i1 %22, label %23, label %167

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  %25 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %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 %25, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %32

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

27:                                               ; preds = %41, %26
  %28 = load i64, ptr %8, align 8, !tbaa !5
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %36, label %31

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

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

36:                                               ; preds = %27
  %37 = load i64, ptr %8, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, 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 %8, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %8, align 8, !tbaa !5
  br label %27, !llvm.loop !9

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

48:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %49 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %49, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %50 unwind label %56

50:                                               ; preds = %48
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %65, %50
  %52 = load i64, ptr %11, align 8, !tbaa !5
  %53 = load i64, ptr %3, align 8, !tbaa !5
  %54 = icmp slt i64 %52, %53
  br i1 %54, label %60, label %55

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

56:                                               ; preds = %48
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %6, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  br label %164

60:                                               ; preds = %51
  %61 = load i64, ptr %11, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %61) #5
  %63 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %62)
          to label %64 unwind label %68

64:                                               ; preds = %60
  br label %65

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

68:                                               ; preds = %60
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %6, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %163

72:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 1, ptr %13, align 8, !tbaa !5
  br label %73

73:                                               ; preds = %152, %72
  %74 = load i64, ptr %13, align 8, !tbaa !5
  %75 = load i64, ptr %3, align 8, !tbaa !5
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %78, label %77

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

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %79 = load i64, ptr %13, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %79) #5
  %81 = load i64, ptr %80, align 8, !tbaa !5
  %82 = load i64, ptr %13, align 8, !tbaa !5
  %83 = sub nsw i64 %82, 1
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %83) #5
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = sub nsw i64 %81, %85
  store i64 %86, ptr %14, align 8, !tbaa !5
  %87 = load i64, ptr %14, align 8, !tbaa !5
  %88 = icmp slt i64 %87, 0
  br i1 %88, label %89, label %92

89:                                               ; preds = %78
  %90 = load i64, ptr %14, align 8, !tbaa !5
  %91 = sub nsw i64 0, %90
  store i64 %91, ptr %14, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %89, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %93 = load i64, ptr %13, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %93) #5
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = load i64, ptr %13, align 8, !tbaa !5
  %97 = sub nsw i64 %96, 1
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %97) #5
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = sub nsw i64 %95, %99
  store i64 %100, ptr %15, align 8, !tbaa !5
  %101 = load i64, ptr %15, align 8, !tbaa !5
  %102 = icmp slt i64 %101, 0
  br i1 %102, label %103, label %106

103:                                              ; preds = %92
  %104 = load i64, ptr %15, align 8, !tbaa !5
  %105 = sub nsw i64 0, %104
  store i64 %105, ptr %15, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %103, %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %107 = load i64, ptr %14, align 8, !tbaa !5
  %108 = load i64, ptr %15, align 8, !tbaa !5
  %109 = add nsw i64 %107, %108
  store i64 %109, ptr %16, align 8, !tbaa !5
  %110 = load i64, ptr %13, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %110) #5
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i64, ptr %13, align 8, !tbaa !5
  %114 = sub nsw i64 %113, 1
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %114) #5
  %116 = load i64, ptr %115, align 8, !tbaa !5
  %117 = sub nsw i64 %112, %116
  store i64 %117, ptr %14, align 8, !tbaa !5
  %118 = load i64, ptr %14, align 8, !tbaa !5
  %119 = icmp slt i64 %118, 0
  br i1 %119, label %120, label %123

120:                                              ; preds = %106
  %121 = load i64, ptr %14, align 8, !tbaa !5
  %122 = sub nsw i64 0, %121
  store i64 %122, ptr %14, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %120, %106
  %124 = load i64, ptr %13, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %124) #5
  %126 = load i64, ptr %125, align 8, !tbaa !5
  %127 = load i64, ptr %13, align 8, !tbaa !5
  %128 = sub nsw i64 %127, 1
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %128) #5
  %130 = load i64, ptr %129, align 8, !tbaa !5
  %131 = sub nsw i64 %126, %130
  store i64 %131, ptr %15, align 8, !tbaa !5
  %132 = load i64, ptr %15, align 8, !tbaa !5
  %133 = icmp slt i64 %132, 0
  br i1 %133, label %134, label %137

134:                                              ; preds = %123
  %135 = load i64, ptr %15, align 8, !tbaa !5
  %136 = sub nsw i64 0, %135
  store i64 %136, ptr %15, align 8, !tbaa !5
  br label %137

137:                                              ; preds = %134, %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %138 = load i64, ptr %14, align 8, !tbaa !5
  %139 = load i64, ptr %15, align 8, !tbaa !5
  %140 = add nsw i64 %138, %139
  store i64 %140, ptr %17, align 8, !tbaa !5
  %141 = load i64, ptr %16, align 8, !tbaa !5
  %142 = load i64, ptr %17, align 8, !tbaa !5
  %143 = icmp slt i64 %141, %142
  br i1 %143, label %144, label %146

144:                                              ; preds = %137
  %145 = load i64, ptr %16, align 8, !tbaa !5
  br label %148

146:                                              ; preds = %137
  %147 = load i64, ptr %17, align 8, !tbaa !5
  br label %148

148:                                              ; preds = %146, %144
  %149 = phi i64 [ %145, %144 ], [ %147, %146 ]
  %150 = load i64, ptr %12, align 8, !tbaa !12
  %151 = add nsw i64 %150, %149
  store i64 %151, ptr %12, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %152

152:                                              ; preds = %148
  %153 = load i64, ptr %13, align 8, !tbaa !5
  %154 = add nsw i64 %153, 1
  store i64 %154, ptr %13, align 8, !tbaa !5
  br label %73, !llvm.loop !14

155:                                              ; preds = %77
  %156 = load i64, ptr %12, align 8, !tbaa !12
  %157 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %156)
          to label %158 unwind label %159

158:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %19, !llvm.loop !15

159:                                              ; preds = %155
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %6, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %163

163:                                              ; preds = %159, %68
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %164

164:                                              ; preds = %163, %56
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %165

165:                                              ; preds = %164, %44
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %166

166:                                              ; preds = %165, %32
  call void @llvm.lifetime.end.p0(i64 24, 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 %169

167:                                              ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %168 = load i32, ptr %1, align 4
  ret i32 %168

169:                                              ; preds = %166
  %170 = load ptr, ptr %6, align 8
  %171 = load i32, ptr %7, align 4
  %172 = insertvalue { ptr, i32 } poison, ptr %170, 0
  %173 = insertvalue { ptr, i32 } %172, i32 %171, 1
  resume { ptr, i32 } %173
}

; 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

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 = { 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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 [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::allocator", align 1
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr %1, align 8, !tbaa !5
  %.not62 = icmp eq i64 %8, 0
  br i1 %.not62, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %0, %._crit_edge60
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %11 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %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 %11, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %12 unwind label %15

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

._crit_edge:                                      ; preds = %.lr.ph, %12
  %.lcssa = phi i64 [ %13, %12 ], [ %20, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.lcssa, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %22 unwind label %26

15:                                               ; preds = %.lr.ph64
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %64

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

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

.preheader:                                       ; preds = %.lr.ph56
  %25 = icmp sgt i64 %31, 1
  br i1 %25, label %.lr.ph59, label %._crit_edge60

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

.lr.ph56:                                         ; preds = %22, %.lr.ph56
  %.04254 = phi i64 [ %30, %.lr.ph56 ], [ 0, %22 ]
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04254) #6
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %28)
  %30 = add nuw nsw i64 %.04254, 1
  %31 = load i64, ptr %2, align 8, !tbaa !5
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %.lr.ph56, label %.preheader, !llvm.loop !11

._crit_edge60:                                    ; preds = %.lr.ph59, %22, %.preheader
  %.041.lcssa = phi i64 [ 0, %.preheader ], [ 0, %22 ], [ %60, %.lr.ph59 ]
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.041.lcssa)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %34 = load i64, ptr %1, align 8, !tbaa !5
  %35 = add nsw i64 %34, -1
  store i64 %35, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %34, 0
  br i1 %.not, label %._crit_edge65, label %.lr.ph64, !llvm.loop !12

.lr.ph59:                                         ; preds = %.preheader, %.lr.ph59
  %.04058 = phi i64 [ %61, %.lr.ph59 ], [ 1, %.preheader ]
  %.04157 = phi i64 [ %60, %.lr.ph59 ], [ 0, %.preheader ]
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04058) #6
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %.04058, -1
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %38) #6
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = sub nsw i64 %37, %40
  %spec.select = call i64 @llvm.abs.i64(i64 %41, i1 true)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04058) #6
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %38) #6
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = sub nsw i64 %43, %45
  %.037 = call i64 @llvm.abs.i64(i64 %46, i1 true)
  %47 = add nuw nsw i64 %.037, %spec.select
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04058) #6
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %38) #6
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = sub nsw i64 %49, %51
  %.139 = call i64 @llvm.abs.i64(i64 %52, i1 true)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04058) #6
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %38) #6
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = sub nsw i64 %54, %56
  %.1 = call i64 @llvm.abs.i64(i64 %57, i1 true)
  %58 = add nuw nsw i64 %.1, %.139
  %59 = call i64 @llvm.umin.i64(i64 %47, i64 %58)
  %60 = add nuw nsw i64 %59, %.04157
  %61 = add nuw nsw i64 %.04058, 1
  %62 = load i64, ptr %2, align 8, !tbaa !5
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %.lr.ph59, label %._crit_edge60, !llvm.loop !13

64:                                               ; preds = %26, %15
  %.pn = phi { ptr, i32 } [ %27, %26 ], [ %16, %15 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

._crit_edge65:                                    ; preds = %._crit_edge60, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_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: 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.abs.i64(i64, i1 immarg) #5

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!13 = distinct !{!13, !10}


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