// File: /workspace/github_cpp_makefile_star2_O1/arnoldrobbins[P]mcilroy-regex/sed3.cpp
// Function: recomp(Text*, Text*, int)
int
recomp(Text *rebuf, Text *t, int delim)
{
	static int lastre;
	uchar *w;
	vacate(&retemp);
	for(w=t->w; ; retemp.w++,w++) {
		assure(&retemp, 2)
		*retemp.w = *w;
		if(*w == delim)
			break;
		else if(*w==0 || *w=='\n')
			syntax("unterminated address");
		else if(*w != '\\')
			continue;
		else if(*++w==delim)
			*retemp.w = delim;
		else if(*w == 'n')
			*retemp.w = '\n';
		else if(*w==0 || *w=='\n')
			syntax("unterminated regular expression");
		else {
			assure(&retemp, 2);
			*++retemp.w = *w;
		}
	}
	*retemp.w = 0;

	assure(rebuf, sizeof(regex_t));
	if(*retemp.s != 0) {
		if(regcomp((regex_t*)rebuf->w,(char*)retemp.s,options) != 0)
			syntax("bad regular expression");
		lastre = rebuf->w - rebuf->s;
		rebuf->w += sizeof(regex_t);
	} else if(rebuf->w == rebuf->s)
		syntax("no previous regular expression");
	t->w = w + 1;
	return lastre;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xbbea(%rip), %r15      # 0x137e0
movq %r15, %rdi
callq 0x727f
movq (%rbx), %r13
leaq 0x57ab(%rip), %r12      # 0xd3b3
cmpq $0x0, 0xbbe0(%rip)      # 0x137f0
je 0x7c31
movq 0xbbc7(%rip), %rax      # 0x137e0
movq 0xbbc8(%rip), %rcx      # 0x137e8
addq $-0x3, %rcx
cmpq %rcx, %rax
jae 0x7c31
movb (%r13), %cl
movb %cl, (%rax)
jmp 0x7c3e
movq %r15, %rdi
movl $0x2, %esi
callq 0x5a80
movzbl (%r13), %eax
cmpl %ebp, %eax
je 0x7cf1
testl %eax, %eax
je 0x7c59
cmpl $0x5c, %eax
je 0x7c6d
cmpl $0xa, %eax
jne 0x7c61
movq %r12, %rdi
callq 0x5ff7
incq 0xbb78(%rip)            # 0x137e0
incq %r13
jmp 0x7c08
movzbl 0x1(%r13), %eax
incq %r13
cmpl %ebp, %eax
jne 0x7c85
movq 0xbb60(%rip), %rax      # 0x137e0
movb %bpl, (%rax)
jmp 0x7c61
testl %eax, %eax
je 0x7c9f
cmpl $0xa, %eax
je 0x7c9f
cmpl $0x6e, %eax
jne 0x7ca8
movq 0xbb46(%rip), %rax      # 0x137e0
movb $0xa, (%rax)
jmp 0x7c61
leaq 0x5722(%rip), %rdi      # 0xd3c8
jmp 0x7c5c
cmpq $0x0, 0xbb40(%rip)      # 0x137f0
je 0x7cc6
movq 0xbb2f(%rip), %rax      # 0x137e8
addq $-0x3, %rax
cmpq %rax, 0xbb1c(%rip)      # 0x137e0
jb 0x7cd3
movq %r15, %rdi
movl $0x2, %esi
callq 0x5a80
movb (%r13), %al
movq 0xbb02(%rip), %rcx      # 0x137e0
leaq 0x1(%rcx), %rdx
movq %rdx, 0xbaf7(%rip)      # 0x137e0
movb %al, 0x1(%rcx)
jmp 0x7c61
movq 0xbae8(%rip), %rax      # 0x137e0
movb $0x0, (%rax)
cmpq $0x0, 0x10(%r14)
je 0x7d0f
movq 0x8(%r14), %rax
addq $-0x29, %rax
cmpq %rax, (%r14)
jb 0x7d1c
movq %r14, %rdi
movl $0x28, %esi
callq 0x5a80
movq 0xbacd(%rip), %rsi      # 0x137f0
cmpb $0x0, (%rsi)
movq (%r14), %rdi
je 0x7d63
leaq 0xb9ba(%rip), %rax      # 0x136ec
movl (%rax), %edx
callq 0xa916
testl %eax, %eax
je 0x7d49
leaq 0x56a4(%rip), %rdi      # 0xd3e8
callq 0x5ff7
movq (%r14), %rax
movl 0x10(%r14), %ecx
movl %eax, %edx
subl %ecx, %edx
movl %edx, 0xba9e(%rip)      # 0x137f8
addq $0x28, %rax
movq %rax, (%r14)
jmp 0x7d75
cmpq 0x10(%r14), %rdi
jne 0x7d75
leaq 0x568f(%rip), %rdi      # 0xd3ff
callq 0x5ff7
incq %r13
movq %r13, (%rbx)
movl 0xba77(%rip), %eax      # 0x137f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq