; LLVM IR from BabitMF/bmf :: bmf/cmd/src/menu.ll (ZN4Menu13select_optionEv)

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

%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.Menu = type { %"class.std::__cxx11::basic_string", %"class.std::vector", %"class.std::vector.11", %"class.std::set", i32, i32, i32, %"class.std::function" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<Menu, std::allocator<Menu>>::_Vector_impl" }
%"struct.std::_Vector_base<Menu, std::allocator<Menu>>::_Vector_impl" = type { %"struct.std::_Vector_base<Menu, std::allocator<Menu>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Menu, std::allocator<Menu>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Menu13select_optionEv(ptr noundef nonnull align 8 dereferenceable(176) %0) #1 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  %9 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 2
  %10 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 6
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = sext i32 %11 to i64
  %13 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %12) #3
  %14 = getelementptr inbounds %class.Menu, ptr %13, i32 0, i32 4
  %15 = load i32, ptr %14, align 8, !tbaa !35
  %16 = icmp eq i32 %15, 2
  br i1 %16, label %17, label %104

17:                                               ; preds = %1
  %18 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 2
  %19 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 6
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %21) #3
  %23 = getelementptr inbounds %class.Menu, ptr %22, i32 0, i32 5
  %24 = load i32, ptr %23, align 4, !tbaa !36
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %62

26:                                               ; preds = %17
  %27 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  %28 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 6
  %29 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %27, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = icmp ne i64 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %26
  %32 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  br label %61

33:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !37
  br label %34

34:                                               ; preds = %57, %33
  %35 = load i32, ptr %4, align 4, !tbaa !37
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 2
  %38 = call noundef i64 @_ZNKSt6vectorI4MenuSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #3
  %39 = icmp ult i64 %36, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %60

41:                                               ; preds = %34
  %42 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 2
  %43 = load i32, ptr %4, align 4, !tbaa !37
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %44) #3
  %46 = getelementptr inbounds %class.Menu, ptr %45, i32 0, i32 4
  %47 = load i32, ptr %46, align 8, !tbaa !35
  %48 = icmp eq i32 %47, 2
  br i1 %48, label %49, label %56

49:                                               ; preds = %41
  %50 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  %51 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %50, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %52 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 0
  %53 = extractvalue { ptr, i8 } %51, 0
  store ptr %53, ptr %52, align 8
  %54 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 1
  %55 = extractvalue { ptr, i8 } %51, 1
  store i8 %55, ptr %54, align 8
  br label %56

56:                                               ; preds = %49, %41
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %4, align 4, !tbaa !37
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !37
  br label %34, !llvm.loop !38

60:                                               ; preds = %40
  br label %61

61:                                               ; preds = %60, %31
  br label %103

62:                                               ; preds = %17
  %63 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  %64 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 6
  %65 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %63, ptr noundef nonnull align 4 dereferenceable(4) %64)
  %66 = icmp ne i64 %65, 0
  br i1 %66, label %67, label %94

67:                                               ; preds = %62
  %68 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  %69 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 6
  %70 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %68, ptr noundef nonnull align 4 dereferenceable(4) %69)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !37
  br label %71

71:                                               ; preds = %90, %67
  %72 = load i32, ptr %6, align 4, !tbaa !37
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 2
  %75 = call noundef i64 @_ZNKSt6vectorI4MenuSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #3
  %76 = icmp ult i64 %73, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %93

78:                                               ; preds = %71
  %79 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 2
  %80 = load i32, ptr %6, align 4, !tbaa !37
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %81) #3
  %83 = getelementptr inbounds %class.Menu, ptr %82, i32 0, i32 5
  %84 = load i32, ptr %83, align 4, !tbaa !36
  %85 = icmp eq i32 %84, 1
  br i1 %85, label %86, label %89

86:                                               ; preds = %78
  %87 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  %88 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %87, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %89

89:                                               ; preds = %86, %78
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %6, align 4, !tbaa !37
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %6, align 4, !tbaa !37
  br label %71, !llvm.loop !40

93:                                               ; preds = %77
  br label %102

94:                                               ; preds = %62
  %95 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 3
  %96 = getelementptr inbounds %class.Menu, ptr %8, i32 0, i32 6
  %97 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %95, ptr noundef nonnull align 4 dereferenceable(4) %96)
  %98 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 0
  %99 = extractvalue { ptr, i8 } %97, 0
  store ptr %99, ptr %98, align 8
  %100 = getelementptr inbounds { ptr, i8 }, ptr %7, i32 0, i32 1
  %101 = extractvalue { ptr, i8 } %97, 1
  store i8 %101, ptr %100, align 8
  br label %102

102:                                              ; preds = %94, %93
  br label %103

103:                                              ; preds = %102, %61
  call void @_ZN4Menu13update_screenEv(ptr noundef nonnull align 8 dereferenceable(176) %8)
  store i1 true, ptr %2, align 1
  br label %105

104:                                              ; preds = %1
  store i1 false, ptr %2, align 1
  br label %105

105:                                              ; preds = %104, %103
  %106 = load i1, ptr %2, align 1
  ret i1 %106
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !32, i64 136}
!10 = !{!"_ZTS4Menu", !11, i64 0, !14, i64 32, !18, i64 56, !22, i64 80, !30, i64 128, !31, i64 132, !32, i64 136, !33, i64 144}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorI4MenuSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseI4MenuSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI4MenuSaIS0_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI4MenuSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessIiE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !13, i64 32}
!28 = !{!"_ZTSSt18_Rb_tree_node_base", !29, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!30 = !{!"_ZTS8MenuType", !7, i64 0}
!31 = !{!"_ZTS13MenuOptionTag", !7, i64 0}
!32 = !{!"int", !7, i64 0}
!33 = !{!"_ZTSSt8functionIFvvEE", !34, i64 0, !6, i64 24}
!34 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!35 = !{!10, !30, i64 128}
!36 = !{!10, !31, i64 132}
!37 = !{!32, !32, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Menu13select_optionEv(ptr noundef nonnull align 8 dereferenceable(176) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = getelementptr inbounds i8, ptr %0, i64 136
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = tail call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %7) #3
  %9 = getelementptr inbounds i8, ptr %8, i64 128
  %10 = load i32, ptr %9, align 8, !tbaa !34
  %11 = icmp eq i32 %10, 2
  br i1 %11, label %12, label %60

12:                                               ; preds = %1
  %13 = load i32, ptr %5, align 8, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = tail call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %14) #3
  %16 = getelementptr inbounds i8, ptr %15, i64 132
  %17 = load i32, ptr %16, align 4, !tbaa !35
  %18 = icmp eq i32 %17, 1
  %19 = getelementptr inbounds i8, ptr %0, i64 80
  %20 = tail call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE5countERKi(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %.not4 = icmp eq i64 %20, 0
  br i1 %18, label %21, label %39

21:                                               ; preds = %12
  br i1 %.not4, label %23, label %22

22:                                               ; preds = %21
  tail call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %19) #3
  br label %59

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 0, ptr %2, align 4, !tbaa !36
  %24 = tail call noundef i64 @_ZNKSt6vectorI4MenuSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %.not10 = icmp eq i64 %24, 0
  br i1 %.not10, label %._crit_edge8, label %.lr.ph7

._crit_edge8:                                     ; preds = %33, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %59

.lr.ph7:                                          ; preds = %23, %33
  %25 = load i32, ptr %2, align 4, !tbaa !36
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %26) #3
  %28 = getelementptr inbounds i8, ptr %27, i64 128
  %29 = load i32, ptr %28, align 8, !tbaa !34
  %30 = icmp eq i32 %29, 2
  br i1 %30, label %31, label %33

31:                                               ; preds = %.lr.ph7
  %32 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %33

33:                                               ; preds = %.lr.ph7, %31
  %34 = load i32, ptr %2, align 4, !tbaa !36
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !36
  %36 = sext i32 %35 to i64
  %37 = call noundef i64 @_ZNKSt6vectorI4MenuSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %38 = icmp ugt i64 %37, %36
  br i1 %38, label %.lr.ph7, label %._crit_edge8, !llvm.loop !37

39:                                               ; preds = %12
  br i1 %.not4, label %57, label %40

40:                                               ; preds = %39
  %41 = tail call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  store i32 0, ptr %3, align 4, !tbaa !36
  %42 = tail call noundef i64 @_ZNKSt6vectorI4MenuSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %.not9 = icmp eq i64 %42, 0
  br i1 %.not9, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %51, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br label %59

.lr.ph:                                           ; preds = %40, %51
  %43 = load i32, ptr %3, align 4, !tbaa !36
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(176) ptr @_ZNSt6vectorI4MenuSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %44) #3
  %46 = getelementptr inbounds i8, ptr %45, i64 132
  %47 = load i32, ptr %46, align 4, !tbaa !35
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %49, label %51

49:                                               ; preds = %.lr.ph
  %50 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %51

51:                                               ; preds = %.lr.ph, %49
  %52 = load i32, ptr %3, align 4, !tbaa !36
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %3, align 4, !tbaa !36
  %54 = sext i32 %53 to i64
  %55 = call noundef i64 @_ZNKSt6vectorI4MenuSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %56 = icmp ugt i64 %55, %54
  br i1 %56, label %.lr.ph, label %._crit_edge, !llvm.loop !39

57:                                               ; preds = %39
  %58 = tail call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %59

59:                                               ; preds = %._crit_edge, %57, %22, %._crit_edge8
  call void @_ZN4Menu13update_screenEv(ptr noundef nonnull align 8 dereferenceable(176) %0)
  br label %60

60:                                               ; preds = %1, %59
  ret i1 %11
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !31, i64 136}
!6 = !{!"_ZTS4Menu", !7, i64 0, !13, i64 32, !17, i64 56, !21, i64 80, !29, i64 128, !30, i64 132, !31, i64 136, !32, i64 144}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"_ZTSSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!17 = !{!"_ZTSSt6vectorI4MenuSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI4MenuSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI4MenuSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI4MenuSaIS0_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!21 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !22, i64 0}
!22 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !23, i64 0}
!23 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !24, i64 0, !26, i64 8}
!24 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !25, i64 0}
!25 = !{!"_ZTSSt4lessIiE"}
!26 = !{!"_ZTSSt15_Rb_tree_header", !27, i64 0, !12, i64 32}
!27 = !{!"_ZTSSt18_Rb_tree_node_base", !28, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!28 = !{!"_ZTSSt14_Rb_tree_color", !10, i64 0}
!29 = !{!"_ZTS8MenuType", !10, i64 0}
!30 = !{!"_ZTS13MenuOptionTag", !10, i64 0}
!31 = !{!"int", !10, i64 0}
!32 = !{!"_ZTSSt8functionIFvvEE", !33, i64 0, !9, i64 24}
!33 = !{!"_ZTSSt14_Function_base", !10, i64 0, !9, i64 16}
!34 = !{!6, !29, i64 128}
!35 = !{!6, !30, i64 132}
!36 = !{!31, !31, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


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