// File: /workspace/github_cpp_makefile_star2_O3/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 0xbaae(%rip), %r15      # 0x137e0
movq %r15, %rdi
callq 0x73bb
movq (%rbx), %r13
leaq 0x566b(%rip), %r12      # 0xd3af
cmpq $0x0, 0xbaa4(%rip)      # 0x137f0
je 0x7d6d
movq 0xba8b(%rip), %rax      # 0x137e0
movq 0xba8c(%rip), %rcx      # 0x137e8
addq $-0x3, %rcx
cmpq %rcx, %rax
jae 0x7d6d
movb (%r13), %cl
movb %cl, (%rax)
jmp 0x7d7e
movq %r15, %rdi
movl $0x2, %esi
callq 0x5a81
movb (%r13), %cl
movzbl %cl, %eax
cmpl %ebp, %eax
je 0x7e34
testb %cl, %cl
je 0x7d97
cmpl $0x5c, %eax
je 0x7dab
cmpl $0xa, %eax
jne 0x7d9f
movq %r12, %rdi
callq 0x5fe9
incq 0xba3a(%rip)            # 0x137e0
incq %r13
jmp 0x7d44
movb 0x1(%r13), %al
incq %r13
movzbl %al, %ecx
cmpl %ebp, %ecx
jne 0x7dc5
movq 0xba20(%rip), %rax      # 0x137e0
movb %bpl, (%rax)
jmp 0x7d9f
testl %ecx, %ecx
je 0x7ddf
cmpl $0xa, %ecx
je 0x7ddf
cmpl $0x6e, %ecx
jne 0x7de8
movq 0xba06(%rip), %rax      # 0x137e0
movb $0xa, (%rax)
jmp 0x7d9f
leaq 0x55de(%rip), %rdi      # 0xd3c4
jmp 0x7d9a
cmpq $0x0, 0xba00(%rip)      # 0x137f0
je 0x7e09
movq 0xb9e7(%rip), %rcx      # 0x137e0
movq 0xb9e8(%rip), %rdx      # 0x137e8
addq $-0x3, %rdx
cmpq %rdx, %rcx
jb 0x7e21
movq %r15, %rdi
movl $0x2, %esi
callq 0x5a81
movb (%r13), %al
movq 0xb9bf(%rip), %rcx      # 0x137e0
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb9b4(%rip)      # 0x137e0
movb %al, 0x1(%rcx)
jmp 0x7d9f
movq 0xb9a5(%rip), %rax      # 0x137e0
movb $0x0, (%rax)
cmpq $0x0, 0x10(%r14)
je 0x7e52
movq 0x8(%r14), %rax
addq $-0x29, %rax
cmpq %rax, (%r14)
jb 0x7e5f
movq %r14, %rdi
movl $0x28, %esi
callq 0x5a81
movq 0xb98a(%rip), %rsi      # 0x137f0
cmpb $0x0, (%rsi)
movq (%r14), %rdi
je 0x7ea6
leaq 0xb877(%rip), %rax      # 0x136ec
movl (%rax), %edx
callq 0xaaaa
testl %eax, %eax
je 0x7e8c
leaq 0x555d(%rip), %rdi      # 0xd3e4
callq 0x5fe9
movq (%r14), %rax
movl 0x10(%r14), %ecx
movl %eax, %edx
subl %ecx, %edx
movl %edx, 0xb95b(%rip)      # 0x137f8
addq $0x28, %rax
movq %rax, (%r14)
jmp 0x7eb8
cmpq 0x10(%r14), %rdi
jne 0x7eb8
leaq 0x5548(%rip), %rdi      # 0xd3fb
callq 0x5fe9
incq %r13
movq %r13, (%rbx)
movl 0xb934(%rip), %eax      # 0x137f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq