// File: lega911[P]ijson/src/server.cpp
// Function: Server::delete_queue(ISlice)
void Server::delete_queue(ISlice key) {
    LOCK _l(global_lock);
    int n = _mapper.del(key);
    if(!n) return;
    auto *ql = _queue_list[n-1];
    _queue_list[n-1] = NULL;

    GC gc;
    Message *msg = NULL;
    ql->mutex.lock();
    for(int index=0;index<this->threads;index++) {
        auto q = &ql->queue[index];
        for(auto const &msg : q->clients) {
            gc.add(msg, GC::Message);
            if(!msg->conn) continue;
            if(!msg->conn->is_closed()) msg->conn->send.status("400 Closed")->done(-1);
        }
        for(auto const &worker : q->workers) {
            worker->unlink();
            if(!worker->is_closed()) worker->send.status("400 Closed")->done(-1);
        }
    }
    delete ql;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rsi, -0x10(%rbp)
movl %edx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq %rsi, -0x138(%rbp)
addq $0x20058, %rsi          # imm = 0x20058
leaq -0x20(%rbp), %rdi
callq 0x1f5d0
movq -0x138(%rbp), %rdi
addq $0x200c8, %rdi          # imm = 0x200C8
movups -0x10(%rbp), %xmm0
movaps %xmm0, -0x40(%rbp)
movq -0x40(%rbp), %rsi
movl -0x38(%rbp), %edx
callq 0x26580
movw %ax, -0x12a(%rbp)
jmp 0x2852c
movw -0x12a(%rbp), %ax
movzwl %ax, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x2855c
movl $0x1, -0x50(%rbp)
jmp 0x2884d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2885f
movq -0x138(%rbp), %rdi
addq $0x20110, %rdi          # imm = 0x20110
movq %rdi, -0x140(%rbp)
movl -0x24(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2d040
movq -0x140(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x24(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x2d040
movq $0x0, (%rax)
leaq -0x70(%rbp), %rdi
callq 0x2d200
jmp 0x285ab
movq $0x0, -0x78(%rbp)
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x1fa50
jmp 0x285c2
movl $0x0, -0x7c(%rbp)
movq -0x138(%rbp), %rcx
movl -0x7c(%rbp), %eax
cmpl 0x28(%rcx), %eax
jge 0x2880f
movq -0x58(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x7c(%rbp), %rcx
imulq $0xa0, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x2d220
movq -0x90(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x2d250
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x2d280
testb $0x1, %al
jne 0x2864d
jmp 0x2871d
leaq -0xb0(%rbp), %rdi
callq 0x2d2b0
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq (%rax), %rsi
leaq -0x70(%rbp), %rdi
movl $0x1, %edx
callq 0x36ce0
jmp 0x2867a
movq -0xd8(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x18(%rax)
jne 0x286a7
jmp 0x2870c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x1e970
jmp 0x2885f
movq -0xd8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
callq 0x1fcc0
movb %al, -0x141(%rbp)
jmp 0x286c2
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0x2870a
jmp 0x286ce
movq -0xd8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
addq $0x18, %rdi
leaq 0x10ca2(%rip), %rsi     # 0x39389
callq 0x1b6d0
movq %rax, -0x150(%rbp)
jmp 0x286f5
movq -0x150(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1b770
jmp 0x28708
jmp 0x2870a
jmp 0x2870c
leaq -0xb0(%rbp), %rdi
callq 0x2d2d0
jmp 0x28631
movq -0x88(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x1f6c0
movq -0xe0(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x1f6f0
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x1f720
testb $0x1, %al
jne 0x2876d
jmp 0x287ff
leaq -0x100(%rbp), %rdi
callq 0x1f750
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq (%rax), %rdi
callq 0x19950
jmp 0x28791
movq -0x128(%rbp), %rax
movq (%rax), %rdi
callq 0x1fcc0
movb %al, -0x151(%rbp)
jmp 0x287a8
movb -0x151(%rbp), %al
testb $0x1, %al
jne 0x287ec
jmp 0x287b4
movq -0x128(%rbp), %rax
movq (%rax), %rdi
addq $0x18, %rdi
leaq 0x10bc0(%rip), %rsi     # 0x39389
callq 0x1b6d0
movq %rax, -0x160(%rbp)
jmp 0x287d7
movq -0x160(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1b770
jmp 0x287ea
jmp 0x287ec
jmp 0x287ee
leaq -0x100(%rbp), %rdi
callq 0x1f7a0
jmp 0x28751
jmp 0x28801
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x285c9
movq -0x58(%rbp), %rax
movq %rax, -0x168(%rbp)
cmpq $0x0, %rax
je 0x2883d
movq -0x168(%rbp), %rdi
callq 0x2d320
movq -0x168(%rbp), %rdi
movl $0x88, %esi
callq 0x19300
leaq -0x70(%rbp), %rdi
callq 0x1e970
movl $0x0, -0x50(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1f880
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x1f880
movq -0x48(%rbp), %rdi
callq 0x194a0
nopw %cs:(%rax,%rax)