// File: /workspace/github_c_makefile_star2_O3/MaoKo[P]FGFX/fgfl/src/regex_node.c
// Function: new_regex_node
regex_node_t*
new_regex_node(int kind, ...) {
    regex_node_t* node = NEW(regex_node_t, 1);
    if (!node)
        { return (NULL_NODE); }
    memset(node, 0, sizeof(*node));

    va_list args;
    va_start(args, kind);

    switch (kind) {
        case AST_SYMBOL:
            node->symbol = va_arg(args, int);
            node->in_string = va_arg(args, int);

            break;

        case AST_CLASS:
            node->class = va_arg(args, bitset_t*);

            node->cce_lower = va_arg(args, int);
            node->cce_upper = va_arg(args, int);

            break;

        case AST_BOUND_NAME:
            node->bound_name = va_arg(args, char const*);
            node->index_token = -1;

            break;

        case AST_EPSILON:
            break;   

        case AST_DOT:
            node->is_dotall = va_arg(args, int);
            break;

        case AST_STAR:
        case AST_QUES:
        case AST_PLUS:
        case AST_TILDE:
            node->left = va_arg(args, regex_node_t*);
            break;

        case AST_OPTION:
            node->igcase = va_arg(args, int);
            node->dotall = va_arg(args, int);
            node->skipws = va_arg(args, int);
            node->reverse = va_arg(args, int);

            node->left = va_arg(args, regex_node_t*);

            break;

        default:
            node->left = va_arg(args, regex_node_t*);
            node->right = va_arg(args, regex_node_t*);
    }

    node->kind_ast = kind;

    va_end(args);
    return (node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xc8, %rsp
movl %edi, %ebx
movq %rsi, -0xc8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %r8, -0xb0(%rbp)
movq %r9, -0xa8(%rbp)
testb %al, %al
je 0x782b
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movl $0x20, %edi
callq 0x3a4e
testq %rax, %rax
je 0x78ae
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0xd0(%rbp), %rcx
movq %rcx, -0x10(%rbp)
leaq 0x10(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movabsq $0x3000000008, %rcx     # imm = 0x3000000008
movq %rcx, -0x20(%rbp)
leal -0x2(%rbx), %ecx
cmpl $0xa, %ecx
ja 0x78f6
leaq 0x4404(%rip), %rdx      # 0xbc7c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7899
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x78a5
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x10(%rax)
movl %ebx, (%rax)
addq $0xc8, %rsp
popq %rbx
popq %rbp
retq
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7a4e
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7a5a
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7a6e
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7a7a
movl -0x20(%rbp), %edx
cmpq $0x29, %rdx
jae 0x7a86
movq -0x10(%rbp), %rsi
movq %rdx, %rcx
addq $0x8, %rcx
movl %ecx, -0x20(%rbp)
movq (%rsi,%rdx), %rsi
movq %rsi, 0x10(%rax)
cmpl $0x20, %edx
ja 0x7a99
addq -0x10(%rbp), %rcx
addl $0x10, %edx
movl %edx, -0x20(%rbp)
jmp 0x7aa5
movl -0x20(%rbp), %ecx
cmpq $0x29, %rcx
jae 0x7ab1
movq -0x10(%rbp), %rdx
leal 0x8(%rcx), %esi
movl %esi, -0x20(%rbp)
movq (%rdx,%rcx), %rdx
movq %rdx, 0x8(%rax)
cmpl $0x21, %ecx
jae 0x7ac4
movq -0x10(%rbp), %rsi
movq %rcx, %rdx
addq $0x10, %rdx
movl %edx, -0x20(%rbp)
movl 0x8(%rsi,%rcx), %esi
movl %esi, 0x10(%rax)
cmpl $0x18, %ecx
ja 0x7ad5
addq -0x10(%rbp), %rdx
addl $0x18, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x7ae1
movl -0x20(%rbp), %edx
cmpq $0x29, %rdx
jae 0x7aeb
movq -0x10(%rbp), %rsi
movq %rdx, %rcx
addq $0x8, %rcx
movl %ecx, -0x20(%rbp)
movl (%rsi,%rdx), %esi
movl %esi, 0x8(%rax)
cmpl $0x20, %edx
ja 0x7afc
addq -0x10(%rbp), %rcx
addl $0x10, %edx
movl %edx, -0x20(%rbp)
jmp 0x7b08
movl -0x20(%rbp), %ecx
cmpq $0x29, %rcx
jae 0x7b14
movq -0x10(%rbp), %rsi
leaq 0x8(%rcx), %rdx
movl %edx, -0x20(%rbp)
cmpl $0x0, (%rsi,%rcx)
setne 0x8(%rax)
cmpl $0x21, %ecx
jae 0x7b27
movq -0x10(%rbp), %rsi
leal 0x10(%rcx), %edi
movl %edi, -0x20(%rbp)
cmpl $0x0, (%rsi,%rdx)
setne 0x9(%rax)
cmpl $0x19, %ecx
jae 0x7b3a
movq -0x10(%rbp), %rsi
leaq 0x18(%rcx), %rdx
movl %edx, -0x20(%rbp)
cmpl $0x0, 0x10(%rsi,%rcx)
setne 0xa(%rax)
cmpl $0x11, %ecx
jae 0x7b4d
movq -0x10(%rbp), %rdi
movl %ecx, %esi
orl $0x20, %esi
movl %esi, -0x20(%rbp)
cmpl $0x0, (%rdi,%rdx)
setne 0xb(%rax)
cmpl $0x28, %esi
ja 0x7b60
movl %esi, %edx
addq -0x10(%rbp), %rdx
addl $0x28, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x7b6c
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq $-0x1, 0x10(%rax)
jmp 0x78ac
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x8(%rax)
jmp 0x78ac
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x78ac
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rcx
movq %rcx, -0x18(%rbp)
movl (%rdx), %ecx
movl %ecx, 0x14(%rax)
jmp 0x78ac
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0xc(%rax)
jmp 0x78ac
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x8(%rax)
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x9(%rax)
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0xa(%rax)
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0xb(%rax)
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rcx
movq %rcx, -0x18(%rbp)
movq (%rdx), %rcx
jmp 0x78a8