// File: /workspace/github_c_makefile_star2_O0/Paxa[P]fast_excel/libxlsxwriter/src/workbook.c
// Function: populate_range_dimensions
STATIC void
_populate_range_dimensions(lxw_workbook *self, lxw_series_range *range)
{

    char formula[LXW_MAX_FORMULA_RANGE_LENGTH] = { 0 };
    char *tmp_str;
    char *sheetname;

    /* If neither the range formula or sheetname is defined then this probably
     * isn't a valid range.
     */
    if (!range->formula && !range->sheetname) {
        range->ignore_cache = LXW_TRUE;
        return;
    }

    /* If the sheetname is already defined it was already set via
     * chart_series_set_categories() or  chart_series_set_values().
     */
    if (range->sheetname)
        return;

    /* Ignore non-contiguous range like (Sheet1!$A$1:$A$2,Sheet1!$A$4:$A$5) */
    if (range->formula[0] == '(') {
        range->ignore_cache = LXW_TRUE;
        return;
    }

    /* Create a copy of the formula to modify and parse into parts. */
    lxw_snprintf(formula, LXW_MAX_FORMULA_RANGE_LENGTH, "%s", range->formula);

    /* Check for valid formula. Note, This needs stronger validation. */
    tmp_str = strchr(formula, '!');

    if (tmp_str == NULL) {
        range->ignore_cache = LXW_TRUE;
        return;
    }
    else {
        /* Split the formulas into sheetname and row-col data. */
        *tmp_str = '\0';
        tmp_str++;
        sheetname = formula;

        /* Remove any worksheet quoting. */
        if (sheetname[0] == '\'')
            sheetname++;
        if (sheetname[strlen(sheetname) - 1] == '\'')
            sheetname[strlen(sheetname) - 1] = '\0';

        /* Check that the sheetname exists. */
        if (!workbook_get_worksheet_by_name(self, sheetname)) {
            LXW_WARN_FORMAT2("workbook_add_chart(): worksheet name '%s' "
                             "in chart formula '%s' doesn't exist.",
                             sheetname, range->formula);
            range->ignore_cache = LXW_TRUE;
            return;
        }

        range->sheetname = lxw_strdup(sheetname);
        range->first_row = lxw_name_to_row(tmp_str);
        range->first_col = lxw_name_to_col(tmp_str);

        if (strchr(tmp_str, ':')) {
            /* 2D range. */
            range->last_row = lxw_name_to_row_2(tmp_str);
            range->last_col = lxw_name_to_col_2(tmp_str);
        }
        else {
            /* 1D range. */
            range->last_row = range->first_row;
            range->last_col = range->first_col;
        }

    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x9b, %edx
callq 0xc6a0
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x43e48
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x43e48
movq -0x10(%rbp), %rax
movb $0x1, 0x1c(%rax)
jmp 0x4405d
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x43e58
jmp 0x4405d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x43e74
movq -0x10(%rbp), %rax
movb $0x1, 0x1c(%rax)
jmp 0x4405d
leaq -0xb0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl $0x9b, %esi
leaq 0x28a16(%rip), %rdx     # 0x6c8a4
movb $0x0, %al
callq 0xc5d0
leaq -0xb0(%rbp), %rdi
movl $0x21, %esi
callq 0xc520
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0x43ec4
movq -0x10(%rbp), %rax
movb $0x1, 0x1c(%rax)
jmp 0x4405d
movq -0xb8(%rbp), %rax
movb $0x0, (%rax)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
jne 0x43f0f
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rdi
callq 0xc4e0
movq %rax, %rcx
movq -0xc8(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x27, %eax
jne 0x43f6c
movq -0xc0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0xc4e0
movq %rax, %rcx
movq -0xd0(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0xcac0
cmpq $0x0, %rax
jne 0x43fb5
movq 0x3906f(%rip), %rax     # 0x7cff8
movq (%rax), %rdi
movq -0xc0(%rbp), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x282bd(%rip), %rsi     # 0x6c25e
movb $0x0, %al
callq 0xc8f0
movq -0x10(%rbp), %rax
movb $0x1, 0x1c(%rax)
jmp 0x4405d
movq -0xc0(%rbp), %rdi
callq 0xcd80
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xb8(%rbp), %rdi
callq 0xc740
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0xb8(%rbp), %rdi
callq 0xc850
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x18(%rax)
movq -0xb8(%rbp), %rdi
movl $0x3a, %esi
callq 0xc520
cmpq $0x0, %rax
je 0x4403d
movq -0xb8(%rbp), %rdi
callq 0xc090
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0xb8(%rbp), %rdi
callq 0xcfc0
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x1a(%rax)
jmp 0x4405b
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movw 0x18(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x1a(%rax)
jmp 0x4405d
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)