// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/workbook.c
// Function: prepare_borders
STATIC void
_prepare_borders(lxw_workbook *self)
{

    lxw_hash_table *borders = lxw_hash_new(128, 1, 1);
    lxw_hash_element *hash_element;
    lxw_hash_element *used_format_element;
    uint16_t index = 0;

    LXW_FOREACH_ORDERED(used_format_element, self->used_xf_formats) {
        lxw_format *format = (lxw_format *) used_format_element->value;
        lxw_border *key = lxw_format_get_border_key(format);

        if (key) {
            /* Look up the format in the hash table. */
            hash_element =
                lxw_hash_key_exists(borders, key, sizeof(lxw_border));

            if (hash_element) {
                /* Border has already been used. */
                format->border_index = *(uint16_t *) hash_element->value;
                format->has_border = LXW_FALSE;
                free(key);
            }
            else {
                /* This is a new border. */
                uint16_t *border_index = calloc(1, sizeof(uint16_t));
                *border_index = index;
                format->border_index = index;
                format->has_border = 1;
                lxw_insert_hash_element(borders, key, border_index,
                                        sizeof(lxw_border));
                index++;
            }
        }
    }

    /* For DXF formats we only need to check if the properties have changed. */
    LXW_FOREACH_ORDERED(used_format_element, self->used_dxf_formats) {
        lxw_format *format = (lxw_format *) used_format_element->value;

        if (format->left || format->right || format->top || format->bottom) {
            format->has_dxf_border = LXW_TRUE;
        }
    }

    lxw_hash_free(borders);

    self->border_count = index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl $0x80, %edi
movl $0x1, %edx
movl %edx, %esi
callq 0xc500
movq %rax, -0x10(%rbp)
movw $0x0, -0x22(%rbp)
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x42292
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xc570
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x4227f
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x1c, %edx
callq 0xc3b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x42224
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movzwl (%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x200(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x204(%rax)
movq -0x38(%rbp), %rdi
callq 0xc0d0
jmp 0x4227d
movl $0x1, %edi
movl $0x2, %esi
callq 0xc870
movq %rax, -0x40(%rbp)
movw -0x22(%rbp), %cx
movq -0x40(%rbp), %rax
movw %cx, (%rax)
movzwl -0x22(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x200(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x204(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x1c, %ecx
callq 0xc040
movw -0x22(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x22(%rbp)
jmp 0x4227f
jmp 0x42281
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x421ad
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x42316
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl 0x20f(%rax), %eax
cmpl $0x0, %eax
jne 0x422fb
movq -0x48(%rbp), %rax
movzbl 0x210(%rax), %eax
cmpl $0x0, %eax
jne 0x422fb
movq -0x48(%rbp), %rax
movzbl 0x211(%rax), %eax
cmpl $0x0, %eax
jne 0x422fb
movq -0x48(%rbp), %rax
movzbl 0x20c(%rax), %eax
cmpl $0x0, %eax
je 0x42306
movq -0x48(%rbp), %rax
movb $0x1, 0x205(%rax)
jmp 0x42308
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x422a8
movq -0x10(%rbp), %rdi
callq 0xd0e0
movw -0x22(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc6(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)