// File: /workspace/github_c_makefile_star2_O1/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 0x79a3
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 0x3b4a
testq %rax, %rax
je 0x7a11
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 0x7a72
leaq 0x428c(%rip), %rdx      # 0xbc7c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7a15
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7a21
xorl %eax, %eax
jmp 0x7a2a
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 0x7aee
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7afa
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7b0e
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7b1a
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7b26
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7b32
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7b69
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7b75
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7bd3
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7bdf
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7c14
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7c20
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq $-0x1, 0x10(%rax)
jmp 0x7a28
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x8(%rax)
jmp 0x7a28
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x10(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7b51
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7b5d
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x7a28
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7b94
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7ba0
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7bbd
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7bc9
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movl (%rcx), %ecx
movl %ecx, 0x14(%rax)
jmp 0x7a28
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7bfc
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7c08
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0xc(%rax)
jmp 0x7a28
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x8(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7c3f
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7c4b
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x9(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7c6a
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7c76
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0xa(%rax)
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x7c95
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7ca1
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0xb(%rax)
jmp 0x79f9