// File: /workspace/github_c_makefile_star2_O2/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:
pushq $0xc
popq %rax
testq %rsi, %rsi
je 0x12f39
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movw $0xffff, %bp            # imm = 0xFFFF
incl %ebp
movzwl %bp, %r15d
cmpq $0x0, (%r14,%r15,8)
jne 0x12da0
testw %bp, %bp
je 0x12f2b
movb $0x1, 0x96(%rbx)
cmpb $0x0, 0x99(%rbx)
jne 0x12ddf
cmpb $0x0, 0x98(%rbx)
jne 0x12ddf
cmpb $0x0, 0x97(%rbx)
jne 0x12ddf
movb $0x1, 0x97(%rbx)
movq %rbx, %rdi
callq 0x12f3a
pushq $0x60
popq %rsi
movq %r15, %rdi
callq 0xc850
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x12ed4
imulq $0xc, %r15, %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
movq %rbx, 0x8(%rsp)
cmpq %r12, 0x10(%rsp)
je 0x12ec9
movq (%r14), %r15
movq 0x88(%rbx), %rbx
movq (%r15), %r13
movb 0x8(%r15), %al
movb %al, 0x8(%rbx,%r12,8)
movq 0x10(%r15), %rdi
callq 0x12fc2
movq %rax, 0x10(%rbx,%r12,8)
movq 0x18(%r15), %rdi
callq 0x127d2
movq %rax, 0x18(%rbx,%r12,8)
movq 0x20(%r15), %rdi
callq 0x12881
movq %rax, 0x20(%rbx,%r12,8)
movq 0x28(%r15), %rdi
callq 0x12926
movq %rax, 0x28(%rbx,%r12,8)
testq %r13, %r13
je 0x12eb7
cmpb $0x3d, (%r13)
jne 0x12eab
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0xc850
movq %rax, 0x30(%rbx,%r12,8)
testq %rax, %rax
je 0x12efa
incq %r13
movq %r13, %rdi
callq 0xcd50
movq 0x30(%rbx,%r12,8), %rdi
movq %rax, (%rdi)
callq 0x116ad
testl %eax, %eax
je 0x12eb7
jmp 0x12f1e
movq %r13, %rdi
callq 0xcd50
movq %rax, (%rbx,%r12,8)
addq $0xc, %r12
addq $0x8, %r14
movq 0x8(%rsp), %rbx
jmp 0x12e13
movw %bp, 0x92(%rbx)
xorl %eax, %eax
jmp 0x12f2b
movq 0x4011d(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x2a1fb(%rip), %rsi     # 0x3d0e0
leaq 0x2a5f0(%rip), %rdx     # 0x3d4dc
movl $0x15d8, %ecx           # imm = 0x15D8
xorl %eax, %eax
callq 0xc8d0
jmp 0x12f28
movq 0x400f7(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x2a1d5(%rip), %rsi     # 0x3d0e0
leaq 0x2a5ca(%rip), %rdx     # 0x3d4dc
movl $0x15ec, %ecx           # imm = 0x15EC
xorl %eax, %eax
callq 0xc8d0
movq 0x8(%rsp), %rdi
callq 0x12f3a
pushq $0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq