; LLVM IR from dynexcoin/Dynex :: src/Platform/Linux/System/Dispatcher.ll (ZN6System10Dispatcher8dispatchEv)

; 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::__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] }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%"class.System::(anonymous namespace)::MutextGuard" = type { ptr }
%"class.System::Dispatcher" = type { i32, [4 x i8], [40 x i8], i32, %"struct.System::ContextPair", %"class.std::queue", %"class.std::stack", %"struct.System::NativeContext", %"struct.System::NativeContextGroup", ptr, ptr, ptr, ptr, i64 }
%"struct.System::ContextPair" = type { ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque.0" }
%"class.std::deque.0" = type { %"class.std::_Deque_base.1" }
%"class.std::_Deque_base.1" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = type { ptr, ptr, ptr, ptr }
%"struct.System::NativeContext" = type { ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, %"class.std::function", %"class.std::function" }
%"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 } }
%"struct.System::NativeContextGroup" = type { ptr, ptr, ptr, ptr }
%"struct.System::OperationContext" = type { ptr, i8, i32 }

@.str.5 = external hidden unnamed_addr constant [90 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.14 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN6System10Dispatcher8dispatchEv = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [43 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #1

declare void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8) #2

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6System10Dispatcher8dispatchEv(ptr noundef nonnull align 8 dereferenceable(424) %0) #6 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.epoll_event, align 1
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i1, align 1
  %14 = alloca %"class.System::(anonymous namespace)::MutextGuard", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca i1, align 1
  %19 = alloca ptr, align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::__cxx11::basic_string", align 8
  %22 = alloca i1, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  br label %24

24:                                               ; preds = %182, %180, %1
  %25 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 10
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %37

28:                                               ; preds = %24
  %29 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 10
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  store ptr %30, ptr %3, align 8, !tbaa !5
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.System::NativeContext", ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !31
  %34 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 10
  store ptr %33, ptr %34, align 8, !tbaa !9
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.System::NativeContext", ptr %35, i32 0, i32 3
  store i8 0, ptr %36, align 1, !tbaa !32
  br label %184

37:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %38 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !33
  %40 = call i32 @epoll_wait(i32 noundef %39, ptr noundef %4, i32 noundef 1, i32 noundef -1)
  store i32 %40, ptr %5, align 4, !tbaa !34
  %41 = load i32, ptr %5, align 4, !tbaa !34
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %153

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %44 = getelementptr inbounds %struct.epoll_event, ptr %4, i32 0, i32 1
  %45 = load ptr, ptr %44, align 1, !tbaa !35
  store ptr %45, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.epoll_event, ptr %4, i32 0, i32 0
  %47 = load i32, ptr %46, align 1, !tbaa !36
  %48 = and i32 %47, 5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %109

50:                                               ; preds = %43
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.System::ContextPair", ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !38
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %109

55:                                               ; preds = %50
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.System::ContextPair", ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !39
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %109

60:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %61 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !40
  %63 = call i64 @read(i32 noundef %62, ptr noundef %7, i64 noundef 8)
  store i64 %63, ptr %8, align 8, !tbaa !41
  %64 = load i64, ptr %8, align 8, !tbaa !41
  %65 = icmp eq i64 %64, -1
  br i1 %65, label %66, label %88

66:                                               ; preds = %60
  store i1 true, ptr %13, align 1
  %67 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #8
  invoke void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %10)
          to label %68 unwind label %71

68:                                               ; preds = %66
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef @.str.14, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %69 unwind label %75

69:                                               ; preds = %68
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %70 unwind label %79

70:                                               ; preds = %69
  store i1 false, ptr %13, align 1
  invoke void @__cxa_throw(ptr %67, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %232 unwind label %79

71:                                               ; preds = %66
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %11, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %12, align 4
  br label %84

75:                                               ; preds = %68
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  br label %83

79:                                               ; preds = %70, %69
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %11, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  br label %83

83:                                               ; preds = %79, %75
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  br label %84

84:                                               ; preds = %83, %71
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  %85 = load i1, ptr %13, align 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  call void @__cxa_free_exception(ptr %67) #8
  br label %87

87:                                               ; preds = %86, %84
  br label %108

88:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %89 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 2
  %90 = getelementptr inbounds [40 x i8], ptr %89, i64 0, i64 0
  call void @_ZN6System12_GLOBAL__N_111MutextGuardC2ER15pthread_mutex_t(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(40) %90)
  br label %91

91:                                               ; preds = %102, %88
  %92 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 5
  %93 = invoke noundef zeroext i1 @_ZNKSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %92)
          to label %94 unwind label %103

94:                                               ; preds = %91
  %95 = xor i1 %93, true
  br i1 %95, label %96, label %107

96:                                               ; preds = %94
  %97 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 5
  %98 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %97)
          to label %99 unwind label %103

99:                                               ; preds = %96
  invoke void @_ZN6System10Dispatcher5spawnEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(424) %23, ptr noundef nonnull align 8 dereferenceable(32) %98)
          to label %100 unwind label %103

100:                                              ; preds = %99
  %101 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 5
  invoke void @_ZNSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %101)
          to label %102 unwind label %103

102:                                              ; preds = %100
  br label %91, !llvm.loop !42

103:                                              ; preds = %100, %99, %96, %91
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %11, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %12, align 4
  call void @_ZN6System12_GLOBAL__N_111MutextGuardD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %108

107:                                              ; preds = %94
  store i32 3, ptr %15, align 4
  call void @_ZN6System12_GLOBAL__N_111MutextGuardD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %152

108:                                              ; preds = %103, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %183

109:                                              ; preds = %55, %50, %43
  %110 = getelementptr inbounds %struct.epoll_event, ptr %4, i32 0, i32 0
  %111 = load i32, ptr %110, align 1, !tbaa !36
  %112 = and i32 %111, 4
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %126

114:                                              ; preds = %109
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.System::ContextPair", ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !39
  %118 = getelementptr inbounds %"struct.System::OperationContext", ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !44
  store ptr %119, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.epoll_event, ptr %4, i32 0, i32 0
  %121 = load i32, ptr %120, align 1, !tbaa !36
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.System::ContextPair", ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !39
  %125 = getelementptr inbounds %"struct.System::OperationContext", ptr %124, i32 0, i32 2
  store i32 %121, ptr %125, align 4, !tbaa !46
  br label %145

126:                                              ; preds = %109
  %127 = getelementptr inbounds %struct.epoll_event, ptr %4, i32 0, i32 0
  %128 = load i32, ptr %127, align 1, !tbaa !36
  %129 = and i32 %128, 1
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %143

131:                                              ; preds = %126
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.System::ContextPair", ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !38
  %135 = getelementptr inbounds %"struct.System::OperationContext", ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !44
  store ptr %136, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.epoll_event, ptr %4, i32 0, i32 0
  %138 = load i32, ptr %137, align 1, !tbaa !36
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.System::ContextPair", ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !38
  %142 = getelementptr inbounds %"struct.System::OperationContext", ptr %141, i32 0, i32 2
  store i32 %138, ptr %142, align 4, !tbaa !46
  br label %144

143:                                              ; preds = %126
  store i32 3, ptr %15, align 4
  br label %152, !llvm.loop !47

144:                                              ; preds = %131
  br label %145

145:                                              ; preds = %144, %114
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %149

148:                                              ; preds = %145
  br label %151

149:                                              ; preds = %145
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.5, i32 noundef 213, ptr noundef @__PRETTY_FUNCTION__._ZN6System10Dispatcher8dispatchEv) #10
  unreachable

150:                                              ; No predecessors!
  br label %151

151:                                              ; preds = %150, %148
  store i32 2, ptr %15, align 4
  br label %152

152:                                              ; preds = %151, %143, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %180

153:                                              ; preds = %37
  %154 = call ptr @__errno_location() #11
  %155 = load i32, ptr %154, align 4, !tbaa !34
  %156 = icmp ne i32 %155, 4
  br i1 %156, label %157, label %179

157:                                              ; preds = %153
  store i1 true, ptr %18, align 1
  %158 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  invoke void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17)
          to label %159 unwind label %162

159:                                              ; preds = %157
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %16, ptr noundef @.str.16, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %160 unwind label %166

160:                                              ; preds = %159
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %158, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %161 unwind label %170

161:                                              ; preds = %160
  store i1 false, ptr %18, align 1
  invoke void @__cxa_throw(ptr %158, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %232 unwind label %170

162:                                              ; preds = %157
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %11, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %12, align 4
  br label %175

166:                                              ; preds = %159
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %11, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %12, align 4
  br label %174

170:                                              ; preds = %161, %160
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %11, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #8
  br label %174

174:                                              ; preds = %170, %166
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  br label %175

175:                                              ; preds = %174, %162
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #8
  %176 = load i1, ptr %18, align 1
  br i1 %176, label %177, label %178

177:                                              ; preds = %175
  call void @__cxa_free_exception(ptr %158) #8
  br label %178

178:                                              ; preds = %177, %175
  br label %183

179:                                              ; preds = %153
  store i32 0, ptr %15, align 4
  br label %180

180:                                              ; preds = %179, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #8
  %181 = load i32, ptr %15, align 4
  switch i32 %181, label %232 [
    i32 0, label %182
    i32 3, label %24
    i32 2, label %184
  ]

182:                                              ; preds = %180
  br label %24, !llvm.loop !47

183:                                              ; preds = %178, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #8
  br label %226

184:                                              ; preds = %180, %28
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 9
  %187 = load ptr, ptr %186, align 8, !tbaa !48
  %188 = icmp ne ptr %185, %187
  br i1 %188, label %189, label %225

189:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %190 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 9
  %191 = load ptr, ptr %190, align 8, !tbaa !48
  %192 = getelementptr inbounds %"struct.System::NativeContext", ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !49
  store ptr %193, ptr %19, align 8, !tbaa !5
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %"class.System::Dispatcher", ptr %23, i32 0, i32 9
  store ptr %194, ptr %195, align 8, !tbaa !48
  %196 = load ptr, ptr %19, align 8, !tbaa !5
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds %"struct.System::NativeContext", ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !49
  %200 = call i32 @swapcontext(ptr noundef %196, ptr noundef %199) #8
  %201 = icmp eq i32 %200, -1
  br i1 %201, label %202, label %224

202:                                              ; preds = %189
  store i1 true, ptr %22, align 1
  %203 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #8
  invoke void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %21)
          to label %204 unwind label %207

204:                                              ; preds = %202
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %20, ptr noundef @.str.17, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %205 unwind label %211

205:                                              ; preds = %204
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %203, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %206 unwind label %215

206:                                              ; preds = %205
  store i1 false, ptr %22, align 1
  invoke void @__cxa_throw(ptr %203, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #9
          to label %232 unwind label %215

207:                                              ; preds = %202
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %11, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %12, align 4
  br label %220

211:                                              ; preds = %204
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %11, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %12, align 4
  br label %219

215:                                              ; preds = %206, %205
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %11, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %12, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #8
  br label %219

219:                                              ; preds = %215, %211
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #8
  br label %220

220:                                              ; preds = %219, %207
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #8
  %221 = load i1, ptr %22, align 1
  br i1 %221, label %222, label %223

222:                                              ; preds = %220
  call void @__cxa_free_exception(ptr %203) #8
  br label %223

223:                                              ; preds = %222, %220
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %226

224:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %225

225:                                              ; preds = %224, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  ret void

226:                                              ; preds = %223, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %227

227:                                              ; preds = %226
  %228 = load ptr, ptr %11, align 8
  %229 = load i32, ptr %12, align 4
  %230 = insertvalue { ptr, i32 } poison, ptr %228, 0
  %231 = insertvalue { ptr, i32 } %230, i32 %229, 1
  resume { ptr, i32 } %231

232:                                              ; preds = %206, %180, %161, %70
  unreachable
}

declare i32 @epoll_wait(i32 noundef, ptr noundef, i32 noundef, i32 noundef) #2

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN6System12_GLOBAL__N_111MutextGuardC2ER15pthread_mutex_t(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6System10Dispatcher5spawnEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #7

; Function Attrs: nounwind
declare i32 @swapcontext(ptr noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { noreturn nounwind "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 "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 = { 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 #7 = { nounwind willreturn memory(none) "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 #8 = { nounwind }
attributes #9 = { noreturn }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(none) }

!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, !6, i64 392}
!10 = !{!"_ZTSN6System10DispatcherE", !11, i64 0, !7, i64 8, !11, i64 48, !12, i64 56, !13, i64 72, !20, i64 152, !26, i64 232, !30, i64 352, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !18, i64 416}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN6System11ContextPairE", !6, i64 0, !6, i64 8}
!13 = !{!"_ZTSSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE", !14, i64 0}
!14 = !{!"_ZTSSt5dequeISt8functionIFvvEESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSSt11_Deque_baseISt8functionIFvvEESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE11_Deque_implE", !17, i64 0}
!17 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !18, i64 8, !19, i64 16, !19, i64 48}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSSt15_Deque_iteratorISt8functionIFvvEERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSSt5stackIiSt5dequeIiSaIiEEE", !21, i64 0}
!21 = !{!"_ZTSSt5dequeIiSaIiEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Deque_baseIiSaIiEE", !23, i64 0}
!23 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE11_Deque_implE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE16_Deque_impl_dataE", !6, i64 0, !18, i64 8, !25, i64 16, !25, i64 48}
!25 = !{!"_ZTSSt15_Deque_iteratorIiRiPiE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!"_ZTSN6System13NativeContextE", !6, i64 0, !6, i64 8, !27, i64 16, !27, i64 17, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !28, i64 56, !28, i64 88}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSSt8functionIFvvEE", !29, i64 0, !6, i64 24}
!29 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!30 = !{!"_ZTSN6System18NativeContextGroupE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!26, !6, i64 24}
!32 = !{!26, !27, i64 17}
!33 = !{!10, !11, i64 0}
!34 = !{!11, !11, i64 0}
!35 = !{!7, !7, i64 0}
!36 = !{!37, !11, i64 0}
!37 = !{!"_ZTS11epoll_event", !11, i64 0, !7, i64 4}
!38 = !{!12, !6, i64 0}
!39 = !{!12, !6, i64 8}
!40 = !{!10, !11, i64 48}
!41 = !{!18, !18, i64 0}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!45, !6, i64 0}
!45 = !{!"_ZTSN6System16OperationContextE", !6, i64 0, !27, i64 8, !11, i64 12}
!46 = !{!45, !11, i64 12}
!47 = distinct !{!47, !43}
!48 = !{!10, !6, i64 384}
!49 = !{!26, !6, i64 0}


; 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::__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] }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%"class.System::(anonymous namespace)::MutextGuard" = type { ptr }

@.str.5 = external hidden unnamed_addr constant [90 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@.str.14 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN6System10Dispatcher8dispatchEv = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [43 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8) local_unnamed_addr #2

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6System10Dispatcher8dispatchEv(ptr noundef nonnull align 8 dereferenceable(424) %0) local_unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.epoll_event, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.System::(anonymous namespace)::MutextGuard", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 392
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %.not109 = icmp eq ptr %12, null
  br i1 %.not109, label %.lr.ph111, label %._crit_edge112

.lr.ph111:                                        ; preds = %1
  %13 = getelementptr inbounds i8, ptr %2, i64 4
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  br label %20

._crit_edge112:                                   ; preds = %80, %1
  %.lcssa = phi ptr [ %12, %1 ], [ %81, %80 ]
  %17 = getelementptr inbounds i8, ptr %.lcssa, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !30
  store ptr %18, ptr %11, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %.lcssa, i64 17
  store i8 0, ptr %19, align 1, !tbaa !31
  br label %83

20:                                               ; preds = %.lr.ph111, %80
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #9
  %21 = load i32, ptr %0, align 8, !tbaa !32
  %22 = call i32 @epoll_wait(i32 noundef %21, ptr noundef nonnull %2, i32 noundef 1, i32 noundef -1)
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %24, label %67

24:                                               ; preds = %20
  %25 = load ptr, ptr %13, align 4, !tbaa !33
  %26 = load i32, ptr %2, align 4, !tbaa !34
  %27 = and i32 %26, 5
  %.not51 = icmp eq i32 %27, 0
  br i1 %.not51, label %57, label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr %25, align 8, !tbaa !36
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %57

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %25, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !37
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %57

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %36 = load i32, ptr %14, align 8, !tbaa !38
  %37 = call i64 @read(i32 noundef %36, ptr noundef nonnull %3, i64 noundef 8)
  %38 = icmp eq i64 %37, -1
  br i1 %38, label %39, label %49

39:                                               ; preds = %35
  %40 = call ptr @__cxa_allocate_exception(i64 16) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #9
  invoke void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5)
          to label %41 unwind label %.thread

41:                                               ; preds = %39
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull @.str.14, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %42 unwind label %.thread68

42:                                               ; preds = %41
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %43 unwind label %46

43:                                               ; preds = %42
  invoke void @__cxa_throw(ptr nonnull %40, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #10
          to label %103 unwind label %46

.thread:                                          ; preds = %39
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %48

.thread68:                                        ; preds = %41
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %48

46:                                               ; preds = %42, %43
  %.029 = phi i1 [ false, %43 ], [ true, %42 ]
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br i1 %.029, label %48, label %56

48:                                               ; preds = %.thread68, %.thread, %46
  %.pn55.pn67 = phi { ptr, i32 } [ %44, %.thread ], [ %47, %46 ], [ %45, %.thread68 ]
  call void @__cxa_free_exception(ptr %40) #9
  br label %56

49:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @_ZN6System12_GLOBAL__N_111MutextGuardC2ER15pthread_mutex_t(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(40) %15)
  %50 = call noundef zeroext i1 @_ZNKSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  br i1 %50, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %49, %52
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  invoke void @_ZN6System10Dispatcher5spawnEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef nonnull align 8 dereferenceable(32) %51)
          to label %52 unwind label %54

52:                                               ; preds = %.lr.ph
  call void @_ZNSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  %53 = call noundef zeroext i1 @_ZNKSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %16)
  br i1 %53, label %._crit_edge, label %.lr.ph, !llvm.loop !39

54:                                               ; preds = %.lr.ph
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6System12_GLOBAL__N_111MutextGuardD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br label %56

._crit_edge:                                      ; preds = %52, %49
  call void @_ZN6System12_GLOBAL__N_111MutextGuardD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %80

56:                                               ; preds = %46, %48, %54
  %.pn55.pn.pn = phi { ptr, i32 } [ %.pn55.pn67, %48 ], [ %47, %46 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %82

57:                                               ; preds = %31, %28, %24
  %58 = and i32 %26, 4
  %.not52 = icmp eq i32 %58, 0
  br i1 %.not52, label %61, label %59

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %25, i64 8
  br label %.loopexit

61:                                               ; preds = %57
  %62 = and i32 %26, 1
  %.not53 = icmp eq i32 %62, 0
  br i1 %.not53, label %80, label %.loopexit, !llvm.loop !41

.loopexit:                                        ; preds = %61, %59
  %.lcssa129.sink = phi ptr [ %60, %59 ], [ %25, %61 ]
  %63 = load ptr, ptr %.lcssa129.sink, align 8, !tbaa !42
  %64 = load ptr, ptr %63, align 8, !tbaa !43
  %65 = getelementptr inbounds i8, ptr %63, i64 12
  store i32 %26, ptr %65, align 4, !tbaa !45
  %.not54 = icmp eq ptr %64, null
  br i1 %.not54, label %66, label %.thread78

.thread78:                                        ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #9
  br label %83

66:                                               ; preds = %.loopexit
  call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.5, i32 noundef 213, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6System10Dispatcher8dispatchEv) #11
  unreachable

67:                                               ; preds = %20
  %68 = tail call ptr @__errno_location() #12
  %69 = load i32, ptr %68, align 4, !tbaa !46
  %.not48 = icmp eq i32 %69, 4
  br i1 %.not48, label %80, label %70

70:                                               ; preds = %67
  %71 = call ptr @__cxa_allocate_exception(i64 16) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #9
  invoke void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8)
          to label %72 unwind label %.thread71

72:                                               ; preds = %70
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull @.str.16, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %73 unwind label %.thread75

73:                                               ; preds = %72
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %74 unwind label %77

74:                                               ; preds = %73
  invoke void @__cxa_throw(ptr nonnull %71, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #10
          to label %103 unwind label %77

.thread71:                                        ; preds = %70
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  br label %79

.thread75:                                        ; preds = %72
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  br label %79

77:                                               ; preds = %73, %74
  %.024 = phi i1 [ false, %74 ], [ true, %73 ]
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  br i1 %.024, label %79, label %82

79:                                               ; preds = %.thread75, %.thread71, %77
  %.pn.pn74 = phi { ptr, i32 } [ %75, %.thread71 ], [ %78, %77 ], [ %76, %.thread75 ]
  call void @__cxa_free_exception(ptr %71) #9
  br label %82

80:                                               ; preds = %67, %._crit_edge, %61
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #9
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %.not = icmp eq ptr %81, null
  br i1 %.not, label %20, label %._crit_edge112

82:                                               ; preds = %77, %79, %56
  %.pn55.pn.pn.pn = phi { ptr, i32 } [ %.pn55.pn.pn, %56 ], [ %.pn.pn74, %79 ], [ %78, %77 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #9
  br label %102

83:                                               ; preds = %.thread78, %._crit_edge112
  %.4 = phi ptr [ %.lcssa, %._crit_edge112 ], [ %64, %.thread78 ]
  %84 = getelementptr inbounds i8, ptr %0, i64 384
  %85 = load ptr, ptr %84, align 8, !tbaa !47
  %.not60 = icmp eq ptr %.4, %85
  br i1 %.not60, label %101, label %86

86:                                               ; preds = %83
  %87 = load ptr, ptr %85, align 8, !tbaa !48
  store ptr %.4, ptr %84, align 8, !tbaa !47
  %88 = load ptr, ptr %.4, align 8, !tbaa !48
  %89 = call i32 @swapcontext(ptr noundef %87, ptr noundef %88) #9
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %101

91:                                               ; preds = %86
  %92 = call ptr @__cxa_allocate_exception(i64 16) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #9
  invoke void @_ZN6System16lastErrorMessageB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10)
          to label %93 unwind label %.thread83

93:                                               ; preds = %91
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull @.str.17, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %94 unwind label %.thread87

94:                                               ; preds = %93
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %92, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %95 unwind label %98

95:                                               ; preds = %94
  invoke void @__cxa_throw(ptr nonnull %92, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #10
          to label %103 unwind label %98

.thread83:                                        ; preds = %91
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #9
  br label %100

.thread87:                                        ; preds = %93
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #9
  br label %100

98:                                               ; preds = %94, %95
  %.0 = phi i1 [ false, %95 ], [ true, %94 ]
  %99 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #9
  br i1 %.0, label %100, label %102

100:                                              ; preds = %.thread87, %.thread83, %98
  %.pn61.pn86 = phi { ptr, i32 } [ %96, %.thread83 ], [ %99, %98 ], [ %97, %.thread87 ]
  call void @__cxa_free_exception(ptr %92) #9
  br label %102

101:                                              ; preds = %86, %83
  ret void

102:                                              ; preds = %98, %100, %82
  %.pn61.pn.pn = phi { ptr, i32 } [ %.pn55.pn.pn.pn, %82 ], [ %.pn61.pn86, %100 ], [ %99, %98 ]
  resume { ptr, i32 } %.pn61.pn.pn

103:                                              ; preds = %95, %74, %43
  unreachable
}

declare i32 @epoll_wait(i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN6System12_GLOBAL__N_111MutextGuardC2ER15pthread_mutex_t(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6System10Dispatcher5spawnEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(424), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #8

; Function Attrs: nounwind
declare i32 @swapcontext(ptr noundef, ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { noreturn nounwind "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 "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 = { 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 #7 = { nofree "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 #8 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 #9 = { nounwind }
attributes #10 = { noreturn }
attributes #11 = { noreturn nounwind }
attributes #12 = { nounwind willreturn memory(none) }

!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, !11, i64 392}
!6 = !{!"_ZTSN6System10DispatcherE", !7, i64 0, !8, i64 8, !7, i64 48, !10, i64 56, !12, i64 72, !19, i64 152, !25, i64 232, !29, i64 352, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !17, i64 416}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6System11ContextPairE", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE", !13, i64 0}
!13 = !{!"_ZTSSt5dequeISt8functionIFvvEESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt11_Deque_baseISt8functionIFvvEESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE11_Deque_implE", !16, i64 0}
!16 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE16_Deque_impl_dataE", !11, i64 0, !17, i64 8, !18, i64 16, !18, i64 48}
!17 = !{!"long", !8, i64 0}
!18 = !{!"_ZTSSt15_Deque_iteratorISt8functionIFvvEERS2_PS2_E", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!19 = !{!"_ZTSSt5stackIiSt5dequeIiSaIiEEE", !20, i64 0}
!20 = !{!"_ZTSSt5dequeIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Deque_baseIiSaIiEE", !22, i64 0}
!22 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE11_Deque_implE", !23, i64 0}
!23 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE16_Deque_impl_dataE", !11, i64 0, !17, i64 8, !24, i64 16, !24, i64 48}
!24 = !{!"_ZTSSt15_Deque_iteratorIiRiPiE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!25 = !{!"_ZTSN6System13NativeContextE", !11, i64 0, !11, i64 8, !26, i64 16, !26, i64 17, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !27, i64 56, !27, i64 88}
!26 = !{!"bool", !8, i64 0}
!27 = !{!"_ZTSSt8functionIFvvEE", !28, i64 0, !11, i64 24}
!28 = !{!"_ZTSSt14_Function_base", !8, i64 0, !11, i64 16}
!29 = !{!"_ZTSN6System18NativeContextGroupE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!30 = !{!25, !11, i64 24}
!31 = !{!25, !26, i64 17}
!32 = !{!6, !7, i64 0}
!33 = !{!8, !8, i64 0}
!34 = !{!35, !7, i64 0}
!35 = !{!"_ZTS11epoll_event", !7, i64 0, !8, i64 4}
!36 = !{!10, !11, i64 0}
!37 = !{!10, !11, i64 8}
!38 = !{!6, !7, i64 48}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = !{!11, !11, i64 0}
!43 = !{!44, !11, i64 0}
!44 = !{!"_ZTSN6System16OperationContextE", !11, i64 0, !26, i64 8, !7, i64 12}
!45 = !{!44, !7, i64 12}
!46 = !{!7, !7, i64 0}
!47 = !{!6, !11, i64 384}
!48 = !{!25, !11, i64 0}


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