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

    lxw_hash_table *num_formats = lxw_hash_new(128, 0, 1);
    lxw_hash_element *hash_element;
    lxw_hash_element *used_format_element;
    uint16_t index = 0xA4;
    uint16_t num_format_count = 0;
    uint16_t *num_format_index;

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

        /* Format already has a number format index. */
        if (format->num_format_index)
            continue;

        /* Check if there is a user defined number format string. */
        if (*format->num_format) {
            char num_format[LXW_FORMAT_FIELD_LEN] = { 0 };
            lxw_snprintf(num_format, LXW_FORMAT_FIELD_LEN, "%s",
                         format->num_format);

            /* Look up the num_format in the hash table. */
            hash_element = lxw_hash_key_exists(num_formats, num_format,
                                               LXW_FORMAT_FIELD_LEN);

            if (hash_element) {
                /* Num_Format has already been used. */
                format->num_format_index = *(uint16_t *) hash_element->value;
            }
            else {
                /* This is a new num_format. */
                num_format_index = calloc(1, sizeof(uint16_t));
                *num_format_index = index;
                format->num_format_index = index;
                lxw_insert_hash_element(num_formats, format->num_format,
                                        num_format_index,
                                        LXW_FORMAT_FIELD_LEN);
                index++;
                num_format_count++;
            }
        }
    }

    LXW_FOREACH_ORDERED(used_format_element, self->used_dxf_formats) {
        lxw_format *format = (lxw_format *) used_format_element->value;

        /* Format already has a number format index. */
        if (format->num_format_index)
            continue;

        /* Check if there is a user defined number format string. */
        if (*format->num_format) {
            char num_format[LXW_FORMAT_FIELD_LEN] = { 0 };
            lxw_snprintf(num_format, LXW_FORMAT_FIELD_LEN, "%s",
                         format->num_format);

            /* Look up the num_format in the hash table. */
            hash_element = lxw_hash_key_exists(num_formats, num_format,
                                               LXW_FORMAT_FIELD_LEN);

            if (hash_element) {
                /* Num_Format has already been used. */
                format->num_format_index = *(uint16_t *) hash_element->value;
            }
            else {
                /* This is a new num_format. */
                num_format_index = calloc(1, sizeof(uint16_t));
                *num_format_index = index;
                format->num_format_index = index;
                lxw_insert_hash_element(num_formats, format->num_format,
                                        num_format_index,
                                        LXW_FORMAT_FIELD_LEN);
                index++;
                /* Don't update num_format_count for DXF formats. */
            }
        }
    }

    lxw_hash_free(num_formats);

    self->num_format_count = num_format_count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movl $0x80, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0xc500
movq %rax, -0x10(%rbp)
movw $0xa4, -0x22(%rbp)
movw $0x0, -0x24(%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 0x4200f
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpw $0x0, 0x1b4(%rax)
je 0x41f20
jmp 0x41ffe
movq -0x38(%rbp), %rax
cmpb $0x0, 0x34(%rax)
je 0x41ffc
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0xc6a0
leaq -0xc0(%rbp), %rdi
movq -0x38(%rbp), %rcx
addq $0x34, %rcx
movl $0x80, %esi
leaq 0x2a948(%rip), %rdx     # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x10(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movl $0x80, %edx
callq 0xc3b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x41f9b
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movw (%rax), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x1b4(%rax)
jmp 0x41ffa
movl $0x1, %edi
movl $0x2, %esi
callq 0xc870
movq %rax, -0x30(%rbp)
movw -0x22(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, (%rax)
movw -0x22(%rbp), %cx
movq -0x38(%rbp), %rax
movw %cx, 0x1b4(%rax)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x34, %rsi
movq -0x30(%rbp), %rdx
movl $0x80, %ecx
callq 0xc040
movw -0x22(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x22(%rbp)
movw -0x24(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x24(%rbp)
jmp 0x41ffc
jmp 0x41ffe
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x41ef6
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x42147
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
cmpw $0x0, 0x1b4(%rax)
je 0x42055
jmp 0x42136
movq -0xc8(%rbp), %rax
cmpb $0x0, 0x34(%rax)
je 0x42134
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0xc6a0
leaq -0x150(%rbp), %rdi
movq -0xc8(%rbp), %rcx
addq $0x34, %rcx
movl $0x80, %esi
leaq 0x2a80d(%rip), %rdx     # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
movq -0x10(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movl $0x80, %edx
callq 0xc3b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x420d9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movw (%rax), %cx
movq -0xc8(%rbp), %rax
movw %cx, 0x1b4(%rax)
jmp 0x42132
movl $0x1, %edi
movl $0x2, %esi
callq 0xc870
movq %rax, -0x30(%rbp)
movw -0x22(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, (%rax)
movw -0x22(%rbp), %cx
movq -0xc8(%rbp), %rax
movw %cx, 0x1b4(%rax)
movq -0x10(%rbp), %rdi
movq -0xc8(%rbp), %rsi
addq $0x34, %rsi
movq -0x30(%rbp), %rdx
movl $0x80, %ecx
callq 0xc040
movw -0x22(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x22(%rbp)
jmp 0x42134
jmp 0x42136
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x42025
movq -0x10(%rbp), %rdi
callq 0xd0e0
movw -0x24(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xbe(%rax)
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax,%rax)