// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/regex_node.c
// Function: set_igcase
regex_node_t*
set_igcase(regex_node_t* root) {
    if (!root)
        { return (NULL_NODE); }
    else if ((root->kind_ast == AST_SYMBOL) || (root->kind_ast == AST_CLASS)) {
        if ((root->kind_ast == AST_SYMBOL) && isalpha(root->symbol)) {
            size_t back_symbol = root->symbol;
            root->kind_ast = AST_CLASS;

            root->class = new_bitset();
            root->cce_lower = root->cce_upper = -1;

            ADD_BITSET(root->class, back_symbol);
        }

        if (root->kind_ast == AST_CLASS) {
            if (root->cce_lower != -1) {
                warnf(root->cce_lower,
                                "[:lower:] is use in ignore case option.");
            } 
            if (root->cce_upper != -1) {
                warnf(root->cce_upper,
                                "[:upper:] is use in ignore case option.");
            } 

            int i;
            while ((i = IT_NEXT(root->class)) != IT_NULL) {
                if (isalpha(i)) {
                    size_t target = (islower(i) ? toupper(i) : tolower(i));
                    ADD_BITSET(root->class, target);    
                }   
            } 
            IT_RESET(root->class);
        }
    }
    return (root);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xabf0
movq $0x0, -0x8(%rbp)
jmp 0xae39
movq -0x10(%rbp), %rax
cmpl $0xa, (%rax)
je 0xac06
movq -0x10(%rbp), %rax
cmpl $0xc, (%rax)
jne 0xae2f
movq -0x10(%rbp), %rax
cmpl $0xa, (%rax)
jne 0xacc4
callq 0x11a0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xacc4
movq -0x10(%rbp), %rax
movslq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl $0xc, (%rax)
callq 0x12b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jb 0xac98
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1440
jmp 0xacc4
movq -0x18(%rbp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
cmpl $0xc, (%rax)
jne 0xae2d
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x10(%rax)
je 0xacf1
movq -0x10(%rbp), %rax
movslq 0x10(%rax), %rdi
leaq 0x43ee(%rip), %rsi      # 0xf0d8
movb $0x0, %al
callq 0x43e0
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x14(%rax)
je 0xad11
movq -0x10(%rbp), %rax
movslq 0x14(%rax), %rdi
leaq 0x43f6(%rip), %rsi      # 0xf100
movb $0x0, %al
callq 0x43e0
jmp 0xad13
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1ac0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0xaddd
callq 0x11a0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xadd8
callq 0x11a0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xad71
movl -0x1c(%rbp), %edi
callq 0x1050
movl %eax, -0x2c(%rbp)
jmp 0xad7c
movl -0x1c(%rbp), %edi
callq 0x1110
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cltq
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jb 0xadac
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x1440
jmp 0xadd8
movq -0x28(%rbp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0xad13
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xadea
jmp 0xae2d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
testb $0x1, 0x54(%rax)
jne 0xae0e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, 0x50(%rax)
xorl %eax, %eax
movl %eax, -0x30(%rbp)
jmp 0xae2a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %eax, 0x50(%rcx)
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
jmp 0xae2f
jmp 0xae31
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)