// File: /workspace/github_c_makefile_star2_O2/Paxa[P]fast_excel/libxlsxwriter/src/worksheet.c
// Function: check_table_name
lxw_error
_check_table_name(lxw_table_options *user_options)
{
    const char *name;
    char *ptr;
    char first[2] = { 0, 0 };

    if (!user_options)
        return LXW_NO_ERROR;

    if (!user_options->name)
        return LXW_NO_ERROR;

    name = user_options->name;

    /* Check table name length. */
    if (lxw_utf8_strlen(name) > 255) {
        LXW_WARN_FORMAT("worksheet_add_table(): "
                        "Table name exceeds Excel's limit of 255.");
        return LXW_ERROR_255_STRING_LENGTH_EXCEEDED;
    }

    /* Check some short invalid names. */
    if (strlen(name) == 1
        && (name[0] == 'C' || name[0] == 'c' || name[0] == 'R'
            || name[0] == 'r')) {
        LXW_WARN_FORMAT1("worksheet_add_table(): "
                         "invalid table name \"%s\".", name);
        return LXW_ERROR_255_STRING_LENGTH_EXCEEDED;
    }

    /* Check for invalid characters in Table name, while trying to allow
     * for utf8 strings. */
    ptr = strpbrk(name, " !\"#$%&'()*+,-/:;<=>?@[\\]^`{|}~");
    if (ptr) {
        LXW_WARN_FORMAT2("worksheet_add_table(): "
                         "invalid character '%c' in table name \"%s\".",
                         *ptr, name);
        return LXW_ERROR_PARAMETER_VALIDATION;
    }

    /* Check for invalid initial character in Table name, while trying to allow
     * for utf8 strings. */
    first[0] = name[0];
    ptr = strpbrk(first, " !\"#$%&'()*+,-./0123456789:;<=>?@[\\]^`{|}~");
    if (ptr) {
        LXW_WARN_FORMAT2("worksheet_add_table(): "
                         "invalid first character '%c' in table name \"%s\".",
                         *ptr, name);
        return LXW_ERROR_PARAMETER_VALIDATION;
    }

    return LXW_NO_ERROR;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
andw $0x0, 0x6(%rsp)
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x2d5c5
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x2d5c5
movq %rbx, %rdi
callq 0xd150
cmpq $0x100, %rax            # imm = 0x100
jae 0x2d584
movq %rbx, %rdi
callq 0xc4c0
cmpq $0x1, %rax
jne 0x2d523
movzbl (%rbx), %eax
addl $-0x43, %eax
cmpl $0x2f, %eax
ja 0x2d523
movabsq $0x800100008001, %rcx   # imm = 0x800100008001
btq %rax, %rcx
jb 0x2d567
leaq 0x16875(%rip), %rsi     # 0x43d9f
movq %rbx, %rdi
callq 0xcb80
testq %rax, %rax
jne 0x2d5a4
movb (%rbx), %al
leaq 0x6(%rsp), %rdi
movb %al, (%rdi)
leaq 0x168c6(%rip), %rsi     # 0x43e0d
callq 0xcb80
testq %rax, %rax
je 0x2d5c5
movq 0x25aa0(%rip), %rcx     # 0x52ff8
movq (%rcx), %rdi
movsbl (%rax), %edx
leaq 0x168d3(%rip), %rsi     # 0x43e38
jmp 0x2d5b8
movq 0x25a8a(%rip), %rax     # 0x52ff8
movq (%rax), %rdi
leaq 0x167eb(%rip), %rsi     # 0x43d63
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc8d0
jmp 0x2d5a0
movq 0x25a6d(%rip), %rax     # 0x52ff8
movq (%rax), %rcx
leaq 0x16782(%rip), %rdi     # 0x43d17
pushq $0x4b
popq %rsi
pushq $0x1
popq %rdx
callq 0xd000
pushq $0x14
jmp 0x2d5c4
movq 0x25a4d(%rip), %rcx     # 0x52ff8
movq (%rcx), %rdi
movsbl (%rax), %edx
leaq 0x16807(%rip), %rsi     # 0x43dbf
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc8d0
pushq $0xd
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq