// File: /workspace/github_c_makefile_star2_O0/afi-lambda[P]a_little_smalltalk/src/names.c
// Function: hashEachElement
object hashEachElement(object dict, register int hash, int(*fun)(object))
{
    object table, key, value, link;
    register object *hp;
    int tablesize;

    table = basicAt(dict, 1);

    /* now see if table is valid */
    if ((tablesize = sizeField(table)) < 3)
        sysError("system error", "lookup on null table");
    else
    {
        hash = 1 + (3 * (hash % (tablesize / 3)));
        hp = sysMemPtr(table) + (hash - 1);
        key = *hp++; /* table at: hash */
        value = *hp++; /* table at: hash + 1 */
        if ((key != nilobj) && (*fun)(key))
            return value;
        for (link = *hp; link != nilobj; link = *hp)
        {
            hp = sysMemPtr(link);
            key = *hp++; /* link at: 1 */
            value = *hp++; /* link at: 2 */
            if ((key != nilobj) && (*fun)(key))
                return value;
        }
    }
    return nilobj;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movswl -0x4(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0xca9a(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movw (%rax), %ax
movw %ax, -0x12(%rbp)
movswl -0x12(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0xca78(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movswl 0x4(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x3, %eax
jge 0x3813
leaq 0x89f4(%rip), %rdi      # 0xc1f6
leaq 0x89fa(%rip), %rsi      # 0xc203
callq 0x63f0
jmp 0x3949
movl -0x8(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x28(%rbp), %eax
cltd
idivl %ecx
imull $0x3, %edx, %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movswl -0x12(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0xca1b(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x20(%rbp)
movw (%rax), %ax
movw %ax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x20(%rbp)
movw (%rax), %ax
movw %ax, -0x16(%rbp)
movswl -0x14(%rbp), %eax
cmpl $0x0, %eax
je 0x38b4
movq -0x10(%rbp), %rax
movswl -0x14(%rbp), %edi
callq *%rax
cmpl $0x0, %eax
je 0x38b4
movw -0x16(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x394f
movq -0x20(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x18(%rbp)
movswl -0x18(%rbp), %eax
cmpl $0x0, %eax
je 0x3947
movswl -0x18(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0xc988(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x20(%rbp)
movw (%rax), %ax
movw %ax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x20(%rbp)
movw (%rax), %ax
movw %ax, -0x16(%rbp)
movswl -0x14(%rbp), %eax
cmpl $0x0, %eax
je 0x3935
movq -0x10(%rbp), %rax
movswl -0x14(%rbp), %edi
callq *%rax
cmpl $0x0, %eax
je 0x3935
movw -0x16(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x394f
jmp 0x3937
movq -0x20(%rbp), %rax
movw (%rax), %ax
movw %ax, -0x18(%rbp)
jmp 0x38bf
jmp 0x3949
movw $0x0, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)