// File: cjxgm[P]libgpp/src/libgpp.cpp
// Function: (anonymous namespace)::make_charset_subset(unsigned char const*)
Charset_Subset make_charset_subset(unsigned char const* s) {
        Charset_Subset x;
        int i;
        unsigned char c;

        x = XX malloc(CHARSET_SUBSET_LEN * sizeof(std::uint32_t));
        for (i = 0; i < CHARSET_SUBSET_LEN; i++)
            x[i] = 0;
        while (*s != 0) {
            if (!((*s) & 0x60)) { // special sequences
                if ((*s) & 0x80)
                    bug("negated special sequences not allowed in charset specifications");
                switch ((*s) & 0x1f) {
                case '\002': // \w, \W, \i, \o, \O not allowed
                case '\004':
                case '\010':
                case '\013':
                case '\014':
                    bug("special sequence not allowed in charset specification");
                case '\003':
                    add_to_charset(x, '\n');
                    // fallthrough
                case '\001':
                    add_to_charset(x, ' ');
                    // fallthrough
                case '\011':
                    add_to_charset(x, '\t');
                    break;
                case '\006':
                    add_to_charset(x, '\n');
                    add_to_charset(x, ' ');
                    add_to_charset(x, '\t');
                    // fallthrough
                case '\005':
                    for (c = 'A'; c <= 'Z'; c++)
                        add_to_charset(x, c);
                    for (c = 'a'; c <= 'z'; c++)
                        add_to_charset(x, c);
                    break;
                case '\007':
                    for (c = '0'; c <= '9'; c++)
                        add_to_charset(x, c);
                    break;
                case '\012':
                    add_to_charset(x, '\n');
                    break;
                }
            } else if ((s[1] == '-') && ((s[2] & 0x60) != 0) && (s[2] >= *s)) {
                for (c = *s; c <= s[2]; c++)
                    add_to_charset(x, c);
                s += 2;
            } else
                add_to_charset(x, *s);
            s++;
        }
        return x;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x20, %edi
callq 0x21a0
movq %rax, %rsi
leaq -0x21(%rbp), %rdi
callq 0x3060
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x35c0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x312a
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x310a
jmp 0x312c
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x3314
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x60, %eax
cmpl $0x0, %eax
jne 0x3283
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x316c
leaq 0x84c3(%rip), %rdi      # 0xb62a
callq 0x35e0
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
andl $0x1f, %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0xb, %eax
ja 0x327e
movq -0x30(%rbp), %rax
leaq 0x815e(%rip), %rcx      # 0xb2f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x84c8(%rip), %rdi      # 0xb66a
callq 0x35e0
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x3640
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x3640
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x3640
jmp 0x327e
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x3640
movq -0x10(%rbp), %rdi
movl $0x20, %esi
callq 0x3640
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x3640
movb $0x41, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
cmpl $0x5a, %eax
jg 0x3224
movq -0x10(%rbp), %rdi
movzbl -0x15(%rbp), %esi
callq 0x3640
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x3204
movb $0x61, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
cmpl $0x7a, %eax
jg 0x3248
movq -0x10(%rbp), %rdi
movzbl -0x15(%rbp), %esi
callq 0x3640
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x3228
jmp 0x327e
movb $0x30, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
cmpl $0x39, %eax
jg 0x326e
movq -0x10(%rbp), %rdi
movzbl -0x15(%rbp), %esi
callq 0x3640
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x324e
jmp 0x327e
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x3640
jmp 0x3303
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x2d, %eax
jne 0x32f1
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
andl $0x60, %eax
cmpl $0x0, %eax
je 0x32f1
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
movq -0x8(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x32f1
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
movq -0x8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jg 0x32e3
movq -0x10(%rbp), %rdi
movzbl -0x15(%rbp), %esi
callq 0x3640
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x32bc
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x8(%rbp)
jmp 0x3301
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movzbl (%rax), %esi
callq 0x3640
jmp 0x3303
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x312c
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop