; LLVM IR from DionysiosB/CodeForces :: 1741C-MinimizeTheThickness (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, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

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

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

21:                                               ; preds = %153, %0
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = add nsw i64 %22, -1
  store i64 %23, ptr %2, align 8, !tbaa !5
  %24 = icmp ne i64 %22, 0
  br i1 %24, label %25, label %161

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

28:                                               ; preds = %25
  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 24, ptr %8) #5
  %29 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %29, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %30 unwind label %40

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

31:                                               ; preds = %65, %30
  %32 = load i64, ptr %10, align 8, !tbaa !5
  %33 = load i64, ptr %3, align 8, !tbaa !5
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %44, label %35

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

36:                                               ; preds = %25
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %6, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, 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 %160

40:                                               ; preds = %28
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %6, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %159

44:                                               ; preds = %31
  %45 = load i64, ptr %10, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %45) #5
  %47 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %46)
          to label %48 unwind label %68

48:                                               ; preds = %44
  %49 = load i64, ptr %10, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %49) #5
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = load i64, ptr %10, align 8, !tbaa !5
  %53 = icmp sgt i64 %52, 0
  br i1 %53, label %54, label %59

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

59:                                               ; preds = %48
  br label %60

60:                                               ; preds = %59, %54
  %61 = phi i64 [ %58, %54 ], [ 0, %59 ]
  %62 = add nsw i64 %51, %61
  %63 = load i64, ptr %10, align 8, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %63) #5
  store i64 %62, ptr %64, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %60
  %66 = load i64, ptr %10, align 8, !tbaa !5
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %10, align 8, !tbaa !5
  br label %31, !llvm.loop !9

68:                                               ; preds = %44
  %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 %10) #5
  br label %158

72:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %73 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %73, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %74

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

78:                                               ; preds = %74
  store i32 7, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %150

79:                                               ; preds = %74
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %81 = load i64, ptr %80, align 8, !tbaa !5
  %82 = load i64, ptr %12, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %82) #5
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = srem i64 %81, %84
  %86 = icmp ne i64 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %79
  br label %147

88:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %89 = load i64, ptr %12, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %89) #5
  %91 = load i64, ptr %90, align 8, !tbaa !5
  store i64 %91, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  store i8 1, ptr %18, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %130, %88
  %93 = load i8, ptr %18, align 1, !tbaa !11, !range !13, !noundef !14
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %99

95:                                               ; preds = %92
  %96 = load i64, ptr %19, align 8, !tbaa !5
  %97 = load i64, ptr %3, align 8, !tbaa !5
  %98 = icmp slt i64 %96, %97
  br label %99

99:                                               ; preds = %95, %92
  %100 = phi i1 [ false, %92 ], [ %98, %95 ]
  br i1 %100, label %102, label %101

101:                                              ; preds = %99
  store i32 10, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %133

102:                                              ; preds = %99
  %103 = load i64, ptr %19, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %103) #5
  %105 = load i64, ptr %104, align 8, !tbaa !5
  %106 = load i64, ptr %17, align 8, !tbaa !5
  %107 = add nsw i64 %106, %105
  store i64 %107, ptr %17, align 8, !tbaa !5
  %108 = load i64, ptr %16, align 8, !tbaa !5
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %16, align 8, !tbaa !5
  %110 = load i64, ptr %17, align 8, !tbaa !5
  %111 = load i64, ptr %14, align 8, !tbaa !5
  %112 = icmp eq i64 %110, %111
  br i1 %112, label %113, label %123

113:                                              ; preds = %102
  %114 = load i64, ptr %15, align 8, !tbaa !5
  %115 = load i64, ptr %16, align 8, !tbaa !5
  %116 = icmp sgt i64 %114, %115
  br i1 %116, label %117, label %119

117:                                              ; preds = %113
  %118 = load i64, ptr %15, align 8, !tbaa !5
  br label %121

119:                                              ; preds = %113
  %120 = load i64, ptr %16, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %119, %117
  %122 = phi i64 [ %118, %117 ], [ %120, %119 ]
  store i64 %122, ptr %15, align 8, !tbaa !5
  store i64 0, ptr %17, align 8, !tbaa !5
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %129

123:                                              ; preds = %102
  %124 = load i64, ptr %17, align 8, !tbaa !5
  %125 = load i64, ptr %14, align 8, !tbaa !5
  %126 = icmp sgt i64 %124, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %123
  store i8 0, ptr %18, align 1, !tbaa !11
  br label %128

128:                                              ; preds = %127, %123
  br label %129

129:                                              ; preds = %128, %121
  br label %130

130:                                              ; preds = %129
  %131 = load i64, ptr %19, align 8, !tbaa !5
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %19, align 8, !tbaa !5
  br label %92, !llvm.loop !15

133:                                              ; preds = %101
  %134 = load i8, ptr %18, align 1, !tbaa !11, !range !13, !noundef !14
  %135 = trunc i8 %134 to i1
  br i1 %135, label %136, label %146

136:                                              ; preds = %133
  %137 = load i64, ptr %11, align 8, !tbaa !5
  %138 = load i64, ptr %15, align 8, !tbaa !5
  %139 = icmp slt i64 %137, %138
  br i1 %139, label %140, label %142

140:                                              ; preds = %136
  %141 = load i64, ptr %11, align 8, !tbaa !5
  br label %144

142:                                              ; preds = %136
  %143 = load i64, ptr %15, align 8, !tbaa !5
  br label %144

144:                                              ; preds = %142, %140
  %145 = phi i64 [ %141, %140 ], [ %143, %142 ]
  store i64 %145, ptr %11, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %144, %133
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  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 %147

147:                                              ; preds = %146, %87
  %148 = load i64, ptr %12, align 8, !tbaa !5
  %149 = add nsw i64 %148, 1
  store i64 %149, ptr %12, align 8, !tbaa !5
  br label %74, !llvm.loop !16

150:                                              ; preds = %78
  %151 = load i64, ptr %11, align 8, !tbaa !5
  %152 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %151)
          to label %153 unwind label %154

153:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #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 %21, !llvm.loop !17

154:                                              ; preds = %150
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %6, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %158

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

159:                                              ; preds = %158, %40
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %160

160:                                              ; preds = %159, %36
  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 %163

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

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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

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

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

; 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
  %.not66 = icmp eq i64 %8, 0
  br i1 %.not66, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %0, %._crit_edge64
  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 %27

12:                                               ; preds = %.lr.ph68
  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
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %13 = load i64, ptr %2, align 8, !tbaa !5
  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 %13, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %14 unwind label %29

14:                                               ; preds = %12
  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
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %17, label %._crit_edge64

17:                                               ; preds = %14
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %18)
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0) #6
  store i64 %21, ptr %22, align 8, !tbaa !5
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, 1
  br i1 %24, label %.lr.ph.peel.next, label %.preheader

.preheader:                                       ; preds = %.lr.ph.peel.next, %17
  %25 = phi i64 [ %23, %17 ], [ %41, %.lr.ph.peel.next ]
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %.lr.ph63, label %._crit_edge64

27:                                               ; preds = %.lr.ph68
  %28 = 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 %76

29:                                               ; preds = %12
  %30 = 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 %76

.lr.ph.peel.next:                                 ; preds = %17, %.lr.ph.peel.next
  %.04452 = phi i64 [ %40, %.lr.ph.peel.next ], [ 1, %17 ]
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04452) #6
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %31)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.04452) #6
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %.04452, -1
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %35) #6
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %37, %34
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04452) #6
  store i64 %38, ptr %39, align 8, !tbaa !5
  %40 = add nuw nsw i64 %.04452, 1
  %41 = load i64, ptr %2, align 8, !tbaa !5
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %.lr.ph.peel.next, label %.preheader, !llvm.loop !9

._crit_edge64:                                    ; preds = %72, %14, %.preheader
  %.042.lcssa = phi i64 [ %25, %.preheader ], [ %15, %14 ], [ %.2, %72 ]
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.042.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
  %44 = load i64, ptr %1, align 8, !tbaa !5
  %45 = add nsw i64 %44, -1
  store i64 %45, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %44, 0
  br i1 %.not, label %._crit_edge69, label %.lr.ph68, !llvm.loop !12

.lr.ph63:                                         ; preds = %.preheader, %72
  %.04162 = phi i64 [ %74, %72 ], [ 0, %.preheader ]
  %.04261 = phi i64 [ %.2, %72 ], [ %25, %.preheader ]
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04162) #6
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = srem i64 %47, %49
  %.not50 = icmp eq i64 %50, 0
  br i1 %.not50, label %51, label %.lr.ph63._crit_edge

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

51:                                               ; preds = %.lr.ph63
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.04162) #6
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = load i64, ptr %2, align 8
  %55 = icmp sgt i64 %54, 0
  br i1 %55, label %.lr.ph58, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %51
  %56 = call i64 @llvm.smin.i64(i64 %.04261, i64 0)
  br label %72

._crit_edge:                                      ; preds = %67
  %57 = call i64 @llvm.smin.i64(i64 %.04261, i64 %.139)
  %spec.select = select i1 %cond.fr, i64 %57, i64 %.04261
  br label %72

.lr.ph58:                                         ; preds = %51, %67
  %.057 = phi i64 [ %68, %67 ], [ 0, %51 ]
  %.03455 = phi i64 [ %.135, %67 ], [ 0, %51 ]
  %.03654 = phi i64 [ %.137, %67 ], [ 0, %51 ]
  %.03853 = phi i64 [ %.139, %67 ], [ 0, %51 ]
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.057) #6
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = add nsw i64 %59, %.03455
  %61 = add nsw i64 %.03654, 1
  %62 = icmp eq i64 %60, %53
  br i1 %62, label %63, label %65

63:                                               ; preds = %.lr.ph58
  %64 = call i64 @llvm.smax.i64(i64 %.03853, i64 %61)
  br label %67

65:                                               ; preds = %.lr.ph58
  %66 = icmp sle i64 %60, %53
  br label %67

67:                                               ; preds = %65, %63
  %.139 = phi i64 [ %64, %63 ], [ %.03853, %65 ]
  %.137 = phi i64 [ 0, %63 ], [ %61, %65 ]
  %.135 = phi i64 [ 0, %63 ], [ %60, %65 ]
  %.1 = phi i1 [ true, %63 ], [ %66, %65 ]
  %cond.fr = freeze i1 %.1
  %68 = add nuw nsw i64 %.057, 1
  %69 = load i64, ptr %2, align 8
  %70 = icmp slt i64 %68, %69
  %71 = select i1 %cond.fr, i1 %70, i1 false
  br i1 %71, label %.lr.ph58, label %._crit_edge, !llvm.loop !13

72:                                               ; preds = %._crit_edge, %._crit_edge.thread, %.lr.ph63._crit_edge
  %73 = phi i64 [ %.pre, %.lr.ph63._crit_edge ], [ %54, %._crit_edge.thread ], [ %69, %._crit_edge ]
  %.2 = phi i64 [ %.04261, %.lr.ph63._crit_edge ], [ %56, %._crit_edge.thread ], [ %spec.select, %._crit_edge ]
  %74 = add nuw nsw i64 %.04162, 1
  %75 = icmp slt i64 %74, %73
  br i1 %75, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14

76:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  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_edge69:                                    ; preds = %._crit_edge64, %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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEE4backEv(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) #5

; 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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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