// File: lega911[P]ijson/src/connect.cpp
// Function: Connect::rpc_result(ISlice&)
void Connect::rpc_result(ISlice &id) {
    if(id.empty() && json.level == 0) {
        while(json.scan()) {
            if(json.key == "id") {
                id = json.value;
                break;
            }
        }
    }
    if(id.empty()) {
        if(server->log & 2) std::cout << ltime() << "400 no id for /rpc/result\n";
        this->send.status("400 No id")->done(-1);
    } else {
        loop->stat_result++;
        int r = loop->worker_result(id, this);
        if(r == 0) {
            this->send.status("200 OK")->done(1);
        } else if(r == -2) {
            if(server->log & 4) std::cout << ltime() << "499 Client is gone\n";
            this->send.status("499 Closed")->done(-1);
        } else {
            if(server->log & 2) std::cout << ltime() << "400 Wrong id for /rpc/result\n";
            this->send.status("400 Wrong id")->done(-1);
        }
    }
    status = Status::net;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1eb40
testb $0x1, %al
jne 0x1c6d7
jmp 0x1c73a
movq -0x30(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jne 0x1c73a
jmp 0x1c6e6
movq -0x30(%rbp), %rdi
addq $0x128, %rdi            # imm = 0x128
callq 0x236d0
testb $0x1, %al
jne 0x1c6fc
jmp 0x1c738
movq -0x30(%rbp), %rdi
addq $0x128, %rdi            # imm = 0x128
leaq 0x1bc36(%rip), %rsi     # 0x38344
callq 0x1ee30
testb $0x1, %al
jne 0x1c719
jmp 0x1c736
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x138(%rcx), %rdx
movq %rdx, (%rax)
movl 0x140(%rcx), %ecx
movl %ecx, 0x8(%rax)
jmp 0x1c738
jmp 0x1c6e6
jmp 0x1c73a
movq -0x10(%rbp), %rdi
callq 0x1eb40
testb $0x1, %al
jne 0x1c749
jmp 0x1c7a5
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x20(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1c77f
callq 0x36960
movq %rax, %rsi
movq 0x2a865(%rip), %rdi     # 0x46fd0
callq 0x192e0
movq %rax, %rdi
leaq 0x1bb7d(%rip), %rsi     # 0x382f7
callq 0x192e0
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x1bb84(%rip), %rsi     # 0x38312
callq 0x1b6d0
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1b770
jmp 0x1c8cb
movq -0x30(%rbp), %rcx
movq 0x30(%rcx), %rax
movq 0x88(%rax), %rdx
addq $0x1, %rdx
movq %rdx, 0x88(%rax)
movq 0x30(%rcx), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq %rdx, -0x28(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x2c620
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x1c811
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x1ba37(%rip), %rsi     # 0x38231
callq 0x1b6d0
movq %rax, %rdi
movl $0x1, %esi
callq 0x1b770
jmp 0x1c8c9
cmpl $-0x2, -0x14(%rbp)
jne 0x1c870
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x20(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1c84d
callq 0x36960
movq %rax, %rsi
movq 0x2a797(%rip), %rdi     # 0x46fd0
callq 0x192e0
movq %rax, %rdi
leaq 0x1ba39(%rip), %rsi     # 0x38281
callq 0x192e0
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x1ba39(%rip), %rsi     # 0x38295
callq 0x1b6d0
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1b770
jmp 0x1c8c7
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movl 0x20(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1c8a6
callq 0x36960
movq %rax, %rsi
movq 0x2a73e(%rip), %rdi     # 0x46fd0
callq 0x192e0
movq %rax, %rdi
leaq 0x1ba7b(%rip), %rsi     # 0x3831c
callq 0x192e0
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
leaq 0x1ba85(%rip), %rsi     # 0x3833a
callq 0x1b6d0
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1b770
jmp 0x1c8c9
jmp 0x1c8cb
movq -0x30(%rbp), %rax
movl $0x0, 0xcc(%rax)
addq $0x30, %rsp
popq %rbp
retq
nop