// File: /workspace/github_c_makefile_star2_O2/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 0x71ff
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)
pushq $0x20
popq %rdi
callq 0x372f
testq %rax, %rax
je 0x7280
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 0x72c8
leaq 0x49ee(%rip), %rdx      # 0xbc38
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x726b
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x7277
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 0x73b0
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x73bc
movl -0x20(%rbp), %edx
cmpq $0x28, %rdx
ja 0x73cd
movq %rdx, %rcx
addq -0x10(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x20(%rbp)
jmp 0x73d9
movl -0x20(%rbp), %edx
cmpq $0x29, %rdx
jae 0x73e5
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 0x73f8
addq -0x10(%rbp), %rcx
addl $0x10, %edx
movl %edx, -0x20(%rbp)
jmp 0x7404
movl -0x20(%rbp), %ecx
cmpq $0x29, %rcx
jae 0x7410
movq -0x10(%rbp), %rdx
leal 0x8(%rcx), %esi
movl %esi, -0x20(%rbp)
movq (%rdx,%rcx), %rdx
movq %rdx, 0x8(%rax)
cmpl $0x21, %ecx
jae 0x7423
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 0x7434
addq -0x10(%rbp), %rdx
addl $0x18, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x7440
movl -0x20(%rbp), %edx
cmpq $0x29, %rdx
jae 0x744a
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 0x745b
addq -0x10(%rbp), %rcx
addl $0x10, %edx
movl %edx, -0x20(%rbp)
jmp 0x7467
movl -0x20(%rbp), %ecx
cmpq $0x28, %rcx
ja 0x7473
movq %rcx, %rdx
addq -0x10(%rbp), %rdx
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x747f
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
orq $-0x1, 0x10(%rax)
jmp 0x727e
movq -0x18(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x18(%rbp)
cmpl $0x0, (%rcx)
setne 0x8(%rax)
jmp 0x727e
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 0x727e
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 0x727e
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 0x727e
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, -0x18(%rbp)
cmpl $0x0, (%rdx)
setne 0x8(%rax)
cmpl $0x28, %ecx
ja 0x7499
movl %ecx, %edx
addq -0x10(%rbp), %rdx
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x74a5
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, -0x18(%rbp)
cmpl $0x0, (%rdx)
setne 0x9(%rax)
cmpl $0x28, %ecx
ja 0x74bf
movl %ecx, %edx
addq -0x10(%rbp), %rdx
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x74cb
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, -0x18(%rbp)
cmpl $0x0, (%rdx)
setne 0xa(%rax)
cmpl $0x28, %ecx
ja 0x74e5
movl %ecx, %edx
addq -0x10(%rbp), %rdx
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x74f1
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, -0x18(%rbp)
cmpl $0x0, (%rdx)
setne 0xb(%rax)
cmpl $0x28, %ecx
ja 0x750b
movl %ecx, %edx
addq -0x10(%rbp), %rdx
addl $0x8, %ecx
movl %ecx, -0x20(%rbp)
jmp 0x7517
movq -0x18(%rbp), %rdx
leaq 0x8(%rdx), %rcx
movq %rcx, -0x18(%rbp)
movq (%rdx), %rcx
jmp 0x727a