// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/regex.c
// Function: regex_atom
static regex_node_t*
regex_atom(void) {
    int kind = peek_token(regex_spec->lex);
    if (kind == T_REG_LBRACK)
        { return (regex_fullccl()); }
    else if (kind == T_REG_QUOTE)
        { return (regex_string()); }
    else if (kind == T_REG_OPTION)
        { return (regex_option()); }
    else if (kind == T_REG_LPAREN) {
        advance_token(regex_spec->lex);
        regex_node_t* root = regex_union();

        if (advance_token(regex_spec->lex) != T_REG_RPAREN) {
            del_regex_node(root);
            errorf(CURRENT_LINE(regex_spec->lex),
                                "Missing a close paren (')').");
            return (NULL_NODE);
        }
        return (root);
    }
    else if (kind == T_REG_DOT) {
        advance_token(regex_spec->lex);
        return (new_regex_node(AST_DOT, false));
    }
    else if (kind == T_REG_BOUND_NAME) {
        advance_token(regex_spec->lex);
        unget_char_back_buffer(LAST_LEXEME(regex_spec->lex), 1);
        return (new_regex_node(AST_BOUND_NAME,
                                strdup(C_LEXEME(regex_spec->lex) + 1)));
    }
    else if ((kind == T_REG_CHAR)
                        || (kind == T_OCT_NUM) || (kind == T_HEX_NUM))  {
        int val_lexeme;
        if ((val_lexeme = regex_char(kind)) != ERROR) {
            advance_token(regex_spec->lex);
            return (new_regex_node(AST_SYMBOL, val_lexeme, false));
        }
        else
            { return (NULL_NODE); }
    }
    else {
        errorf(CURRENT_LINE(regex_spec->lex),
                        "Unrecognized rule. Missing a char in the regex.");
        return (NULL_NODE);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x19c61(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x3300
movl %eax, -0xc(%rbp)
cmpl $0x16, -0xc(%rbp)
jne 0x817e
callq 0x8320
movq %rax, -0x8(%rbp)
jmp 0x8316
cmpl $0xc, -0xc(%rbp)
jne 0x8192
callq 0x84f0
movq %rax, -0x8(%rbp)
jmp 0x8316
cmpl $0x20, -0xc(%rbp)
jne 0x81a6
callq 0x8630
movq %rax, -0x8(%rbp)
jmp 0x8316
cmpl $0x8, -0xc(%rbp)
jne 0x8218
movq 0x19c0d(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
callq 0x7be0
movq %rax, -0x18(%rbp)
movq 0x19bf5(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
cmpq $0x9, %rax
je 0x820b
movq -0x18(%rbp), %rdi
callq 0xa380
movq 0x19bd7(%rip), %rax     # 0x21dc0
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x6c4f(%rip), %rsi      # 0xee46
movb $0x0, %al
callq 0x4230
movq $0x0, -0x8(%rbp)
jmp 0x8316
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8316
cmpl $0xa, -0xc(%rbp)
jne 0x8244
movq 0x19b9b(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
movl $0x9, %edi
xorl %esi, %esi
movb $0x0, %al
callq 0x9c00
movq %rax, -0x8(%rbp)
jmp 0x8316
cmpl $0xd, -0xc(%rbp)
jne 0x82a0
movq 0x19b6f(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
movq 0x19b60(%rip), %rax     # 0x21dc0
movq (%rax), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x2950
movq 0x19b48(%rip), %rax     # 0x21dc0
movq (%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
addq $0x1, %rdi
callq 0x1190
movq %rax, %rsi
movl $0x8, %edi
movb $0x0, %al
callq 0x9c00
movq %rax, -0x8(%rbp)
jmp 0x8316
cmpl $0x1f, -0xc(%rbp)
je 0x82b2
cmpl $0x1d, -0xc(%rbp)
je 0x82b2
cmpl $0x1e, -0xc(%rbp)
jne 0x82f2
movl -0xc(%rbp), %edi
callq 0x88b0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x82e8
movq 0x19af7(%rip), %rax     # 0x21dc0
movq (%rax), %rdi
callq 0x2cc0
movl -0x1c(%rbp), %esi
movl $0xa, %edi
xorl %edx, %edx
movb $0x0, %al
callq 0x9c00
movq %rax, -0x8(%rbp)
jmp 0x8316
movq $0x0, -0x8(%rbp)
jmp 0x8316
movq 0x19ac7(%rip), %rax     # 0x21dc0
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x6b5c(%rip), %rsi      # 0xee63
movb $0x0, %al
callq 0x4230
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq