// File: /workspace/github_c_makefile_star2_O1/c-zhou[P]yahs/sdict.c
// Function: asm_put
uint32_t asm_put(asm_dict_t *d, const char *name, uint64_t len, uint64_t gap, uint32_t n, uint32_t s, uint32_t gn, 
        uint32_t *gs, uint32_t *gsize, uint32_t *gcomp, uint32_t *gtype, uint32_t *glink, uint32_t *gevid)
{
    if (!name) 
        return UINT32_MAX;
    sdhash_t *h;
    khint_t k;
    int absent;

    h = d->h;
    k = kh_put(sdict, h, name, &absent);
    if (absent) {
        sd_aseq_t *a;
        if (d->n == d->m) {
            d->m = d->m? d->m<<1 : 16;
            d->s = (sd_aseq_t *) realloc(d->s, d->m * sizeof(sd_aseq_t));
        }
        a = &d->s[d->n];
        a->len = len;
        a->gap = gap;
        a->n = n;
        a->s = s;
        a->gn = gn;
        a->gs = memcpy1(gs, sizeof(uint32_t) * gn);
        a->gsize = memcpy1(gsize, sizeof(uint32_t) * gn);
        a->gcomp = memcpy1(gcomp, sizeof(uint32_t) * gn);
        a->gtype = memcpy1(gtype, sizeof(uint32_t) * gn);
        a->glink = memcpy1(glink, sizeof(uint32_t) * gn);
        a->gevid = memcpy1(gevid, sizeof(uint32_t) * gn);
        kh_key(h, k) = a->name = strdup(name);
        kh_val(h, k) = d->n++;
    }
    return kh_val(h, k);
}

// Assembly:
testq %rsi, %rsi
je 0x502d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r12d
movq %rcx, %r13
movq %rdx, %rbx
movq %rdi, %r14
movl %r9d, 0xc(%rsp)
movq 0x10(%rdi), %rbp
leaq 0x34(%rsp), %r15
movq %rbp, %rdi
movq %rsi, 0x28(%rsp)
movq %r15, %rdx
callq 0x44fd
cmpl $0x0, (%r15)
movl %eax, %ecx
je 0x5126
movq %rcx, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movl 0x70(%rsp), %ebp
movl 0x4(%r14), %eax
cmpl %eax, (%r14)
jne 0x4faa
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x10, %eax
cmovnel %ecx, %eax
movl %eax, 0x4(%r14)
movq 0x8(%r14), %rdi
imulq $0x58, %rax, %rsi
callq 0x2290
movq %rax, 0x8(%r14)
movq 0x8(%r14), %rax
movl (%r14), %ecx
movq %rcx, 0x10(%rsp)
imulq $0x58, %rcx, %rcx
leaq (%rax,%rcx), %r15
movq %rbx, 0x8(%rax,%rcx)
movq %r13, 0x10(%rax,%rcx)
movl %r12d, 0x18(%rax,%rcx)
movl 0xc(%rsp), %edx
movl %edx, 0x1c(%rax,%rcx)
movl %ebp, 0x20(%rax,%rcx)
movl %ebp, %r12d
shlq $0x2, %r12
testl %ebp, %ebp
je 0x5033
movq 0x80(%rsp), %rbp
movq 0x78(%rsp), %rbx
movq %r12, %rdi
callq 0x2250
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2220
movq %r13, 0x28(%r15)
movq %r12, %rdi
callq 0x2250
movq %rax, %rbx
movq %rax, %rdi
movq %rbp, %rsi
movl 0x70(%rsp), %ebp
movq %r12, %rdx
callq 0x2220
jmp 0x503d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movq $0x0, 0x28(%r15)
xorl %ebx, %ebx
movq %rbx, 0x30(%r15)
testl %ebp, %ebp
je 0x508a
movq 0x88(%rsp), %rbx
movq %r12, %rdi
callq 0x2250
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2220
movq %r13, 0x38(%r15)
movq %r12, %rdi
callq 0x2250
movq %rax, %rbx
movq %rax, %rdi
movq 0x90(%rsp), %rsi
movq %r12, %rdx
callq 0x2220
jmp 0x5094
movq $0x0, 0x38(%r15)
xorl %ebx, %ebx
movq %rbx, 0x40(%r15)
testl %ebp, %ebp
je 0x50e4
movq 0xa0(%rsp), %rbp
movq 0x98(%rsp), %rbx
movq %r12, %rdi
callq 0x2250
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2220
movq %r13, 0x48(%r15)
movq %r12, %rdi
callq 0x2250
movq %rax, %rbx
movq %rax, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x2220
jmp 0x50ee
movq $0x0, 0x48(%r15)
xorl %ebx, %ebx
movq %rbx, 0x50(%r15)
movq 0x28(%rsp), %rdi
callq 0x23b0
movq %rax, (%r15)
movq 0x20(%rsp), %rbp
movq 0x18(%rbp), %rcx
movq 0x18(%rsp), %rdx
movq %rax, (%rcx,%rdx,8)
movq %rdx, %rcx
movq 0x10(%rsp), %rdx
leal 0x1(%rdx), %eax
movl %eax, (%r14)
movq 0x20(%rbp), %rax
movl %edx, (%rax,%rcx,4)
movq 0x20(%rbp), %rax
movl (%rax,%rcx,4), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq