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

    lxw_hash_table *fonts = 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_font *key = lxw_format_get_font_key(format);

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

            if (hash_element) {
                /* Font has already been used. */
                format->font_index = *(uint16_t *) hash_element->value;
                format->has_font = LXW_FALSE;
                free(key);
            }
            else {
                /* This is a new font. */
                uint16_t *font_index = calloc(1, sizeof(uint16_t));
                *font_index = index;
                format->font_index = index;
                format->has_font = LXW_TRUE;
                lxw_insert_hash_element(fonts, key, font_index,
                                        sizeof(lxw_font));
                index++;
            }
        }
    }

    lxw_hash_free(fonts);

    /* 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;

        /* The only font properties that can change for a DXF format are:
         * color, bold, italic, underline and strikethrough. */
        if (format->font_color || format->bold || format->italic
            || format->underline || format->font_strikeout) {
            format->has_dxf_font = LXW_TRUE;
        }
    }

    self->font_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 0x41df4
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xc150
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x41de1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x98, %edx
callq 0xc3b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x41d85
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movw (%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x1b6(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x1b8(%rax)
movq -0x38(%rbp), %rdi
callq 0xc0d0
jmp 0x41ddf
movl $0x1, %edi
movl $0x2, %esi
callq 0xc870
movq %rax, -0x40(%rbp)
movw -0x22(%rbp), %cx
movq -0x40(%rbp), %rax
movw %cx, (%rax)
movw -0x22(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x1b6(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x1b8(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl $0x98, %ecx
callq 0xc040
movw -0x22(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x22(%rbp)
jmp 0x41de1
jmp 0x41de3
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x41d0d
movq -0x10(%rbp), %rdi
callq 0xd0e0
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x41e8e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x1cc(%rax)
jne 0x41e73
movq -0x48(%rbp), %rax
movzbl 0x1c8(%rax), %eax
cmpl $0x0, %eax
jne 0x41e73
movq -0x48(%rbp), %rax
movzbl 0x1c9(%rax), %eax
cmpl $0x0, %eax
jne 0x41e73
movq -0x48(%rbp), %rax
movzbl 0x1d0(%rax), %eax
cmpl $0x0, %eax
jne 0x41e73
movq -0x48(%rbp), %rax
movzbl 0x1d1(%rax), %eax
cmpl $0x0, %eax
je 0x41e7e
movq -0x48(%rbp), %rax
movb $0x1, 0x1b9(%rax)
jmp 0x41e80
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x41e13
movw -0x22(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc4(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)