// File: /workspace/github_c_makefile_star2_O1/Paxa[P]fast_excel/libxlsxwriter/src/chart.c
// Function: chart_write_trendline
STATIC void
_chart_write_trendline(lxw_chart *self, lxw_chart_series *series)
{
    if (!series->has_trendline)
        return;

    lxw_xml_start_tag(self->file, "c:trendline", NULL);

    /* Write the c:name element. */
    if (series->trendline_name)
        _chart_write_name(self, series->trendline_name);

    /* Write the c:spPr element. */
    _chart_write_sp_pr(self, series->trendline_line, NULL, NULL);

    /* Write the c:trendlineType element. */
    _chart_write_trendline_type(self, series->trendline_type);

    /* Write the c:order element. */
    if (series->trendline_type == LXW_CHART_TRENDLINE_TYPE_POLY
        && series->trendline_value >= 2) {

        _chart_write_order(self, series->trendline_value);
    }

    /* Write the c:period element. */
    if (series->trendline_type == LXW_CHART_TRENDLINE_TYPE_AVERAGE
        && series->trendline_value >= 2) {

        _chart_write_period(self, series->trendline_value);
    }

    if (series->has_trendline_forecast) {
        /* Write the c:forward element. */
        _chart_write_forward(self, series->trendline_forward);

        /* Write the c:backward element. */
        _chart_write_backward(self, series->trendline_backward);
    }

    /* Write the c:intercept element. */
    if (series->has_trendline_intercept)
        _chart_write_intercept(self, series->trendline_intercept);

    /* Write the c:dispRSqr element. */
    if (series->has_trendline_r_squared)
        _chart_write_disp_rsqr(self);

    if (series->has_trendline_equation) {
        /* Write the c:dispEq element. */
        _chart_write_disp_eq(self);

        /* Write the c:trendlineLbl element. */
        _chart_write_trendline_lbl(self);

    }

    lxw_xml_end_tag(self->file, "c:trendline");
}

// Assembly:
cmpb $0x0, 0xd8(%rsi)
je 0x183c8
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x29458(%rip), %rsi     # 0x41359
xorl %edx, %edx
callq 0xc350
movq 0xf8(%r15), %rdx
testq %rdx, %rdx
je 0x17f25
movq (%rbx), %rdi
leaq 0x29447(%rip), %rsi     # 0x41365
xorl %ecx, %ecx
callq 0xcb30
movq 0x100(%r15), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x14fbe
movb 0xdd(%r15), %al
movq %rsp, %rcx
movq $0x0, (%rcx)
movq %rcx, 0x8(%rcx)
decb %al
cmpb $0x4, %al
ja 0x17f66
movzbl %al, %eax
leaq 0x284df(%rip), %rcx     # 0x4043c
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x17f6d
leaq 0x2941c(%rip), %rsi     # 0x41389
leaq 0x294e0(%rip), %rdi     # 0x41454
callq 0xc030
leaq 0x1040(%rax), %rcx
movq $0x0, 0x1040(%rax)
movq %rsp, %r14
movq 0x8(%r14), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%r14)
movq (%rbx), %rdi
leaq 0x293ed(%rip), %rsi     # 0x41390
movq %r14, %rdx
callq 0xcc00
movq (%r14), %rdi
testq %rdi, %rdi
je 0x17fd3
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x17fc8
movq %r14, 0x8(%rsp)
callq 0xc0c0
movq (%rsp), %rdi
jmp 0x17fae
cmpb $0x2, 0xdd(%r15)
jne 0x17ff6
movzbl 0xde(%r15), %eax
cmpw $0x2, %ax
jb 0x17ff6
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x17620
cmpb $0x5, 0xdd(%r15)
jne 0x18078
movzbl 0xde(%r15), %esi
cmpq $0x2, %rsi
jb 0x18078
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29433(%rip), %rdi     # 0x41454
callq 0xc180
leaq 0x1040(%rax), %rcx
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x29355(%rip), %rsi     # 0x413a0
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18078
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18071
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x18053
cmpb $0x0, 0xd9(%r15)
je 0x1816c
movsd 0xe0(%r15), %xmm0
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x293b2(%rip), %rdi     # 0x41454
callq 0xcc80
leaq 0x1040(%rax), %rcx
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x292dd(%rip), %rsi     # 0x413a9
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x180f9
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x180f2
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x180d4
movsd 0xe8(%r15), %xmm0
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x2933f(%rip), %rdi     # 0x41454
callq 0xcc80
leaq 0x1040(%rax), %rcx
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x29274(%rip), %rsi     # 0x413b3
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1816c
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18165
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x18147
cmpb $0x0, 0xdc(%r15)
je 0x181e9
movsd 0x108(%r15), %xmm0
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x292c2(%rip), %rdi     # 0x41454
callq 0xcc80
leaq 0x1040(%rax), %rcx
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x29202(%rip), %rsi     # 0x413be
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x181e9
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x181e2
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x181c4
cmpb $0x0, 0xdb(%r15)
je 0x18264
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x2924e(%rip), %rdi     # 0x41454
leaq 0x2d52b(%rip), %rsi     # 0x45738
callq 0xc030
leaq 0x1040(%rax), %rcx
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x29193(%rip), %rsi     # 0x413ca
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18264
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x1825d
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x1823f
cmpb $0x0, 0xda(%r15)
je 0x183ac
xorl %r15d, %r15d
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x291cf(%rip), %rdi     # 0x41454
leaq 0x2d4ac(%rip), %rsi     # 0x45738
callq 0xc030
leaq 0x1040(%rax), %rcx
movq %r15, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x2911f(%rip), %rsi     # 0x413d5
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x182e3
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x182dc
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x182be
movq (%rbx), %rdi
leaq 0x290f1(%rip), %r15     # 0x413de
xorl %r12d, %r12d
movq %r15, %rsi
xorl %edx, %edx
callq 0xc350
movq (%rbx), %rdi
leaq 0x28ed0(%rip), %rsi     # 0x411d4
xorl %edx, %edx
callq 0xcc00
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29159(%rip), %rdi     # 0x41474
leaq 0x281ca(%rip), %rsi     # 0x404ec
callq 0xc030
movl $0x1040, %r13d          # imm = 0x1040
leaq (%rax,%r13), %rcx
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rsp)
leaq 0x28f4e(%rip), %rdi     # 0x4129a
xorl %esi, %esi
callq 0xc180
addq %rax, %r13
movq %r12, 0x1040(%rax)
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %r13, 0x8(%rsp)
movq (%rbx), %rdi
leaq 0x28f33(%rip), %rsi     # 0x412a7
movq %r14, %rdx
callq 0xcc00
movq (%rbx), %rdi
movq %r15, %rsi
callq 0xc060
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x183ac
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x183a5
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x18387
movq (%rbx), %rdi
leaq 0x28fa3(%rip), %rsi     # 0x41359
callq 0xc060
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq