// File: /workspace/github_c_makefile_star2_O3/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 0x185ee
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x29230(%rip), %rsi     # 0x41351
xorl %edx, %edx
callq 0xc350
movq 0xf8(%r15), %rdx
testq %rdx, %rdx
je 0x18145
movq (%rbx), %rdi
leaq 0x2921f(%rip), %rsi     # 0x4135d
xorl %ecx, %ecx
callq 0xcb30
movq 0x100(%r15), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1520f
movb 0xdd(%r15), %al
movq %rsp, %rcx
movq $0x0, (%rcx)
movq %rcx, 0x8(%rcx)
decb %al
cmpb $0x4, %al
ja 0x18186
movzbl %al, %eax
leaq 0x282bb(%rip), %rcx     # 0x40438
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x1818d
leaq 0x291f4(%rip), %rsi     # 0x41381
leaq 0x292b8(%rip), %rdi     # 0x4144c
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 0x291c5(%rip), %rsi     # 0x41388
movq %r14, %rdx
callq 0xcc00
movq (%r14), %rdi
testq %rdi, %rdi
je 0x181f3
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x181e8
movq %r14, 0x8(%rsp)
callq 0xc0c0
movq (%rsp), %rdi
jmp 0x181ce
movb 0xdd(%r15), %al
cmpb $0x2, %al
jne 0x18222
movzbl 0xde(%r15), %eax
cmpw $0x2, %ax
jb 0x1829e
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x17840
movb 0xdd(%r15), %al
cmpb $0x5, %al
jne 0x1829e
movzbl 0xde(%r15), %esi
cmpq $0x2, %rsi
jb 0x1829e
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29205(%rip), %rdi     # 0x4144c
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 0x29127(%rip), %rsi     # 0x41398
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1829e
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18297
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x18279
cmpb $0x0, 0xd9(%r15)
je 0x18392
movsd 0xe0(%r15), %xmm0
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29184(%rip), %rdi     # 0x4144c
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 0x290af(%rip), %rsi     # 0x413a1
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1831f
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18318
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x182fa
movsd 0xe8(%r15), %xmm0
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29111(%rip), %rdi     # 0x4144c
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 0x29046(%rip), %rsi     # 0x413ab
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18392
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x1838b
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x1836d
cmpb $0x0, 0xdc(%r15)
je 0x1840f
movsd 0x108(%r15), %xmm0
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29094(%rip), %rdi     # 0x4144c
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 0x28fd4(%rip), %rsi     # 0x413b6
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1840f
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18408
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x183ea
cmpb $0x0, 0xdb(%r15)
je 0x1848a
xorl %r12d, %r12d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x29020(%rip), %rdi     # 0x4144c
leaq 0x2d315(%rip), %rsi     # 0x45748
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 0x28f65(%rip), %rsi     # 0x413c2
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1848a
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18483
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x18465
cmpb $0x0, 0xda(%r15)
je 0x185d2
xorl %r15d, %r15d
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x28fa1(%rip), %rdi     # 0x4144c
leaq 0x2d296(%rip), %rsi     # 0x45748
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 0x28ef1(%rip), %rsi     # 0x413cd
movq %r14, %rdx
callq 0xcc00
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18509
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x18502
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x184e4
movq (%rbx), %rdi
leaq 0x28ec3(%rip), %r15     # 0x413d6
xorl %r12d, %r12d
movq %r15, %rsi
xorl %edx, %edx
callq 0xc350
movq (%rbx), %rdi
leaq 0x28ca2(%rip), %rsi     # 0x411cc
xorl %edx, %edx
callq 0xcc00
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
leaq 0x28f2b(%rip), %rdi     # 0x4146c
leaq 0x27f9c(%rip), %rsi     # 0x404e4
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 0x28d20(%rip), %rdi     # 0x41292
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 0x28d05(%rip), %rsi     # 0x4129f
movq %r14, %rdx
callq 0xcc00
movq (%rbx), %rdi
movq %r15, %rsi
callq 0xc060
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x185d2
movq 0x1040(%rdi), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x185cb
movq %r14, 0x8(%rsp)
callq 0xc0c0
jmp 0x185ad
movq (%rbx), %rdi
leaq 0x28d75(%rip), %rsi     # 0x41351
callq 0xc060
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq