; LLVM IR from dynexcoin/Dynex :: src/P2p/P2pConnectionProxy.ll (ZN7DynexCN18P2pConnectionProxy4readERNS_10P2pMessageE)

; 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.DynexCN::LevinProtocol::Command" = type { i32, i8, i8, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.DynexCN::P2pConnectionProxy" = type { %"class.DynexCN::IP2pConnection", %"class.std::queue", %"class.DynexCN::P2pContextOwner", ptr, ptr }
%"class.DynexCN::IP2pConnection" = type { 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<DynexCN::P2pMessage, std::allocator<DynexCN::P2pMessage>>::_Deque_impl" }
%"struct.std::_Deque_base<DynexCN::P2pMessage, std::allocator<DynexCN::P2pMessage>>::_Deque_impl" = type { %"struct.std::_Deque_base<DynexCN::P2pMessage, std::allocator<DynexCN::P2pMessage>>::_Deque_impl_data" }
%"struct.std::_Deque_base<DynexCN::P2pMessage, std::allocator<DynexCN::P2pMessage>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.DynexCN::P2pContextOwner" = type { ptr, %"struct.std::_List_iterator" }
%"struct.std::_List_iterator" = type { ptr }
%"struct.DynexCN::P2pMessage" = type { i32, %"class.std::vector" }

@_ZTIN6System20InterruptedExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7DynexCN13LevinProtocol7CommandC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN7DynexCN10P2pContext11readCommandERNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN18P2pConnectionProxy4readERNS_10P2pMessageE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.DynexCN::LevinProtocol::Command", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = getelementptr inbounds %"class.DynexCN::P2pConnectionProxy", ptr %9, i32 0, i32 1
  %11 = call noundef zeroext i1 @_ZNKSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  br i1 %11, label %18, label %12

12:                                               ; preds = %2
  %13 = getelementptr inbounds %"class.DynexCN::P2pConnectionProxy", ptr %9, i32 0, i32 1
  %14 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %13)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7DynexCN10P2pMessageaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  %17 = getelementptr inbounds %"class.DynexCN::P2pConnectionProxy", ptr %9, i32 0, i32 1
  call void @_ZNSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
  br label %57

18:                                               ; preds = %2
  br label %19

19:                                               ; preds = %56, %18
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #7
  call void @_ZN7DynexCN13LevinProtocol7CommandC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  %20 = getelementptr inbounds %"class.DynexCN::P2pConnectionProxy", ptr %9, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = invoke noundef zeroext i1 @_ZN7DynexCN10P2pContext11readCommandERNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(272) %21, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %23 unwind label %26

23:                                               ; preds = %19
  br i1 %22, label %30, label %24

24:                                               ; preds = %23
  %25 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @llvm.memset.p0.i64(ptr align 16 %25, i8 0, i64 8, i1 false)
  call void @_ZN6System20InterruptedExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  invoke void @__cxa_throw(ptr %25, ptr @_ZTIN6System20InterruptedExceptionE, ptr @_ZNSt9exceptionD2Ev) #8
          to label %63 unwind label %26

26:                                               ; preds = %45, %38, %24, %19
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %6, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %7, align 4
  call void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #7
  br label %58

30:                                               ; preds = %23
  %31 = getelementptr inbounds %"struct.DynexCN::LevinProtocol::Command", ptr %5, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !21
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.DynexCN::P2pMessage", ptr %33, i32 0, i32 0
  store i32 %32, ptr %34, align 8, !tbaa !29
  %35 = getelementptr inbounds %"struct.DynexCN::LevinProtocol::Command", ptr %5, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !21
  %37 = icmp eq i32 %36, 1001
  br i1 %37, label %38, label %41

38:                                               ; preds = %30
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN7DynexCN18P2pConnectionProxy23handleHandshakeResponseERKNS_13LevinProtocol7CommandERNS_10P2pMessageE(ptr noundef nonnull align 8 dereferenceable(120) %9, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %39)
          to label %40 unwind label %26

40:                                               ; preds = %38
  store i32 2, ptr %8, align 4
  br label %54

41:                                               ; preds = %30
  %42 = getelementptr inbounds %"struct.DynexCN::LevinProtocol::Command", ptr %5, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !21
  %44 = icmp eq i32 %43, 1002
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  invoke void @_ZN7DynexCN18P2pConnectionProxy15handleTimedSyncERKNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(120) %9, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %46 unwind label %26

46:                                               ; preds = %45
  br label %52

47:                                               ; preds = %41
  %48 = getelementptr inbounds %"struct.DynexCN::LevinProtocol::Command", ptr %5, i32 0, i32 3
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.DynexCN::P2pMessage", ptr %49, i32 0, i32 1
  %51 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIhSaIhEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 8 dereferenceable(24) %48) #7
  store i32 2, ptr %8, align 4
  br label %54

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52
  store i32 0, ptr %8, align 4
  br label %54

54:                                               ; preds = %53, %47, %40
  call void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #7
  %55 = load i32, ptr %8, align 4
  switch i32 %55, label %63 [
    i32 0, label %56
    i32 2, label %57
  ]

56:                                               ; preds = %54
  br label %19, !llvm.loop !31

57:                                               ; preds = %54, %12
  ret void

58:                                               ; preds = %26
  %59 = load ptr, ptr %6, align 8
  %60 = load i32, ptr %7, align 4
  %61 = insertvalue { ptr, i32 } poison, ptr %59, 0
  %62 = insertvalue { ptr, i32 } %61, i32 %60, 1
  resume { ptr, i32 } %62

63:                                               ; preds = %54, %24
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7DynexCN10P2pMessageaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN18P2pConnectionProxy23handleHandshakeResponseERKNS_13LevinProtocol7CommandERNS_10P2pMessageE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN18P2pConnectionProxy15handleTimedSyncERKNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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 104}
!10 = !{!"_ZTSN7DynexCN18P2pConnectionProxyE", !11, i64 0, !12, i64 8, !19, i64 88, !6, i64 104, !6, i64 112}
!11 = !{!"_ZTSN7DynexCN14IP2pConnectionE"}
!12 = !{!"_ZTSSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE", !13, i64 0}
!13 = !{!"_ZTSSt5dequeIN7DynexCN10P2pMessageESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt11_Deque_baseIN7DynexCN10P2pMessageESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt11_Deque_baseIN7DynexCN10P2pMessageESaIS1_EE11_Deque_implE", !16, i64 0}
!16 = !{!"_ZTSNSt11_Deque_baseIN7DynexCN10P2pMessageESaIS1_EE16_Deque_impl_dataE", !6, i64 0, !17, i64 8, !18, i64 16, !18, i64 48}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSSt15_Deque_iteratorIN7DynexCN10P2pMessageERS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!19 = !{!"_ZTSN7DynexCN15P2pContextOwnerE", !6, i64 0, !20, i64 8}
!20 = !{!"_ZTSSt14_List_iteratorISt10unique_ptrIN7DynexCN10P2pContextESt14default_deleteIS2_EEE", !6, i64 0}
!21 = !{!22, !23, i64 0}
!22 = !{!"_ZTSN7DynexCN13LevinProtocol7CommandE", !23, i64 0, !24, i64 4, !24, i64 5, !25, i64 8}
!23 = !{!"int", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSSt6vectorIhSaIhEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!30, !23, i64 0}
!30 = !{!"_ZTSN7DynexCN10P2pMessageE", !23, i64 0, !25, i64 8}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; 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.DynexCN::LevinProtocol::Command" = type { i32, i8, i8, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTIN6System20InterruptedExceptionE = external dso_local constant { ptr, ptr, ptr }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7DynexCN13LevinProtocol7CommandC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN7DynexCN10P2pContext11readCommandERNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN18P2pConnectionProxy4readERNS_10P2pMessageE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.DynexCN::LevinProtocol::Command", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = tail call noundef zeroext i1 @_ZNKSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %5, label %.preheader, label %7

.preheader:                                       ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 104
  br label %10

7:                                                ; preds = %2
  %8 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %9 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7DynexCN10P2pMessageaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  tail call void @_ZNSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br label %26

10:                                               ; preds = %.preheader, %25
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @_ZN7DynexCN13LevinProtocol7CommandC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = invoke noundef zeroext i1 @_ZN7DynexCN10P2pContext11readCommandERNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(272) %11, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %13 unwind label %.loopexit

