// File: /workspace/github_cpp_makefile_star2_O1/lega911[P]ijson/src/server.cpp
// Function: Loop::_add_worker(Slice, Connect*)
int Loop::_add_worker(Slice name, Connect *worker) {
    if(!name.empty() && name.ptr()[0] == '/') name.remove(1);
    QueueLine *ql = server->get_queue(name, true);
    Queue *q;

    if(worker->info) {
        try {
            ql->info.set(worker->info);
            json::unescape(ql->info);
        } catch (Exception &e) {
            ql->info.clear();
        };
    }

    if(!worker->connection_id) generate_id(worker->connection_id);

    if(!worker->worker_mode && worker->worker_item && worker->worker_sub_name.compare(name)) {
        worker->worker_item->pop();

        GC gc;
        for(auto const &it : worker->direct_message) {
            gc.add(it, GC::DirectMessage);
        }
        worker->direct_message.clear();
    }

    if(!worker->direct_message.empty()) {
        worker->write_mode(true);
        return 1;
    }

    Message *msg = NULL;
    GC gc;
    int result;

    ql->last_worker = get_time_sec();
    std::string sid;

    ql->mutex.lock();
    int rloop = _nloop;
    for(int index=-1;index<server->threads;index++) {
        if(index == _nloop) continue;
        if(index >= 0) rloop = index;
        q = &ql->queue[rloop];

        auto it=q->clients.begin();
        while (it != q->clients.end()) {
            msg = *it;

            if(msg->required_worker) {
                if(msg->required_worker != worker->connection_id) {
                    msg = NULL;
                    it++;
                    continue;
                }
            }
            it = q->clients.erase(it);
            gc.add(msg, GC::Message);

            if(!msg->conn) break;
            Connect *client = msg->conn;
            if(client->is_closed()) {
                if(server->log & 8) std::cout << ltime() << "closed client " << msg->conn << std::endl;
                msg = NULL;
                continue;
            }

            bool skip = true;
            if(client->status == Status::client_wait_result) {
                client->mutex.lock();
                if(client->status == Status::client_wait_result) {
                    client->status = Status::busy;
                    skip = false;
                }
                client->mutex.unlock();
            }

            if(skip) {
                if(server->log & 8) std::cout << ltime() << "client is busy!!! " << client << std::endl;
                msg = NULL;
                continue;
            }

            if(worker->noid) break;
            Slice id = client->id;
            if(id.empty()) {
                try {
                    while(client->json.scan()) {
                        if(client->json.key == "id") {
                            id = client->json.value;
                            client->id.set(id);
                            break;
                        }
                    }
                } catch (const error::InvalidData &e) {
                    client->send.status("400 No Id")->done(-1);
                    if(server->log & 4) std::cout << ltime() << "400 no id " << name.as_string() << std::endl;
                    msg = NULL;
                    continue;
                }
                if(id.empty()) {
                    generate_id(client->id);
                    id = client->id;
                };
            }
            sid = id.as_string();

            server->wait_lock.lock();
            bool busy = server->wait_response.find(sid) != server->wait_response.end();
            server->wait_lock.unlock();
            if(busy) {
                // colision id
                if(server->log & 2) std::cout << ltime() << "collision id\n";
                client->send.status("400 Collision Id")->done(-1);
                client->status = Status::net;
                msg = NULL;
                continue;
            }
            break;
        }
        if(msg) break;
    }

    if(msg) {
        if(!msg->conn) {
            if(worker->worker_mode) worker->status = Status::worker_mode_async;
            else worker->status = Status::net;
            worker->send.status("200 OK")->header("Name", msg->name)->header("Async", Slice("true"))->done(*msg->buf);
        } else {
            auto client = msg->conn;
            if(worker->fail_on_disconnect) {
                worker->client = client;
                worker->client->link();
            }
            if(worker->noid) {
                worker->status = Status::worker_wait_result;
                worker->send.status("200 OK")->header("Name", client->name)->done(client->body);
            } else {
                worker->send.status("200 OK")->header("Id", client->id)->header("Name", client->name)->done(client->body);
                server->wait_lock.lock();
                server->wait_response[sid] = client;
                server->wait_lock.unlock();
                client->link();
                worker->status = Status::net;
            }
            result = 1;
        }
        if(server->log & 32) worker->start_time = get_time();
    } else {
        Queue *q0 = &ql->queue[_nloop];
        if(q0->workers.size()) {
            auto it=q0->workers.begin();
            while (it != q0->workers.end()) {
                Connect *conn = *it;
                if(conn->is_closed() || conn == worker) {
                    it = q0->workers.erase(it);
                    conn->unlink();
                } else {
                    it++;
                }
            }
        }

        q0->workers.push_back(worker);
        worker->link();
        worker->status = Status::worker_wait_job;
        result = 0;
    }

    if(!worker->worker_item) {
        if(worker->worker_mode || worker->noid || worker->status == Status::worker_wait_job) worker->worker_item = ql->workers.push(worker);
        if(!worker->worker_mode && worker->noid) worker->worker_sub_name.set(name);
    }

    ql->mutex.unlock();

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r14
movq %rsi, -0x78(%rbp)
movl %edx, -0x70(%rbp)
movq %rcx, -0x30(%rbp)
testl %edx, %edx
je 0x11f01
cmpb $0x2f, (%rsi)
jne 0x11f01
testl %edx, %edx
movl $0x1, %eax
cmovlel %edx, %eax
cltq
addq %rax, %rsi
movq %rsi, -0x78(%rbp)
subl %eax, %edx
movl %edx, -0x70(%rbp)
movq 0x18(%r14), %rdi
movq -0x78(%rbp), %rsi
movl -0x70(%rbp), %edx
movl $0x1, %ecx
callq 0xfa1c
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movl 0x170(%rax), %edx
testl %edx, %edx
movq %r14, -0x38(%rbp)
je 0x11f54
movq -0x68(%rbp), %rcx
leaq 0x48(%rcx), %rbx
movq 0x168(%rax), %rsi
movl $0x0, 0x50(%rcx)
movq %rbx, %rdi
callq 0xc0a8
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd3d8
movq -0x30(%rbp), %rdi
cmpl $0x0, 0x108(%rdi)
jne 0x11f6d
addq $0x100, %rdi            # imm = 0x100
callq 0x168a1
movq -0x30(%rbp), %rdx
cmpb $0x0, 0xf3(%rdx)
jne 0x1205b
movq 0x178(%rdx), %rdi
testq %rdi, %rdi
je 0x1205b
movslq 0x188(%rdx), %rax
testq %rax, %rax
jle 0x11fca
movl -0x70(%rbp), %ecx
movq 0x180(%rdx), %rdx
movq -0x78(%rbp), %rsi
xorl %r8d, %r8d
testl %ecx, %ecx
cmovlel %r8d, %ecx
cmpq %r8, %rcx
je 0x11fd5
movb (%rdx,%r8), %r9b
cmpb (%rsi,%r8), %r9b
jne 0x11fd5
incq %r8
cmpq %r8, %rax
jne 0x11fb1
jmp 0x11fcc
xorl %eax, %eax
cmpl -0x70(%rbp), %eax
jge 0x1205b
callq 0x16bbc
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq 0x1a0(%rax), %r15
movq 0x1c0(%rax), %r14
cmpq %r14, %r15
je 0x12040
movq 0x1b0(%rax), %r13
movq 0x1b8(%rax), %r12
leaq -0x60(%rbp), %rbx
movq (%r15), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x168de
addq $0x8, %r15
cmpq %r13, %r15
jne 0x1203b
movq 0x8(%r12), %r15
addq $0x8, %r12
leaq 0x200(%r15), %r13
cmpq %r14, %r15
jne 0x12012
movl $0x190, %edi            # imm = 0x190
addq -0x30(%rbp), %rdi
callq 0x13576
leaq -0x60(%rbp), %rdi
callq 0xc13a
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %rdi
movq 0x1c0(%rdi), %rax
cmpq 0x1a0(%rdi), %rax
je 0x12083
movl $0x1, %ebx
movl $0x1, %esi
callq 0x8a20
jmp 0x12ac2
xorps %xmm0, %xmm0
movaps %xmm0, -0x100(%rbp)
movq $0x0, -0xf0(%rbp)
callq 0x16511
movl %eax, %eax
movq -0x68(%rbp), %rcx
movq %rax, 0x10(%rcx)
leaq -0xd0(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x18(%rcx), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x83f0
testl %eax, %eax
jne 0x12ae4
movq 0x18(%r14), %rax
xorl %r12d, %r12d
cmpl $0x0, 0x28(%rax)
js 0x12749
movl 0x4(%r14), %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %edx
je 0x1273a
testl %edx, %edx
movl %edx, -0xb4(%rbp)
cmovnsl %edx, %ecx
movq -0x68(%rbp), %rax
movq 0x40(%rax), %rax
movl %ecx, -0xb8(%rbp)
movslq %ecx, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x5, %rcx
movq 0x60(%rax,%rcx), %r15
cmpq 0x80(%rax,%rcx), %r15
leaq -0xa8(%rbp), %r14
je 0x12725
addq %rcx, %rax
addq $0x50, %rax
movq 0x20(%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq %rax, -0xc0(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x88(%rbp)
movq (%r15), %r12
cmpl $0x0, 0x10(%r12)
je 0x121b9
leaq 0x8(%r12), %rdi
movq -0x30(%rbp), %rsi
movl $0x100, %eax            # imm = 0x100
addq %rax, %rsi
callq 0xca80
testl %eax, %eax
je 0x121b9
addq $0x8, %r15
cmpq -0xb0(%rbp), %r15
jne 0x121b1
movq -0x88(%rbp), %rax
movq 0x8(%rax), %r15
addq $0x8, %rax
movq %rax, -0x88(%rbp)
leaq 0x200(%r15), %rax
movq %rax, -0xb0(%rbp)
xorl %r12d, %r12d
jmp 0x125de
movq %r15, -0x60(%rbp)
movq -0x88(%rbp), %rcx
movq (%rcx), %rax
movq %rax, -0x58(%rbp)
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
movq %r14, %rdi
movq -0xc0(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x13d46
movq -0xa8(%rbp), %r15
movq -0x98(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x100(%rbp), %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x168de
movq 0x18(%r12), %r13
testq %r13, %r13
je 0x12725
cmpl $-0x1, (%r13)
je 0x12290
cmpl $0x4, 0xcc(%r13)
jne 0x122dd
leaq 0x50(%r13), %rbx
movq %rbx, %rdi
callq 0x83f0
testl %eax, %eax
jne 0x12ad6
cmpl $0x4, 0xcc(%r13)
jne 0x122d5
movl $0x5, 0xcc(%r13)
movq %rbx, %rdi
callq 0x8240
movq -0x30(%rbp), %rax
cmpb $0x0, 0xf1(%rax)
je 0x1238f
xorl %r13d, %r13d
jmp 0x125d5
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movb $0x1, %r13b
testb $0x8, 0x20(%rax)
je 0x125d2
callq 0x16531
movq %rax, %rbx
testq %rax, %rax
je 0x12561
movq %rbx, %rdi
callq 0x8130
movq 0xbd0b(%rip), %rdi      # 0x1dfd0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8350
jmp 0x1257f
movq %rbx, %rdi
callq 0x8240
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
testb $0x8, 0x20(%rax)
je 0x12387
callq 0x16531
movq %rax, %rbx
testq %rax, %rax
je 0x12318
movq %rbx, %rdi
callq 0x8130
movq 0xbcc5(%rip), %rdi      # 0x1dfd0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8350
jmp 0x12336
movq 0xbcb1(%rip), %rcx      # 0x1dfd0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x8470
movl $0x12, %edx
movq 0xbc8e(%rip), %rdi      # 0x1dfd0
leaq 0x6214(%rip), %rsi      # 0x1855d
callq 0x8350
movq 0xbc7b(%rip), %rdi      # 0x1dfd0
movq %r13, %rsi
callq 0x8250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x82f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x81f0
movb $0x1, %r13b
jmp 0x125d2
movq $0x0, -0xa8(%rbp)
movl $0x0, -0xa0(%rbp)
movq 0xe0(%r13), %rax
movl 0xe8(%r13), %ecx
movq %rax, -0xa8(%rbp)
movl %ecx, -0xa0(%rbp)
testl %ecx, %ecx
jne 0x12483
leaq 0xe0(%r13), %rax
movq %rax, -0x80(%rbp)
leaq 0x128(%r13), %rbx
movq %rbx, %rdi
callq 0xd606
testb %al, %al
je 0x12456
movl 0x130(%r13), %eax
movq 0x128(%r13), %rcx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
movb $0x69, %dil
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x123d9
cmpb (%rcx,%rsi), %dil
jne 0x123d9
leaq 0x4f38(%rip), %rdi      # 0x1734c
movb 0x1(%rsi,%rdi), %dil
incq %rsi
cmpq $0x2, %rsi
jne 0x12402
cmpl $0x2, %eax
jne 0x123d9
movq 0x138(%r13), %rsi
movq %rsi, -0xa8(%rbp)
movl 0x140(%r13), %edx
movl %edx, -0xa0(%rbp)
movl $0x0, 0xe8(%r13)
movq -0x80(%rbp), %rdi
callq 0xc0a8
cmpl $0x0, -0xa0(%rbp)
jne 0x12483
movq -0x80(%rbp), %rdi
callq 0x168a1
movq 0xe0(%r13), %rax
movl 0xe8(%r13), %ecx
movq %rax, -0xa8(%rbp)
movl %ecx, -0xa0(%rbp)
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xc468
leaq -0xe0(%rbp), %rdi
movq %rbx, %rsi
callq 0x8390
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x124bf
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x8320
movq -0x38(%rbp), %r14
movq 0x18(%r14), %rdi
movl $0x20158, %eax          # imm = 0x20158
addq %rax, %rdi
callq 0x83f0
testl %eax, %eax
jne 0x12add
movq 0x18(%r14), %rdi
movl $0x20128, %eax          # imm = 0x20128
addq %rax, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x14586
movq %rax, %rbx
movq 0x18(%r14), %rdi
leaq 0x20130(%rdi), %rax
movq %rax, -0x80(%rbp)
addq $0x20158, %rdi          # imm = 0x20158
callq 0x8240
cmpq -0x80(%rbp), %rbx
je 0x125f4
movq 0x18(%r14), %rax
testb $0x2, 0x20(%rax)
leaq -0xa8(%rbp), %r14
je 0x12636
callq 0x16531
movq %rax, %rbx
testq %rax, %rax
je 0x12600
movq %rbx, %rdi
callq 0x8130
movq 0xba7f(%rip), %rdi      # 0x1dfd0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8350
jmp 0x1261e
movq 0xba68(%rip), %rcx      # 0x1dfd0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x8470
movl $0xe, %edx
movq 0xba45(%rip), %rdi      # 0x1dfd0
leaq 0x5fbc(%rip), %rsi      # 0x1854e
callq 0x8350
movq 0x18(%r12), %rsi
movq 0xba2d(%rip), %rdi      # 0x1dfd0
callq 0x8250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x82f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x8040
movq %rax, %rdi
callq 0x81f0
xorl %r12d, %r12d
testb %r13b, %r13b
je 0x12725
movq -0xc0(%rbp), %rax
cmpq 0x30(%rax), %r15
jne 0x1215b
jmp 0x12725
xorl %r13d, %r13d
leaq -0xa8(%rbp), %r14
jmp 0x125d5
movq 0xb9c9(%rip), %rcx      # 0x1dfd0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x8470
movl $0xd, %edx
movq 0xb9a6(%rip), %rdi      # 0x1dfd0
leaq 0x5f54(%rip), %rsi      # 0x18585
callq 0x8350
leaq 0x18(%r13), %rdi
leaq 0x5f52(%rip), %rsi      # 0x18593
callq 0x9ee0
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x9f54
movl $0x0, 0xcc(%r13)
jmp 0x12387
jmp 0x12665
movq %rax, %r12
cmpl $0x2, %edx
jne 0x12b83
movq %r12, %rdi
callq 0x8120
addq $0x18, %r13
movq %r13, %rdi
leaq 0x5ee9(%rip), %rsi      # 0x18570
callq 0x9ee0
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x9f54
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
testb $0x4, 0x20(%rax)
je 0x12715
callq 0x16531
movq 0xb91d(%rip), %rdi      # 0x1dfd0
movq %rax, %rsi
callq 0x8300
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x5ead(%rip), %rsi      # 0x1857a
callq 0x8350
leaq -0x60(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xc468
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x8350
movq %rax, %rdi
callq 0x8160
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x12715
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x8320
callq 0x8450
movb $0x1, %r13b
xorl %r12d, %r12d
jmp 0x125f7
testq %r12, %r12
movq -0x38(%rbp), %r14
movl -0xb8(%rbp), %ecx
movl -0xb4(%rbp), %edx
jne 0x12749
incl %edx
movq 0x18(%r14), %rax
cmpl 0x28(%rax), %edx
jl 0x120ef
testq %r12, %r12
je 0x127c7
movq 0x18(%r12), %rbx
movq -0x30(%rbp), %rdi
testq %rbx, %rbx
je 0x128cb
cmpb $0x1, 0xf0(%rdi)
jne 0x12773
movq %rbx, 0x120(%rdi)
incl 0x8(%rbx)
cmpb $0x1, 0xf1(%rdi)
jne 0x1293c
movl $0x2, 0xcc(%rdi)
addq $0x18, %rdi
leaq 0x4aa4(%rip), %rsi      # 0x17239
callq 0x9ee0
leaq 0xb8(%rbx), %rdx
leaq 0x5dfc(%rip), %rsi      # 0x185a4
movq %rax, %rdi
callq 0xbbd6
addq $0xd0, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa704
jmp 0x129d4
movq -0x68(%rbp), %rax
movq 0x40(%rax), %rax
movslq 0x4(%r14), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %rbx
movq 0x48(%rax,%rcx), %rdx
movq 0x28(%rax,%rcx), %r13
movq %rdx, %rsi
subq %r13, %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
shlq $0x6, %rsi
movq 0x30(%rax,%rcx), %rdx
subq 0x38(%rax,%rcx), %rdx
sarq $0x3, %rdx
addq %rsi, %rdx
movq 0x10(%rax,%rcx), %r14
movq 0x20(%rax,%rcx), %r15
movq %r15, %rax
subq %r14, %rax
sarq $0x3, %rax
addq %rdx, %rax
jne 0x1284f
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x129f5
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, 0x30(%rbx)
jmp 0x12a01
cmpq 0x30(%rbx), %r14
je 0x12829
movq (%r14), %r12
cmpl $-0x1, (%r12)
je 0x1287f
cmpq -0x30(%rbp), %r12
je 0x1287f
addq $0x8, %r14
cmpq %r15, %r14
jne 0x1284f
movq 0x8(%r13), %r14
addq $0x8, %r13
leaq 0x200(%r14), %r15
jmp 0x1284f
movq %r14, -0x60(%rbp)
movq (%r13), %rax
movq %rax, -0x58(%rbp)
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x50(%rbp)
movq %r13, -0x48(%rbp)
leaq -0xa8(%rbp), %rdi
movq %rbx, %rsi
leaq -0x60(%rbp), %rdx
callq 0x149e8
movq -0xa8(%rbp), %r14
movq -0x98(%rbp), %r15
movq -0x90(%rbp), %r13
movq %r12, %rdi
callq 0x898c
jmp 0x1284f
xorl %eax, %eax
cmpb $0x0, 0xf3(%rdi)
movl $0x6, %ecx
cmovel %eax, %ecx
movl %ecx, 0xcc(%rdi)
addq $0x18, %rdi
leaq 0x494c(%rip), %rsi      # 0x17239
callq 0x9ee0
leaq 0x28(%r12), %rdx
leaq 0x5ca6(%rip), %rsi      # 0x185a4
movq %rax, %rdi
callq 0xbbd6
leaq 0x523f(%rip), %rcx      # 0x17b4c
leaq -0x60(%rbp), %rdx
movq %rcx, (%rdx)
movl $0x4, 0x8(%rdx)
leaq 0x5c87(%rip), %rsi      # 0x185a9
movq %rax, %rdi
callq 0xbbd6
movq 0x20(%r12), %rsi
movq %rax, %rdi
callq 0xa704
jmp 0x129d4
addq $0x18, %rdi
leaq 0x48f2(%rip), %rsi      # 0x17239
callq 0x9ee0
leaq 0xe0(%rbx), %rdx
leaq 0x5c47(%rip), %rsi      # 0x185a1
movq %rax, %rdi
callq 0xbbd6
leaq 0xb8(%rbx), %rdx
leaq 0x5c34(%rip), %rsi      # 0x185a4
movq %rax, %rdi
callq 0xbbd6
leaq 0xd0(%rbx), %rsi
movq %rax, %rdi
callq 0xa704
movl $0x20158, %edi          # imm = 0x20158
addq 0x18(%r14), %rdi
callq 0x83f0
testl %eax, %eax
jne 0x12aeb
movl $0x20128, %edi          # imm = 0x20128
addq 0x18(%r14), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x135ec
movq %rbx, (%rax)
movl $0x20158, %edi          # imm = 0x20158
addq 0x18(%r14), %rdi
callq 0x8240
incl 0x8(%rbx)
movq -0x30(%rbp), %rax
movl $0x0, 0xcc(%rax)
movq 0x18(%r14), %rax
movl $0x1, %ebx
testb $0x20, 0x20(%rax)
je 0x12a14
callq 0x164e8
movq -0x30(%rbp), %rcx
movq %rax, 0x1e0(%rcx)
jmp 0x12a14
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x15228
movq -0x30(%rbp), %rax
incl 0x8(%rax)
movl $0x1, 0xcc(%rax)
xorl %ebx, %ebx
movq -0x30(%rbp), %rsi
cmpq $0x0, 0x178(%rsi)
jne 0x12a88
cmpb $0x0, 0xf3(%rsi)
jne 0x12a3d
cmpb $0x0, 0xf1(%rsi)
jne 0x12a3d
cmpl $0x1, 0xcc(%rsi)
jne 0x12a55
movq -0x68(%rbp), %rdi
addq $0x58, %rdi
callq 0x16c30
movq -0x30(%rbp), %rcx
movq %rax, 0x178(%rcx)
movq -0x30(%rbp), %rdi
cmpb $0x0, 0xf3(%rdi)
jne 0x12a88
cmpb $0x1, 0xf1(%rdi)
jne 0x12a88
movq -0x78(%rbp), %rsi
movl -0x70(%rbp), %edx
movl $0x0, 0x188(%rdi)
addq $0x180, %rdi            # imm = 0x180
callq 0xc0a8
movq -0xe8(%rbp), %rdi
callq 0x8240
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x12ab6
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x8320
leaq -0x100(%rbp), %rdi
callq 0xc13a
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x81d0
movl %eax, %edi
callq 0x81d0
movl %eax, %edi
callq 0x81d0
movl %eax, %edi
callq 0x81d0
jmp 0x12b80
movq %rax, %r12
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x12b1a
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x8320
jmp 0x12b1a
jmp 0x12b17
movq %rax, %r12
callq 0x8450
jmp 0x12b83
movq %rax, %rdi
callq 0xc171
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
movq %rax, %r12
jmp 0x12ba5
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
movq %rax, %r12
cmpl $0x1, %edx
jne 0x12bb1
movq %r12, %rdi
callq 0x8120
movq -0x68(%rbp), %rax
movl $0x0, 0x50(%rax)
callq 0x8450
movq -0x38(%rbp), %r14
jmp 0x11f54
jmp 0x12b80
jmp 0x12b80
movq %rax, %r12
leaq -0x60(%rbp), %rdi
jmp 0x12bac
jmp 0x12b80
jmp 0x12b80
jmp 0x12b80
movq %rax, %r12
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x12ba5
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x8320
leaq -0x100(%rbp), %rdi
callq 0xc13a
movq %r12, %rdi
callq 0x84a0
nop