// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/regex.c
// Function: regex_ccl
static bitset_t*
regex_ccl(bool* cce_lower, bool* cce_upper) {
    bitset_t* range = new_bitset();
    while (!in_first(regex_spec->lex, T_REG_RBRACK, T_EOF, -1)) {
        int kind_right = advance_token(regex_spec->lex);
        if (kind_right == T_ERROR) {
            del_bitset(range);
            return (NULL_BITSET);
        }
        else if (kind_right > T_CC_FIRST && kind_right < T_CC_LAST) {
            bitset_t* (*cce_ptr)(int) = NULL;
            if (kind_right < T_CC_MIDDLE) {
                cce_ptr = &regex_cce;
                if (!*cce_lower)
                    { (*cce_lower) = (kind_right == T_CCE_LOWER); }
                if (!*cce_upper)
                    { (*cce_upper) = (kind_right == T_CCE_UPPER); }
            }
            else
                { cce_ptr = &regex_n_cce; }
            bitset_t* cce_range = (*cce_ptr)(kind_right);
            UNION_BITSET(range, cce_range);
            del_bitset(cce_range);
        }
        else {
            size_t min_range = regex_char(kind_right);

            if (peek_token(regex_spec->lex) == T_REG_HYPHEN) {
                advance_token(regex_spec->lex);
                int kind_left = advance_token(regex_spec->lex);

                size_t max_range = regex_char(kind_left);
                add_range_bitset(range, min_range, max_range + 1);

                if (max_range < min_range) {
                    warnf(CURRENT_LINE(regex_spec->lex),
                        "The min range %c is greater than the max range %c.",
                        min_range, max_range);
                }
                else if (max_range == min_range) {
                    warnf(CURRENT_LINE(regex_spec->lex),
                        "The min range and max range are both equal.");
                    ADD_BITSET(range, min_range);
                }
            }
            else
                { ADD_BITSET(range, min_range); }
        }
    }
    return (range);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
callq 0x12b0
movq %rax, -0x20(%rbp)
movq 0x191c0(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
movl $0x17, %esi
movl $0x70, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movb $0x0, %al
callq 0x3350
xorb $-0x1, %al
testb $0x1, %al
jne 0x8c24
jmp 0x8e43
movq 0x19195(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
movl %eax, -0x24(%rbp)
cmpl $0x6f, -0x24(%rbp)
jne 0x8c52
movq -0x20(%rbp), %rdi
callq 0x1320
movq $0x0, -0x8(%rbp)
jmp 0x8e4b
cmpl $0x4a, -0x24(%rbp)
jle 0x8ce8
cmpl $0x64, -0x24(%rbp)
jge 0x8ce8
movq $0x0, -0x30(%rbp)
cmpl $0x57, -0x24(%rbp)
jge 0x8cb3
leaq 0x1e5(%rip), %rax       # 0x8e60
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, (%rax)
jne 0x8c98
cmpl $0x50, -0x24(%rbp)
sete %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
jne 0x8cb1
cmpl $0x55, -0x24(%rbp)
sete %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
jmp 0x8cbe
leaq 0x536(%rip), %rax       # 0x91f0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl -0x24(%rbp), %edi
callq *%rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
xorl %edi, %edi
callq 0x18b0
movq -0x38(%rbp), %rdi
callq 0x1320
jmp 0x8e3c
movl -0x24(%rbp), %edi
callq 0x88b0
cltq
movq %rax, -0x40(%rbp)
movq 0x190c3(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x3300
cmpl $0x1a, %eax
jne 0x8df3
movq 0x190ab(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
movq 0x1909c(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
callq 0x88b0
cltq
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq $0x1, %rdx
callq 0x1630
movq -0x50(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x8d82
movq 0x1905d(%rip), %rax     # 0x21dc0
movq (%rax), %rax
movslq 0x28(%rax), %rdi
movq -0x40(%rbp), %rdx
movq -0x50(%rbp), %rcx
leaq 0x619a(%rip), %rsi      # 0xef13
movb $0x0, %al
callq 0x43e0
jmp 0x8df1
movq -0x50(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x8def
movq 0x1902d(%rip), %rax     # 0x21dc0
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x61a5(%rip), %rsi      # 0xef46
movb $0x0, %al
callq 0x43e0
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jb 0x8dc7
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1440
jmp 0x8def
movq -0x40(%rbp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x8df1
jmp 0x8e3a
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jb 0x8e12
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1440
jmp 0x8e3a
movq -0x40(%rbp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x40(%rbp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x8e3c
jmp 0x8e3e
jmp 0x8bf9
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)