// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
movq %rdi, %rbx
movq %rax, 0x8(%rax)
movzbl 0x20e(%rsi), %eax
cmpl $0x1, %eax
je 0x221ad
cmpl $0x3, %eax
je 0x22175
cmpl $0x2, %eax
je 0x221a4
jmp 0x221e3
leaq 0x1e5aa(%rip), %rdi     # 0x40726
leaq 0x205c5(%rip), %rsi     # 0x42748
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
leaq 0x1e586(%rip), %rdi     # 0x40731
jmp 0x221b4
leaq 0x1e572(%rip), %rdi     # 0x40726
leaq 0x2058d(%rip), %rsi     # 0x42748
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movb 0x20e(%r14), %al
testb %al, %al
je 0x221f9
cmpb $0x0, 0x20d(%r14)
jne 0x221f9
movb $0x1, 0x20d(%r14)
movq (%rbx), %rdi
leaq 0x1e53b(%rip), %rsi     # 0x4073e
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0xc380
movzbl 0x20f(%r14), %edx
movl 0x21c(%r14), %ecx
leaq 0x20433(%rip), %rsi     # 0x42659
movq %rbx, %rdi
callq 0x2230f
movzbl 0x210(%r14), %edx
movl 0x220(%r14), %ecx
leaq 0x1e501(%rip), %rsi     # 0x40745
movq %rbx, %rdi
callq 0x2230f
movzbl 0x211(%r14), %edx
movl 0x224(%r14), %ecx
leaq 0x1e4e9(%rip), %rsi     # 0x4074b
movq %rbx, %rdi
callq 0x2230f
movzbl 0x20c(%r14), %edx
movl 0x214(%r14), %ecx
leaq 0x1e4cf(%rip), %rsi     # 0x4074f
movq %rbx, %rdi
callq 0x2230f
testb %bpl, %bpl
je 0x222b0
leaq 0x1e4c2(%rip), %rsi     # 0x40756
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2230f
leaq 0x1e4b8(%rip), %rsi     # 0x4075f
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x222c9
movzbl 0x20d(%r14), %edx
movl 0x218(%r14), %ecx
leaq 0x1e4a4(%rip), %rsi     # 0x4076a
movq %rbx, %rdi
callq 0x2230f
movq (%rbx), %rdi
leaq 0x1e466(%rip), %rsi     # 0x4073e
callq 0xc060
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x22304
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x222fd
movq %r15, 0x10(%rsp)
callq 0xc0d0
jmp 0x222dd
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq