// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, %r12
cmpq $0x0, (%rdi)
jne 0xc6ad
leal 0x1(%r15), %esi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x21e0
movq %rax, (%r12)
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
movq %rbx, %rax
movl $0x9e3779b9, %edx       # imm = 0x9E3779B9
movl %r14d, %ecx
movl %r14d, %edi
cmpl $0xc, %r14d
jb 0xc771
movl $0x9e3779b9, %edx       # imm = 0x9E3779B9
movl %r14d, %edi
movl %r14d, %ecx
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
movq %rbx, %rax
addl 0x4(%rax), %edx
addl 0x8(%rax), %ecx
addl (%rax), %esi
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %r8d
shrl $0xd, %r8d
xorl %esi, %r8d
subl %ecx, %edx
subl %r8d, %edx
movl %r8d, %esi
shll $0x8, %esi
xorl %edx, %esi
subl %r8d, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0xd, %edx
xorl %ecx, %edx
subl %esi, %r8d
subl %edx, %r8d
movl %edx, %ecx
shrl $0xc, %ecx
xorl %r8d, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %r8d
shll $0x10, %r8d
xorl %esi, %r8d
subl %ecx, %edx
subl %r8d, %edx
movl %r8d, %r9d
shrl $0x5, %r9d
xorl %edx, %r9d
subl %r8d, %ecx
subl %r9d, %ecx
movl %r9d, %esi
shrl $0x3, %esi
xorl %ecx, %esi
subl %r9d, %r8d
subl %esi, %r8d
movl %esi, %edx
shll $0xa, %edx
xorl %r8d, %edx
subl %esi, %r9d
subl %edx, %r9d
movl %edx, %ecx
shrl $0xf, %ecx
xorl %r9d, %ecx
addq $0xc, %rax
addl $-0xc, %edi
cmpl $0xb, %edi
ja 0xc6dd
movq (%r12), %r9
addl %r14d, %ecx
decl %edi
cmpl $0xa, %edi
movq %rbx, -0x30(%rbp)
ja 0xc809
leaq 0x8a66(%rip), %r8       # 0x151f4
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movzbl 0xa(%rax), %edi
shll $0x18, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl 0x9(%rax), %edi
shll $0x10, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl 0x8(%rax), %edi
shll $0x8, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl 0x7(%rax), %edi
shll $0x18, %edi
addl %edx, %edi
movl %edi, %edx
movzbl 0x6(%rax), %edi
shll $0x10, %edi
addl %edx, %edi
movl %edi, %edx
movzbl 0x5(%rax), %edi
shll $0x8, %edi
addl %edx, %edi
movl %edi, %edx
movzbl 0x4(%rax), %edi
addl %edx, %edi
movl %edi, %edx
movzbl 0x3(%rax), %edi
shll $0x18, %edi
addl %esi, %edi
movl %edi, %esi
movzbl 0x2(%rax), %edi
shll $0x10, %edi
addl %esi, %edi
movl %edi, %esi
movzbl 0x1(%rax), %edi
shll $0x8, %edi
addl %esi, %edi
movl %edi, %esi
movzbl (%rax), %eax
addl %esi, %eax
movl %eax, %esi
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %eax
shrl $0xd, %eax
xorl %esi, %eax
subl %ecx, %edx
subl %eax, %edx
movl %eax, %esi
shll $0x8, %esi
xorl %edx, %esi
subl %eax, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0xd, %edx
xorl %ecx, %edx
subl %esi, %eax
subl %edx, %eax
movl %edx, %ecx
shrl $0xc, %ecx
xorl %eax, %ecx
subl %edx, %esi
subl %ecx, %esi
movl %ecx, %eax
shll $0x10, %eax
xorl %esi, %eax
subl %ecx, %edx
subl %eax, %edx
movl %eax, %esi
shrl $0x5, %esi
xorl %edx, %esi
subl %eax, %ecx
subl %esi, %ecx
movl %esi, %edx
shrl $0x3, %edx
xorl %ecx, %edx
subl %esi, %eax
subl %edx, %eax
movl %edx, %ebx
shll $0xa, %ebx
xorl %eax, %ebx
addl %ebx, %edx
subl %edx, %esi
shrl $0xf, %ebx
xorl %esi, %ebx
andl %ebx, %r15d
movq %r15, -0x40(%rbp)
movq %r9, -0x38(%rbp)
movq (%r9,%r15,8), %r15
movl %r14d, %r13d
testq %r15, %r15
je 0xc8b6
movq %r15, %r12
cmpl %ebx, 0x10(%r12)
jne 0xc8a7
cmpl %r14d, 0x14(%r12)
jne 0xc8a7
leaq 0x18(%r12), %rdi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0x22a0
testl %eax, %eax
je 0xc90b
movq %r12, %r15
movq (%r12), %rax
movq %rax, %r12
testq %rax, %rax
jne 0xc884
leaq 0x1f(%r13), %rsi
movl $0x1, %edi
callq 0x21e0
movq %rax, %r12
leaq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movq %r13, %rdx
callq 0x2240
movl %ebx, 0x10(%r12)
movl %r14d, 0x14(%r12)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq %rax, (%r12)
movq %r12, (%rdx,%rcx,8)
addq $0x8, %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq %r12, %r15
je 0xc8f5
movq (%r12), %rax
movq %rax, (%r15)
jmp 0xc8e1