13:                                               ; preds = %10
  br i1 %12, label %17, label %14

14:                                               ; preds = %13
  %15 = call ptr @__cxa_allocate_exception(i64 8) #6
  store i64 0, ptr %15, align 16
  call void @_ZN6System20InterruptedExceptionC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  invoke void @__cxa_throw(ptr nonnull %15, ptr nonnull @_ZTIN6System20InterruptedExceptionE, ptr nonnull @_ZNSt9exceptionD2Ev) #7
          to label %27 unwind label %.loopexit.split-lp

.loopexit:                                        ; preds = %10, %20
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %16

.loopexit.split-lp:                               ; preds = %14, %19
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %16

16:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  resume { ptr, i32 } %lpad.phi

17:                                               ; preds = %13
  %18 = load i32, ptr %3, align 8, !tbaa !20
  store i32 %18, ptr %1, align 8, !tbaa !28
  switch i32 %18, label %21 [
    i32 1001, label %19
    i32 1002, label %20
  ]

19:                                               ; preds = %17
  invoke void @_ZN7DynexCN18P2pConnectionProxy23handleHandshakeResponseERKNS_13LevinProtocol7CommandERNS_10P2pMessageE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.thread unwind label %.loopexit.split-lp

20:                                               ; preds = %17
  invoke void @_ZN7DynexCN18P2pConnectionProxy15handleTimedSyncERKNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(120) %0, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %25 unwind label %.loopexit

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  %23 = getelementptr inbounds i8, ptr %1, i64 8
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIhSaIhEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %22) #6
  br label %.thread

.thread:                                          ; preds = %21, %19
  call void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  br label %26

25:                                               ; preds = %20
  call void @_ZN7DynexCN13LevinProtocol7CommandD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  br label %10

26:                                               ; preds = %.thread, %7
  ret void

27:                                               ; preds = %14
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7DynexCN10P2pMessageaSEOS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN18P2pConnectionProxy23handleHandshakeResponseERKNS_13LevinProtocol7CommandERNS_10P2pMessageE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN18P2pConnectionProxy15handleTimedSyncERKNS_13LevinProtocol7CommandE(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 "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 }
attributes #7 = { noreturn }

!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, !13, i64 104}
!6 = !{!"_ZTSN7DynexCN18P2pConnectionProxyE", !7, i64 0, !8, i64 8, !18, i64 88, !13, i64 104, !13, i64 112}
!7 = !{!"_ZTSN7DynexCN14IP2pConnectionE"}
!8 = !{!"_ZTSSt5queueIN7DynexCN10P2pMessageESt5dequeIS1_SaIS1_EEE", !9, i64 0}
!9 = !{!"_ZTSSt5dequeIN7DynexCN10P2pMessageESaIS1_EE", !10, i64 0}
!10 = !{!"_ZTSSt11_Deque_baseIN7DynexCN10P2pMessageESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSNSt11_Deque_baseIN7DynexCN10P2pMessageESaIS1_EE11_Deque_implE", !12, i64 0}
!12 = !{!"_ZTSNSt11_Deque_baseIN7DynexCN10P2pMessageESaIS1_EE16_Deque_impl_dataE", !13, i64 0, !16, i64 8, !17, i64 16, !17, i64 48}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C++ TBAA"}
!16 = !{!"long", !14, i64 0}
!17 = !{!"_ZTSSt15_Deque_iteratorIN7DynexCN10P2pMessageERS1_PS1_E", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!18 = !{!"_ZTSN7DynexCN15P2pContextOwnerE", !13, i64 0, !19, i64 8}
!19 = !{!"_ZTSSt14_List_iteratorISt10unique_ptrIN7DynexCN10P2pContextESt14default_deleteIS2_EEE", !13, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTSN7DynexCN13LevinProtocol7CommandE", !22, i64 0, !23, i64 4, !23, i64 5, !24, i64 8}
!22 = !{!"int", !14, i64 0}
!23 = !{!"bool", !14, i64 0}
!24 = !{!"_ZTSSt6vectorIhSaIhEE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!28 = !{!29, !22, i64 0}
!29 = !{!"_ZTSN7DynexCN10P2pMessageE", !22, i64 0, !24, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass