// File: /workspace/github_cpp_makefile_star2_O1/arnoldrobbins[P]mcilroy-regex/re2.cpp
// Function: regbra(Cenv*)
static Rex*			// bracket expression
regbra(Cenv *env)
{
	Class *r = (Class*)NEW(Class);
	Set set;
	int c, i, neg, last, inrange, init;
	neg = 0;
	if(env->cursor.n>0 && *env->cursor.p=='^') {
		env->cursor.next();
		neg = 1;
	}
	if(env->cursor.n < 2)
		goto error;
	inrange = 0;	// 0=no, 1=possibly, 2=definitely
	for(init=1; ; init=0) {
		if(env->cursor.n <= 0)
			goto error;
		c = *env->cursor.p;
		env->cursor.next();
		if(c == ']') {
			if(init) {
				last = c;
				inrange = 1;
				continue;
			}
			if(inrange != 0)
				set.insert(last);
			if(inrange == 2)
				set.insert('-');
			break;
		} else if(c == '-') {
			if(inrange == 0 && !init)
				goto error;
			if(inrange == 1) {
				inrange = 2;
				continue;
			}
		} else if(c == '[') {
			if(env->cursor.n < 2)
				goto error;
			c = *env->cursor.p;
			switch(c) {
			case ':':
				env->cursor.next();
				if(inrange == 1)
					set.insert(last);
				if(!getcharcl(c, &set, env))
					goto error;
				inrange = 0;
				continue;
			case '=':
				env->cursor.next();
				if(inrange == 2)
					goto error;
				if(inrange == 1)
					set.insert(last);
				i = findcollelem(c, env);
				if(i == -1)
					goto error;
				set.insert(i);
				inrange = 0;
				continue;
			case '.':
				env->cursor.next();
				c = findcollelem(c, env);
				if(c == -1)
					goto error;
				break;
			default:
				c = '[';
			}
		}
		if(inrange == 2) {
			if(last > c)
				goto error;
			for(i=last; i<=c; i++)
				set.insert(i);
			inrange = 0;
		} else if(inrange == 1)
			set.insert(last);
		else
			inrange = 1;
		last = c;
	}
	r->orset(&set);
	r->icase(env->map);
	if(neg)
		r->neg(env->flags);
	return r;
error:
	delete r;
	return ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r15
movl $0x40, %edi
callq 0x5170
movq %rax, %rdi
movb $0x7, 0x8(%rax)
movq $0x0, 0x10(%rax)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x18(%rdi)
leaq 0x6cce(%rip), %rax      # 0x12758
leaq 0x10(%rax), %rcx
movq %rcx, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
testb $0x4, 0x1(%r15)
je 0xbaab
callq *0x18(%rax)
xorps %xmm0, %xmm0
xorl %edi, %edi
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movb $0x1, %cl
cmpl $0x0, 0x10(%r15)
movq %rdi, 0x10(%rsp)
jle 0xbad9
movq 0x8(%r15), %rax
cmpb $0x5e, (%rax)
jne 0xbad9
incq %rax
movq %rax, 0x8(%r15)
decl 0x10(%r15)
xorl %ecx, %ecx
movl %ecx, 0x8(%rsp)
cmpl $0x2, 0x10(%r15)
jl 0xbd75
cmpl $0x0, 0x10(%r15)
jle 0xbd75
xorl %ecx, %ecx
movb $0x1, %sil
xorl %ebp, %ebp
movq 0x8(%r15), %rdx
movzbl (%rdx), %r12d
leaq 0x1(%rdx), %rdi
movl 0x10(%r15), %eax
leal -0x1(%rax), %r8d
movq %rdi, 0x8(%r15)
movl %r8d, 0x10(%r15)
cmpl $0x2d, %r12d
je 0xbc37
cmpl $0x5b, %r12d
je 0xbb49
cmpl $0x5d, %r12d
jne 0xbca7
testb $0x1, %cl
jne 0xbd99
movl $0x1, %eax
movl $0x5d, %r12d
jmp 0xbd17
cmpl $0x2, 0x10(%r15)
jl 0xbd75
movzbl (%rdi), %ecx
cmpl $0x2e, %ecx
je 0xbc7f
cmpl $0x3d, %ecx
je 0xbc61
movl $0x5b, %r12d
cmpl $0x3a, %ecx
jne 0xbca7
addq $0x2, %rdx
movq %rdx, 0x8(%r15)
addl $-0x2, %eax
movl %eax, 0x10(%r15)
cmpl $0x1, %ebp
jne 0xbb99
movzbl %bl, %esi
leaq 0x20(%rsp), %rdi
callq 0x81d8
movl 0x10(%r15), %eax
movl %eax, 0xc(%rsp)
movl $0x8, %r14d
movq %r15, 0x18(%rsp)
leaq 0x712d(%rip), %rax      # 0x12ce0
movq -0x8(%r14,%rax), %rbp
movq %rbp, %rdi
callq 0x50d0
leal 0x2(%rax), %r15d
movl 0xc(%rsp), %r13d
subl %r15d, %r13d
jle 0xbc21
movq %rax, %r12
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movslq %r12d, %rdx
movq %rbp, %rdi
movq %rax, %rbp
movq %rax, %rsi
movq %rdx, 0x40(%rsp)
callq 0x50e0
testl %eax, %eax
jne 0xbc21
movq 0x40(%rsp), %rax
cmpb $0x3a, (%rbp,%rax)
jne 0xbc21
shlq $0x20, %r12
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r12
sarq $0x20, %r12
cmpb $0x5d, (%rbp,%r12)
je 0xbd2d
addq $0x10, %r14
cmpq $0xc8, %r14
jne 0xbbac
jmp 0xbd75
testl %ebp, %ebp
sete %al
xorb $0x1, %sil
testb %sil, %al
jne 0xbd75
movl $0x2d, %r12d
movl $0x2, %eax
cmpl $0x1, %ebp
jne 0xbca7
movl %ebx, %r12d
jmp 0xbd17
addq $0x2, %rdx
movq %rdx, 0x8(%r15)
addl $-0x2, %eax
movl %eax, 0x10(%r15)
cmpl $0x1, %ebp
je 0xbce4
cmpl $0x2, %ebp
jne 0xbcf1
jmp 0xbd75
addq $0x2, %rdx
movq %rdx, 0x8(%r15)
addl $-0x2, %eax
movl %eax, 0x10(%r15)
movl $0x2e, %edi
movq %r15, %rsi
callq 0xbdf0
movl %eax, %r12d
cmpl $-0x1, %eax
je 0xbd75
cmpl $0x1, %ebp
je 0xbcd9
cmpl $0x2, %ebp
jne 0xbcdd
cmpl %r12d, %ebx
jg 0xbd75
leal 0x1(%r12), %ebp
leaq 0x20(%rsp), %r14
movzbl %bl, %esi
movq %r14, %rdi
callq 0x81d8
incl %ebx
cmpl %ebx, %ebp
jne 0xbcc4
xorl %eax, %eax
jmp 0xbd17
movl %ebx, %eax
jmp 0xbd08
movl $0x1, %eax
jmp 0xbd17
movzbl %bl, %esi
leaq 0x20(%rsp), %rdi
callq 0x81d8
movl $0x3d, %edi
movq %r15, %rsi
callq 0xbdf0
cmpl $-0x1, %eax
je 0xbd75
xorl %ebp, %ebp
movl %ebx, %r12d
movzbl %al, %esi
leaq 0x20(%rsp), %rdi
callq 0x81d8
movl %ebp, %eax
movb $0x1, %cl
xorl %esi, %esi
cmpl $0x0, 0x10(%r15)
movl %eax, %ebp
movl %r12d, %ebx
jg 0xbafa
jmp 0xbd75
movslq %r15d, %rax
addq %rax, %rbp
movq 0x18(%rsp), %r15
movq %rbp, 0x8(%r15)
movl %r13d, 0x10(%r15)
leaq 0x6f99(%rip), %rax      # 0x12ce0
movq (%r14,%rax), %r14
xorl %ebp, %ebp
movl %ebp, %edi
callq *%r14
testl %eax, %eax
je 0xbd64
movzbl %bpl, %esi
leaq 0x20(%rsp), %rdi
callq 0x81d8
incl %ebp
xorl %eax, %eax
cmpl $0x100, %ebp            # imm = 0x100
jne 0xbd4d
jmp 0xbc59
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xbd85
movq (%rdi), %rax
callq *0x8(%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
je 0xbdbe
movzbl %bl, %esi
leaq 0x20(%rsp), %rdi
callq 0x81d8
cmpl $0x2, %ebp
jne 0xbdbe
leaq 0x20(%rsp), %rdi
movl $0x2d, %esi
callq 0x81d8
leaq 0x20(%rsp), %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x854c
movq 0x28(%r15), %rsi
movq %rbx, %rdi
callq 0x857a
cmpb $0x0, 0x8(%rsp)
jne 0xbd87
movl (%r15), %esi
movq %rbx, %rdi
callq 0x8560
jmp 0xbd87