// File: /workspace/github_c_makefile_star2_O1/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 0x25480
cmpl $0x3, %eax
je 0x25445
cmpl $0x2, %eax
je 0x25477
jmp 0x254b2
leaq 0x1e2ca(%rip), %rdi     # 0x43716
leaq 0x202e5(%rip), %rsi     # 0x45738
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
leaq 0x1e2a3(%rip), %rdi     # 0x43721
jmp 0x25487
leaq 0x1e28f(%rip), %rdi     # 0x43716
leaq 0x202aa(%rip), %rsi     # 0x45738
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
cmpb $0x0, 0x20e(%r14)
je 0x254ce
cmpb $0x0, 0x20d(%r14)
jne 0x254ce
movb $0x1, 0x20d(%r14)
movq (%rbx), %rdi
leaq 0x1e256(%rip), %rsi     # 0x4372e
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0xc350
movzbl 0x20f(%r14), %edx
movl 0x21c(%r14), %ecx
leaq 0x2014e(%rip), %rsi     # 0x45649
movq %rbx, %rdi
callq 0x255e5
movzbl 0x210(%r14), %edx
movl 0x220(%r14), %ecx
leaq 0x1e21c(%rip), %rsi     # 0x43735
movq %rbx, %rdi
callq 0x255e5
movzbl 0x211(%r14), %edx
movl 0x224(%r14), %ecx
leaq 0x1e204(%rip), %rsi     # 0x4373b
movq %rbx, %rdi
callq 0x255e5
movzbl 0x20c(%r14), %edx
movl 0x214(%r14), %ecx
leaq 0x1e1ea(%rip), %rsi     # 0x4373f
movq %rbx, %rdi
callq 0x255e5
testb %bpl, %bpl
je 0x25586
movq (%rbx), %rdi
leaq 0x1e1da(%rip), %rsi     # 0x43746
xorl %edx, %edx
callq 0xcc00
movq (%rbx), %rdi
leaq 0x1e1d2(%rip), %rsi     # 0x4374f
xorl %edx, %edx
callq 0xcc00
jmp 0x255a4
movzbl 0x20d(%r14), %edx
movl 0x218(%r14), %ecx
leaq 0x1e1be(%rip), %rsi     # 0x4375a
movq %rbx, %rdi
callq 0x255e5
movq (%rbx), %rdi
leaq 0x1e180(%rip), %rsi     # 0x4372e
callq 0xc060
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x255da
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x255d3
movq %r15, 0x10(%rsp)
callq 0xc0c0
jmp 0x255b3
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq