// File: /workspace/github_c_makefile_star2_O1/Paxa[P]fast_excel/libxlsxwriter/src/styles.c
// Function: write_fill
STATIC void
_write_fill(lxw_styles *self, lxw_format *format, uint8_t is_dxf)
{
    struct xml_attribute_list attributes;
    struct xml_attribute *attribute;

    uint8_t pattern = format->pattern;
    lxw_color_t bg_color = format->bg_color;
    lxw_color_t fg_color = format->fg_color;

    char *patterns[] = {
        "none",
        "solid",
        "mediumGray",
        "darkGray",
        "lightGray",
        "darkHorizontal",
        "darkVertical",
        "darkDown",
        "darkUp",
        "darkGrid",
        "darkTrellis",
        "lightHorizontal",
        "lightVertical",
        "lightDown",
        "lightUp",
        "lightGrid",
        "lightTrellis",
        "gray125",
        "gray0625",
    };

    if (is_dxf) {
        bg_color = format->dxf_bg_color;
        fg_color = format->dxf_fg_color;
    }

    LXW_INIT_ATTRIBUTES();

    /* Special handling for pattern only case. */
    if (!bg_color && !fg_color && pattern) {
        _write_default_fill(self, patterns[pattern]);
        LXW_FREE_ATTRIBUTES();
        return;
    }

    lxw_xml_start_tag(self->file, "fill", NULL);

    /* None/Solid patterns are handled differently for dxf formats. */
    if (pattern && !(is_dxf && pattern <= LXW_PATTERN_SOLID))
        LXW_PUSH_ATTRIBUTES_STR("patternType", patterns[pattern]);

    lxw_xml_start_tag(self->file, "patternFill", &attributes);

    if (fg_color != LXW_COLOR_UNSET)
        _write_fg_color(self, fg_color);

    _write_bg_color(self, bg_color, pattern);

    lxw_xml_end_tag(self->file, "patternFill");
    lxw_xml_end_tag(self->file, "fill");

    LXW_FREE_ATTRIBUTES();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movb 0x1f4(%rsi), %al
movzbl %al, %r13d
xorl %eax, %eax
testl %edx, %edx
setne %al
movl 0x1e4(%rsi,%rax,8), %r15d
movl 0x1e8(%rsi,%rax,8), %ebp
movq %rsp, %r12
movq $0x0, (%r12)
movq %r12, 0x8(%r12)
movl %ebp, %eax
orl %r15d, %eax
sete %al
testb %r13b, %r13b
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x251e6
leaq 0x30b6f(%rip), %rax     # 0x55d20
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x250b3
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x253fc
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x251df
movq %r12, 0x8(%rsp)
callq 0xc0c0
jmp 0x251bd
movl %edx, %r14d
movq (%rbx), %rdi
leaq 0x202b3(%rip), %rsi     # 0x454a6
xorl %edx, %edx
callq 0xc350
testq %r13, %r13
je 0x25246
testb %r14b, %r14b
setne %al
cmpb $0x1, %r13b
sete %cl
testb %cl, %al
jne 0x25246
leaq 0x30b09(%rip), %rax     # 0x55d20
movq (%rax,%r13,8), %rsi
leaq 0x1e40c(%rip), %rdi     # 0x4362e
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x1e3ea(%rip), %rsi     # 0x4363a
movq %rsp, %r12
movq %r12, %rdx
callq 0xc350
testl %r15d, %r15d
je 0x25305
xorl %eax, %eax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq %r12, 0x8(%r12)
andl $0xffffff, %r15d        # imm = 0xFFFFFF
leaq 0x1e137(%rip), %rdx     # 0x433b9
leaq 0x20(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0xc570
leaq 0x1e120(%rip), %rdi     # 0x433c0
movq %r14, %rsi
callq 0xc030
leaq 0x1040(%rax), %rcx
xorl %edx, %edx
movq %rdx, 0x1040(%rax)
movq 0x8(%r12), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%r12)
movq (%rbx), %rdi
leaq 0x1e42c(%rip), %rsi     # 0x436fb
movq %r12, %rdx
callq 0xcc00
movq (%r12), %rdi
testq %rdi, %rdi
je 0x25302
movq 0x1040(%rdi), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x252f6
movq %r12, 0x18(%rsp)
callq 0xc0c0
movq 0x10(%rsp), %rdi
jmp 0x252db
movq %rsp, %r12
leaq 0x10(%rsp), %r14
movq $0x0, (%r14)
movq %r14, 0x8(%r14)
testl %ebp, %ebp
je 0x25348
andl $0xffffff, %ebp         # imm = 0xFFFFFF
leaq 0x1e093(%rip), %rdx     # 0x433b9
leaq 0x20(%rsp), %r15
movl $0x20, %esi
movq %r15, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc570
leaq 0x1e07d(%rip), %rdi     # 0x433c0
movq %r15, %rsi
jmp 0x2535c
cmpb $0x1, %r13b
ja 0x253af
leaq 0x1cb13(%rip), %rdi     # 0x41e68
leaq 0x1e3a7(%rip), %rsi     # 0x43703
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
leaq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rsi
movq %rax, (%rsi)
movq %rcx, 0x8(%rdx)
movq (%rbx), %rdi
leaq 0x1e379(%rip), %rsi     # 0x43706
callq 0xcc00
jmp 0x253af
movq 0x1040(%rdi), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x253aa
movq %r14, 0x18(%rsp)
callq 0xc0c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x25394
movq (%rbx), %rdi
leaq 0x1e277(%rip), %rsi     # 0x4363a
callq 0xc060
movq (%rbx), %rdi
leaq 0x200d4(%rip), %rsi     # 0x454a6
callq 0xc060
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x253fc
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x253f5
movq %r12, 0x8(%rsp)
callq 0xc0c0
jmp 0x253d7
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq