; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2019-20/Dec/Bronze (gymnastics)

; 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::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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@K = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@A = external dso_local global [10 x %"class.std::vector"], align 16

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3ranSt6vectorIiSaIiEEi(ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @K, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %19

19:                                               ; preds = %33, %0
  %20 = load i32, ptr %2, align 4, !tbaa !8
  %21 = load i32, ptr @K, align 4, !tbaa !8
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %36

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [10 x %"class.std::vector"], ptr @A, i64 0, i64 %26
  %28 = load i32, ptr @N, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %29)
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [10 x %"class.std::vector"], ptr @A, i64 0, i64 %31
  call void @_ZN5input2reIiEEvRSt6vectorIT_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %32)
  br label %33

33:                                               ; preds = %24
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !8
  br label %19, !llvm.loop !11

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

37:                                               ; preds = %88, %36
  %38 = load i32, ptr %4, align 4, !tbaa !8
  %39 = load i32, ptr @N, align 4, !tbaa !8
  %40 = add nsw i32 %39, 1
  %41 = icmp slt i32 %38, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %37
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %91

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %84, %43
  %45 = load i32, ptr %6, align 4, !tbaa !8
  %46 = load i32, ptr @N, align 4, !tbaa !8
  %47 = add nsw i32 %46, 1
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 1, ptr %7, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %51

51:                                               ; preds = %75, %50
  %52 = load i32, ptr %8, align 4, !tbaa !8
  %53 = load i32, ptr @K, align 4, !tbaa !8
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %51
  %57 = load i32, ptr %8, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10 x %"class.std::vector"], ptr @A, i64 0, i64 %58
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %59)
  %60 = load i32, ptr %4, align 4, !tbaa !8
  %61 = call noundef i32 @_Z3ranSt6vectorIiSaIiEEi(ptr noundef %9, i32 noundef %60)
  %62 = load i32, ptr %8, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10 x %"class.std::vector"], ptr @A, i64 0, i64 %63
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %64)
          to label %65 unwind label %70

65:                                               ; preds = %56
  %66 = load i32, ptr %6, align 4, !tbaa !8
  %67 = call noundef i32 @_Z3ranSt6vectorIiSaIiEEi(ptr noundef %10, i32 noundef %66)
  %68 = icmp sge i32 %61, %67
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br i1 %68, label %69, label %74

69:                                               ; preds = %65
  store i8 0, ptr %7, align 1, !tbaa !13
  br label %74

70:                                               ; preds = %56
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %11, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %12, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %93

74:                                               ; preds = %69, %65
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %8, align 4, !tbaa !8
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !8
  br label %51, !llvm.loop !15

78:                                               ; preds = %55
  %79 = load i8, ptr %7, align 1, !tbaa !13, !range !16, !noundef !17
  %80 = trunc i8 %79 to i1
  %81 = zext i1 %80 to i32
  %82 = load i32, ptr %3, align 4, !tbaa !8
  %83 = add nsw i32 %82, %81
  store i32 %83, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %84

84:                                               ; preds = %78
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %6, align 4, !tbaa !8
  br label %44, !llvm.loop !18

87:                                               ; preds = %49
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %4, align 4, !tbaa !8
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %4, align 4, !tbaa !8
  br label %37, !llvm.loop !19

91:                                               ; preds = %42
  call void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %92 = load i32, ptr %1, align 4
  ret i32 %92

93:                                               ; preds = %70
  %94 = load ptr, ptr %11, align 8
  %95 = load i32, ptr %12, align 4
  %96 = insertvalue { ptr, i32 } poison, ptr %94, 0
  %97 = insertvalue { ptr, i32 } %96, i32 %95, 1
  resume { ptr, i32 } %97
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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::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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@K = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@A = external dso_local global [10 x %"class.std::vector"], align 16

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3ranSt6vectorIiSaIiEEi(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  tail call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) @K, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %10 = load i32, ptr @K, align 4, !tbaa !8
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %12 = phi i32 [ %10, %0 ], [ %17, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !8
  %13 = load i32, ptr @N, align 4, !tbaa !8
  %.not33 = icmp slt i32 %13, 1
  br i1 %.not33, label %._crit_edge36, label %.preheader23

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [10 x %"class.std::vector"], ptr @A, i64 0, i64 %indvars.iv
  %15 = load i32, ptr @N, align 4, !tbaa !8
  %16 = sext i32 %15 to i64
  tail call void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %16)
  tail call void @_ZN5input2reIiEEvRSt6vectorIT_SaIS2_EE(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr @K, align 4, !tbaa !8
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader23:                                     ; preds = %._crit_edge, %._crit_edge32
  %20 = phi i32 [ %30, %._crit_edge32 ], [ %13, %._crit_edge ]
  %21 = phi i32 [ %31, %._crit_edge32 ], [ %12, %._crit_edge ]
  %.promoted = phi i32 [ %.promoted41, %._crit_edge32 ], [ 0, %._crit_edge ]
  %22 = phi i32 [ %32, %._crit_edge32 ], [ %12, %._crit_edge ]
  %.01734 = phi i32 [ %33, %._crit_edge32 ], [ 1, %._crit_edge ]
  %.not2130 = icmp slt i32 %20, 1
  br i1 %.not2130, label %._crit_edge32, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader23
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.preheader, label %.preheader.lr.ph.split.us

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  %24 = add i32 %.promoted, %20
  store i32 %24, ptr %1, align 4, !tbaa !8
  br label %._crit_edge32

._crit_edge36:                                    ; preds = %._crit_edge32, %._crit_edge
  call void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge29
  %25 = phi i32 [ %34, %._crit_edge29 ], [ %20, %.preheader.lr.ph ]
  %26 = phi i32 [ %35, %._crit_edge29 ], [ %20, %.preheader.lr.ph ]
  %27 = phi i32 [ %39, %._crit_edge29 ], [ %.promoted, %.preheader.lr.ph ]
  %28 = phi i32 [ %36, %._crit_edge29 ], [ %21, %.preheader.lr.ph ]
  %.02031 = phi i32 [ %40, %._crit_edge29 ], [ 1, %.preheader.lr.ph ]
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph28, label %._crit_edge29

._crit_edge32:                                    ; preds = %._crit_edge29, %.preheader.lr.ph.split.us, %.preheader23
  %30 = phi i32 [ %20, %.preheader.lr.ph.split.us ], [ %20, %.preheader23 ], [ %34, %._crit_edge29 ]
  %31 = phi i32 [ %21, %.preheader.lr.ph.split.us ], [ %21, %.preheader23 ], [ %36, %._crit_edge29 ]
  %.promoted41 = phi i32 [ %24, %.preheader.lr.ph.split.us ], [ %.promoted, %.preheader23 ], [ %39, %._crit_edge29 ]
  %32 = phi i32 [ %22, %.preheader.lr.ph.split.us ], [ %22, %.preheader23 ], [ %36, %._crit_edge29 ]
  %33 = add nuw nsw i32 %.01734, 1
  %.not.not = icmp slt i32 %.01734, %30
  br i1 %.not.not, label %.preheader23, label %._crit_edge36, !llvm.loop !13

._crit_edge29.loopexit:                           ; preds = %43
  %.pre = load i32, ptr @N, align 4, !tbaa !8
  br label %._crit_edge29

._crit_edge29:                                    ; preds = %._crit_edge29.loopexit, %.preheader
  %34 = phi i32 [ %25, %.preheader ], [ %.pre, %._crit_edge29.loopexit ]
  %35 = phi i32 [ %26, %.preheader ], [ %.pre, %._crit_edge29.loopexit ]
  %36 = phi i32 [ %28, %.preheader ], [ %45, %._crit_edge29.loopexit ]
  %.019.lcssa = phi i8 [ 1, %.preheader ], [ %spec.select, %._crit_edge29.loopexit ]
  %37 = and i8 %.019.lcssa, 1
  %38 = zext nneg i8 %37 to i32
  %39 = add nsw i32 %27, %38
  store i32 %39, ptr %1, align 4, !tbaa !8
  %40 = add nuw nsw i32 %.02031, 1
  %.not21.not = icmp slt i32 %.02031, %35
  br i1 %.not21.not, label %.preheader, label %._crit_edge32, !llvm.loop !15

.lr.ph28:                                         ; preds = %.preheader, %43
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %43 ], [ 0, %.preheader ]
  %.01926 = phi i8 [ %spec.select, %43 ], [ 1, %.preheader ]
  %41 = getelementptr inbounds [10 x %"class.std::vector"], ptr @A, i64 0, i64 %indvars.iv39
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %41)
  %42 = call noundef i32 @_Z3ranSt6vectorIiSaIiEEi(ptr noundef nonnull %2, i32 noundef %.01734)
  invoke void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %41)
          to label %43 unwind label %48

43:                                               ; preds = %.lr.ph28
  %44 = call noundef i32 @_Z3ranSt6vectorIiSaIiEEi(ptr noundef nonnull %3, i32 noundef %.02031)
  %.not22 = icmp slt i32 %42, %44
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %spec.select = select i1 %.not22, i8 %.01926, i8 0
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %45 = load i32, ptr @K, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next40, %46
  br i1 %47, label %.lr.ph28, label %._crit_edge29.loopexit, !llvm.loop !16

48:                                               ; preds = %.lr.ph28
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %49
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12, !14}
!16 = distinct !{!16, !12}


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