// File: /workspace/github_cpp_makefile_star2_O1/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 0x12e97
movq %rcx, %r15
movl %edx, %eax
leaq 0x3637d(%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 0x12bf6
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x14bb2
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12ebd
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12ebd
cmpb $0x1, 0x4(%rbx)
jne 0x12e9c
leaq 0x10(%rsp), %rdx
movq %rbx, (%rdx)
movl %esi, 0x8(%rdx)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x13199
jmp 0x12dcb
cmpb $0x1, 0x4(%rbx)
jne 0x12eab
leaq 0x10(%rsp), %rdx
movq %rbx, (%rdx)
movl %esi, 0x8(%rdx)
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x13372
movq 0x30(%rsp), %r14
jmp 0x12ebd
movl $0x240, %edi            # imm = 0x240
callq 0xb4e0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x12bf6
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x13648
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12ebd
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12ebd
cmpq $0x0, 0x8(%rbx)
jne 0x12e7f
xorl %r14d, %r14d
movl $0x400, %edi            # imm = 0x400
callq 0xb4e0
movq %rax, %r12
movq %rax, %rdi
callq 0x1440e
leaq 0x18(%rsp), %rdi
movq %r12, -0x8(%rdi)
xorl %r14d, %r14d
movq %r12, %rsi
callq 0x1451a
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x10(%rbx), %rdi
movups %xmm0, 0x8(%rbx)
testq %rdi, %rdi
je 0x12e70
callq 0x147ae
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x12e7f
callq 0x147ae
leaq 0x8(%rbx), %rdx
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rcx
movq %r15, %rsi
callq 0x1354b
jmp 0x12eb8
xorl %r14d, %r14d
jmp 0x12ebd
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x13296
jmp 0x12eb8
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x1346f
movq 0x10(%rsp), %r14
leaq 0x18(%rbx), %r15
movq %r15, %rdi
callq 0xd82c
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 0x36700(%rip), %rdx     # 0x495f1
movq %rbx, %rsi
callq 0x14cd8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12f09
movq (%rdi), %rax
callq *0x8(%rax)
xorl %r14d, %r14d
movq %r15, %rdi
callq 0xd88c
movl 0xc(%rsp), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x400, %esi            # imm = 0x400
movq %r12, %rdi
jmp 0x12f9a
jmp 0x12fa3
jmp 0x12fa3
jmp 0x12fa3
jmp 0x12fa3
jmp 0x12f7b
jmp 0x12f7b
movq %rax, %rbx
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12f92
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12f92
jmp 0x12f7b
movq %rax, %rbx
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x12f88
leaq 0x10(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x12f88
movq %rax, %rdi
callq 0xd81f
jmp 0x12fa3
movq %rax, %rbx
movl $0x240, %esi            # imm = 0x240
jmp 0x12f97
movq %rax, %rbx
movl $0x30, %esi
movq %r14, %rdi
callq 0xb510
jmp 0x12fbb
jmp 0x12fa3
movq %rax, %rbx
jmp 0x12fbb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12fbb
movq (%rdi), %rax
callq *0x8(%rax)
xorl %r14d, %r14d
jmp 0x12fc3
movq %rax, %rbx
testq %r14, %r14
je 0x12fd1
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0xba10
nop