// File: /workspace/github_c_makefile_star2_O3/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 0x15f77
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r14
movw $0xffff, %bp            # imm = 0xFFFF
incl %ebp
movzwl %bp, %r15d
cmpq $0x0, (%r12,%r15,8)
jne 0x15e03
testw %bp, %bp
je 0x15f69
movb $0x1, 0x96(%r14)
cmpb $0x0, 0x99(%r14)
jne 0x15e47
cmpb $0x0, 0x98(%r14)
jne 0x15e47
cmpb $0x0, 0x97(%r14)
jne 0x15e47
movb $0x1, 0x97(%r14)
movq %r14, %rdi
callq 0x15f78
movl $0x60, %esi
movq %r15, %rdi
callq 0xc7f0
movq %rax, 0x88(%r14)
testq %rax, %rax
je 0x15f4f
movl $0x6, %r13d
xorl %ebx, %ebx
movq %r14, (%rsp)
movq %r12, 0x8(%rsp)
movq (%r12,%rbx,8), %r12
movq 0x88(%r14), %r14
movq (%r12), %rax
movq %rax, 0x10(%rsp)
movb 0x8(%r12), %al
movb %al, -0x28(%r14,%r13,8)
movq 0x10(%r12), %rdi
callq 0x1600b
movq %rax, -0x20(%r14,%r13,8)
movq 0x18(%r12), %rdi
callq 0x15988
movq %rax, -0x18(%r14,%r13,8)
movq 0x20(%r12), %rdi
callq 0x15a08
movq %rax, -0x10(%r14,%r13,8)
movq 0x28(%r12), %rdi
movq 0x10(%rsp), %r12
callq 0x15a80
movq %rax, -0x8(%r14,%r13,8)
testq %r12, %r12
je 0x15f2a
cmpb $0x3d, (%r12)
jne 0x15f1d
movl $0x1, %edi
movl $0x28, %esi
callq 0xc7f0
movq %rax, (%r14,%r13,8)
testq %rax, %rax
je 0x15f56
incq %r12
movq %r12, %rdi
callq 0xcce0
movq (%r14,%r13,8), %rdi
movq %rax, (%rdi)
callq 0x148b6
testl %eax, %eax
je 0x15f2a
jmp 0x15f5b
movq %r12, %rdi
callq 0xcce0
movq %rax, -0x30(%r14,%r13,8)
incq %rbx
addq $0xc, %r13
cmpq %rbx, %r15
movq (%rsp), %r14
movq 0x8(%rsp), %r12
jne 0x15e7d
movw %bp, 0x92(%r14)
xorl %eax, %eax
jmp 0x15f69
callq 0xd4a3
jmp 0x15f64
callq 0xd47f
movq (%rsp), %rdi
callq 0x15f78
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq