// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movb 0x1f4(%rax), %al
movb %al, -0x31(%rbp)
movq -0x10(%rbp), %rax
movl 0x1e8(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x1e4(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0xe0(%rbp), %rdi
leaq 0x48ce3(%rip), %rsi     # 0x7cad0
movl $0x98, %edx
callq 0xc980
cmpb $0x0, -0x11(%rbp)
je 0x33e17
movq -0x10(%rbp), %rax
movl 0x1f0(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x1ec(%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0x33e19
movq $0x0, -0x28(%rbp)
leaq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x33e9e
cmpl $0x0, -0x3c(%rbp)
jne 0x33e9e
movzbl -0x31(%rbp), %eax
cmpl $0x0, %eax
je 0x33e9e
movq -0x8(%rbp), %rdi
movzbl -0x31(%rbp), %eax
movq -0xe0(%rbp,%rax,8), %rsi
callq 0x33cb0
jmp 0x33e55
cmpq $0x0, -0x28(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x33e65
jmp 0x33e97
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x1040(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x33e8a
leaq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x33e8c
movq -0x30(%rbp), %rdi
callq 0xc0d0
jmp 0x33e55
jmp 0x33e99
jmp 0x33fbf
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x37336(%rip), %rsi     # 0x6b1e2
xorl %eax, %eax
movl %eax, %edx
callq 0xc390
movzbl -0x31(%rbp), %eax
cmpl $0x0, %eax
je 0x33f1a
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
je 0x33ed0
movzbl -0x31(%rbp), %eax
cmpl $0x1, %eax
jle 0x33f1a
jmp 0x33ed2
movzbl -0x31(%rbp), %eax
movq -0xe0(%rbp,%rax,8), %rsi
leaq 0x35579(%rip), %rdi     # 0x6945e
callq 0xc030
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x1040(%rax)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1040, %rax           # imm = 0x1040
movq %rax, -0x20(%rbp)
jmp 0x33f18
jmp 0x33f1a
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x35542(%rip), %rsi     # 0x6946a
leaq -0x28(%rbp), %rdx
callq 0xc390
cmpl $0x0, -0x3c(%rbp)
je 0x33f43
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x33fd0
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
movzbl -0x31(%rbp), %edx
callq 0x340b0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x35509(%rip), %rsi     # 0x6946a
callq 0xc060
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x3726e(%rip), %rsi     # 0x6b1e2
callq 0xc060
jmp 0x33f7b
cmpq $0x0, -0x28(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x33f8b
jmp 0x33fbd
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x1040(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x33fb0
leaq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x33fb2
movq -0x30(%rbp), %rdi
callq 0xc0d0
jmp 0x33f7b
jmp 0x33fbf
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)