// File: /workspace/github_c_makefile_star2_O2/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 0x156b8
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x2916d(%rip), %rsi     # 0x3e351
xorl %edx, %edx
callq 0xc380
movq 0xf8(%r15), %rdx
testq %rdx, %rdx
je 0x15208
movq (%rbx), %rdi
leaq 0x2915c(%rip), %rsi     # 0x3e35d
xorl %ecx, %ecx
callq 0xcba0
movq 0x100(%r15), %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1201b
movb 0xdd(%r15), %al
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
movq %r14, 0x8(%r14)
decb %al
cmpb $0x4, %al
ja 0x15248
movzbl %al, %eax
leaq 0x281f9(%rip), %rcx     # 0x3d438
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x1524f
leaq 0x29132(%rip), %rsi     # 0x3e381
leaq 0x291f6(%rip), %rdi     # 0x3e44c
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x29107(%rip), %rsi     # 0x3e388
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x152b0
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x152a9
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x15289
movb 0xdd(%r15), %al
cmpb $0x2, %al
jne 0x152df
movzbl 0xde(%r15), %eax
cmpw $0x2, %ax
jb 0x1535d
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x14970
movb 0xdd(%r15), %al
cmpb $0x5, %al
jne 0x1535d
movzbl 0xde(%r15), %esi
cmpq $0x2, %rsi
jb 0x1535d
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x29149(%rip), %rdi     # 0x3e44c
callq 0xc1a0
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x2906a(%rip), %rsi     # 0x3e398
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1535d
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x15356
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x15336
cmpb $0x0, 0xd9(%r15)
je 0x15455
movsd 0xe0(%r15), %xmm0
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x290c6(%rip), %rdi     # 0x3e44c
callq 0xccf0
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x28ff0(%rip), %rsi     # 0x3e3a1
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x153e0
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x153d9
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x153b9
movsd 0xe8(%r15), %xmm0
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x29051(%rip), %rdi     # 0x3e44c
callq 0xccf0
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x28f85(%rip), %rsi     # 0x3e3ab
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x15455
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x1544e
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x1542e
cmpb $0x0, 0xdc(%r15)
je 0x154d4
movsd 0x108(%r15), %xmm0
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x28fd2(%rip), %rdi     # 0x3e44c
callq 0xccf0
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x28f11(%rip), %rsi     # 0x3e3b6
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x154d4
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x154cd
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x154ad
cmpb $0x0, 0xdb(%r15)
je 0x15551
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x28f5c(%rip), %rdi     # 0x3e44c
leaq 0x2d251(%rip), %rsi     # 0x42748
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x28ea0(%rip), %rsi     # 0x3e3c2
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x15551
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x1554a
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x1552a
cmpb $0x0, 0xda(%r15)
je 0x1569e
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x28edb(%rip), %rdi     # 0x3e44c
leaq 0x2d1d0(%rip), %rsi     # 0x42748
callq 0xc030
leaq 0x1040(%rax), %rcx
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x28e2a(%rip), %rsi     # 0x3e3cd
movq %r14, %rdx
callq 0xcc70
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x155d2
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x155cb
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x155ab
movq (%rbx), %rdi
leaq 0x28dfa(%rip), %r15     # 0x3e3d6
movq %r15, %rsi
xorl %edx, %edx
callq 0xc380
movq (%rbx), %rdi
leaq 0x28bdc(%rip), %rsi     # 0x3e1cc
xorl %edx, %edx
callq 0xcc70
andq $0x0, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0x28e63(%rip), %rdi     # 0x3e46c
leaq 0x27ed4(%rip), %rsi     # 0x3d4e4
callq 0xc030
movl $0x1040, %r12d          # imm = 0x1040
andq $0x0, 0x1040(%rax)
leaq (%rax,%r12), %rcx
movq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %rcx, 0x10(%rsp)
leaq 0x28c57(%rip), %rdi     # 0x3e292
xorl %esi, %esi
callq 0xc1a0
addq %rax, %r12
andq $0x0, 0x1040(%rax)
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq %r12, 0x10(%rsp)
movq (%rbx), %rdi
leaq 0x28c3b(%rip), %rsi     # 0x3e29f
movq %r14, %rdx
callq 0xcc70
movq (%rbx), %rdi
movq %r15, %rsi
callq 0xc060
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1569e
movq 0x1040(%rdi), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x15697
movq %r14, 0x10(%rsp)
callq 0xc0d0
jmp 0x15677
movq (%rbx), %rdi
leaq 0x28ca9(%rip), %rsi     # 0x3e351
callq 0xc060
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq