// File: /workspace/github_c_makefile_star2_O1/Paxa[P]fast_excel/libxlsxwriter/src/chart.c
// Function: chart_series_set_labels_custom
lxw_error
chart_series_set_labels_custom(lxw_chart_series *series,
                               lxw_chart_data_label *data_labels[])
{
    uint16_t i = 0;
    uint16_t data_label_count = 0;

    if (data_labels == NULL)
        return LXW_ERROR_NULL_PARAMETER_IGNORED;

    while (data_labels[data_label_count])
        data_label_count++;

    if (data_label_count == 0)
        return LXW_ERROR_NULL_PARAMETER_IGNORED;

    series->has_labels = LXW_TRUE;

    /* Set the Value label type if no other type is set. */
    if (!series->show_labels_name && !series->show_labels_category
        && !series->show_labels_value) {
        series->show_labels_value = LXW_TRUE;
    }

    /* Free any existing resource. */
    _chart_free_data_labels(series);

    series->data_labels = calloc(data_label_count,
                                 sizeof(lxw_chart_custom_label));
    RETURN_ON_MEM_ERROR(series->data_labels, LXW_ERROR_MEMORY_MALLOC_FAILED);

    /* Copy the user data into the array of new structs. The struct types
     * are different since the internal version has more fields. */
    for (i = 0; i < data_label_count; i++) {
        lxw_chart_data_label *user_label = data_labels[i];
        lxw_chart_custom_label *data_label = &series->data_labels[i];
        const char *src_value = user_label->value;

        data_label->hide = user_label->hide;
        data_label->font = _chart_convert_font_args(user_label->font);
        data_label->line = _chart_convert_line_args(user_label->line);
        data_label->fill = _chart_convert_fill_args(user_label->fill);
        data_label->pattern =
            _chart_convert_pattern_args(user_label->pattern);

        if (src_value) {
            if (*src_value == '=') {
                /* The value is a formula. Handle like other chart ranges. */
                data_label->range = calloc(1, sizeof(lxw_series_range));
                GOTO_LABEL_ON_MEM_ERROR(data_label->range, mem_error);

                data_label->range->formula = lxw_strdup(src_value + 1);

                /* Add the formula to the data cache to allow value to be looked
                 * up and filled in when the file is closed. */
                if (_chart_init_data_cache(data_label->range) != LXW_NO_ERROR)
                    goto mem_error;
            }
            else {
                /* The value is a simple string. */
                data_label->value = lxw_strdup(src_value);
            }
        }
    }

    series->data_label_count = data_label_count;

    return LXW_NO_ERROR;

mem_error:
    _chart_free_data_labels(series);
    return LXW_ERROR_MEMORY_MALLOC_FAILED;
}

// Assembly:
movl $0xc, %eax
testq %rsi, %rsi
je 0x15d5f
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r12
movw $0xffff, %bp            # imm = 0xFFFF
incl %ebp
movzwl %bp, %r15d
cmpq $0x0, (%r14,%r15,8)
jne 0x15bd5
testw %bp, %bp
je 0x15d51
movb $0x1, 0x96(%r12)
cmpb $0x0, 0x99(%r12)
jne 0x15c1e
cmpb $0x0, 0x98(%r12)
jne 0x15c1e
cmpb $0x0, 0x97(%r12)
jne 0x15c1e
movb $0x1, 0x97(%r12)
movq %r12, %rdi
callq 0x15d67
movl $0x60, %esi
movq %r15, %rdi
callq 0xc7f0
movq %rax, 0x88(%r12)
testq %rax, %rax
je 0x15d60
cmpq $0x1, %r15
adcq $0x0, %r15
shlq $0x5, %r15
leaq (%r15,%r15,2), %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
movq %r12, 0x8(%rsp)
movq (%r14), %rbx
movq 0x88(%r12), %r12
movq (%rbx), %r15
movb 0x8(%rbx), %al
movb %al, 0x8(%r12,%r13)
movq 0x10(%rbx), %rdi
callq 0x15dfa
movq %rax, 0x10(%r12,%r13)
movq 0x18(%rbx), %rdi
callq 0x1572d
movq %rax, 0x18(%r12,%r13)
movq 0x20(%rbx), %rdi
callq 0x157ad
movq %rax, 0x20(%r12,%r13)
movq 0x28(%rbx), %rdi
callq 0x15825
movq %rax, 0x28(%r12,%r13)
testq %r15, %r15
je 0x15d02
cmpb $0x3d, (%r15)
jne 0x15cf6
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, 0x30(%r12,%r13)
testq %rax, %rax
je 0x15d22
incq %r15
movq %r15, %rdi
callq 0xcce0
movq 0x30(%r12,%r13), %rdi
movq %rax, (%rdi)
callq 0x146bf
movl $0xb, %ecx
testl %eax, %eax
jne 0x15d04
jmp 0x15d02
movq %r15, %rdi
callq 0xcce0
movq %rax, (%r12,%r13)
xorl %ecx, %ecx
testl %ecx, %ecx
jne 0x15d2e
addq $0x8, %r14
addq $0x60, %r13
cmpq %r13, 0x10(%rsp)
movq 0x8(%rsp), %r12
jne 0x15c61
jmp 0x15d46
callq 0xd4b0
movl $0xb, %ecx
jmp 0x15d04
cmpl $0xb, %ecx
movq 0x8(%rsp), %rdi
jne 0x15d44
callq 0x15d67
movl $0x1, %eax
jmp 0x15d51
jmp 0x15d51
movw %bp, 0x92(%r12)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xd4d4
jmp 0x15d3d