; LLVM IR from DionysiosB/CodeForces :: 2064C-RemoveTheEnds (main)

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

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

@.str = external hidden unnamed_addr constant [5 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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %16

16:                                               ; preds = %184, %0
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = add nsw i64 %17, -1
  store i64 %18, ptr %2, align 8, !tbaa !5
  %19 = icmp ne i64 %17, 0
  br i1 %19, label %20, label %190

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %53, %20
  %23 = load i64, ptr %6, align 8, !tbaa !5
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %28 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %7)
          to label %29 unwind label %45

29:                                               ; preds = %27
  %30 = load i64, ptr %5, align 8, !tbaa !5
  %31 = icmp sge i64 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  %33 = load i64, ptr %7, align 8, !tbaa !5
  %34 = icmp sgt i64 %33, 0
  br i1 %34, label %41, label %35

35:                                               ; preds = %32, %29
  %36 = load i64, ptr %5, align 8, !tbaa !5
  %37 = icmp sle i64 %36, 0
  br i1 %37, label %38, label %49

38:                                               ; preds = %35
  %39 = load i64, ptr %7, align 8, !tbaa !5
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %38, %32
  %42 = load i64, ptr %7, align 8, !tbaa !5
  %43 = load i64, ptr %5, align 8, !tbaa !5
  %44 = add nsw i64 %43, %42
  store i64 %44, ptr %5, align 8, !tbaa !5
  br label %52

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

49:                                               ; preds = %38, %35
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %50 unwind label %45

50:                                               ; preds = %49
  %51 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %51, ptr %5, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %50, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %53

53:                                               ; preds = %52
  %54 = load i64, ptr %6, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %6, align 8, !tbaa !5
  br label %22, !llvm.loop !9

56:                                               ; preds = %26
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %57 unwind label %63

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

58:                                               ; preds = %88, %57
  %59 = load i64, ptr %10, align 8, !tbaa !5
  %60 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %61 = icmp ult i64 %59, %60
  br i1 %61, label %67, label %62

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

63:                                               ; preds = %56
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %8, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %9, align 4
  br label %189

67:                                               ; preds = %58
  %68 = load i64, ptr %10, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %68) #5
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = icmp slt i64 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %67
  br label %88

73:                                               ; preds = %67
  %74 = load i64, ptr %10, align 8, !tbaa !5
  %75 = icmp sge i64 %74, 2
  br i1 %75, label %76, label %81

76:                                               ; preds = %73
  %77 = load i64, ptr %10, align 8, !tbaa !5
  %78 = sub nsw i64 %77, 2
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %78) #5
  %80 = load i64, ptr %79, align 8, !tbaa !5
  br label %82

81:                                               ; preds = %73
  br label %82

82:                                               ; preds = %81, %76
  %83 = phi i64 [ %80, %76 ], [ 0, %81 ]
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %84) #5
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = add nsw i64 %86, %83
  store i64 %87, ptr %85, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %82, %72
  %89 = load i64, ptr %10, align 8, !tbaa !5
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %10, align 8, !tbaa !5
  br label %58, !llvm.loop !11

91:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %92 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %93 = sub i64 %92, 1
  store i64 %93, ptr %11, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %121, %91
  %95 = load i64, ptr %11, align 8, !tbaa !5
  %96 = icmp sge i64 %95, 0
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %94
  %99 = load i64, ptr %11, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %99) #5
  %101 = load i64, ptr %100, align 8, !tbaa !5
  %102 = icmp sgt i64 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %98
  br label %121

104:                                              ; preds = %98
  %105 = load i64, ptr %11, align 8, !tbaa !5
  %106 = add nsw i64 %105, 2
  %107 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %108 = icmp ult i64 %106, %107
  br i1 %108, label %109, label %114

109:                                              ; preds = %104
  %110 = load i64, ptr %11, align 8, !tbaa !5
  %111 = add nsw i64 %110, 2
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %111) #5
  %113 = load i64, ptr %112, align 8, !tbaa !5
  br label %115

114:                                              ; preds = %104
  br label %115

115:                                              ; preds = %114, %109
  %116 = phi i64 [ %113, %109 ], [ 0, %114 ]
  %117 = load i64, ptr %11, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %117) #5
  %119 = load i64, ptr %118, align 8, !tbaa !5
  %120 = add nsw i64 %119, %116
  store i64 %120, ptr %118, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %115, %103
  %122 = load i64, ptr %11, align 8, !tbaa !5
  %123 = add nsw i64 %122, -1
  store i64 %123, ptr %11, align 8, !tbaa !5
  br label %94, !llvm.loop !12

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

125:                                              ; preds = %178, %124
  %126 = load i64, ptr %13, align 8, !tbaa !5
  %127 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %128 = icmp ult i64 %126, %127
  br i1 %128, label %130, label %129

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

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  %131 = load i64, ptr %13, align 8, !tbaa !5
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %131) #5
  %133 = load i64, ptr %132, align 8, !tbaa !5
  %134 = icmp sgt i64 %133, 0
  br i1 %134, label %135, label %152

135:                                              ; preds = %130
  %136 = load i64, ptr %13, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %136) #5
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = load i64, ptr %13, align 8, !tbaa !5
  %140 = add nsw i64 %139, 1
  %141 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %142 = icmp ult i64 %140, %141
  br i1 %142, label %143, label %148

143:                                              ; preds = %135
  %144 = load i64, ptr %13, align 8, !tbaa !5
  %145 = add nsw i64 %144, 1
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %145) #5
  %147 = load i64, ptr %146, align 8, !tbaa !5
  br label %149

148:                                              ; preds = %135
  br label %149

149:                                              ; preds = %148, %143
  %150 = phi i64 [ %147, %143 ], [ 0, %148 ]
  %151 = sub nsw i64 %138, %150
  store i64 %151, ptr %14, align 8, !tbaa !5
  br label %168

152:                                              ; preds = %130
  %153 = load i64, ptr %13, align 8, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %153) #5
  %155 = load i64, ptr %154, align 8, !tbaa !5
  %156 = sub nsw i64 0, %155
  %157 = load i64, ptr %13, align 8, !tbaa !5
  %158 = icmp ne i64 %157, 0
  br i1 %158, label %159, label %164

159:                                              ; preds = %152
  %160 = load i64, ptr %13, align 8, !tbaa !5
  %161 = sub nsw i64 %160, 1
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %161) #5
  %163 = load i64, ptr %162, align 8, !tbaa !5
  br label %165

164:                                              ; preds = %152
  br label %165

165:                                              ; preds = %164, %159
  %166 = phi i64 [ %163, %159 ], [ 0, %164 ]
  %167 = add nsw i64 %156, %166
  store i64 %167, ptr %14, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %165, %149
  %169 = load i64, ptr %12, align 8, !tbaa !5
  %170 = load i64, ptr %14, align 8, !tbaa !5
  %171 = icmp sgt i64 %169, %170
  br i1 %171, label %172, label %174

172:                                              ; preds = %168
  %173 = load i64, ptr %12, align 8, !tbaa !5
  br label %176

174:                                              ; preds = %168
  %175 = load i64, ptr %14, align 8, !tbaa !5
  br label %176

176:                                              ; preds = %174, %172
  %177 = phi i64 [ %173, %172 ], [ %175, %174 ]
  store i64 %177, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %178

178:                                              ; preds = %176
  %179 = load i64, ptr %13, align 8, !tbaa !5
  %180 = add nsw i64 %179, 1
  store i64 %180, ptr %13, align 8, !tbaa !5
  br label %125, !llvm.loop !13

181:                                              ; preds = %129
  %182 = load i64, ptr %12, align 8, !tbaa !5
  %183 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %182)
          to label %184 unwind label %185

184:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(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 %16, !llvm.loop !14

185:                                              ; preds = %181
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %8, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %189

189:                                              ; preds = %185, %63, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(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
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %192

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

192:                                              ; preds = %189
  %193 = load ptr, ptr %8, align 8
  %194 = load i32, ptr %9, align 4
  %195 = insertvalue { ptr, i32 } poison, ptr %193, 0
  %196 = insertvalue { ptr, i32 } %195, i32 %194, 1
  resume { ptr, i32 } %196
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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


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

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

@.str = external hidden unnamed_addr constant [5 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 i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = add nsw i64 %7, -1
  store i64 %8, ptr %1, align 8, !tbaa !5
  %.not60 = icmp eq i64 %7, 0
  br i1 %.not60, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %0, %._crit_edge59
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %9 = 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
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !5
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %44, %.lr.ph62
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %.preheader44 unwind label %50

.preheader44:                                     ; preds = %._crit_edge
  %12 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %.not64 = icmp eq i64 %12, 0
  br i1 %.not64, label %._crit_edge49, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %.preheader44
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = icmp slt i64 %14, 0
  br i1 %15, label %18, label %16

16:                                               ; preds = %.lr.ph48.preheader
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  br label %18

18:                                               ; preds = %16, %.lr.ph48.preheader
  %19 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %20 = icmp ugt i64 %19, 1
  br i1 %20, label %.lr.ph48.peel.next, label %._crit_edge49

.lr.ph48.peel.next:                               ; preds = %18
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1) #6
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = icmp slt i64 %22, 0
  br i1 %23, label %26, label %24

24:                                               ; preds = %.lr.ph48.peel.next
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1) #6
  br label %26

26:                                               ; preds = %24, %.lr.ph48.peel.next
  %27 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %28 = icmp ugt i64 %27, 2
  br i1 %28, label %.lr.ph48, label %._crit_edge49

.lr.ph:                                           ; preds = %.lr.ph62, %44
  %.03945 = phi i64 [ %45, %44 ], [ 0, %.lr.ph62 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %30 = load i64, ptr %4, align 8, !tbaa !5
  %31 = icmp sgt i64 %30, -1
  %32 = load i64, ptr %5, align 8
  %33 = icmp sgt i64 %32, 0
  %or.cond = select i1 %31, i1 %33, i1 false
  br i1 %or.cond, label %37, label %34

34:                                               ; preds = %.lr.ph
  %35 = icmp slt i64 %30, 1
  %36 = icmp slt i64 %32, 0
  %or.cond3 = select i1 %35, i1 %36, i1 false
  br i1 %or.cond3, label %37, label %41

37:                                               ; preds = %34, %.lr.ph
  %38 = add nsw i64 %32, %30
  br label %44

39:                                               ; preds = %41
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %131

41:                                               ; preds = %34
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %42 unwind label %39

42:                                               ; preds = %41
  %43 = load i64, ptr %5, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %42, %37
  %storemerge = phi i64 [ %43, %42 ], [ %38, %37 ]
  store i64 %storemerge, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %45 = add nuw nsw i64 %.03945, 1
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge49:                                    ; preds = %62, %18, %26, %.preheader44
  %48 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %.03550 = add i64 %48, -1
  %49 = icmp sgt i64 %.03550, -1
  br i1 %49, label %.lr.ph54, label %.preheader

50:                                               ; preds = %._crit_edge
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %131

.lr.ph48:                                         ; preds = %26, %62
  %.03646 = phi i64 [ %63, %62 ], [ 2, %26 ]
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03646) #6
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = icmp slt i64 %53, 0
  br i1 %54, label %62, label %55

55:                                               ; preds = %.lr.ph48
  %56 = add nsw i64 %.03646, -2
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %56) #6
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03646) #6
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = add nsw i64 %60, %58
  store i64 %61, ptr %59, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %.lr.ph48, %55
  %63 = add nuw nsw i64 %.03646, 1
  %64 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %65 = icmp ult i64 %63, %64
  br i1 %65, label %.lr.ph48, label %._crit_edge49, !llvm.loop !11

.preheader:                                       ; preds = %102, %._crit_edge49
  %66 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %.not65 = icmp eq i64 %66, 0
  br i1 %.not65, label %._crit_edge59, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %.preheader
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %68 = load i64, ptr %67, align 8, !tbaa !5
  %69 = icmp sgt i64 %68, 0
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %71 = load i64, ptr %70, align 8, !tbaa !5
  br i1 %69, label %74, label %72

72:                                               ; preds = %.lr.ph58.preheader
  %73 = sub i64 0, %71
  br label %83

74:                                               ; preds = %.lr.ph58.preheader
  %75 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %76 = icmp ugt i64 %75, 1
  br i1 %76, label %77, label %80

77:                                               ; preds = %74
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1) #6
  %79 = load i64, ptr %78, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %77, %74
  %81 = phi i64 [ %79, %77 ], [ 0, %74 ]
  %82 = sub nsw i64 %71, %81
  br label %83

83:                                               ; preds = %80, %72
  %.0.peel = phi i64 [ %82, %80 ], [ %73, %72 ]
  %84 = call i64 @llvm.smax.i64(i64 %.0.peel, i64 0)
  %85 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %86 = icmp ugt i64 %85, 1
  br i1 %86, label %.lr.ph58, label %._crit_edge59

.lr.ph54:                                         ; preds = %._crit_edge49, %102
  %.03552 = phi i64 [ %.035, %102 ], [ %.03550, %._crit_edge49 ]
  %.035.in51 = phi i64 [ %.03552, %102 ], [ %48, %._crit_edge49 ]
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03552) #6
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = icmp sgt i64 %88, 0
  br i1 %89, label %102, label %90

90:                                               ; preds = %.lr.ph54
  %91 = add nuw i64 %.035.in51, 1
  %92 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %93 = icmp ult i64 %91, %92
  br i1 %93, label %94, label %97

94:                                               ; preds = %90
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %91) #6
  %96 = load i64, ptr %95, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %90, %94
  %98 = phi i64 [ %96, %94 ], [ 0, %90 ]
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03552) #6
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = add nsw i64 %100, %98
  store i64 %101, ptr %99, align 8, !tbaa !5
  br label %102

102:                                              ; preds = %.lr.ph54, %97
  %.035 = add nsw i64 %.03552, -1
  %103 = icmp sgt i64 %.03552, 0
  br i1 %103, label %.lr.ph54, label %.preheader, !llvm.loop !13

._crit_edge59:                                    ; preds = %127, %83, %.preheader
  %.034.lcssa = phi i64 [ 0, %.preheader ], [ %84, %83 ], [ %128, %127 ]
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.034.lcssa)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(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
  %105 = load i64, ptr %1, align 8, !tbaa !5
  %106 = add nsw i64 %105, -1
  store i64 %106, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %105, 0
  br i1 %.not, label %._crit_edge63, label %.lr.ph62, !llvm.loop !14

.lr.ph58:                                         ; preds = %83, %127
  %.03356 = phi i64 [ %.pre-phi, %127 ], [ 1, %83 ]
  %.03455 = phi i64 [ %128, %127 ], [ %84, %83 ]
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03356) #6
  %108 = load i64, ptr %107, align 8, !tbaa !5
  %109 = icmp sgt i64 %108, 0
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03356) #6
  %111 = load i64, ptr %110, align 8, !tbaa !5
  br i1 %109, label %112, label %122

112:                                              ; preds = %.lr.ph58
  %113 = add nuw nsw i64 %.03356, 1
  %114 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %115 = icmp ult i64 %113, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %112
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %113) #6
  %118 = load i64, ptr %117, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %112, %116
  %120 = phi i64 [ %118, %116 ], [ 0, %112 ]
  %121 = sub nsw i64 %111, %120
  br label %127

122:                                              ; preds = %.lr.ph58
  %123 = add nsw i64 %.03356, -1
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %123) #6
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = sub i64 %125, %111
  %.pre = add nuw nsw i64 %.03356, 1
  br label %127

127:                                              ; preds = %122, %119
  %.pre-phi = phi i64 [ %.pre, %122 ], [ %113, %119 ]
  %.0 = phi i64 [ %126, %122 ], [ %121, %119 ]
  %128 = call i64 @llvm.smax.i64(i64 %.03455, i64 %.0)
  %129 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %130 = icmp ult i64 %.pre-phi, %129
  br i1 %130, label %.lr.ph58, label %._crit_edge59, !llvm.loop !15

131:                                              ; preds = %50, %39
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

._crit_edge63:                                    ; preds = %._crit_edge59, %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 @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.peeled.count", i32 2}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}


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