; LLVM IR from microsoft/Multiverso :: src/communicator.ll (ZN10multiverso12Communicator4MainEv)

; 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::unique_ptr.20" = type { %"struct.std::__uniq_ptr_data.21" }
%"struct.std::__uniq_ptr_data.21" = type { %"class.std::__uniq_ptr_impl.22" }
%"class.std::__uniq_ptr_impl.22" = type { %"class.std::tuple.23" }
%"class.std::tuple.23" = type { %"struct.std::_Tuple_impl.24" }
%"struct.std::_Tuple_impl.24" = type { %"struct.std::_Head_base.27" }
%"struct.std::_Head_base.27" = type { ptr }
%"class.multiverso::Actor" = type { ptr, %"class.std::unique_ptr", %"class.std::unordered_map", i8, %"class.std::__cxx11::basic_string", %"class.std::unique_ptr.7" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::unique_ptr.7" = type { %"struct.std::__uniq_ptr_data.8" }
%"struct.std::__uniq_ptr_data.8" = type { %"class.std::__uniq_ptr_impl.9" }
%"class.std::__uniq_ptr_impl.9" = type { %"class.std::tuple.10" }
%"class.std::tuple.10" = type { %"struct.std::_Tuple_impl.11" }
%"struct.std::_Tuple_impl.11" = type { %"struct.std::_Head_base.14" }
%"struct.std::_Head_base.14" = type { ptr }
%"class.multiverso::Communicator" = type { %"class.multiverso::Actor", ptr, %"class.std::unique_ptr.7" }

@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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
declare dso_local void @_ZN10multiverso12Communicator14ProcessMessageERSt10unique_ptrINS_7MessageESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10multiverso12Communicator4MainEv(ptr noundef nonnull align 8 dereferenceable(136) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca { i64, i64 }, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca %"class.std::unique_ptr.20", align 8
  %9 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = getelementptr inbounds %"class.multiverso::Actor", ptr %10, i32 0, i32 3
  store i8 1, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds %"class.multiverso::Communicator", ptr %10, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !32
  %14 = load ptr, ptr %13, align 8, !tbaa !34
  %15 = getelementptr inbounds ptr, ptr %14, i64 13
  %16 = load ptr, ptr %15, align 8
  %17 = call noundef i32 %16(ptr noundef nonnull align 8 dereferenceable(8) %13)
  switch i32 %17, label %80 [
    i32 1, label %18
    i32 0, label %31
  ]

18:                                               ; preds = %1
  %19 = getelementptr inbounds %"class.multiverso::Communicator", ptr %10, i32 0, i32 2
  %20 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 8) #6
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN10multiverso12Communicator11CommunicateEv to i64), i64 0 }, ptr %3, align 8, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store ptr %10, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6threadC2IMN10multiverso12CommunicatorEFvvEJPS2_EvEEOT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %21 unwind label %24

21:                                               ; preds = %18
  store i1 false, ptr %7, align 1
  call void @_ZNSt10unique_ptrISt6threadSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  call void @_ZN10multiverso5Actor4MainEv(ptr noundef nonnull align 8 dereferenceable(120) %10)
  %22 = getelementptr inbounds %"class.multiverso::Communicator", ptr %10, i32 0, i32 2
  %23 = call noundef ptr @_ZNKSt10unique_ptrISt6threadSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  call void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %81

24:                                               ; preds = %18
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %5, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  %28 = load i1, ptr %7, align 1
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 8) #8
  br label %30

30:                                               ; preds = %29, %24
  br label %82

31:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %32

32:                                               ; preds = %77, %31
  %33 = getelementptr inbounds %"class.multiverso::Actor", ptr %10, i32 0, i32 1
  %34 = call noundef ptr @_ZNKSt10unique_ptrIN10multiverso7MtQueueIS_INS0_7MessageESt14default_deleteIS2_EEEES3_IS6_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  %35 = invoke noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE5AliveEv(ptr noundef nonnull align 8 dereferenceable(169) %34)
          to label %36 unwind label %44

36:                                               ; preds = %32
  br i1 %35, label %37, label %78

37:                                               ; preds = %36
  %38 = getelementptr inbounds %"class.multiverso::Actor", ptr %10, i32 0, i32 1
  %39 = call noundef ptr @_ZNKSt10unique_ptrIN10multiverso7MtQueueIS_INS0_7MessageESt14default_deleteIS2_EEEES3_IS6_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #7
  %40 = invoke noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE6TryPopERS5_(ptr noundef nonnull align 8 dereferenceable(169) %39, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %41 unwind label %44

41:                                               ; preds = %37
  br i1 %40, label %42, label %48

42:                                               ; preds = %41
  invoke void @_ZN10multiverso12Communicator14ProcessMessageERSt10unique_ptrINS_7MessageESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(136) %10, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %43 unwind label %44

43:                                               ; preds = %42
  br label %48

44:                                               ; preds = %42, %37, %32
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %5, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %6, align 4
  br label %79

48:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %49 = getelementptr inbounds %"class.multiverso::Communicator", ptr %10, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !32
  %51 = load ptr, ptr %50, align 8, !tbaa !34
  %52 = getelementptr inbounds ptr, ptr %51, i64 9
  %53 = load ptr, ptr %52, align 8
  %54 = invoke noundef i32 %53(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef %8)
          to label %55 unwind label %61

55:                                               ; preds = %48
  %56 = sext i32 %54 to i64
  store i64 %56, ptr %9, align 8, !tbaa !37
  %57 = load i64, ptr %9, align 8, !tbaa !37
  %58 = icmp ugt i64 %57, 0
  br i1 %58, label %59, label %65

59:                                               ; preds = %55
  invoke void @_ZN10multiverso12Communicator12LocalForwardERSt10unique_ptrINS_7MessageESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(136) %10, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %60 unwind label %61

60:                                               ; preds = %59
  br label %65

61:                                               ; preds = %70, %68, %59, %48
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %5, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %79

65:                                               ; preds = %60, %55
  %66 = call noundef ptr @_ZNKSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %67 = icmp eq ptr %66, null
  br i1 %67, label %70, label %68

68:                                               ; preds = %65
  invoke void (ptr, ...) @_ZN10multiverso3Log5FatalEPKcz(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 59)
          to label %69 unwind label %61

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69, %65
  %71 = getelementptr inbounds %"class.multiverso::Communicator", ptr %10, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !32
  %73 = load ptr, ptr %72, align 8, !tbaa !34
  %74 = getelementptr inbounds ptr, ptr %73, i64 8
  %75 = load ptr, ptr %74, align 8
  %76 = invoke noundef i32 %75(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %77 unwind label %61

77:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %32, !llvm.loop !38

78:                                               ; preds = %36
  call void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %81

79:                                               ; preds = %61, %44
  call void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %82

80:                                               ; preds = %1
  call void (ptr, ...) @_ZN10multiverso3Log5FatalEPKcz(ptr noundef @.str.10)
  br label %81

81:                                               ; preds = %80, %78, %21
  ret void

82:                                               ; preds = %79, %30
  %83 = load ptr, ptr %5, align 8
  %84 = load i32, ptr %6, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #4

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

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

declare void @_ZN10multiverso5Actor4MainEv(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #5

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

declare void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE5AliveEv(ptr noundef nonnull align 8 dereferenceable(169)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE6TryPopERS5_(ptr noundef nonnull align 8 dereferenceable(169), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

declare void @_ZN10multiverso3Log5FatalEPKcz(ptr noundef, ...) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 = { nobuiltin 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 #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 = { nobuiltin allocsize(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 = { "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 = { builtin allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { builtin 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, !23, i64 72}
!10 = !{!"_ZTSN10multiverso5ActorE", !11, i64 8, !17, i64 16, !23, i64 72, !24, i64 80, !26, i64 112}
!11 = !{!"_ZTSSt10unique_ptrIN10multiverso7MtQueueIS_INS0_7MessageESt14default_deleteIS2_EEEES3_IS6_EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_dataIN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_ELb1ELb1EE", !13, i64 0}
!13 = !{!"_ZTSSt15__uniq_ptr_implIN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_EE", !14, i64 0}
!14 = !{!"_ZTSSt5tupleIJPN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_EEE", !15, i64 0}
!15 = !{!"_ZTSSt11_Tuple_implILm0EJPN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_EEE", !16, i64 0}
!16 = !{!"_ZTSSt10_Head_baseILm0EPN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEELb0EE", !6, i64 0}
!17 = !{!"_ZTSSt13unordered_mapIiSt8functionIFvRSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS3_EEEESt4hashIiESt8equal_toIiESaISt4pairIKiS9_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_HashtableIiSt4pairIKiSt8functionIFvRSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS5_EEEEESaISC_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENSE_18_Mod_range_hashingENSE_20_Default_ranged_hashENSE_20_Prime_rehash_policyENSE_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !19, i64 8, !20, i64 16, !19, i64 24, !21, i64 32, !6, i64 48}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!21 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !22, i64 0, !19, i64 8}
!22 = !{!"float", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !19, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!26 = !{!"_ZTSSt10unique_ptrISt6threadSt14default_deleteIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_dataISt6threadSt14default_deleteIS0_ELb1ELb1EE", !28, i64 0}
!28 = !{!"_ZTSSt15__uniq_ptr_implISt6threadSt14default_deleteIS0_EE", !29, i64 0}
!29 = !{!"_ZTSSt5tupleIJPSt6threadSt14default_deleteIS0_EEE", !30, i64 0}
!30 = !{!"_ZTSSt11_Tuple_implILm0EJPSt6threadSt14default_deleteIS0_EEE", !31, i64 0}
!31 = !{!"_ZTSSt10_Head_baseILm0EPSt6threadLb0EE", !6, i64 0}
!32 = !{!33, !6, i64 120}
!33 = !{!"_ZTSN10multiverso12CommunicatorE", !10, i64 0, !6, i64 120, !26, i64 128}
!34 = !{!35, !35, i64 0}
!35 = !{!"vtable pointer", !8, i64 0}
!36 = !{!7, !7, i64 0}
!37 = !{!19, !19, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"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"

%"class.std::unique_ptr.20" = type { %"struct.std::__uniq_ptr_data.21" }
%"struct.std::__uniq_ptr_data.21" = type { %"class.std::__uniq_ptr_impl.22" }
%"class.std::__uniq_ptr_impl.22" = type { %"class.std::tuple.23" }
%"class.std::tuple.23" = type { %"struct.std::_Tuple_impl.24" }
%"struct.std::_Tuple_impl.24" = type { %"struct.std::_Head_base.27" }
%"struct.std::_Head_base.27" = type { ptr }

@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

; 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
declare dso_local void @_ZN10multiverso12Communicator14ProcessMessageERSt10unique_ptrINS_7MessageESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10multiverso12Communicator4MainEv(ptr noundef nonnull align 8 dereferenceable(136) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca { i64, i64 }, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::unique_ptr.20", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  store i8 1, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 120
  %7 = load ptr, ptr %6, align 8, !tbaa !31
  %8 = load ptr, ptr %7, align 8, !tbaa !33
  %9 = getelementptr inbounds i8, ptr %8, i64 104
  %10 = load ptr, ptr %9, align 8
  %11 = tail call noundef i32 %10(ptr noundef nonnull align 8 dereferenceable(8) %7)
  switch i32 %11, label %54 [
    i32 1, label %12
    i32 0, label %19
  ]

12:                                               ; preds = %1
  %13 = tail call noalias noundef nonnull dereferenceable(8) ptr @_Znwm(i64 noundef 8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  store i64 ptrtoint (ptr @_ZN10multiverso12Communicator11CommunicateEv to i64), ptr %2, align 8, !tbaa !35
  %.fca.1.gep = getelementptr inbounds i8, ptr %2, i64 8
  store i64 0, ptr %.fca.1.gep, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store ptr %0, ptr %3, align 8, !tbaa !36
  invoke void @_ZNSt6threadC2IMN10multiverso12CommunicatorEFvvEJPS2_EvEEOT_DpOT0_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %14 unwind label %17

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %0, i64 128
  call void @_ZNSt10unique_ptrISt6threadSt14default_deleteIS0_EE5resetEPS0_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @_ZN10multiverso5Actor4MainEv(ptr noundef nonnull align 8 dereferenceable(120) %0)
  %16 = call noundef ptr @_ZNKSt10unique_ptrISt6threadSt14default_deleteIS0_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
  br label %55

17:                                               ; preds = %12
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 8) #8
  br label %56

19:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  br label %21

21:                                               ; preds = %46, %19
  %22 = call noundef ptr @_ZNKSt10unique_ptrIN10multiverso7MtQueueIS_INS0_7MessageESt14default_deleteIS2_EEEES3_IS6_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %23 = invoke noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE5AliveEv(ptr noundef nonnull align 8 dereferenceable(169) %22)
          to label %24 unwind label %30

24:                                               ; preds = %21
  br i1 %23, label %25, label %52

25:                                               ; preds = %24
  %26 = call noundef ptr @_ZNKSt10unique_ptrIN10multiverso7MtQueueIS_INS0_7MessageESt14default_deleteIS2_EEEES3_IS6_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %27 = invoke noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE6TryPopERS5_(ptr noundef nonnull align 8 dereferenceable(169) %26, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %28 unwind label %30

28:                                               ; preds = %25
  br i1 %27, label %29, label %32

29:                                               ; preds = %28
  invoke void @_ZN10multiverso12Communicator14ProcessMessageERSt10unique_ptrINS_7MessageESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(136) %0, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %32 unwind label %30

30:                                               ; preds = %29, %25, %21
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %53

32:                                               ; preds = %29, %28
  %33 = load ptr, ptr %6, align 8, !tbaa !31
  %34 = load ptr, ptr %33, align 8, !tbaa !33
  %35 = getelementptr inbounds i8, ptr %34, i64 72
  %36 = load ptr, ptr %35, align 8
  %37 = invoke noundef i32 %36(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull %4)
          to label %38 unwind label %40

38:                                               ; preds = %32
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %42, label %39

39:                                               ; preds = %38
  invoke void @_ZN10multiverso12Communicator12LocalForwardERSt10unique_ptrINS_7MessageESt14default_deleteIS2_EE(ptr noundef nonnull align 8 dereferenceable(136) %0, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %42 unwind label %40

40:                                               ; preds = %46, %45, %39, %32
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %53

42:                                               ; preds = %39, %38
  %43 = call noundef ptr @_ZNKSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EE3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %44 = icmp eq ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  invoke void (ptr, ...) @_ZN10multiverso3Log5FatalEPKcz(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 59)
          to label %46 unwind label %40

46:                                               ; preds = %45, %42
  %47 = load ptr, ptr %6, align 8, !tbaa !31
  %48 = load ptr, ptr %47, align 8, !tbaa !33
  %49 = getelementptr inbounds i8, ptr %48, i64 64
  %50 = load ptr, ptr %49, align 8
  %51 = invoke noundef i32 %50(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %21 unwind label %40, !llvm.loop !37

52:                                               ; preds = %24
  call void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %55

53:                                               ; preds = %40, %30
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %31, %30 ]
  call void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %56

54:                                               ; preds = %1
  tail call void (ptr, ...) @_ZN10multiverso3Log5FatalEPKcz(ptr noundef nonnull @.str.10)
  br label %55

55:                                               ; preds = %54, %52, %14
  ret void

56:                                               ; preds = %17, %53
  %.pn.pn = phi { ptr, i32 } [ %.pn, %53 ], [ %18, %17 ]
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #4

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

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

declare void @_ZN10multiverso5Actor4MainEv(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #5

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

declare void @_ZNSt6thread4joinEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE5AliveEv(ptr noundef nonnull align 8 dereferenceable(169)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10multiverso7MtQueueISt10unique_ptrINS_7MessageESt14default_deleteIS2_EEE6TryPopERS5_(ptr noundef nonnull align 8 dereferenceable(169), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

declare void @_ZN10multiverso3Log5FatalEPKcz(ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 = { nobuiltin 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 #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 = { nobuiltin allocsize(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 = { "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 = { builtin allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { builtin 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, !22, i64 72}
!6 = !{!"_ZTSN10multiverso5ActorE", !7, i64 8, !16, i64 16, !22, i64 72, !23, i64 80, !25, i64 112}
!7 = !{!"_ZTSSt10unique_ptrIN10multiverso7MtQueueIS_INS0_7MessageESt14default_deleteIS2_EEEES3_IS6_EE", !8, i64 0}
!8 = !{!"_ZTSSt15__uniq_ptr_dataIN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_ELb1ELb1EE", !9, i64 0}
!9 = !{!"_ZTSSt15__uniq_ptr_implIN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_EE", !10, i64 0}
!10 = !{!"_ZTSSt5tupleIJPN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_EEE", !11, i64 0}
!11 = !{!"_ZTSSt11_Tuple_implILm0EJPN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEES4_IS7_EEE", !12, i64 0}
!12 = !{!"_ZTSSt10_Head_baseILm0EPN10multiverso7MtQueueISt10unique_ptrINS0_7MessageESt14default_deleteIS3_EEEELb0EE", !13, i64 0}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C++ TBAA"}
!16 = !{!"_ZTSSt13unordered_mapIiSt8functionIFvRSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS3_EEEESt4hashIiESt8equal_toIiESaISt4pairIKiS9_EEE", !17, i64 0}
!17 = !{!"_ZTSSt10_HashtableIiSt4pairIKiSt8functionIFvRSt10unique_ptrIN10multiverso7MessageESt14default_deleteIS5_EEEEESaISC_ENSt8__detail10_Select1stESt8equal_toIiESt4hashIiENSE_18_Mod_range_hashingENSE_20_Default_ranged_hashENSE_20_Prime_rehash_policyENSE_17_Hashtable_traitsILb0ELb0ELb1EEEE", !13, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !13, i64 48}
!18 = !{!"long", !14, i64 0}
!19 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !13, i64 0}
!20 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !21, i64 0, !18, i64 8}
!21 = !{!"float", !14, i64 0}
!22 = !{!"bool", !14, i64 0}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !18, i64 8, !14, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!25 = !{!"_ZTSSt10unique_ptrISt6threadSt14default_deleteIS0_EE", !26, i64 0}
!26 = !{!"_ZTSSt15__uniq_ptr_dataISt6threadSt14default_deleteIS0_ELb1ELb1EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_implISt6threadSt14default_deleteIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt5tupleIJPSt6threadSt14default_deleteIS0_EEE", !29, i64 0}
!29 = !{!"_ZTSSt11_Tuple_implILm0EJPSt6threadSt14default_deleteIS0_EEE", !30, i64 0}
!30 = !{!"_ZTSSt10_Head_baseILm0EPSt6threadLb0EE", !13, i64 0}
!31 = !{!32, !13, i64 120}
!32 = !{!"_ZTSN10multiverso12CommunicatorE", !6, i64 0, !13, i64 120, !25, i64 128}
!33 = !{!34, !34, i64 0}
!34 = !{!"vtable pointer", !15, i64 0}
!35 = !{!14, !14, i64 0}
!36 = !{!13, !13, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


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