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

; 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.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 } }
%"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::NativeContextGroup" = type { ptr, ptr, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN6System10Dispatcher11pushContextEPNS_13NativeContextE = external hidden unnamed_addr constant [54 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6System10Dispatcher11pushContextEPNS_13NativeContextE(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = icmp ne ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %2
  br label %11

9:                                                ; preds = %2
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.5, i32 noundef 261, ptr noundef @__PRETTY_FUNCTION__._ZN6System10Dispatcher11pushContextEPNS_13NativeContextE) #2
  unreachable

10:                                               ; No predecessors!
  br label %11

11:                                               ; preds = %10, %8
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.System::NativeContext", ptr %12, i32 0, i32 3
  %14 = load i8, ptr %13, align 1, !tbaa !9, !range !14, !noundef !15
  %15 = trunc i8 %14 to i1
  br i1 %15, label %16, label %17

16:                                               ; preds = %11
  br label %43

17:                                               ; preds = %11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.System::NativeContext", ptr %18, i32 0, i32 4
  store ptr null, ptr %19, align 8, !tbaa !16
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.System::NativeContext", ptr %20, i32 0, i32 3
  store i8 1, ptr %21, align 1, !tbaa !9
  %22 = getelementptr inbounds %"class.System::Dispatcher", ptr %5, i32 0, i32 10
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %37

25:                                               ; preds = %17
  %26 = getelementptr inbounds %"class.System::Dispatcher", ptr %5, i32 0, i32 11
  %27 = load ptr, ptr %26, align 8, !tbaa !35
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %32

30:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.5, i32 noundef 267, ptr noundef @__PRETTY_FUNCTION__._ZN6System10Dispatcher11pushContextEPNS_13NativeContextE) #2
  unreachable

31:                                               ; No predecessors!
  br label %32

32:                                               ; preds = %31, %29
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.System::Dispatcher", ptr %5, i32 0, i32 11
  %35 = load ptr, ptr %34, align 8, !tbaa !35
  %36 = getelementptr inbounds %"struct.System::NativeContext", ptr %35, i32 0, i32 4
  store ptr %33, ptr %36, align 8, !tbaa !16
  br label %40

37:                                               ; preds = %17
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.System::Dispatcher", ptr %5, i32 0, i32 10
  store ptr %38, ptr %39, align 8, !tbaa !17
  br label %40

40:                                               ; preds = %37, %32
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.System::Dispatcher", ptr %5, i32 0, i32 11
  store ptr %41, ptr %42, align 8, !tbaa !35
  br label %43

43:                                               ; preds = %40, %16
  ret void
}

attributes #0 = { 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 #1 = { 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 = { noreturn 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, !11, i64 17}
!10 = !{!"_ZTSN6System13NativeContextE", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 17, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 88}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSSt8functionIFvvEE", !13, i64 0, !6, i64 24}
!13 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!10, !6, i64 24}
!17 = !{!18, !6, i64 392}
!18 = !{!"_ZTSN6System10DispatcherE", !19, i64 0, !7, i64 8, !19, i64 48, !20, i64 56, !21, i64 72, !28, i64 152, !10, i64 232, !34, i64 352, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !26, i64 416}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTSN6System11ContextPairE", !6, i64 0, !6, i64 8}
!21 = !{!"_ZTSSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE", !22, i64 0}
!22 = !{!"_ZTSSt5dequeISt8functionIFvvEESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseISt8functionIFvvEESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !26, i64 8, !27, i64 16, !27, i64 48}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSSt15_Deque_iteratorISt8functionIFvvEERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTSSt5stackIiSt5dequeIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSSt5dequeIiSaIiEE", !30, i64 0}
!30 = !{!"_ZTSSt11_Deque_baseIiSaIiEE", !31, i64 0}
!31 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE11_Deque_implE", !32, i64 0}
!32 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE16_Deque_impl_dataE", !6, i64 0, !26, i64 8, !33, i64 16, !33, i64 48}
!33 = !{!"_ZTSSt15_Deque_iteratorIiRiPiE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_ZTSN6System18NativeContextGroupE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!35 = !{!18, !6, i64 400}


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

@.str.5 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN6System10Dispatcher11pushContextEPNS_13NativeContextE = external hidden unnamed_addr constant [54 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6System10Dispatcher11pushContextEPNS_13NativeContextE(ptr nocapture noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.5, i32 noundef 261, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6System10Dispatcher11pushContextEPNS_13NativeContextE) #2
  unreachable

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 17
  %6 = load i8, ptr %5, align 1, !tbaa !5, !range !13, !noundef !14
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %20, label %8

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr null, ptr %9, align 8, !tbaa !15
  store i8 1, ptr %5, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 392
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  %.not9 = icmp eq ptr %11, null
  br i1 %.not9, label %18, label %12

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 400
  %14 = load ptr, ptr %13, align 8, !tbaa !34
  %.not10 = icmp eq ptr %14, null
  br i1 %.not10, label %15, label %16

15:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.5, i32 noundef 267, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6System10Dispatcher11pushContextEPNS_13NativeContextE) #2
  unreachable

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %14, i64 24
  br label %18

18:                                               ; preds = %8, %16
  %.sink = phi ptr [ %17, %16 ], [ %10, %8 ]
  store ptr %1, ptr %.sink, align 8, !tbaa !35
  %19 = getelementptr inbounds i8, ptr %0, i64 400
  store ptr %1, ptr %19, align 8, !tbaa !34
  br label %20

20:                                               ; preds = %4, %18
  ret void
}

attributes #0 = { 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 #1 = { 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 = { noreturn 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, !10, i64 17}
!6 = !{!"_ZTSN6System13NativeContextE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 17, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !11, i64 56, !11, i64 88}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSSt8functionIFvvEE", !12, i64 0, !7, i64 24}
!12 = !{!"_ZTSSt14_Function_base", !8, i64 0, !7, i64 16}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !7, i64 24}
!16 = !{!17, !7, i64 392}
!17 = !{!"_ZTSN6System10DispatcherE", !18, i64 0, !8, i64 8, !18, i64 48, !19, i64 56, !20, i64 72, !27, i64 152, !6, i64 232, !33, i64 352, !7, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !25, i64 416}
!18 = !{!"int", !8, i64 0}
!19 = !{!"_ZTSN6System11ContextPairE", !7, i64 0, !7, i64 8}
!20 = !{!"_ZTSSt5queueISt8functionIFvvEESt5dequeIS2_SaIS2_EEE", !21, i64 0}
!21 = !{!"_ZTSSt5dequeISt8functionIFvvEESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt11_Deque_baseISt8functionIFvvEESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE11_Deque_implE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseISt8functionIFvvEESaIS2_EE16_Deque_impl_dataE", !7, i64 0, !25, i64 8, !26, i64 16, !26, i64 48}
!25 = !{!"long", !8, i64 0}
!26 = !{!"_ZTSSt15_Deque_iteratorISt8functionIFvvEERS2_PS2_E", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!27 = !{!"_ZTSSt5stackIiSt5dequeIiSaIiEEE", !28, i64 0}
!28 = !{!"_ZTSSt5dequeIiSaIiEE", !29, i64 0}
!29 = !{!"_ZTSSt11_Deque_baseIiSaIiEE", !30, i64 0}
!30 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE11_Deque_implE", !31, i64 0}
!31 = !{!"_ZTSNSt11_Deque_baseIiSaIiEE16_Deque_impl_dataE", !7, i64 0, !25, i64 8, !32, i64 16, !32, i64 48}
!32 = !{!"_ZTSSt15_Deque_iteratorIiRiPiE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!33 = !{!"_ZTSN6System18NativeContextGroupE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!34 = !{!17, !7, i64 400}
!35 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass