// File: arnoldrobbins[P]mcilroy-regex/re1.cpp
// Function: Rep::dorep(int, unsigned char*, Rex*, Eenv*)
int Rep::dorep(int n, uchar *s, Rex *cont, Eenv *env)
{
	int result = NONE;
	if(hi > n) {
		Rep1 rep1(this, s, n+1, cont);
		Save save(n1, n2, env);
		if(env->flags&SPACE)
			return BAD;
		if(env->pushpos(this, s, BEGI))	
			return BAD;
		result = rex->parse(s, &rep1, env);
		env->poppos();
		save.restore(env);
	}
	if(result==BEST || result==BAD || lo>n)
		return result;
	if(env->pushpos(this, s, ENDP))	// end BEGR
		return BAD;
	int res1 = follow(s, cont, env);
	env->poppos();
	return res1==NONE? result: res1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movl $0x0, -0x34(%rbp)
movl 0x1c(%rax), %eax
cmpl -0x14(%rbp), %eax
jle 0xaff5
movq -0x1e8(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x14(%rbp), %ecx
incl %ecx
movq -0x28(%rbp), %r8
leaq -0x70(%rbp), %rdi
callq 0xc2a0
movq -0x1e8(%rbp), %rax
movl 0x20(%rax), %esi
movl 0x24(%rax), %edx
movq -0x30(%rbp), %rcx
leaq -0x1c8(%rbp), %rdi
callq 0xa7c0
jmp 0xaec8
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xaf05
movl $0x3, -0x4(%rbp)
movl $0x1, -0x1d8(%rbp)
jmp 0xafbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
jmp 0xafe7
movq -0x1e8(%rbp), %rsi
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0x9260
movl %eax, -0x1ec(%rbp)
jmp 0xaf26
movl -0x1ec(%rbp), %eax
cmpl $0x0, %eax
je 0xaf67
movl $0x3, -0x4(%rbp)
movl $0x1, -0x1d8(%rbp)
jmp 0xafbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1d0(%rbp)
movl %eax, -0x1d4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0xc190
jmp 0xafe7
movq -0x1e8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rcx
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq -0x70(%rbp), %rdx
callq *%rax
movl %eax, -0x1f0(%rbp)
jmp 0xaf8f
movl -0x1f0(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
callq 0xc030
jmp 0xafa3
movq -0x30(%rbp), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0xa920
jmp 0xafb5
movl $0x0, -0x1d8(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0xc190
leaq -0x70(%rbp), %rdi
callq 0xc320
movl -0x1d8(%rbp), %eax
testl %eax, %eax
je 0xafe5
jmp 0xafe0
jmp 0xb08f
jmp 0xaff5
leaq -0x70(%rbp), %rdi
callq 0xc320
jmp 0xb09b
cmpl $0x2, -0x34(%rbp)
je 0xb010
cmpl $0x3, -0x34(%rbp)
je 0xb010
movq -0x1e8(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0x14(%rbp), %eax
jle 0xb018
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xb08f
movq -0x1e8(%rbp), %rsi
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x4, %ecx
callq 0x9260
cmpl $0x0, %eax
je 0xb03f
movl $0x3, -0x4(%rbp)
jmp 0xb08f
movq -0x1e8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0xbd70
movl %eax, -0x1dc(%rbp)
movq -0x30(%rbp), %rdi
callq 0xc030
cmpl $0x0, -0x1dc(%rbp)
jne 0xb07a
movl -0x34(%rbp), %eax
movl %eax, -0x1f4(%rbp)
jmp 0xb086
movl -0x1dc(%rbp), %eax
movl %eax, -0x1f4(%rbp)
movl -0x1f4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
movq -0x1d0(%rbp), %rdi
callq 0x52d0
nopw (%rax,%rax)