// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0xafe8
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jle 0xb141
xorl %r12d, %r12d
xorl %eax, %eax
jmp 0xb193
xorl %eax, %eax
movl %r15d, %ebp
movq (%rsp), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8(%rsp)
movl %eax, %eax
movb %bpl, (%rcx,%rax)
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
movq %rbx, %rdi
callq 0xafe8
movl %eax, %r15d
movl 0x8(%rsp), %eax
cmpl $0x100, %r15d           # imm = 0x100
jg 0xb18f
cmpl $0x64, %eax
jb 0xb143
movzbl %bpl, %r12d
cmpl $0x104, %r15d           # imm = 0x104
jne 0xb1a4
xorl %r14d, %r14d
jmp 0xb66f
testl %eax, %eax
jle 0xb223
addl $0xfffffefa, %r15d      # imm = 0xFFFFFEFA
cmpl $0xa, %r15d
ja 0xb3f5
movl $0x427, %ecx            # imm = 0x427
btl %r15d, %ecx
jae 0xb3f5
decl %eax
movl %eax, 0x8(%rsp)
je 0xb2c6
movq %rsp, %rdi
callq 0x819e
movq %rax, %r15
testq %rax, %rax
je 0xb35e
movl %edx, %ebp
movl $0x28, %edi
callq 0x5170
movq %rax, %r14
movq 0x28(%rbx), %rcx
movq %rax, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x85e8
testb $0x4, 0x1(%rbx)
je 0xb35e
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %r14d, %r14d
jmp 0xb35e
cmpl $0x201, %r15d           # imm = 0x201
jl 0xb2fe
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
addl $0xfffffe00, %r15d      # imm = 0xFFFFFE00
cmpl 0x30(%rbx), %r15d
jg 0xb19c
movl %r15d, %eax
cmpb $0x0, 0x3b(%rbx,%rax)
je 0xb19c
movl $0x1, %eax
movl %r15d, %ecx
shll %cl, %eax
orw %ax, 0x38(%rbx)
movl $0x20, %edi
callq 0x5170
movq %rax, %r14
movb $0x8, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x7878(%rip), %rax      # 0x12b10
movq %rax, (%r14)
movl %r15d, 0x18(%r14)
testb $0x4, 0x1(%rbx)
je 0xb5b0
movq %r14, %rdi
callq 0x9a92
movl $0x20, %esi
movq %r14, %rdi
callq 0x5180
xorl %r14d, %r14d
jmp 0xb5b0
movl $0x18, %edi
callq 0x5170
movq %rax, %r14
movb $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x7332(%rip), %rax      # 0x12618
leaq 0x10(%rax), %rcx
movq %rcx, (%r14)
testb $0x4, 0x1(%rbx)
je 0xb367
movq %r14, %rdi
callq *0x18(%rax)
xorl %r14d, %r14d
jmp 0xb367
xorl %r14d, %r14d
addl $0xfffffeff, %r15d      # imm = 0xFFFFFEFF
cmpl $0xe, %r15d
ja 0xb66f
leaq 0x21af(%rip), %rax      # 0xd4c8
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0x18, %edi
callq 0x5170
movq %rax, %r14
movb $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x72d6(%rip), %rax      # 0x12618
leaq 0x10(%rax), %rcx
movq %rcx, (%r14)
testb $0x4, 0x1(%rbx)
je 0xb66f
movq %r14, %rdi
callq *0x18(%rax)
jmp 0xb19c
testq %r15, %r15
je 0xb19c
movl $0x28, %edi
callq 0x5170
movq %rax, %rdi
movq 0x28(%rbx), %rax
movb (%rax,%r12), %cl
movb $0x4, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x18(%rdi)
leaq 0x740b(%rip), %rax      # 0x127a8
leaq 0x10(%rax), %rdx
movq %rdx, (%rdi)
movb %cl, 0x20(%rdi)
testb $0x4, 0x1(%rbx)
je 0xb3b2
callq *0x18(%rax)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0xb6ac
testq %rax, %rax
je 0xb3de
movq %rax, %r15
movq %rbx, %rdi
callq 0xb108
movq %r15, %rdi
movq %rax, %rsi
callq 0xb99c
jmp 0xb661
testq %r14, %r14
je 0xb19c
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0xb19c
movl $0x28, %edi
callq 0x5170
movq %rax, %r14
movq %rsp, %rdi
callq 0x819e
movq 0x28(%rbx), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x85e8
testb $0x4, 0x1(%rbx)
je 0xb659
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %r14d, %r14d
jmp 0xb659
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
movl $0x18, %edi
callq 0x5170
movq %rax, %rdi
movb $0x2, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x7249(%rip), %rax      # 0x126b8
jmp 0xb601
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
incl 0x34(%rbx)
movslq 0x30(%rbx), %r12
movq %r12, %r14
incq %r14
movl %r14d, 0x30(%rbx)
leal 0x2(%r12), %edi
movq %rbx, %rsi
callq 0xabf4
testq %rax, %rax
je 0xb682
movq %rax, %r15
cmpb $0x0, 0x8(%rax)
jne 0xb4c8
testb $0x1, (%rbx)
jne 0xb687
movq %rbx, %rdi
callq 0xafe8
cmpl $0x10a, %eax            # imm = 0x10A
jne 0xb687
decl 0x34(%rbx)
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
cmpl $0x8, %r12d
jg 0xb505
movb $0x1, 0x3b(%rbx,%r14)
movl $0x28, %edi
callq 0x5170
movq %rax, %rdi
movb $0x9, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x763b(%rip), %rax      # 0x12b60
movq %rax, (%rdi)
movw %r14w, 0x18(%rdi)
movb $0x0, 0x1a(%rdi)
movq %r15, 0x20(%rdi)
testb $0x4, 0x1(%rbx)
je 0xb542
callq 0xc086
xorl %edi, %edi
testq %rdi, %rdi
je 0xb682
movl 0x30(%rbx), %edx
movl %r14d, %esi
jmp 0xb63f
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
movl $0x18, %edi
callq 0x5170
movq %rax, %r14
movb $0x1, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x70d7(%rip), %rax      # 0x12668
leaq 0x10(%rax), %rcx
movq %rcx, (%r14)
testb $0x4, 0x1(%rbx)
je 0xb5a7
movq %r14, %rdi
callq *0x18(%rax)
xorl %r14d, %r14d
testb $0x1, (%rbx)
je 0xb64a
movq %r14, %rdi
jmp 0xb63b
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
movl $0x20, %edi
callq 0x5170
movq %rax, %rdi
movb $0x3, 0x8(%rax)
movq $0x0, 0x10(%rax)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x18(%rdi)
leaq 0x7107(%rip), %rax      # 0x12708
leaq 0x10(%rax), %rcx
movq %rcx, (%rdi)
testb $0x4, 0x1(%rbx)
je 0xb63b
callq *0x18(%rax)
xorl %edi, %edi
jmp 0xb63b
movq 0x8(%rbx), %rax
xorl %ecx, %ecx
cmpb $0x5c, (%rax)
sete %cl
addq %rcx, %rax
incq %rax
movq %rax, 0x8(%rbx)
notl %ecx
addl %ecx, 0x10(%rbx)
movq %rbx, %rdi
callq 0xba4b
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0xb6ac
movq %rax, %r14
testq %r14, %r14
je 0xb19c
cmpl $0x0, 0x10(%rbx)
jle 0xb66f
movq %rbx, %rdi
callq 0xb108
movq %r14, %rdi
movq %rax, %rsi
callq 0xb99c
movq %rax, %r14
movq %r14, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0xb64a
movq (%r15), %rax
movq %r15, %rdi
jmp 0xb3ed
jmp 0xb694
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x5180
movq %rbx, %rdi
callq 0x52b0