// File: lega911[P]ijson/src/server.cpp
// Function: Server::get_queue(ISlice, bool)
QueueLine *Server::get_queue(ISlice key, bool create) {
    u16 n = _mapper.find(key);
    if(n) return _queue_list[n-1];
    if(!create) return NULL;

    LOCK _l(global_lock);
    n = _mapper.find(key);
    if(n) return _queue_list[n-1];

    QueueLine *ql = new QueueLine(threads);
    ql->name.set(key);

    n = 0;
    for(u16 i=0;i<_queue_list.size();i++) {
        if(_queue_list[i] == NULL) {
            _queue_list[i] = ql;
            n = i + 1;
            break;
        }
    }
    if(!n) {
        _queue_list.push_back(ql);
        n = _queue_list.size();
    }
    _mapper.add(key, n);
    return ql;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %cl, %al
movq %rsi, -0x18(%rbp)
movl %edx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rdi
movq %rdi, -0x88(%rbp)
addq $0x200c8, %rdi          # imm = 0x200C8
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rsi
movl -0x30(%rbp), %edx
callq 0x26450
movw %ax, -0x24(%rbp)
cmpw $0x0, -0x24(%rbp)
je 0x2826f
movq -0x88(%rbp), %rdi
addq $0x20110, %rdi          # imm = 0x20110
movzwl -0x24(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x2d040
movq (%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x284ac
testb $0x1, -0x21(%rbp)
jne 0x28282
movq $0x0, -0x8(%rbp)
jmp 0x284ac
movq -0x88(%rbp), %rsi
addq $0x20058, %rsi          # imm = 0x20058
leaq -0x40(%rbp), %rdi
callq 0x1f5d0
movq -0x88(%rbp), %rdi
addq $0x200c8, %rdi          # imm = 0x200C8
movups -0x18(%rbp), %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0x50(%rbp), %rsi
movl -0x48(%rbp), %edx
callq 0x26450
movw %ax, -0x8a(%rbp)
jmp 0x282c4
movw -0x8a(%rbp), %ax
movw %ax, -0x24(%rbp)
cmpw $0x0, -0x24(%rbp)
je 0x28317
movq -0x88(%rbp), %rdi
addq $0x20110, %rdi          # imm = 0x20110
movzwl -0x24(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x2d040
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x60(%rbp)
jmp 0x28496
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x284a1
movl $0x88, %edi
callq 0x27250
movq %rax, -0x98(%rbp)
jmp 0x2832a
movq -0x98(%rbp), %rdi
movq -0x88(%rbp), %rax
movl 0x28(%rax), %esi
callq 0x2d060
jmp 0x28342
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1ed20
jmp 0x2835c
movw $0x0, -0x24(%rbp)
movw $0x0, -0x6a(%rbp)
movq -0x88(%rbp), %rdi
movzwl -0x6a(%rbp), %eax
movq %rax, -0xa0(%rbp)
addq $0x20110, %rdi          # imm = 0x20110
callq 0x218a0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
cmpq %rcx, %rax
jae 0x28428
movq -0x88(%rbp), %rdi
addq $0x20110, %rdi          # imm = 0x20110
movzwl -0x6a(%rbp), %eax
movl %eax, %esi
callq 0x2d040
cmpq $0x0, (%rax)
jne 0x28415
movq -0x88(%rbp), %rdi
movq -0x68(%rbp), %rax
movq %rax, -0xa8(%rbp)
addq $0x20110, %rdi          # imm = 0x20110
movzwl -0x6a(%rbp), %eax
movl %eax, %esi
callq 0x2d040
movq -0xa8(%rbp), %rcx
movq %rcx, (%rax)
movzwl -0x6a(%rbp), %eax
addl $0x1, %eax
movw %ax, -0x24(%rbp)
jmp 0x28428
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x88, %esi
callq 0x19300
jmp 0x284a1
jmp 0x28417
movw -0x6a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x6a(%rbp)
jmp 0x28368
cmpw $0x0, -0x24(%rbp)
jne 0x2845f
movq -0x88(%rbp), %rdi
addq $0x20110, %rdi          # imm = 0x20110
leaq -0x68(%rbp), %rsi
callq 0x1f8d0
jmp 0x28448
movq -0x88(%rbp), %rdi
addq $0x20110, %rdi          # imm = 0x20110
callq 0x218a0
movw %ax, -0x24(%rbp)
movq -0x88(%rbp), %rdi
addq $0x200c8, %rdi          # imm = 0x200C8
movups -0x18(%rbp), %xmm0
movaps %xmm0, -0x80(%rbp)
movzwl -0x24(%rbp), %ecx
movq -0x80(%rbp), %rsi
movl -0x78(%rbp), %edx
callq 0x26220
jmp 0x28487
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1f880
jmp 0x284ac
leaq -0x40(%rbp), %rdi
callq 0x1f880
jmp 0x284b9
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x194a0
nopw %cs:(%rax,%rax)