; LLVM IR from eyangch/competitive-programming :: Codeforces/1535 (b)

; 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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [2000 x i64], align 16
@o = external dso_local global %"class.std::vector", align 8
@e = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %16

16:                                               ; preds = %107, %0
  %17 = load i64, ptr @T, align 8, !tbaa !8
  %18 = add nsw i64 %17, -1
  store i64 %18, ptr @T, align 8, !tbaa !8
  %19 = icmp ne i64 %17, 0
  br i1 %19, label %20, label %111

20:                                               ; preds = %16
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #6
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %22

22:                                               ; preds = %43, %20
  %23 = load i64, ptr %2, align 8, !tbaa !8
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %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 %2) #6
  br label %46

27:                                               ; preds = %22
  %28 = load i64, ptr %2, align 8, !tbaa !8
  %29 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = srem i64 %33, 2
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %27
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %37
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @o, ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %42

39:                                               ; preds = %27
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %40
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 8 dereferenceable(8) %41)
  br label %42

42:                                               ; preds = %39, %36
  br label %43

43:                                               ; preds = %42
  %44 = load i64, ptr %2, align 8, !tbaa !8
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %2, align 8, !tbaa !8
  br label %22, !llvm.loop !11

46:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %47 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #6
  %48 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  %49 = mul nsw i64 %47, %48
  store i64 %49, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %50

50:                                               ; preds = %80, %46
  %51 = load i64, ptr %4, align 8, !tbaa !8
  %52 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #6
  %53 = icmp slt i64 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %83

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %56 = load i64, ptr %4, align 8, !tbaa !8
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %6, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %76, %55
  %59 = load i64, ptr %6, align 8, !tbaa !8
  %60 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #6
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %79

63:                                               ; preds = %58
  %64 = load i64, ptr %4, align 8, !tbaa !8
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @o, i64 noundef %64) #6
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = load i64, ptr %6, align 8, !tbaa !8
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @o, i64 noundef %67) #6
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = call noundef i64 @_ZSt3gcdIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef %66, i64 noundef %69) #6
  %71 = icmp sgt i64 %70, 1
  br i1 %71, label %72, label %75

72:                                               ; preds = %63
  %73 = load i64, ptr %3, align 8, !tbaa !8
  %74 = add nsw i64 %73, 1
  store i64 %74, ptr %3, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %72, %63
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %6, align 8, !tbaa !8
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %6, align 8, !tbaa !8
  br label %58, !llvm.loop !13

79:                                               ; preds = %62
  br label %80

80:                                               ; preds = %79
  %81 = load i64, ptr %4, align 8, !tbaa !8
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %4, align 8, !tbaa !8
  br label %50, !llvm.loop !14

83:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %84

84:                                               ; preds = %104, %83
  %85 = load i64, ptr %7, align 8, !tbaa !8
  %86 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  %87 = icmp slt i64 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %107

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %90 = load i64, ptr %7, align 8, !tbaa !8
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %8, align 8, !tbaa !8
  br label %92

92:                                               ; preds = %100, %89
  %93 = load i64, ptr %8, align 8, !tbaa !8
  %94 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #6
  %95 = icmp slt i64 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %103

97:                                               ; preds = %92
  %98 = load i64, ptr %3, align 8, !tbaa !8
  %99 = add nsw i64 %98, 1
  store i64 %99, ptr %3, align 8, !tbaa !8
  br label %100

100:                                              ; preds = %97
  %101 = load i64, ptr %8, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr %8, align 8, !tbaa !8
  br label %92, !llvm.loop !15

103:                                              ; preds = %96
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %7, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %7, align 8, !tbaa !8
  br label %84, !llvm.loop !16

107:                                              ; preds = %88
  %108 = load i64, ptr %3, align 8, !tbaa !8
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %109, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %16, !llvm.loop !17

111:                                              ; preds = %16
  %112 = load i32, ptr %1, align 4
  ret i32 %112
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3gcdIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef, i64 noundef) #1

; 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) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #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 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 #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


; 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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [2000 x i64], align 16
@o = external dso_local global %"class.std::vector", align 8
@e = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %8 = load i64, ptr @T, align 8, !tbaa !8
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr @T, align 8, !tbaa !8
  %.not49 = icmp eq i64 %8, 0
  br i1 %.not49, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %0, %._crit_edge47
  tail call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #5
  tail call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #5
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %11 = load i64, ptr @N, align 8, !tbaa !8
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph51
  %13 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #5
  %14 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #5
  %15 = mul nsw i64 %14, %13
  %16 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #5
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph37, label %.preheader

.lr.ph:                                           ; preds = %.lr.ph51, %.lr.ph
  %.02629 = phi i64 [ %22, %.lr.ph ], [ 0, %.lr.ph51 ]
  %18 = getelementptr inbounds [2000 x i64], ptr @a, i64 0, i64 %.02629
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %20 = load i64, ptr %18, align 8, !tbaa !8
  %21 = and i64 %20, 1
  %.not27 = icmp eq i64 %21, 0
  %e.o = select i1 %.not27, ptr @e, ptr @o
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %e.o, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %22 = add nuw nsw i64 %.02629, 1
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.loopexit28:                                      ; preds = %.lr.ph33, %.lr.ph37
  %.1.lcssa = phi i64 [ %.02534, %.lr.ph37 ], [ %spec.select, %.lr.ph33 ]
  %25 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #5
  %26 = icmp slt i64 %29, %25
  br i1 %26, label %.lr.ph37, label %.preheader, !llvm.loop !13

.preheader:                                       ; preds = %.loopexit28, %._crit_edge
  %.025.lcssa = phi i64 [ %15, %._crit_edge ], [ %.1.lcssa, %.loopexit28 ]
  %27 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #5
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph46, label %._crit_edge47

.lr.ph37:                                         ; preds = %._crit_edge, %.loopexit28
  %.02435 = phi i64 [ %29, %.loopexit28 ], [ 0, %._crit_edge ]
  %.02534 = phi i64 [ %.1.lcssa, %.loopexit28 ], [ %15, %._crit_edge ]
  %29 = add nuw nsw i64 %.02435, 1
  %30 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #5
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %.lr.ph33, label %.loopexit28

.lr.ph33:                                         ; preds = %.lr.ph37, %.lr.ph33
  %.02331 = phi i64 [ %39, %.lr.ph33 ], [ %29, %.lr.ph37 ]
  %.130 = phi i64 [ %spec.select, %.lr.ph33 ], [ %.02534, %.lr.ph37 ]
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @o, i64 noundef %.02435) #5
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @o, i64 noundef %.02331) #5
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = tail call noundef i64 @_ZSt3gcdIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef %33, i64 noundef %35) #5
  %37 = icmp sgt i64 %36, 1
  %38 = zext i1 %37 to i64
  %spec.select = add nsw i64 %.130, %38
  %39 = add nuw nsw i64 %.02331, 1
  %40 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @o) #5
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %.lr.ph33, label %.loopexit28, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph42, %.lr.ph46
  %.4.lcssa = phi i64 [ %.344, %.lr.ph46 ], [ %51, %.lr.ph42 ]
  %42 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #5
  %43 = icmp slt i64 %48, %42
  br i1 %43, label %.lr.ph46, label %._crit_edge47, !llvm.loop !15

._crit_edge47:                                    ; preds = %.loopexit, %.preheader
  %.3.lcssa = phi i64 [ %.025.lcssa, %.preheader ], [ %.4.lcssa, %.loopexit ]
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.3.lcssa)
  %45 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %44, i8 noundef signext 10)
  %46 = load i64, ptr @T, align 8, !tbaa !8
  %47 = add nsw i64 %46, -1
  store i64 %47, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %46, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !16

.lr.ph46:                                         ; preds = %.preheader, %.loopexit
  %.02245 = phi i64 [ %48, %.loopexit ], [ 0, %.preheader ]
  %.344 = phi i64 [ %.4.lcssa, %.loopexit ], [ %.025.lcssa, %.preheader ]
  %48 = add nuw nsw i64 %.02245, 1
  %49 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #5
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %.lr.ph42, label %.loopexit

.lr.ph42:                                         ; preds = %.lr.ph46, %.lr.ph42
  %.040 = phi i64 [ %52, %.lr.ph42 ], [ %48, %.lr.ph46 ]
  %.439 = phi i64 [ %51, %.lr.ph42 ], [ %.344, %.lr.ph46 ]
  %51 = add nsw i64 %.439, 1
  %52 = add nuw nsw i64 %.040, 1
  %53 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #5
  %54 = icmp slt i64 %52, %53
  br i1 %54, label %.lr.ph42, label %.loopexit, !llvm.loop !17

._crit_edge52:                                    ; preds = %._crit_edge47, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; 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 #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3gcdIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef, i64 noundef) local_unnamed_addr #1

; 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 #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_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 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 #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 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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