// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movw $0x0, -0x1a(%rbp)
movw $0x0, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x162bf
movl $0xc, -0x4(%rbp)
jmp 0x16535
jmp 0x162c1
movq -0x18(%rbp), %rax
movzwl -0x1c(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x162de
movw -0x1c(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1c(%rbp)
jmp 0x162c1
movzwl -0x1c(%rbp), %eax
cmpl $0x0, %eax
jne 0x162f3
movl $0xc, -0x4(%rbp)
jmp 0x16535
movq -0x10(%rbp), %rax
movb $0x1, 0x96(%rax)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x99(%rax)
jne 0x16330
movq -0x10(%rbp), %rax
cmpb $0x0, 0x98(%rax)
jne 0x16330
movq -0x10(%rbp), %rax
cmpb $0x0, 0x97(%rax)
jne 0x16330
movq -0x10(%rbp), %rax
movb $0x1, 0x97(%rax)
movq -0x10(%rbp), %rdi
callq 0x16540
movzwl -0x1c(%rbp), %eax
movl %eax, %edi
movl $0x60, %esi
callq 0xc870
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x88(%rax)
jne 0x16395
movq 0x66c8c(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x4fd5a(%rip), %rsi     # 0x660d0
leaq 0x4ffaf(%rip), %rdx     # 0x6632c
movl $0x15d8, %ecx           # imm = 0x15D8
movb $0x0, %al
callq 0xc8f0
movl $0x1, -0x4(%rbp)
jmp 0x16535
jmp 0x16397
movw $0x0, -0x1a(%rbp)
movzwl -0x1a(%rbp), %eax
movzwl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1650d
movq -0x18(%rbp), %rax
movzwl -0x1a(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movzwl -0x1a(%rbp), %ecx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movb 0x8(%rax), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x16600
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x15970
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x15a90
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15bb0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
cmpq $0x0, -0x38(%rbp)
je 0x164fa
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0x164e5
movl $0x1, %edi
movl $0x28, %esi
callq 0xc870
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x164b2
movq 0x66b65(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
leaq 0x4fc33(%rip), %rsi     # 0x660d0
leaq 0x4fe88(%rip), %rdx     # 0x6632c
movl $0x15ec, %ecx           # imm = 0x15EC
movb $0x0, %al
callq 0xc8f0
jmp 0x16525
jmp 0x164b4
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x14880
cmpl $0x0, %eax
je 0x164e3
jmp 0x16525
jmp 0x164f8
movq -0x38(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x164fa
jmp 0x164fc
movw -0x1a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1a(%rbp)
jmp 0x1639d
movw -0x1c(%rbp), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x92(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x16535
movq -0x10(%rbp), %rdi
callq 0x16540
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop