; LLVM IR from DionysiosB/CodeForces :: 1000-1099 (1062B-Math)

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::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
  %15 = alloca i8, align 1
  %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)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %19, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 2, ptr %6, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %51, %0
  %21 = load i64, ptr %5, align 8, !tbaa !5
  %22 = icmp sgt i64 %21, 1
  br i1 %22, label %23, label %27

23:                                               ; preds = %20
  %24 = load i64, ptr %6, align 8, !tbaa !5
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = icmp sle i64 %24, %25
  br label %27

27:                                               ; preds = %23, %20
  %28 = phi i1 [ false, %20 ], [ %26, %23 ]
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %27
  %31 = load i64, ptr %5, align 8, !tbaa !5
  %32 = load i64, ptr %6, align 8, !tbaa !5
  %33 = srem i64 %31, %32
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  br label %51

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %42, %36
  %38 = load i64, ptr %5, align 8, !tbaa !5
  %39 = load i64, ptr %6, align 8, !tbaa !5
  %40 = srem i64 %38, %39
  %41 = icmp eq i64 %40, 0
  br i1 %41, label %42, label %48

42:                                               ; preds = %37
  %43 = load i64, ptr %6, align 8, !tbaa !5
  %44 = load i64, ptr %5, align 8, !tbaa !5
  %45 = sdiv i64 %44, %43
  store i64 %45, ptr %5, align 8, !tbaa !5
  %46 = load i64, ptr %7, align 8, !tbaa !5
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %7, align 8, !tbaa !5
  br label %37, !llvm.loop !9

48:                                               ; preds = %37
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %49 unwind label %54

49:                                               ; preds = %48
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %50 unwind label %54

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

51:                                               ; preds = %50, %35
  %52 = load i64, ptr %6, align 8, !tbaa !5
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %6, align 8, !tbaa !5
  br label %20, !llvm.loop !11

54:                                               ; preds = %49, %48
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %8, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, 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 %145

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

59:                                               ; preds = %70, %58
  %60 = load i64, ptr %11, align 8, !tbaa !5
  %61 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %62 = icmp ult i64 %60, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %59
  %65 = load i64, ptr %11, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %65) #5
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = load i64, ptr %10, align 8, !tbaa !5
  %69 = mul nsw i64 %68, %67
  store i64 %69, ptr %10, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %64
  %71 = load i64, ptr %11, align 8, !tbaa !5
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %11, align 8, !tbaa !5
  br label %59, !llvm.loop !12

73:                                               ; preds = %63
  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
  %74 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %75 = icmp ne i64 %74, 0
  br i1 %75, label %76, label %79

76:                                               ; preds = %73
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #5
  %78 = load i64, ptr %77, align 8, !tbaa !5
  br label %80

79:                                               ; preds = %73
  br label %80

80:                                               ; preds = %79, %76
  %81 = phi i64 [ %78, %76 ], [ 1, %79 ]
  store i64 %81, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 1, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  store i8 1, ptr %15, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 1, ptr %16, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %111, %80
  %83 = load i64, ptr %16, align 8, !tbaa !5
  %84 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %85 = icmp ult i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %114

87:                                               ; preds = %82
  %88 = load i64, ptr %16, align 8, !tbaa !5
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %88) #5
  %90 = load i64, ptr %89, align 8, !tbaa !5
  %91 = load i64, ptr %16, align 8, !tbaa !5
  %92 = sub nsw i64 %91, 1
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %92) #5
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = icmp ne i64 %90, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %87
  store i8 0, ptr %15, align 1, !tbaa !13
  br label %97

97:                                               ; preds = %96, %87
  %98 = load i64, ptr %13, align 8, !tbaa !5
  %99 = load i64, ptr %16, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(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 %98, %101
  br i1 %102, label %103, label %105

103:                                              ; preds = %97
  %104 = load i64, ptr %13, align 8, !tbaa !5
  br label %109

105:                                              ; preds = %97
  %106 = load i64, ptr %16, align 8, !tbaa !5
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %106) #5
  %108 = load i64, ptr %107, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %105, %103
  %110 = phi i64 [ %104, %103 ], [ %108, %105 ]
  store i64 %110, ptr %13, align 8, !tbaa !5
  br label %111

111:                                              ; preds = %109
  %112 = load i64, ptr %16, align 8, !tbaa !5
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %16, align 8, !tbaa !5
  br label %82, !llvm.loop !15

114:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !5
  br label %115

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

119:                                              ; preds = %115
  %120 = load i64, ptr %14, align 8, !tbaa !5
  %121 = mul nsw i64 %120, 2
  store i64 %121, ptr %14, align 8, !tbaa !5
  %122 = load i64, ptr %17, align 8, !tbaa !5
  %123 = add nsw i64 %122, 1
  store i64 %123, ptr %17, align 8, !tbaa !5
  br label %115, !llvm.loop !16

124:                                              ; preds = %115
  %125 = load i8, ptr %15, align 1, !tbaa !13, !range !17, !noundef !18
  %126 = trunc i8 %125 to i1
  br i1 %126, label %127, label %131

127:                                              ; preds = %124
  %128 = load i64, ptr %14, align 8, !tbaa !5
  %129 = load i64, ptr %13, align 8, !tbaa !5
  %130 = icmp ne i64 %128, %129
  br label %131

131:                                              ; preds = %127, %124
  %132 = phi i1 [ true, %124 ], [ %130, %127 ]
  %133 = zext i1 %132 to i64
  %134 = load i64, ptr %17, align 8, !tbaa !5
  %135 = add nsw i64 %134, %133
  store i64 %135, ptr %17, align 8, !tbaa !5
  %136 = load i64, ptr %10, align 8, !tbaa !5
  %137 = load i64, ptr %17, align 8, !tbaa !5
  %138 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %136, i64 noundef %137)
          to label %139 unwind label %141

139:                                              ; preds = %131
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #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 @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %140 = load i32, ptr %1, align 4
  ret i32 %140

141:                                              ; preds = %131
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %8, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %145

145:                                              ; preds = %141, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #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 @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %8, align 8
  %148 = load i32, ptr %9, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #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 i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(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 @_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

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 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{i8 0, i8 2}
!18 = !{}


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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIlSaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %7 = load i64, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 2, ptr %4, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 1
  br i1 %8, label %.lr.ph46, label %._crit_edge47

._crit_edge47:                                    ; preds = %18, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %9 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %.not67 = icmp eq i64 %9, 0
  br i1 %.not67, label %._crit_edge52, label %.lr.ph51

.lr.ph46:                                         ; preds = %0, %18
  %10 = phi i64 [ %19, %18 ], [ %7, %0 ]
  %.03444 = phi i64 [ %.2, %18 ], [ %7, %0 ]
  %storemerge43 = phi i64 [ %21, %18 ], [ 2, %0 ]
  %11 = srem i64 %.03444, %storemerge43
  %.not38 = icmp eq i64 %11, 0
  br i1 %.not38, label %.lr.ph.preheader, label %18

.lr.ph.preheader:                                 ; preds = %.lr.ph46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.13541 = phi i64 [ %12, %.lr.ph ], [ %.03444, %.lr.ph.preheader ]
  %storemerge3940 = phi i64 [ %13, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %12 = sdiv i64 %.13541, %storemerge43
  %13 = add nuw nsw i64 %storemerge3940, 1
  %14 = srem i64 %12, %storemerge43
  %15 = icmp eq i64 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  store i64 %13, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %16 unwind label %25

16:                                               ; preds = %._crit_edge
  invoke void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %17 unwind label %25

17:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %.pre = load i64, ptr %4, align 8, !tbaa !5
  %.pre73 = load i64, ptr %1, align 8
  br label %18

18:                                               ; preds = %.lr.ph46, %17
  %19 = phi i64 [ %10, %.lr.ph46 ], [ %.pre73, %17 ]
  %20 = phi i64 [ %storemerge43, %.lr.ph46 ], [ %.pre, %17 ]
  %.2 = phi i64 [ %.03444, %.lr.ph46 ], [ %12, %17 ]
  %21 = add nsw i64 %20, 1
  store i64 %21, ptr %4, align 8, !tbaa !5
  %22 = icmp sgt i64 %.2, 1
  %23 = icmp slt i64 %20, %19
  %24 = select i1 %22, i1 %23, i1 false
  br i1 %24, label %.lr.ph46, label %._crit_edge47, !llvm.loop !11

25:                                               ; preds = %16, %._crit_edge
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %26

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge47
  %.033.lcssa = phi i64 [ 1, %._crit_edge47 ], [ %30, %.lr.ph51 ]
  %27 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %.not = icmp eq i64 %27, 0
  br i1 %.not, label %37, label %34

.lr.ph51:                                         ; preds = %._crit_edge47, %.lr.ph51
  %.03249 = phi i64 [ %31, %.lr.ph51 ], [ 0, %._crit_edge47 ]
  %.03348 = phi i64 [ %30, %.lr.ph51 ], [ 1, %._crit_edge47 ]
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03249) #5
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = mul nsw i64 %29, %.03348
  %31 = add nuw nsw i64 %.03249, 1
  %32 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %.lr.ph51, label %._crit_edge52, !llvm.loop !12

34:                                               ; preds = %._crit_edge52
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #5
  %36 = load i64, ptr %35, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %._crit_edge52, %34
  %38 = phi i64 [ %36, %34 ], [ 1, %._crit_edge52 ]
  %39 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %40 = icmp ugt i64 %39, 1
  br i1 %40, label %.lr.ph58, label %.preheader

.preheader.loopexit:                              ; preds = %54
  %41 = xor i1 %spec.select, true
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %37
  %.031.lcssa = phi i64 [ %38, %37 ], [ %55, %.preheader.loopexit ]
  %.029.lcssa = phi i1 [ false, %37 ], [ %41, %.preheader.loopexit ]
  %42 = icmp sgt i64 %.031.lcssa, 1
  br i1 %42, label %.lr.ph63, label %._crit_edge64

.lr.ph58:                                         ; preds = %37, %54
  %.02856 = phi i64 [ %56, %54 ], [ 1, %37 ]
  %.02955 = phi i1 [ %spec.select, %54 ], [ true, %37 ]
  %.03154 = phi i64 [ %55, %54 ], [ %38, %37 ]
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02856) #5
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = add nsw i64 %.02856, -1
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %45) #5
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %.not37 = icmp eq i64 %44, %47
  %spec.select = select i1 %.not37, i1 %.02955, i1 false
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02856) #5
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = icmp sgt i64 %.03154, %49
  br i1 %50, label %54, label %51

51:                                               ; preds = %.lr.ph58
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.02856) #5
  %53 = load i64, ptr %52, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %.lr.ph58, %51
  %55 = phi i64 [ %53, %51 ], [ %.03154, %.lr.ph58 ]
  %56 = add nuw nsw i64 %.02856, 1
  %57 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %58 = icmp ult i64 %56, %57
  br i1 %58, label %.lr.ph58, label %.preheader.loopexit, !llvm.loop !13

.lr.ph63:                                         ; preds = %.preheader, %.lr.ph63
  %.062 = phi i64 [ %60, %.lr.ph63 ], [ 0, %.preheader ]
  %.03061 = phi i64 [ %59, %.lr.ph63 ], [ 1, %.preheader ]
  %59 = shl nsw i64 %.03061, 1
  %60 = add nuw nsw i64 %.062, 1
  %61 = icmp slt i64 %59, %.031.lcssa
  br i1 %61, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14

._crit_edge64:                                    ; preds = %.lr.ph63, %.preheader
  %.030.lcssa = phi i64 [ 1, %.preheader ], [ %59, %.lr.ph63 ]
  %.0.lcssa = phi i64 [ 0, %.preheader ], [ %60, %.lr.ph63 ]
  %62 = icmp ne i64 %.030.lcssa, %.031.lcssa
  %63 = or i1 %62, %.029.lcssa
  %64 = zext i1 %63 to i64
  %65 = add nuw nsw i64 %.0.lcssa, %64
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.033.lcssa, i64 noundef %65)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEE9push_backERKl(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_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 i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(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 @_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

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 = { nounwind }

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

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


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