// File: arnoldrobbins[P]mcilroy-regex/re1.cpp
// Function: Alt::parse(unsigned char*, Rex*, Eenv*)
int Alt::parse(uchar *s, Rex *cont, Eenv *env)
{
	debug(ALT, "Altl", s);
	Save save(n1, n2, env);
	if(env->flags&SPACE)
		return BAD;
	if(env->pushpos(this, s, BEGA))
		return BAD;
	Alt1 alt1(cont, serial);
	int result = left->parse(s, &alt1, env);
	if(result!=BEST && result!=BAD) {
		debug(ALT, "Altr", s);
		save.restore(env);
		env->pos[env->npos-1].serial = rserial;
		alt1.serial = rserial;
		int rightresult = right->parse(s, &alt1, env);
		if(rightresult != NONE)
			result = rightresult;
	}
	env->poppos();
	save.restore(env);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl 0x18(%rax), %esi
movl 0x1c(%rax), %edx
movq -0x28(%rbp), %rcx
leaq -0x180(%rbp), %rdi
callq 0xa7c0
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xaa32
movl $0x3, -0x4(%rbp)
movl $0x1, -0x184(%rbp)
jmp 0xac04
movq -0x1c8(%rbp), %rsi
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x2, %ecx
callq 0x9260
movl %eax, -0x1cc(%rbp)
jmp 0xaa53
movl -0x1cc(%rbp), %eax
cmpl $0x0, %eax
je 0xaa8b
movl $0x3, -0x4(%rbp)
movl $0x1, -0x184(%rbp)
jmp 0xac04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
jmp 0xac1c
movq -0x1c8(%rbp), %rax
movq -0x20(%rbp), %rsi
movswl 0xa(%rax), %edx
leaq -0x1b8(%rbp), %rdi
callq 0xc120
jmp 0xaaa8
movq -0x1c8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq -0x1b8(%rbp), %rdx
callq *%rax
movl %eax, -0x1d0(%rbp)
jmp 0xaad3
movl -0x1d0(%rbp), %eax
movl %eax, -0x1bc(%rbp)
cmpl $0x2, -0x1bc(%rbp)
je 0xabc8
cmpl $0x3, -0x1bc(%rbp)
je 0xabc8
movq -0x28(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0xa920
jmp 0xab0b
movq -0x1c8(%rbp), %rax
movw 0x30(%rax), %ax
movw %ax, -0x1da(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x28, %rdi
movl 0x20(%rax), %esi
decl %esi
callq 0xbd20
movq %rax, -0x1d8(%rbp)
jmp 0xab3b
movq -0x1c8(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movw -0x1da(%rbp), %dx
movw %dx, 0x8(%rcx)
movw 0x30(%rax), %cx
movw %cx, -0x1ae(%rbp)
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rcx
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq -0x1b8(%rbp), %rdx
callq *%rax
movl %eax, -0x1e0(%rbp)
jmp 0xab83
movl -0x1e0(%rbp), %eax
movl %eax, -0x1c0(%rbp)
cmpl $0x0, -0x1c0(%rbp)
je 0xabc6
movl -0x1c0(%rbp), %eax
movl %eax, -0x1bc(%rbp)
jmp 0xabc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x190(%rbp)
movl %eax, -0x194(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0xc170
jmp 0xac1c
jmp 0xabc8
movq -0x28(%rbp), %rdi
callq 0xc030
jmp 0xabd3
movq -0x28(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0xa920
jmp 0xabe5
movl -0x1bc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x184(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0xc170
leaq -0x180(%rbp), %rdi
callq 0xc190
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
leaq -0x180(%rbp), %rdi
callq 0xc190
movq -0x190(%rbp), %rdi
callq 0x52d0
nopw %cs:(%rax,%rax)