// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/workbook.c
// Function: prepare_vml
STATIC void
_prepare_vml(lxw_workbook *self)
{
    lxw_worksheet *worksheet;
    lxw_sheet *sheet;
    uint32_t comment_id = 0;
    uint32_t vml_drawing_id = 0;
    uint32_t vml_data_id = 1;
    uint32_t vml_header_id = 0;
    uint32_t vml_shape_id = 1024;
    uint32_t comment_count = 0;

    STAILQ_FOREACH(sheet, self->sheets, list_pointers) {
        if (sheet->is_chartsheet)
            continue;
        else
            worksheet = sheet->u.worksheet;

        if (!worksheet->has_vml && !worksheet->has_header_vml)
            continue;

        if (worksheet->has_vml) {
            self->has_vml = LXW_TRUE;
            if (worksheet->has_comments) {
                self->comment_count++;
                comment_id++;
                self->has_comments = LXW_TRUE;
            }

            vml_drawing_id++;

            comment_count = lxw_worksheet_prepare_vml_objects(worksheet,
                                                              vml_data_id,
                                                              vml_shape_id,
                                                              vml_drawing_id,
                                                              comment_id);

            /* Each VML should start with a shape id incremented by 1024. */
            vml_data_id += 1 * ((1024 + comment_count) / 1024);
            vml_shape_id += 1024 * ((1024 + comment_count) / 1024);
        }

        if (worksheet->has_header_vml) {
            self->has_vml = LXW_TRUE;
            vml_drawing_id++;
            vml_header_id++;
            lxw_worksheet_prepare_header_vml_objects(worksheet,
                                                     vml_header_id,
                                                     vml_drawing_id);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x400, -0x2c(%rbp)     # imm = 0x400
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3e592
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3e47e
jmp 0x3e581
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a0(%rax)
jne 0x3e4a9
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a2(%rax)
jne 0x3e4a9
jmp 0x3e581
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a0(%rax)
je 0x3e546
movq -0x8(%rbp), %rax
movb $0x1, 0xd3(%rax)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a1(%rax)
je 0x3e4fc
movq -0x8(%rbp), %rax
movw 0xc2(%rax), %cx
addw $0x1, %cx
movw %cx, 0xc2(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0xd4(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x2c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x1c(%rbp), %r8d
callq 0xc720
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
shrl $0xa, %eax
shll $0x0, %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x30(%rbp), %eax
addl $0x400, %eax            # imm = 0x400
shrl $0xa, %eax
shll $0xa, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x2a2(%rax)
je 0x3e57f
movq -0x8(%rbp), %rax
movb $0x1, 0xd3(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0xc650
jmp 0x3e581
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x3e465
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)