; LLVM IR from seikhchilli/codeforces-solution :: 381A (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::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" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 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 i32, align 4
  %3 = alloca %"class.std::__cxx11::list", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  call void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %21, %0
  %13 = load i32, ptr %5, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %28

17:                                               ; preds = %12
  %18 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %19 unwind label %24

19:                                               ; preds = %17
  invoke void @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %20 unwind label %24

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %5, align 4, !tbaa !5
  br label %12, !llvm.loop !9

24:                                               ; preds = %19, %17
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %6, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %88

28:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  store i8 1, ptr %10, align 1, !tbaa !11
  br label %29

29:                                               ; preds = %67, %62, %51, %46, %28
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %2, align 4, !tbaa !5
  %32 = icmp ne i32 %30, 0
  br i1 %32, label %33, label %72

33:                                               ; preds = %29
  %34 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %35 = trunc i8 %34 to i1
  %36 = xor i1 %35, true
  %37 = zext i1 %36 to i8
  store i8 %37, ptr %10, align 1, !tbaa !11
  %38 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %56

40:                                               ; preds = %33
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp sge i32 %42, %44
  br i1 %45, label %46, label %51

46:                                               ; preds = %40
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = add nsw i32 %49, %48
  store i32 %50, ptr %9, align 4, !tbaa !5
  call void @_ZNSt7__cxx114listIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %29, !llvm.loop !15

51:                                               ; preds = %40
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = load i32, ptr %9, align 4, !tbaa !5
  %55 = add nsw i32 %54, %53
  store i32 %55, ptr %9, align 4, !tbaa !5
  call void @_ZNSt7__cxx114listIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %29, !llvm.loop !15

56:                                               ; preds = %33
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp sge i32 %58, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %56
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %65, %64
  store i32 %66, ptr %8, align 4, !tbaa !5
  call void @_ZNSt7__cxx114listIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %29, !llvm.loop !15

67:                                               ; preds = %56
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = add nsw i32 %70, %69
  store i32 %71, ptr %8, align 4, !tbaa !5
  call void @_ZNSt7__cxx114listIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %29, !llvm.loop !15

72:                                               ; preds = %29
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %73)
          to label %75 unwind label %84

75:                                               ; preds = %72
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef @.str)
          to label %77 unwind label %84

77:                                               ; preds = %75
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %76, i32 noundef %78)
          to label %80 unwind label %84

80:                                               ; preds = %77
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %82 unwind label %84

82:                                               ; preds = %80
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %83 = load i32, ptr %1, align 4
  ret i32 %83

84:                                               ; preds = %80, %77, %75, %72
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %6, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %88

88:                                               ; preds = %84, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %6, align 8
  %91 = load i32, ptr %7, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(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 = { 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 = !{!"int", !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}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 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 i32, align 4
  %2 = alloca %"class.std::__cxx11::list", align 8
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %10, %0
  %.lcssa = phi i32 [ %5, %0 ], [ %12, %10 ]
  %7 = add nsw i32 %.lcssa, -1
  store i32 %7, ptr %1, align 4, !tbaa !5
  %.not22 = icmp eq i32 %.lcssa, 0
  br i1 %.not22, label %._crit_edge, label %.lr.ph26

.lr.ph:                                           ; preds = %0, %10
  %.01621 = phi i32 [ %11, %10 ], [ 0, %0 ]
  %8 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %9 unwind label %14

9:                                                ; preds = %.lr.ph
  invoke void @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %10 unwind label %14

10:                                               ; preds = %9
  %11 = add nuw nsw i32 %.01621, 1
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %.lr.ph, label %.preheader, !llvm.loop !9

14:                                               ; preds = %9, %.lr.ph
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %50

thread-pre-split:                                 ; preds = %23, %27, %32, %36
  %.013.ph = phi i32 [ %39, %36 ], [ %35, %32 ], [ %.01323, %27 ], [ %.01323, %23 ]
  %.012.ph = phi i32 [ %.01224, %36 ], [ %.01224, %32 ], [ %30, %27 ], [ %26, %23 ]
  %.pr = load i32, ptr %1, align 4, !tbaa !5
  %16 = add nsw i32 %.pr, -1
  store i32 %16, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %.pr, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph26

.lr.ph26:                                         ; preds = %.preheader, %thread-pre-split
  %.0.shrunk25 = phi i1 [ %17, %thread-pre-split ], [ true, %.preheader ]
  %.01224 = phi i32 [ %.012.ph, %thread-pre-split ], [ 0, %.preheader ]
  %.01323 = phi i32 [ %.013.ph, %thread-pre-split ], [ 0, %.preheader ]
  %17 = xor i1 %.0.shrunk25, true
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %.not17 = icmp slt i32 %19, %21
  br i1 %.0.shrunk25, label %31, label %22

22:                                               ; preds = %.lr.ph26
  br i1 %.not17, label %27, label %23

23:                                               ; preds = %22
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %25, %.01224
  call void @_ZNSt7__cxx114listIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %thread-pre-split, !llvm.loop !11

27:                                               ; preds = %22
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, %.01224
  call void @_ZNSt7__cxx114listIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %thread-pre-split, !llvm.loop !11

31:                                               ; preds = %.lr.ph26
  br i1 %.not17, label %36, label %32

32:                                               ; preds = %31
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, %.01323
  call void @_ZNSt7__cxx114listIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %thread-pre-split, !llvm.loop !11

36:                                               ; preds = %31
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, %.01323
  call void @_ZNSt7__cxx114listIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %thread-pre-split, !llvm.loop !11

._crit_edge:                                      ; preds = %thread-pre-split, %.preheader
  %.013.lcssa = phi i32 [ 0, %.preheader ], [ %.013.ph, %thread-pre-split ]
  %.012.lcssa = phi i32 [ 0, %.preheader ], [ %.012.ph, %thread-pre-split ]
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.013.lcssa)
          to label %41 unwind label %48

41:                                               ; preds = %._crit_edge
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @.str)
          to label %43 unwind label %48

43:                                               ; preds = %41
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %42, i32 noundef %.012.lcssa)
          to label %45 unwind label %48

45:                                               ; preds = %43
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %47 unwind label %48

47:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

48:                                               ; preds = %45, %43, %41, %._crit_edge
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %50

50:                                               ; preds = %48, %14
  %.pn = phi { ptr, i32 } [ %15, %14 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(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 = { "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 = { 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 = !{!"int", !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}


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