// File: /workspace/github_c_makefile_star2_O3/BernardTatin[P]s7sh/s7.c
// Function: hash_table_add
static inline s7_pointer hash_table_add(s7_scheme *sc, s7_pointer table, s7_pointer key, s7_pointer value)
                {
                    s7_int hash, hash_mask, loc;
                    hash_entry_t *x, *p;

                    if (!hash_chosen(table))
                        hash_table_set_checker(table, type(key)); /* raw_hash value (hash_loc(sc, table, key)) does not change via hash_table_set_checker etc */

                    hash_mask = hash_table_mask(table);
                    hash = hash_loc(sc, table, key);
                    loc = hash & hash_mask;

                    for (x = hash_table_element(table, loc); x; x = hash_entry_next(x))
                        if ((hash_entry_raw_hash(x) == hash) &&
                                (s7_is_equal(sc, hash_entry_key(x), key)))
                            return(value);

                    p = mallocate_block(sc);
                    hash_entry_key(p) = key;
                    hash_entry_set_value(p, T_Pos(value));
                    hash_entry_set_raw_hash(p, hash);
                    hash_entry_next(p) = hash_table_element(table, loc);
                    hash_table_element(table, loc) = p;

                    hash_table_entries(table)++;
                    if (hash_table_entries(table) > hash_mask)
                        resize_hash_table(sc, table);

                    return(value);
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, (%rsp)
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
btl $0x1d, %eax
jb 0xff015
movzbl (%r12), %ecx
movq 0x18(%r14), %rdx
leaq 0x4d00a(%rip), %rsi     # 0x14bff0
movq (%rsi,%rcx,8), %rcx
cmpq %rcx, %rdx
je 0xff015
leaq -0xc2189(%rip), %rsi    # 0x3ce6d
cmpq %rsi, %rdx
je 0xff011
leaq -0xc1bd8(%rip), %rcx    # 0x3d42a
movq %rcx, 0x18(%r14)
orq $0x20000000, %rax       # imm = 0x20000000
movq %rax, (%r14)
jmp 0xff015
movq %rcx, 0x18(%r14)
movq 0x8(%r14), %rbx
movq 0x20(%r14), %rax
movzbl (%r12), %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq *(%rax,%rcx,8)
movq %rax, %r13
movq %rax, %rcx
movq %rbx, 0x10(%rsp)
andq %rbx, %rcx
movq 0x10(%r14), %rax
movq %rcx, 0x8(%rsp)
movq (%rax,%rcx,8), %rbp
testq %rbp, %rbp
je 0xff07e
leaq 0x53ccb(%rip), %rbx     # 0x152d20
cmpq %r13, 0x10(%rbp)
jne 0xff075
movq (%rbp), %rsi
movzbl (%rsi), %eax
movq %r15, %rdi
movq %r12, %rdx
xorl %ecx, %ecx
callq *(%rbx,%rax,8)
testb %al, %al
jne 0xff125
movq 0x18(%rbp), %rbp
testq %rbp, %rbp
jne 0xff055
movq 0x838(%r15), %rax
testq %rax, %rax
jne 0xff0c9
movl $0x2800, %edi           # imm = 0x2800
callq 0x8480
movq %rax, 0x838(%r15)
movq %rax, %rcx
addq $0x28, %rcx
movl $0xff, %edx
movq %rcx, -0x10(%rcx)
movl $0x0, -0x20(%rcx)
addq $0x28, %rcx
decl %edx
jne 0xff0a7
movq $0x0, -0x10(%rcx)
movl $0x0, -0x20(%rcx)
movq 0x18(%rax), %rcx
movq %rcx, 0x838(%r15)
movl $0x0, 0x8(%rax)
movq %r12, (%rax)
movq (%rsp), %rcx
movq %rcx, 0x20(%rax)
movq %r13, 0x10(%rax)
movq 0x10(%r14), %rcx
movq 0x8(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, 0x18(%rax)
movq 0x10(%r14), %rcx
movq %rax, (%rcx,%rdx,8)
movq 0x28(%r14), %rax
incq 0x18(%rax)
movq 0x28(%r14), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, 0x18(%rax)
jle 0xff125
movq %r15, %rdi
movq %r14, %rsi
callq 0x3dcce
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq