// File: /workspace/github_cpp_makefile_star2_O1/lega911[P]ijson/src/mapper.cpp
// Function: Mapper::add(ISlice, unsigned short)
void Mapper::add(ISlice name, u16 value) {
    mutex.lock();
    int i = 0;
    int next;
    int nstep = 1;
    Step *step = get_step_t(nstep);
    for(;;i++) {
        if(i >= name.size()) {
            step->end = value;
            break;
        }
        u16 a = name.ptr()[i];

        if(a == '*') {
            step->std = value;
            break;
        }

        if(a < 32 || a >= 128) THROW("Wrong char");
        a -= 32;

        next = step->k[a];
        if(!next) {
            next = _next();
            step = get_step_t(nstep);
            step->k[a] = next;
        }
        nstep = next;
        step = get_step_t(nstep);
    }

    char *old = NULL;
    if(buf_t) {
        old = abuf.exchange(buf_t);
        buf_t = NULL;
    }
    mutex.unlock();

    if(old) {
        server->_free_lock.lock();
        server->_free_list.push_back(old);
        server->_free_lock.unlock();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, -0x2c(%rbp)
movl %edx, %r13d
movq %rsi, -0x40(%rbp)
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x83f0
testl %eax, %eax
jne 0xeba4
movq 0x38(%rbx), %rax
testq %rax, %rax
jne 0xea01
movq 0x30(%rbx), %rax
movq %r14, -0x48(%rbp)
testl %r13d, %r13d
movl -0x2c(%rbp), %esi
movq -0x40(%rbp), %rdi
jle 0xeac6
movl %r13d, %r8d
movl $0x1, %r15d
xorl %r14d, %r14d
movq %r8, -0x50(%rbp)
movsbl (%rdi,%r14), %ecx
movzwl %cx, %r12d
cmpl $0x2a, %r12d
jne 0xea3a
movw %si, 0x2(%rax)
jmp 0xeab4
leal -0x80(%r12), %edx
cmpl $-0x61, %edx
jbe 0xeb5f
addl $0xffe0, %ecx           # imm = 0xFFE0
movzwl %cx, %r13d
movzwl 0x4(%rax,%r13,2), %eax
testw %ax, %ax
jne 0xea93
movq %rbx, %rdi
callq 0xe8ca
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
jne 0xea72
movq 0x30(%rbx), %rcx
decl %r15d
movslq %r15d, %rdx
imulq $0xc4, %rdx, %rdx
addq %rcx, %rdx
movw %ax, 0x4(%rdx,%r13,2)
movl -0x2c(%rbp), %esi
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %r8
movzwl %ax, %r15d
movq 0x38(%rbx), %rax
testq %rax, %rax
jne 0xeaa4
movq 0x30(%rbx), %rax
imull $0xc4, %r15d, %ecx
addq %rcx, %rax
addq $-0xc4, %rax
cmpl $0x2a, %r12d
je 0xeac9
incq %r14
cmpq %r14, %r8
jne 0xea25
movw %si, (%rax)
movq $0x0, -0x38(%rbp)
movq 0x38(%rbx), %rax
testq %rax, %rax
je 0xeaea
xchgq %rax, 0x30(%rbx)
movq %rax, -0x38(%rbp)
movq $0x0, 0x38(%rbx)
movq -0x48(%rbp), %rdi
callq 0x8240
cmpq $0x0, -0x38(%rbp)
je 0xeb50
movl $0x20088, %edi          # imm = 0x20088
addq (%rbx), %rdi
callq 0x83f0
testl %eax, %eax
jne 0xeba4
movq (%rbx), %rdi
movq 0x200b8(%rdi), %rsi
cmpq 0x200c0(%rdi), %rsi
je 0xeb33
movq -0x38(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x200b8(%rdi)
jmp 0xeb43
addq $0x200b0, %rdi          # imm = 0x200B0
leaq -0x38(%rbp), %rdx
callq 0xecd8
movl $0x20088, %edi          # imm = 0x20088
addq (%rbx), %rdi
callq 0x8240
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0x8170
movq %rax, %rbx
leaq 0x9648(%rip), %rsi      # 0x181bb
leaq 0x961e(%rip), %rdx      # 0x18198
leaq 0x9645(%rip), %r8       # 0x181c6
movq %rax, %rdi
movl $0x37, %ecx
callq 0xcd04
leaq 0xf183(%rip), %rsi      # 0x1dd18
leaq -0x188c(%rip), %rdx     # 0xd310
movq %rbx, %rdi
callq 0x8480
movl %eax, %edi
callq 0x81d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x8220
movq %r14, %rdi
callq 0x84a0