// File: /workspace/github_cpp_makefile_star2_O3/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, %r15d
movl %edx, %r13d
movq %rsi, -0x40(%rbp)
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x83f0
testl %eax, %eax
jne 0xead4
movq 0x38(%rbx), %rax
testq %rax, %rax
jne 0xe931
movq 0x30(%rbx), %rax
movl %r15d, -0x2c(%rbp)
movq %r14, -0x38(%rbp)
testl %r13d, %r13d
movq -0x40(%rbp), %rsi
jle 0xe9e2
movl %r13d, %r13d
movl $0x1, %r14d
xorl %r15d, %r15d
movsbl (%rsi,%r15), %ecx
movzwl %cx, %edx
cmpl $0x2a, %edx
je 0xe9de
addl $-0x80, %edx
cmpl $-0x61, %edx
jbe 0xea8f
addl $0xffe0, %ecx           # imm = 0xFFE0
movzwl %cx, %r12d
movzwl 0x4(%rax,%r12,2), %eax
testw %ax, %ax
jne 0xe9af
movq %rbx, %rdi
callq 0xe7f2
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
jne 0xe995
movq 0x30(%rbx), %rcx
movslq %r14d, %rdx
imulq $0xc4, %rdx, %rdx
addq %rcx, %rdx
movw %ax, -0xc0(%rdx,%r12,2)
movq -0x40(%rbp), %rsi
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
jne 0xe9bc
movq 0x30(%rbx), %rcx
movzwl %ax, %r14d
imull $0xc4, %r14d, %eax
addq %rcx, %rax
addq $-0xc4, %rax
incq %r15
cmpq %r15, %r13
jne 0xe952
jmp 0xe9e2
addq $0x2, %rax
movl -0x2c(%rbp), %ecx
movw %cx, (%rax)
movq $0x0, -0x48(%rbp)
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0xea4c
xchgq %r14, 0x30(%rbx)
movq %r14, -0x48(%rbp)
movq $0x0, 0x38(%rbx)
movq -0x38(%rbp), %rdi
callq 0x8240
testq %r14, %r14
je 0xea80
movl $0x20088, %edi          # imm = 0x20088
addq (%rbx), %rdi
callq 0x83f0
testl %eax, %eax
jne 0xead4
movq (%rbx), %rdi
movq 0x200b8(%rdi), %rsi
cmpq 0x200c0(%rdi), %rsi
je 0xea63
movq %r14, (%rsi)
addq $0x8, 0x200b8(%rdi)
jmp 0xea73
movq -0x38(%rbp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8240
addq $0x200b0, %rdi          # imm = 0x200B0
leaq -0x48(%rbp), %rdx
callq 0xebda
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 0x9718(%rip), %rsi      # 0x181bb
leaq 0x96ee(%rip), %rdx      # 0x18198
leaq 0x9715(%rip), %r8       # 0x181c6
movq %rax, %rdi
movl $0x37, %ecx
callq 0xcd04
leaq 0xf253(%rip), %rsi      # 0x1dd18
leaq -0x17bc(%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