// File: /workspace/github_c_makefile_star2_O3/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 0x2521b
leaq 0x31b3a(%rip), %rax     # 0x56d20
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
callq 0x250e8
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x25437
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x25214
movq %r12, 0x8(%rsp)
callq 0xc0c0
jmp 0x251f2
movl %edx, %r14d
movq (%rbx), %rdi
leaq 0x2028e(%rip), %rsi     # 0x454b6
xorl %edx, %edx
callq 0xc350
testq %r13, %r13
je 0x2527b
testb %r14b, %r14b
setne %al
cmpb $0x1, %r13b
sete %cl
testb %cl, %al
jne 0x2527b
leaq 0x31ad4(%rip), %rax     # 0x56d20
movq (%rax,%r13,8), %rsi
leaq 0x1e3e7(%rip), %rdi     # 0x4363e
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 0x1e3c5(%rip), %rsi     # 0x4364a
movq %rsp, %r14
movq %r14, %rdx
callq 0xc350
testl %r15d, %r15d
je 0x2533a
xorl %eax, %eax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq %r12, 0x8(%r12)
andl $0xffffff, %r15d        # imm = 0xFFFFFF
leaq 0x1e112(%rip), %rdx     # 0x433c9
leaq 0x20(%rsp), %r14
movl $0x20, %esi
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0xc570
leaq 0x1e0fb(%rip), %rdi     # 0x433d0
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 0x1e407(%rip), %rsi     # 0x4370b
movq %r12, %rdx
callq 0xcc00
movq (%r12), %rdi
testq %rdi, %rdi
je 0x25337
movq 0x1040(%rdi), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x2532b
movq %r12, 0x18(%rsp)
callq 0xc0c0
movq 0x10(%rsp), %rdi
jmp 0x25310
movq %rsp, %r14
leaq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
testl %ebp, %ebp
je 0x2537d
andl $0xffffff, %ebp         # imm = 0xFFFFFF
leaq 0x1e06e(%rip), %rdx     # 0x433c9
leaq 0x20(%rsp), %r15
movl $0x20, %esi
movq %r15, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc570
leaq 0x1e058(%rip), %rdi     # 0x433d0
movq %r15, %rsi
jmp 0x25391
cmpb $0x1, %r13b
ja 0x253f4
leaq 0x1caee(%rip), %rdi     # 0x41e78
leaq 0x1e382(%rip), %rsi     # 0x43713
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
leaq 0x10(%rsp), %r15
movq 0x8(%r15), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%r15)
movq (%rbx), %rdi
leaq 0x1e354(%rip), %rsi     # 0x43716
movq %r15, %rdx
callq 0xcc00
movq (%r15), %rdi
testq %rdi, %rdi
je 0x253f4
movq 0x1040(%rdi), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
jne 0x253e8
movq %r15, 0x18(%rsp)
callq 0xc0c0
movq 0x10(%rsp), %rdi
jmp 0x253cd
movq (%rbx), %rdi
leaq 0x1e24c(%rip), %rsi     # 0x4364a
callq 0xc060
movq (%rbx), %rdi
leaq 0x200a9(%rip), %rsi     # 0x454b6
callq 0xc060
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x25437
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x25430
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x25412
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq