// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
cmpl $0x4, %edx
ja 0x12c77
movq %rcx, %r15
movl %edx, %eax
leaq 0x36547(%rip), %rcx     # 0x490b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x30, %edi
callq 0xb4e0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x12a3a
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x14934
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12ca1
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12ca1
cmpb $0x1, 0x4(%rbx)
jne 0x12c7c
leaq 0x10(%rsp), %rdx
movq %rbx, (%rdx)
movl %esi, 0x8(%rdx)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x12fc5
jmp 0x12c9e
cmpb $0x1, 0x4(%rbx)
jne 0x12c8e
leaq 0x10(%rsp), %rdx
movq %rbx, (%rdx)
movl %esi, 0x8(%rdx)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x13197
jmp 0x12c9e
movl $0x240, %edi            # imm = 0x240
callq 0xb4e0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x12a3a
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x13466
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12ca1
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12ca1
cmpq $0x0, 0x8(%rbx)
je 0x12d05
leaq 0x8(%rbx), %rdx
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x13369
jmp 0x12c9e
xorl %r14d, %r14d
jmp 0x12ca1
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x130bb
jmp 0x12c9e
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x1328d
movq (%r14), %r14
leaq 0x18(%rbx), %r15
movq %r15, %rdi
callq 0xd7dc
leaq 0x88(%rbx), %rdi
addq $0x90, %rbx
movl 0xc(%rsp), %eax
leaq 0x30(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x10(%rsp), %r8
movq %r14, (%r8)
leaq 0x3691c(%rip), %rdx     # 0x495f1
movq %rbx, %rsi
callq 0x14a5a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12ced
movq (%rdi), %rax
callq *0x8(%rax)
movq %r15, %rdi
callq 0xd83c
movl 0xc(%rsp), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x400, %edi            # imm = 0x400
callq 0xb4e0
movq %rax, %r14
movq %rax, %rdi
callq 0x141b6
leaq 0x18(%rsp), %r12
movq %r14, -0x8(%r12)
movq %r12, %rdi
movq %r14, %rsi
callq 0x142c2
movaps -0x8(%r12), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%r12)
movq 0x10(%rbx), %rdi
movups %xmm0, 0x8(%rbx)
testq %rdi, %rdi
je 0x12c5c
callq 0x14544
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12c5c
callq 0x14544
jmp 0x12c5c
movq %rax, %rbx
movl $0x400, %esi            # imm = 0x400
jmp 0x12dd2
jmp 0x12db8
jmp 0x12db8
movq %rax, %rbx
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12dcd
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12dcd
jmp 0x12db8
movq %rax, %rbx
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12dc3
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12dc3
movq %rax, %rdi
callq 0xd7cf
movq %rax, %rbx
movl $0x30, %esi
jmp 0x12dd2
movq %rax, %rbx
movl $0x240, %esi            # imm = 0x240
movq %r14, %rdi
callq 0xb510
jmp 0x12dff
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12dff
movq (%rdi), %rax
jmp 0x12dfc
movq %rax, %rbx
testq %r14, %r14
je 0x12dff
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0xba10
nop