// File: /workspace/github_cpp_makefile_star2_O2/Barath-Kannan[P]SignalsAndSlots/inc/BSignals/details/SignalImpl.hpp
// Function: BSignals::details::SignalImpl<unsigned int>::connectSlotFunction(unsigned int, BSignals::ExecutorScheme, std::function<void (unsigned int)>)
int connectSlotFunction(uint32_t id, BSignals::ExecutorScheme scheme, std::function<void(Args...)> slot){
        std::unique_ptr<Slot<Args...>> slotInstance{nullptr};
        switch(scheme){
            case(BSignals::ExecutorScheme::STRAND):
                slotInstance = std::make_unique<StrandSlot<Args...>>(slot);
                break;
            case(BSignals::ExecutorScheme::THREAD_POOLED):
                if (enableEmissionGuard) slotInstance = std::make_unique<ThreadPooledSlot<Args...>>(slot, [this, id](){return getIsStillConnectedFromExecutor(id);});
                else slotInstance = std::make_unique<ThreadPooledSlot<Args...>>(slot);
                break;
            case(BSignals::ExecutorScheme::ASYNCHRONOUS):
                if (enableEmissionGuard) slotInstance = std::make_unique<AsynchronousSlot<Args...>>(slot, [this, id](){return getIsStillConnectedFromExecutor(id);});
                else slotInstance = std::make_unique<AsynchronousSlot<Args...>>(slot);
                break;
            case(BSignals::ExecutorScheme::DEFERRED_SYNCHRONOUS):
                initializeDeferredQueue();
                slotInstance = std::make_unique<DeferredSlot<Args...>>(slot, deferredQueue, id);
                break;
            case(BSignals::ExecutorScheme::SYNCHRONOUS):
                slotInstance = std::make_unique<SynchronousSlot<Args...>>(slot);
                break;
        }
        slotLock.lock();
        slots.emplace_hint(slots.end(), std::piecewise_construct, std::make_tuple(id),
                    std::make_tuple(std::move(slotInstance)));
        slotLock.unlock();
        return (int)id;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
cmpl $0x4, %edx
ja 0x10e9c
movq %rcx, %r14
movl %edx, %eax
leaq 0x292bd(%rip), %rcx     # 0x3a0c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x11556
jmp 0x10ec3
cmpb $0x1, 0x4(%rbx)
jne 0x10ea1
leaq 0x8(%rsp), %rdx
movq %rbx, (%rdx)
movl %esi, 0x8(%rdx)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x111c7
jmp 0x10ec3
cmpb $0x1, 0x4(%rbx)
jne 0x10eb3
leaq 0x8(%rsp), %rdx
movq %rbx, (%rdx)
movl %esi, 0x8(%rdx)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x112fd
jmp 0x10ec3
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x11158
jmp 0x10ec3
movq %rbx, %rdi
callq 0x1143c
leaq 0x8(%rbx), %rdx
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x114ad
jmp 0x10ec3
xorl %r14d, %r14d
jmp 0x10ec6
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1126f
jmp 0x10ec3
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x113a9
movq (%r15), %r14
leaq 0x18(%rbx), %r15
movq %r15, %rdi
callq 0xcd38
leaq 0x88(%rbx), %rdi
addq $0x90, %rbx
movl 0x4(%rsp), %eax
leaq 0x18(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x8(%rsp), %r8
movq %r14, (%r8)
leaq 0x296dd(%rip), %rdx     # 0x3a5d7
movq %rbx, %rsi
callq 0x1294e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x10f12
movq (%rdi), %rax
callq *0x8(%rax)
movq %r15, %rdi
callq 0xcd8e
movl 0x4(%rsp), %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x10f4b
movq (%rdi), %rax
jmp 0x10f48
movq %rax, %rbx
testq %r14, %r14
je 0x10f4b
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0xba30
nop