// File: /workspace/github_cpp_makefile_star2_O2/arnoldrobbins[P]mcilroy-regex/re2.cpp
// Function: regSeq(Cenv*)
static Rex *
regSeq(Cenv *env)
{
	Rex *e, *f, *g;
	int c, parno;
	uchar ch;
	uchar data[101];
	if(cdebug)
		printf("regSeq %lx.%d parno=%d\n",
			(unsigned long)env->cursor.p, env->cursor.n, env->parno);
	Seg string(data, 0);
	for( ;  ; ch = c) {	// get string
		c = token(env);
		if(c>T_META || (unsigned)string.n>=sizeof(data)-1)
			break;
		string.p[string.n++] = c;
		eat(env);
	}
	if(c == T_BAD)
		return ERROR;
	if(string.n > 0) switch(c) {
	case T_STAR:
	case T_PLUS:
	case T_LEFT:
	case T_QUES:
	case T_BANG:
		string.n--;
		if(string.n < 0)
			return ERROR;
		if(string.n == 0)
			e = NEW(Ok);
		else {
			Seg copy = string.copy();
			if(copy.p == 0)
				return ERROR;
			e = NEW(String(copy, env->map));
		}
		f = NEW(Onechar(env->map[ch]));
		f = regRep(f, 0, 0, env);
		if(f == ERROR) {
			delete e;
			return f;
		}
		g = regSeq(env);
		return mkSeq(e, mkSeq(f, g));
	default:
		e = NEW(String(string.copy(), env->map));
		f = regSeq(env);
		return mkSeq(e, f);
	} else if(c > T_BACK) {
		eat(env);
		c -= T_BACK;
		if(c>env->parno || env->paren[c] == 0)
			return ERROR;
		env->backref |= 1<<c;
		e = regRep(NEW(Back(c)), 0, 0, env);
	} else switch(c) {
	case T_AND:
	case T_CLOSE:
	case T_BAR:
	case T_END:
		return NEW(Ok);
	case T_DOLL:
		eat(env);
		e = regRep(NEW(End), 0, 0, env);
		break;
	case T_CFLX:
		eat(env);
		e = NEW(Anchor);
		if(env->flags&REG_EXTENDED)
			e = regRep(e, 0, 0, env);
		break;
	case T_OPEN:
		eat(env);
		++env->parnest;
		parno = ++env->parno;
		e = regAlt(parno+1, env);
		if(e == ERROR)
			break;
		if(e->type==OK && env->flags&REG_EXTENDED) {
			delete e;
			return ERROR;
		} 
		if(token(env) != T_CLOSE) {
			delete e;
			return ERROR;
		}
		--env->parnest;
		eat(env);
		if(parno <= BACK_REF_MAX)
			env->paren[parno] = 1;
		e = NEW(Subexp(parno, e));
		if(e == ERROR)
			break;
		e = regRep(e, parno, env->parno, env);
		break;
	case T_BRA:
		eat(env);
		e = regRep(regbra(env), 0, 0, env);
		break;
	case T_DOT:
		eat(env);
		e = regRep(NEW(Dot), 0, 0, env);
		break;
	default:
		return ERROR;
	}
	if(e != ERROR && env->cursor.n > 0)
		e = mkSeq(e, regSeq(env));
	return e;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
andl $0x0, 0x38(%rsp)
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x9f98
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jg 0xa0f1
cmpl $0x63, %r14d
ja 0xa0f1
leaq 0x1(%r14), %r12
movl %r12d, 0x38(%rsp)
movb %r15b, 0x70(%rsp,%r14)
movq %rbx, %rdi
callq 0xafb1
movq %r12, %r14
movl %r15d, %r13d
jmp 0xa0bb
cmpl $0x104, %r15d           # imm = 0x104
jne 0xa102
xorl %r14d, %r14d
jmp 0xa5a1
movabsq $0x100000001, %r12      # imm = 0x100000001
testl %r14d, %r14d
je 0xa178
addl $0xfffffefa, %r15d      # imm = 0xFFFFFEFA
cmpl $0xa, %r15d
ja 0xa314
movl $0x427, %eax            # imm = 0x427
btl %r15d, %eax
jae 0xa314
leal -0x1(%r14), %eax
movl %eax, 0x38(%rsp)
cmpl $0x1, %r14d
jne 0xa1ee
pushq $0x18
popq %rdi
callq 0x5170
movq %rax, %r14
movb $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x74ba(%rip), %rax      # 0x11618
leaq 0x10(%rax), %rcx
movq %rcx, (%r14)
testb $0x4, 0x1(%rbx)
je 0xa237
addq $0x18, %rax
jmp 0xa22f
cmpl $0x201, %r15d           # imm = 0x201
jl 0xa2a2
movq %rbx, %rdi
callq 0xafb1
addl $0xfffffe00, %r15d      # imm = 0xFFFFFE00
cmpl 0x30(%rbx), %r15d
jg 0xa0fa
movl %r15d, %eax
cmpb $0x0, 0x3b(%rbx,%rax)
je 0xa0fa
pushq $0x1
popq %rax
movl %r15d, %ecx
shll %cl, %eax
orw %ax, 0x38(%rbx)
pushq $0x20
popq %rdi
callq 0x5170
movq %rax, %rdi
movb $0x8, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x793d(%rip), %rax      # 0x11b10
movq %rax, (%rdi)
movl %r15d, 0x18(%rdi)
testb $0x4, 0x1(%rbx)
je 0xa56d
callq 0xae50
jmp 0xa4bf
leaq 0x30(%rsp), %rdi
callq 0x79f0
testq %rax, %rax
je 0xa0fa
movq %rax, %r15
movl %edx, %ebp
pushq $0x28
popq %rdi
callq 0x5170
movq %rax, %r14
movq 0x28(%rbx), %rcx
movq %rax, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x7d78
testb $0x4, 0x1(%rbx)
je 0xa237
movq (%r14), %rax
addq $0x8, %rax
movq %r14, %rdi
callq *(%rax)
xorl %r14d, %r14d
pushq $0x28
popq %rdi
callq 0x5170
movq %rax, %rdi
movq 0x28(%rbx), %rax
movzbl %r13b, %ecx
movb (%rax,%rcx), %cl
movb $0x4, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %r12, 0x18(%rdi)
leaq 0x7547(%rip), %rax      # 0x117a8
leaq 0x10(%rax), %rdx
movq %rdx, (%rdi)
movb %cl, 0x20(%rdi)
testb $0x4, 0x1(%rbx)
je 0xa276
callq *0x18(%rax)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0xa8c8
testq %rax, %rax
je 0xa2fd
movq %rax, %r15
movq %rbx, %rdi
callq 0xa095
movq %r15, %rdi
movq %rax, %rsi
callq 0xab3f
jmp 0xa593
xorl %r14d, %r14d
addl $0xfffffeff, %r15d      # imm = 0xFFFFFEFF
cmpl $0xe, %r15d
ja 0xa5a1
leaq 0x221b(%rip), %rax      # 0xc4d8
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
pushq $0x18
popq %rdi
callq 0x5170
movq %rax, %r14
movb $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x7337(%rip), %rax      # 0x11618
leaq 0x10(%rax), %rcx
movq %rcx, (%r14)
testb $0x4, 0x1(%rbx)
je 0xa5a1
movq %r14, %rdi
callq *0x18(%rax)
jmp 0xa0fa
testq %r14, %r14
je 0xa0fa
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0xa0fa
pushq $0x28
popq %rdi
callq 0x5170
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x79f0
movq 0x28(%rbx), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x7d78
testb $0x4, 0x1(%rbx)
je 0xa58b
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %r14d, %r14d
jmp 0xa58b
movq %rbx, %rdi
callq 0xafb1
pushq $0x18
popq %rdi
callq 0x5170
movq %rax, %rdi
movb $0x2, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x7342(%rip), %rax      # 0x116b8
jmp 0xa4ab
movq %rbx, %rdi
callq 0xafb1
movq 0x30(%rbx), %r15
movq %r15, %xmm1
pcmpeqd %xmm0, %xmm0
psubd %xmm0, %xmm1
movdqa %xmm1, 0x10(%rsp)
movq %xmm1, 0x30(%rbx)
leal 0x2(%r15), %edi
movq %rbx, %rsi
callq 0x9c54
testq %rax, %rax
je 0xa0fa
movq %rax, %r14
cmpb $0x0, 0x8(%rax)
jne 0xa3c6
testb $0x1, (%rbx)
jne 0xa306
movq %rbx, %rdi
callq 0x9f98
cmpl $0x10a, %eax            # imm = 0x10A
jne 0xa306
decl 0x34(%rbx)
movq %rbx, %rdi
callq 0xafb1
movdqa 0x10(%rsp), %xmm0
movd %xmm0, %ebp
cmpl $0x8, %r15d
jg 0xa3fc
movslq %ebp, %rax
movb $0x1, 0x3b(%rbx,%rax)
pushq $0x28
popq %rdi
callq 0x5170
movb $0x9, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x774c(%rip), %rcx      # 0x11b60
movq %rcx, (%rax)
movw %bp, 0x18(%rax)
movb $0x0, 0x1a(%rax)
movq %r14, 0x20(%rax)
testb $0x4, 0x1(%rbx)
jne 0xa846
movl 0x30(%rbx), %edx
movq %rax, %rdi
movl %ebp, %esi
jmp 0xa571
movq %rbx, %rdi
callq 0xafb1
pushq $0x18
popq %rdi
callq 0x5170
movq %rax, %r14
movb $0x1, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x720b(%rip), %rcx      # 0x11668
leaq 0x10(%rcx), %rax
movq %rax, (%r14)
movl (%rbx), %eax
btl $0xa, %eax
jae 0xa477
movq %r14, %rdi
callq *0x18(%rcx)
movl (%rbx), %eax
xorl %r14d, %r14d
testb $0x1, %al
jne 0xa56a
jmp 0xa57c
movq %rbx, %rdi
callq 0xafb1
pushq $0x20
popq %rdi
callq 0x5170
movq %rax, %rdi
movb $0x3, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %r12, 0x18(%rax)
leaq 0x725d(%rip), %rax      # 0x11708
leaq 0x10(%rax), %rcx
movq %rcx, (%rdi)
testb $0x4, 0x1(%rbx)
je 0xa56d
callq *0x18(%rax)
xorl %edi, %edi
jmp 0xa56d
movq %rbx, %rdi
callq 0xafb1
pushq $0x40
popq %rdi
callq 0x5170
movq %rax, %rdi
movb $0x7, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %r12, 0x18(%rax)
leaq 0x726b(%rip), %rax      # 0x11758
leaq 0x10(%rax), %rcx
movq %rcx, (%rdi)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x20(%rdi)
movdqu %xmm0, 0x30(%rdi)
testb $0x4, 0x1(%rbx)
jne 0xa50f
movq %rdi, 0x20(%rsp)
jmp 0xa51f
callq *0x18(%rax)
pxor %xmm0, %xmm0
movq $0x0, 0x20(%rsp)
movdqa %xmm0, 0x50(%rsp)
movdqa %xmm0, 0x40(%rsp)
movl 0x10(%rbx), %r8d
testl %r8d, %r8d
jle 0xa557
movq 0x8(%rbx), %rax
movb (%rax), %cl
cmpb $0x5e, %cl
movb %cl, 0xf(%rsp)
jne 0xa551
incq %rax
movq %rax, 0x8(%rbx)
decl %r8d
movl %r8d, 0x10(%rbx)
cmpl $0x2, %r8d
jae 0xa5b6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa567
movq (%rdi), %rax
callq *0x8(%rax)
xorl %r14d, %r14d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0xa8c8
movq %rax, %r14
testq %r14, %r14
je 0xa0fa
cmpl $0x0, 0x10(%rbx)
jle 0xa5a1
movq %rbx, %rdi
callq 0xa095
movq %r14, %rdi
movq %rax, %rsi
callq 0xab3f
movq %rax, %r14
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
xorl %ebp, %ebp
xorl %ecx, %ecx
testl %r8d, %r8d
jle 0xa557
movq 0x8(%rbx), %rdx
movzbl (%rdx), %r13d
leaq 0x1(%rdx), %rsi
leal -0x1(%r8), %edi
movq %rsi, 0x8(%rbx)
movl %edi, 0x10(%rbx)
cmpl $0x2d, %r13d
je 0xa6f5
cmpl $0x5b, %r13d
je 0xa608
cmpl $0x5d, %r13d
jne 0xa75f
pushq $0x5d
popq %r13
pushq $0x1
popq %r15
testb $0x1, %cl
je 0xa7dd
jmp 0xa853
cmpl $0x3, %r8d
jb 0xa557
movzbl (%rsi), %eax
cmpl $0x2e, %eax
je 0xa738
cmpl $0x3d, %eax
je 0xa719
pushq $0x5b
popq %r13
cmpl $0x3a, %eax
jne 0xa75f
addq $0x2, %rdx
movq %rdx, 0x8(%rbx)
addl $-0x2, %r8d
movl %r8d, 0x10(%rbx)
cmpl $0x1, %ebp
jne 0xa65c
movzbl 0x10(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x7a2a
movl 0x10(%rbx), %r8d
pushq $0x8
popq %r12
cmpq $0xc8, %r12
je 0xa557
leaq 0x766c(%rip), %rax      # 0x11ce0
movq -0x8(%r12,%rax), %rbp
movq %rbp, %rdi
movq %r8, %r14
callq 0x50d0
movq %r14, %r8
movq %rax, %r13
addl $0x2, %eax
movl %r8d, %r15d
subl %eax, %r15d
jle 0xa6ec
movq 0x8(%rbx), %rsi
movslq %r13d, %rdx
movq %rbp, %rdi
movq %rsi, 0x28(%rsp)
movq %rdx, 0x68(%rsp)
movl %eax, %ebp
callq 0x50e0
movq %r14, %r8
testl %eax, %eax
jne 0xa6ec
movq 0x28(%rsp), %rax
movq 0x68(%rsp), %rdx
cmpb $0x3a, (%rax,%rdx)
jne 0xa6ec
shlq $0x20, %r13
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r13
sarq $0x20, %r13
movq 0x28(%rsp), %rax
cmpb $0x5d, (%rax,%r13)
je 0xa7f2
addq $0x10, %r12
jmp 0xa660
testl %ebp, %ebp
sete %cl
xorb $0x1, %al
testb %al, %cl
jne 0xa557
pushq $0x2d
popq %r13
cmpl $0x1, %ebp
jne 0xa75f
movl 0x10(%rsp), %r13d
pushq $0x2
jmp 0xa79a
addq $0x2, %rdx
movq %rdx, 0x8(%rbx)
addl $-0x2, %r8d
movl %r8d, 0x10(%rbx)
cmpl $0x1, %ebp
je 0xa7a3
cmpl $0x2, %ebp
jne 0xa7b2
jmp 0xa557
addq $0x2, %rdx
movq %rdx, 0x8(%rbx)
addl $-0x2, %r8d
movl %r8d, 0x10(%rbx)
pushq $0x2e
popq %rdi
movq %rbx, %rsi
callq 0xabe6
movl %eax, %r13d
cmpl $-0x1, %eax
je 0xa557
cmpl $0x1, %ebp
je 0xa792
cmpl $0x2, %ebp
jne 0xa798
cmpl %r13d, 0x10(%rsp)
jg 0xa557
leaq 0x40(%rsp), %r15
movl 0x10(%rsp), %ebp
cmpl %r13d, %ebp
jg 0xa79e
movzbl %bpl, %esi
movq %r15, %rdi
callq 0x7a2a
incl %ebp
jmp 0xa77d
movl 0x10(%rsp), %eax
jmp 0xa7cd
pushq $0x1
popq %r15
jmp 0xa7dd
xorl %r15d, %r15d
jmp 0xa7dd
movzbl 0x10(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x7a2a
pushq $0x3d
popq %rdi
movq %rbx, %rsi
callq 0xabe6
cmpl $-0x1, %eax
je 0xa557
xorl %ebp, %ebp
movl 0x10(%rsp), %r13d
movzbl %al, %esi
leaq 0x40(%rsp), %rdi
callq 0x7a2a
movl %ebp, %r15d
movl 0x10(%rbx), %r8d
movb $0x1, %cl
xorl %eax, %eax
movl %r13d, 0x10(%rsp)
movl %r15d, %ebp
jmp 0xa5bc
movslq %ebp, %rax
movq 0x28(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
movl %r15d, 0x10(%rbx)
leaq 0x74d4(%rip), %rax      # 0x11ce0
movq (%r12,%rax), %r13
xorl %r15d, %r15d
xorl %r12d, %r12d
leaq 0x40(%rsp), %rbp
cmpl $0x100, %r12d           # imm = 0x100
je 0xa83f
movl %r12d, %edi
callq *%r13
testl %eax, %eax
je 0xa83a
movzbl %r12b, %esi
movq %rbp, %rdi
callq 0x7a2a
incl %r12d
jmp 0xa81b
movl 0x10(%rsp), %r13d
jmp 0xa7dd
movq %rax, %rdi
callq 0xae8c
jmp 0xa0fa
testl %ebp, %ebp
je 0xa878
movzbl 0x10(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x7a2a
cmpl $0x2, %ebp
jne 0xa878
leaq 0x40(%rsp), %rdi
pushq $0x2d
popq %rsi
callq 0x7a2a
leaq 0x40(%rsp), %rsi
movq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x7cdc
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0x7d08
cmpb $0x5e, 0xf(%rsp)
jne 0xa56a
movl (%rbx), %esi
movq %r14, %rdi
callq 0x7ce6
jmp 0xa56a
jmp 0xa8b2
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x5180
movq %rbx, %rdi
callq 0x52b0