; LLVM IR from turi-code/SFrame :: oss_src/fileio/oss_webstor/sysutils.ll (ZN7webstor8internal10SocketPool3addEij)

; 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.pollfd = type { i32, i16, i16 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.9" = type { ptr }
%"class.webstor::internal::SocketPool" = type { ptr, %"class.webstor::internal::EventSync" }
%"class.webstor::internal::EventSync" = type <{ %union.pthread_mutex_t, %"class.std::set", i32, [4 x i8] }>
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<webstor::internal::EventWaiter *, webstor::internal::EventWaiter *, std::_Identity<webstor::internal::EventWaiter *>, std::less<webstor::internal::EventWaiter *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<webstor::internal::EventWaiter *, webstor::internal::EventWaiter *, std::_Identity<webstor::internal::EventWaiter *>, std::less<webstor::internal::EventWaiter *>>::_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 }
%"struct.webstor::internal::SocketPoolState" = type { %"class.std::vector", %"class.std::vector.4" }
%"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 }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<pollfd, std::allocator<pollfd>>::_Vector_impl" }
%"struct.std::_Vector_base<pollfd, std::allocator<pollfd>>::_Vector_impl" = type { %"struct.std::_Vector_base<pollfd, std::allocator<pollfd>>::_Vector_impl_data" }
%"struct.std::_Vector_base<pollfd, std::allocator<pollfd>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7webstor8internal10SocketPool3addEij(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.pollfd, align 4
  %9 = alloca i8, align 1
  %10 = alloca i64, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.9", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = and i32 %19, 1
  %21 = icmp ne i32 %20, 0
  %22 = zext i1 %21 to i64
  %23 = select i1 %21, i32 17, i32 0
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = and i32 %24, 2
  %26 = icmp ne i32 %25, 0
  %27 = zext i1 %26 to i64
  %28 = select i1 %26, i32 20, i32 0
  %29 = or i32 %23, %28
  %30 = trunc i32 %29 to i16
  %31 = getelementptr inbounds %struct.pollfd, ptr %8, i32 0, i32 1
  store i16 %30, ptr %31, align 4, !tbaa !11
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = getelementptr inbounds %struct.pollfd, ptr %8, i32 0, i32 0
  store i32 %32, ptr %33, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !17
  br label %34

34:                                               ; preds = %59, %3
  %35 = load i64, ptr %10, align 8, !tbaa !17
  %36 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !19
  %38 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %37, i32 0, i32 1
  %39 = call noundef i64 @_ZNKSt6vectorI6pollfdSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #6
  %40 = icmp ult i64 %35, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %62

42:                                               ; preds = %34
  %43 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  %45 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %44, i32 0, i32 1
  %46 = load i64, ptr %10, align 8, !tbaa !17
  %47 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI6pollfdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %46) #6
  %48 = getelementptr inbounds %struct.pollfd, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 4, !tbaa !14
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = icmp eq i32 %49, %50
  br i1 %51, label %52, label %58

52:                                               ; preds = %42
  %53 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  %55 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %54, i32 0, i32 1
  %56 = load i64, ptr %10, align 8, !tbaa !17
  %57 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI6pollfdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %56) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %57, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !30
  store i8 1, ptr %9, align 1, !tbaa !15
  br label %58

58:                                               ; preds = %52, %42
  br label %59

59:                                               ; preds = %58
  %60 = load i64, ptr %10, align 8, !tbaa !17
  %61 = add i64 %60, 1
  store i64 %61, ptr %10, align 8, !tbaa !17
  br label %34, !llvm.loop !32

62:                                               ; preds = %41
  %63 = load i8, ptr %9, align 1, !tbaa !15, !range !34, !noundef !35
  %64 = trunc i8 %63 to i1
  br i1 %64, label %69, label %65

65:                                               ; preds = %62
  %66 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !19
  %68 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %67, i32 0, i32 1
  call void @_ZNSt6vectorI6pollfdSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 4 dereferenceable(8) %8)
  br label %69

69:                                               ; preds = %65, %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %70 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  %72 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %71, i32 0, i32 0
  %73 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #6
  %74 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %73, ptr %74, align 8
  %75 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !19
  %77 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %76, i32 0, i32 0
  %78 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #6
  %79 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %78, ptr %79, align 8
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  %82 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8
  %84 = call ptr @_ZSt11lower_boundIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_(ptr %81, ptr %83, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %85 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %86 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %87, i32 0, i32 0
  %89 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #6
  %90 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  %91 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br i1 %91, label %97, label %92

92:                                               ; preds = %69
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = load i32, ptr %6, align 4, !tbaa !9
  %96 = icmp ne i32 %94, %95
  br label %97

97:                                               ; preds = %92, %69
  %98 = phi i1 [ true, %69 ], [ %96, %92 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br i1 %98, label %99, label %110

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = getelementptr inbounds %"class.webstor::internal::SocketPool", ptr %18, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !19
  %105 = getelementptr inbounds %"struct.webstor::internal::SocketPoolState", ptr %104, i32 0, i32 0
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %106 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.9", ptr %15, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8
  %108 = call ptr @_ZNSt6vectorIiSaIiEE6insertEN9__gnu_cxx17__normal_iteratorIPKiS1_EERS4_(ptr noundef nonnull align 8 dereferenceable(24) %105, ptr %107, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  store i1 true, ptr %4, align 1
  store i32 1, ptr %17, align 4
  br label %111

110:                                              ; preds = %97
  store i1 false, ptr %4, align 1
  store i32 1, ptr %17, align 4
  br label %111

111:                                              ; preds = %110, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %112 = load i1, ptr %4, align 1
  ret i1 %112
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxeqIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"_ZTS6pollfd", !10, i64 0, !13, i64 4, !13, i64 6}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSN7webstor8internal10SocketPoolE", !6, i64 0, !21, i64 8}
!21 = !{!"_ZTSN7webstor8internal9EventSyncE", !7, i64 0, !22, i64 40, !10, i64 88}
!22 = !{!"_ZTSSt3setIPN7webstor8internal11EventWaiterESt4lessIS3_ESaIS3_EE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeIPN7webstor8internal11EventWaiterES3_St9_IdentityIS3_ESt4lessIS3_ESaIS3_EE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeIPN7webstor8internal11EventWaiterES3_St9_IdentityIS3_ESt4lessIS3_ESaIS3_EE13_Rb_tree_implIS7_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIPN7webstor8internal11EventWaiterEEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessIPN7webstor8internal11EventWaiterEE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !18, 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 = !{i64 0, i64 4, !9, i64 4, i64 2, !31, i64 6, i64 2, !31}
!31 = !{!13, !13, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{i8 0, i8 2}
!35 = !{}


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

%struct.pollfd = type { i32, i16, i16 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.9" = type { ptr }

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7webstor8internal10SocketPool3addEij(ptr nocapture noundef nonnull readonly align 8 dereferenceable(104) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.pollfd, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.9", align 8
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %9 = and i32 %2, 1
  %.not = icmp eq i32 %9, 0
  %10 = select i1 %.not, i16 0, i16 17
  %11 = and i32 %2, 2
  %.not12 = icmp eq i32 %11, 0
  %12 = select i1 %.not12, i16 0, i16 20
  %13 = or i16 %10, %12
  %14 = getelementptr inbounds i8, ptr %5, i64 4
  store i16 %13, ptr %14, align 4, !tbaa !9
  store i32 %1, ptr %5, align 8, !tbaa !12
  %15 = load ptr, ptr %0, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = tail call noundef i64 @_ZNKSt6vectorI6pollfdSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %.not17 = icmp eq i64 %17, 0
  br i1 %.not17, label %.critedge16, label %.lr.ph

._crit_edge:                                      ; preds = %28
  br i1 %.1, label %36, label %.critedge16

.lr.ph:                                           ; preds = %3, %28
  %.01015 = phi i1 [ %.1, %28 ], [ false, %3 ]
  %.01114 = phi i64 [ %29, %28 ], [ 0, %3 ]
  %18 = load ptr, ptr %0, align 8, !tbaa !13
  %19 = getelementptr inbounds i8, ptr %18, i64 24
  %20 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI6pollfdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %.01114) #5
  %21 = load i32, ptr %20, align 4, !tbaa !12
  %22 = icmp eq i32 %21, %1
  br i1 %22, label %23, label %28

23:                                               ; preds = %.lr.ph
  %24 = load ptr, ptr %0, align 8, !tbaa !13
  %25 = getelementptr inbounds i8, ptr %24, i64 24
  %26 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI6pollfdSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %.01114) #5
  %27 = load i64, ptr %5, align 8
  store i64 %27, ptr %26, align 4
  br label %28

28:                                               ; preds = %.lr.ph, %23
  %.1 = phi i1 [ true, %23 ], [ %.01015, %.lr.ph ]
  %29 = add nuw i64 %.01114, 1
  %30 = load ptr, ptr %0, align 8, !tbaa !13
  %31 = getelementptr inbounds i8, ptr %30, i64 24
  %32 = tail call noundef i64 @_ZNKSt6vectorI6pollfdSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %33 = icmp ult i64 %29, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !26

.critedge16:                                      ; preds = %3, %._crit_edge
  %34 = load ptr, ptr %0, align 8, !tbaa !13
  %35 = getelementptr inbounds i8, ptr %34, i64 24
  call void @_ZNSt6vectorI6pollfdSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 4 dereferenceable(8) %5)
  br label %36

36:                                               ; preds = %.critedge16, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %37 = load ptr, ptr %0, align 8, !tbaa !13
  %38 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #5
  %39 = load ptr, ptr %0, align 8, !tbaa !13
  %40 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #5
  %41 = call ptr @_ZSt11lower_boundIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEiET_S7_S7_RKT0_(ptr %38, ptr %40, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store ptr %41, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %42 = load ptr, ptr %0, align 8, !tbaa !13
  %43 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %42) #5
  store ptr %43, ptr %7, align 8
  %44 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br i1 %44, label %.critedge, label %45

45:                                               ; preds = %36
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %.not13 = icmp eq i32 %47, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br i1 %.not13, label %53, label %49

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

49:                                               ; preds = %45, %.critedge
  %50 = load ptr, ptr %0, align 8, !tbaa !13
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKiSt6vectorIiSaIiEEEC2IPivEERKNS0_IT_S5_EE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %51 = load ptr, ptr %8, align 8
  %52 = call ptr @_ZNSt6vectorIiSaIiEE6insertEN9__gnu_cxx17__normal_iteratorIPKiS1_EERS4_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr %51, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %53

53:                                               ; preds = %45, %49
  %.0 = phi i1 [ true, %49 ], [ false, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i1 %.0
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxeqIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #4 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"_ZTS6pollfd", !6, i64 0, !11, i64 4, !11, i64 6}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN7webstor8internal10SocketPoolE", !15, i64 0, !16, i64 8}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSN7webstor8internal9EventSyncE", !7, i64 0, !17, i64 40, !6, i64 88}
!17 = !{!"_ZTSSt3setIPN7webstor8internal11EventWaiterESt4lessIS3_ESaIS3_EE", !18, i64 0}
!18 = !{!"_ZTSSt8_Rb_treeIPN7webstor8internal11EventWaiterES3_St9_IdentityIS3_ESt4lessIS3_ESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSNSt8_Rb_treeIPN7webstor8internal11EventWaiterES3_St9_IdentityIS3_ESt4lessIS3_ESaIS3_EE13_Rb_tree_implIS7_Lb1EEE", !20, i64 0, !22, i64 8}
!20 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIPN7webstor8internal11EventWaiterEEE", !21, i64 0}
!21 = !{!"_ZTSSt4lessIPN7webstor8internal11EventWaiterEE"}
!22 = !{!"_ZTSSt15_Rb_tree_header", !23, i64 0, !25, i64 32}
!23 = !{!"_ZTSSt18_Rb_tree_node_base", !24, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!24 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!25 = !{!"long", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass