// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movl %ecx, %r15d
movq %rsi, %rbx
movq (%rdi), %rax
testq %rax, %rax
movl %edx, -0x2c(%rbp)
jne 0xdf3e
movq %rdi, %r14
leal 0x1(%r15), %esi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x21e0
movl -0x2c(%rbp), %edx
movq %rax, (%r14)
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
movq %rbx, %r10
movl $0x9e3779b9, %r11d      # imm = 0x9E3779B9
movl %edx, %ecx
movl %edx, %edi
cmpl $0xc, %edx
jb 0xe00e
movl $0x9e3779b9, %r11d      # imm = 0x9E3779B9
movl %edx, %edi
movl %edx, %ecx
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
movq %rbx, %r10
addl 0x4(%r10), %r11d
addl 0x8(%r10), %ecx
addl (%r10), %esi
subl %r11d, %esi
subl %ecx, %esi
movl %ecx, %r8d
shrl $0xd, %r8d
xorl %esi, %r8d
subl %ecx, %r11d
subl %r8d, %r11d
movl %r8d, %esi
shll $0x8, %esi
xorl %r11d, %esi
subl %r8d, %ecx
subl %esi, %ecx
movl %esi, %r11d
shrl $0xd, %r11d
xorl %ecx, %r11d
subl %esi, %r8d
subl %r11d, %r8d
movl %r11d, %ecx
shrl $0xc, %ecx
xorl %r8d, %ecx
subl %r11d, %esi
subl %ecx, %esi
movl %ecx, %r8d
shll $0x10, %r8d
xorl %esi, %r8d
subl %ecx, %r11d
subl %r8d, %r11d
movl %r8d, %r9d
shrl $0x5, %r9d
xorl %r11d, %r9d
subl %r8d, %ecx
subl %r9d, %ecx
movl %r9d, %esi
shrl $0x3, %esi
xorl %ecx, %esi
subl %r9d, %r8d
subl %esi, %r8d
movl %esi, %r11d
shll $0xa, %r11d
xorl %r8d, %r11d
subl %esi, %r9d
subl %r11d, %r9d
movl %r11d, %ecx
shrl $0xf, %ecx
xorl %r9d, %ecx
addq $0xc, %r10
addl $-0xc, %edi
cmpl $0xb, %edi
ja 0xdf6b
addl %edx, %ecx
decl %edi
cmpl $0xa, %edi
movq %rbx, -0x48(%rbp)
ja 0xe0b4
leaq 0x61ce(%rip), %r8       # 0x141f4
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movzbl 0xa(%r10), %edi
shll $0x18, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl 0x9(%r10), %edi
shll $0x10, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl 0x8(%r10), %edi
shll $0x8, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl 0x7(%r10), %edi
shll $0x18, %edi
addl %r11d, %edi
movl %edi, %r11d
movzbl 0x6(%r10), %edi
shll $0x10, %edi
addl %r11d, %edi
movl %edi, %r11d
movzbl 0x5(%r10), %edi
shll $0x8, %edi
addl %r11d, %edi
movl %edi, %r11d
movzbl 0x4(%r10), %edi
addl %r11d, %edi
movl %edi, %r11d
movzbl 0x3(%r10), %edi
shll $0x18, %edi
addl %esi, %edi
movl %edi, %esi
movzbl 0x2(%r10), %edi
shll $0x10, %edi
addl %esi, %edi
movl %edi, %esi
movzbl 0x1(%r10), %edi
shll $0x8, %edi
addl %esi, %edi
movl %edi, %esi
movzbl (%r10), %edi
addl %esi, %edi
movl %edi, %esi
subl %r11d, %esi
subl %ecx, %esi
movl %ecx, %edi
shrl $0xd, %edi
xorl %esi, %edi
subl %ecx, %r11d
subl %edi, %r11d
movl %edi, %esi
shll $0x8, %esi
xorl %r11d, %esi
subl %edi, %ecx
subl %esi, %ecx
movl %esi, %r8d
shrl $0xd, %r8d
xorl %ecx, %r8d
subl %esi, %edi
subl %r8d, %edi
movl %r8d, %ecx
shrl $0xc, %ecx
xorl %edi, %ecx
subl %r8d, %esi
subl %ecx, %esi
movl %ecx, %edi
shll $0x10, %edi
xorl %esi, %edi
subl %ecx, %r8d
subl %edi, %r8d
movl %edi, %esi
shrl $0x5, %esi
xorl %r8d, %esi
subl %edi, %ecx
subl %esi, %ecx
movl %esi, %r8d
shrl $0x3, %r8d
xorl %ecx, %r8d
subl %esi, %edi
subl %r8d, %edi
movl %r8d, %ebx
shll $0xa, %ebx
xorl %edi, %ebx
addl %ebx, %r8d
subl %r8d, %esi
shrl $0xf, %ebx
xorl %esi, %ebx
andl %ebx, %r15d
movq %r15, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq (%rax,%r15,8), %r15
movl %edx, %r14d
testq %r15, %r15
je 0xe178
movq %r15, %r12
movq %r15, %r13
cmpl %ebx, 0x10(%r13)
jne 0xe169
cmpl %edx, 0x14(%r13)
jne 0xe169
leaq 0x18(%r13), %rdi
movq -0x48(%rbp), %rsi
movq %r14, %rdx
callq 0x22a0
movl -0x2c(%rbp), %edx
testl %eax, %eax
je 0xe1ca
movq %r13, %r12
movq (%r13), %rax
movq %rax, %r13
testq %rax, %rax
jne 0xe146
leaq 0x1f(%r14), %rsi
movl $0x1, %edi
movl %edx, %r12d
callq 0x21e0
movq %rax, %r13
leaq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
movq %r14, %rdx
callq 0x2240
movl %ebx, 0x10(%r13)
movl %r12d, 0x14(%r13)
movq %r15, (%r13)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq %r13, (%rdx,%rcx,8)
addq $0x8, %r13
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq %r13, %r12
je 0xe1b4
movq (%r13), %rax
movq %rax, (%r12)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq %rax, (%r13)
jmp 0xe1b0