// File: /workspace/github_c_makefile_star2_O0/bluecmd[P]fst-example/gtkwave/fstapi.c
// Function: JenkinsIns
void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint32_t hashmask)
{
struct collchain_t ***base = (struct collchain_t ***)base_i;
uint32_t hf, h;
struct collchain_t **ar;
struct collchain_t *chain, *pchain;

if(!*base)
        {
        *base = (struct collchain_t **)calloc(1, (hashmask + 1) * sizeof(void *));
        }
ar = *base;

h = (hf = j_hash(mem, length, length)) & hashmask;
pchain = chain = ar[h];
while(chain)
        {
        if((chain->fullhash == hf) && (chain->length == length) && !memcmp(chain->mem, mem, length))
                {
                if(pchain != chain) /* move hit to front */
                        {
                        pchain->next = chain->next;
                        chain->next = ar[h];
                        ar[h] = chain;
                        }
                return(&(chain->payload));
                }

        pchain = chain;
        chain = chain->next;
        }

chain = (struct collchain_t *)calloc(1, sizeof(struct collchain_t) + length - 1);
memcpy(chain->mem, mem, length);
chain->fullhash = hf;
chain->length = length;
chain->next = ar[h];
ar[h] = chain;
return(&(chain->payload));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1207a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x21f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x121d0
movl %eax, -0x2c(%rbp)
andl -0x20(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x12150
movq -0x40(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x2c(%rbp), %eax
jne 0x12138
movq -0x40(%rbp), %rax
movl 0x14(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x12138
movq -0x40(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x21d0
cmpl $0x0, %eax
jne 0x12138
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x12127
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x121c2
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x120b0
movl -0x1c(%rbp), %eax
movl %eax, %esi
addq $0x20, %rsi
subq $0x1, %rsi
movl $0x1, %edi
callq 0x21f0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x2250
movl -0x2c(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)