// File: /workspace/github_cpp_makefile_star2_O2/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 0xb3e2(%rip), %r15      # 0x127e0
movq %r15, %rdi
callq 0x6abd
movq %rbx, (%rsp)
movq (%rbx), %rbx
pushq $0x2
popq %r12
leaq 0x4f97(%rip), %r13      # 0xc3af
cmpq $0x0, 0xb3d0(%rip)      # 0x127f0
je 0x743f
movq 0xb3b7(%rip), %rax      # 0x127e0
movq 0xb3b8(%rip), %rcx      # 0x127e8
addq $-0x3, %rcx
cmpq %rcx, %rax
jae 0x743f
movb (%rbx), %cl
movb %cl, (%rax)
jmp 0x744c
movq %r15, %rdi
movl %r12d, %esi
callq 0x5880
movb (%rbx), %cl
movzbl %cl, %eax
cmpl %ebp, %eax
je 0x74fd
testb %cl, %cl
je 0x7465
cmpl $0x5c, %eax
je 0x7479
cmpl $0xa, %eax
jne 0x746d
movq %r13, %rdi
callq 0x5d41
incq 0xb36c(%rip)            # 0x127e0
incq %rbx
jmp 0x7418
movb 0x1(%rbx), %al
incq %rbx
movzbl %al, %ecx
cmpl %ebp, %ecx
jne 0x7492
movq 0xb353(%rip), %rax      # 0x127e0
movb %bpl, (%rax)
jmp 0x746d
testl %ecx, %ecx
je 0x74ac
cmpl $0xa, %ecx
je 0x74ac
cmpl $0x6e, %ecx
jne 0x74b5
movq 0xb339(%rip), %rax      # 0x127e0
movb $0xa, (%rax)
jmp 0x746d
leaq 0x4f11(%rip), %rdi      # 0xc3c4
jmp 0x7468
cmpq $0x0, 0xb333(%rip)      # 0x127f0
je 0x74d6
movq 0xb31a(%rip), %rcx      # 0x127e0
movq 0xb31b(%rip), %rdx      # 0x127e8
addq $-0x3, %rdx
cmpq %rdx, %rcx
jb 0x74ea
movq %r15, %rdi
movl %r12d, %esi
callq 0x5880
movb (%rbx), %al
movq 0xb2f6(%rip), %rcx      # 0x127e0
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb2eb(%rip)      # 0x127e0
movb %al, 0x1(%rcx)
jmp 0x746d
movq 0xb2dc(%rip), %rax      # 0x127e0
movb $0x0, (%rax)
cmpq $0x0, 0x10(%r14)
je 0x751b
movq 0x8(%r14), %rax
addq $-0x29, %rax
cmpq %rax, (%r14)
jb 0x7526
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x5880
movq 0xb2c3(%rip), %rsi      # 0x127f0
cmpb $0x0, (%rsi)
movq (%r14), %rdi
je 0x756d
leaq 0xb1b0(%rip), %rax      # 0x126ec
movl (%rax), %edx
callq 0x9a28
testl %eax, %eax
je 0x7553
leaq 0x4e96(%rip), %rdi      # 0xc3e4
callq 0x5d41
movq (%r14), %rax
movl 0x10(%r14), %ecx
movl %eax, %edx
subl %ecx, %edx
movl %edx, 0xb294(%rip)      # 0x127f8
addq $0x28, %rax
movq %rax, (%r14)
jmp 0x757f
cmpq 0x10(%r14), %rdi
jne 0x757f
leaq 0x4e81(%rip), %rdi      # 0xc3fb
callq 0x5d41
incq %rbx
movq (%rsp), %rax
movq %rbx, (%rax)
movl 0xb269(%rip), %eax      # 0x127f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq