// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movq %rsi, %rbx
movq (%rdi), %rax
testq %rax, %rax
movl %edx, -0x2c(%rbp)
jne 0xaef3
movq %rdi, %r15
leal 0x1(%r14), %esi
shlq $0x3, %rsi
pushq $0x1
popq %rdi
callq 0x21e0
movl -0x2c(%rbp), %edx
movq %rax, (%r15)
leaq 0xa(%rbx), %r11
movl $0x9e3779b9, %esi       # imm = 0x9E3779B9
movl $0x9e3779b9, %r10d      # imm = 0x9E3779B9
movl %edx, %ecx
movl %edx, %edi
cmpl $0xc, %edi
jb 0xafaf
addl -0x6(%r11), %r10d
addl -0x2(%r11), %ecx
addl -0xa(%r11), %esi
subl %r10d, %esi
subl %ecx, %esi
movl %ecx, %r8d
shrl $0xd, %r8d
xorl %esi, %r8d
subl %ecx, %r10d
subl %r8d, %r10d
movl %r8d, %esi
shll $0x8, %esi
xorl %r10d, %esi
subl %r8d, %ecx
subl %esi, %ecx
movl %esi, %r10d
shrl $0xd, %r10d
xorl %ecx, %r10d
subl %esi, %r8d
subl %r10d, %r8d
movl %r10d, %ecx
shrl $0xc, %ecx
xorl %r8d, %ecx
subl %r10d, %esi
subl %ecx, %esi
movl %ecx, %r8d
shll $0x10, %r8d
xorl %esi, %r8d
subl %ecx, %r10d
subl %r8d, %r10d
movl %r8d, %r9d
shrl $0x5, %r9d
xorl %r10d, %r9d
subl %r8d, %ecx
subl %r9d, %ecx
movl %r9d, %esi
shrl $0x3, %esi
xorl %ecx, %esi
subl %r9d, %r8d
subl %esi, %r8d
movl %esi, %r10d
shll $0xa, %r10d
xorl %r8d, %r10d
subl %esi, %r9d
subl %r10d, %r9d
movl %r10d, %ecx
shrl $0xf, %ecx
xorl %r9d, %ecx
addl $-0xc, %edi
addq $0xc, %r11
jmp 0xaf06
addl %edx, %ecx
decl %edi
cmpl $0xa, %edi
movq %rbx, -0x48(%rbp)
ja 0xb055
leaq 0x722d(%rip), %r8       # 0x121f4
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movzbl (%r11), %edi
shll $0x18, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl -0x1(%r11), %edi
shll $0x10, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl -0x2(%r11), %edi
shll $0x8, %edi
addl %ecx, %edi
movl %edi, %ecx
movzbl -0x3(%r11), %edi
shll $0x18, %edi
addl %r10d, %edi
movl %edi, %r10d
movzbl -0x4(%r11), %edi
shll $0x10, %edi
addl %r10d, %edi
movl %edi, %r10d
movzbl -0x5(%r11), %edi
shll $0x8, %edi
addl %r10d, %edi
movl %edi, %r10d
movzbl -0x6(%r11), %edi
addl %r10d, %edi
movl %edi, %r10d
movzbl -0x7(%r11), %edi
shll $0x18, %edi
addl %esi, %edi
movl %edi, %esi
movzbl -0x8(%r11), %edi
shll $0x10, %edi
addl %esi, %edi
movl %edi, %esi
movzbl -0x9(%r11), %edi
shll $0x8, %edi
addl %esi, %edi
movl %edi, %esi
movzbl -0xa(%r11), %edi
addl %esi, %edi
movl %edi, %esi
subl %r10d, %esi
subl %ecx, %esi
movl %ecx, %r8d
shrl $0xd, %r8d
xorl %esi, %r8d
subl %ecx, %r10d
subl %r8d, %r10d
movl %r8d, %esi
shll $0x8, %esi
xorl %r10d, %esi
subl %r8d, %ecx
subl %esi, %ecx
movl %esi, %edi
shrl $0xd, %edi
xorl %ecx, %edi
subl %esi, %r8d
subl %edi, %r8d
movl %edi, %ecx
shrl $0xc, %ecx
xorl %r8d, %ecx
subl %edi, %esi
subl %ecx, %esi
movl %ecx, %r8d
shll $0x10, %r8d
xorl %esi, %r8d
subl %ecx, %edi
subl %r8d, %edi
movl %r8d, %esi
shrl $0x5, %esi
xorl %edi, %esi
subl %r8d, %ecx
subl %esi, %ecx
movl %esi, %edi
shrl $0x3, %edi
xorl %ecx, %edi
subl %esi, %r8d
subl %edi, %r8d
movl %edi, %ebx
shll $0xa, %ebx
xorl %r8d, %ebx
addl %ebx, %edi
subl %edi, %esi
shrl $0xf, %ebx
xorl %esi, %ebx
andl %ebx, %r14d
movq %r14, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq (%rax,%r14,8), %r14
movl %edx, %r15d
movq %r14, %rax
movq %r14, %r12
testq %rax, %rax
je 0xb116
movq %rax, %r13
cmpl %ebx, 0x10(%rax)
jne 0xb10d
cmpl %edx, 0x14(%r13)
jne 0xb10d
leaq 0x18(%r13), %rdi
movq -0x48(%rbp), %rsi
movq %r15, %rdx
callq 0x22a0
movl -0x2c(%rbp), %edx
testl %eax, %eax
je 0xb166
movq (%r13), %rax
movq %r13, %r12
jmp 0xb0e3
leaq 0x1f(%r15), %rsi
pushq $0x1
popq %rdi
movl %edx, %r12d
callq 0x21e0
movq %rax, %r13
leaq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
movq %r15, %rdx
callq 0x2240
movl %ebx, 0x10(%r13)
movl %r12d, 0x14(%r13)
movq %r14, (%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 0xb150
movq (%r13), %rax
movq %rax, (%r12)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rdx,%rcx,8), %rax
movq %rax, (%r13)
jmp 0xb14c