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

    LXW_INIT_ATTRIBUTES();

    /* Add attributes for diagonal borders. */
    if (format->diag_type == LXW_DIAGONAL_BORDER_UP) {
        LXW_PUSH_ATTRIBUTES_STR("diagonalUp", "1");
    }
    else if (format->diag_type == LXW_DIAGONAL_BORDER_DOWN) {
        LXW_PUSH_ATTRIBUTES_STR("diagonalDown", "1");
    }
    else if (format->diag_type == LXW_DIAGONAL_BORDER_UP_DOWN) {
        LXW_PUSH_ATTRIBUTES_STR("diagonalUp", "1");
        LXW_PUSH_ATTRIBUTES_STR("diagonalDown", "1");
    }

    /* Ensure that a default diag border is set if the diag type is set. */
    if (format->diag_type && !format->diag_border) {
        format->diag_border = LXW_BORDER_THIN;
    }

    /* Write the start border tag. */
    lxw_xml_start_tag(self->file, "border", &attributes);

    /* Write the <border> sub elements. */
    _write_sub_border(self, "left", format->left, format->left_color);
    _write_sub_border(self, "right", format->right, format->right_color);
    _write_sub_border(self, "top", format->top, format->top_color);
    _write_sub_border(self, "bottom", format->bottom, format->bottom_color);

    if (is_dxf) {
        _write_sub_border(self, "vertical", 0, LXW_COLOR_UNSET);
        _write_sub_border(self, "horizontal", 0, LXW_COLOR_UNSET);
    }

    /* Conditional DXF formats don't allow diagonal borders. */
    if (!is_dxf)
        _write_sub_border(self, "diagonal",
                          format->diag_border, format->diag_color);

    lxw_xml_end_tag(self->file, "border");

    LXW_FREE_ATTRIBUTES();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq %rax, 0x8(%rax)
movzbl 0x20e(%rsi), %eax
cmpl $0x1, %eax
je 0x254bb
cmpl $0x3, %eax
je 0x25480
cmpl $0x2, %eax
je 0x254b2
jmp 0x254f4
leaq 0x1e29f(%rip), %rdi     # 0x43726
leaq 0x202ba(%rip), %rsi     # 0x45748
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
leaq 0x1e278(%rip), %rdi     # 0x43731
jmp 0x254c2
leaq 0x1e264(%rip), %rdi     # 0x43726
leaq 0x2027f(%rip), %rsi     # 0x45748
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movb 0x20e(%r14), %al
testb %al, %al
je 0x2550a
cmpb $0x0, 0x20d(%r14)
jne 0x2550a
movb $0x1, 0x20d(%r14)
movq (%rbx), %rdi
leaq 0x1e22a(%rip), %rsi     # 0x4373e
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0xc350
movzbl 0x20f(%r14), %edx
movl 0x21c(%r14), %ecx
leaq 0x20122(%rip), %rsi     # 0x45659
movq %rbx, %rdi
callq 0x25621
movzbl 0x210(%r14), %edx
movl 0x220(%r14), %ecx
leaq 0x1e1f0(%rip), %rsi     # 0x43745
movq %rbx, %rdi
callq 0x25621
movzbl 0x211(%r14), %edx
movl 0x224(%r14), %ecx
leaq 0x1e1d8(%rip), %rsi     # 0x4374b
movq %rbx, %rdi
callq 0x25621
movzbl 0x20c(%r14), %edx
movl 0x214(%r14), %ecx
leaq 0x1e1be(%rip), %rsi     # 0x4374f
movq %rbx, %rdi
callq 0x25621
testb %bpl, %bpl
je 0x255c2
movq (%rbx), %rdi
leaq 0x1e1ae(%rip), %rsi     # 0x43756
xorl %edx, %edx
callq 0xcc00
movq (%rbx), %rdi
leaq 0x1e1a6(%rip), %rsi     # 0x4375f
xorl %edx, %edx
callq 0xcc00
jmp 0x255e0
movzbl 0x20d(%r14), %edx
movl 0x218(%r14), %ecx
leaq 0x1e192(%rip), %rsi     # 0x4376a
movq %rbx, %rdi
callq 0x25621
movq (%rbx), %rdi
leaq 0x1e154(%rip), %rsi     # 0x4373e
callq 0xc060
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x25616
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x2560f
movq %r15, 0x10(%rsp)
callq 0xc0c0
jmp 0x255ef
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq