// File: /workspace/github_cpp_makefile_star2_O3/arnoldrobbins[P]mcilroy-regex/sed1.cpp
// Function: compile(Text*, Text*)
void
compile(Text *script, Text *t)
{
	int loc;	/* progam counter */
	int neg;	/* ! in effect */
	int cmd;
	int naddr;
	int *q;		/* address of instruction word */
	t->w = t->s;	/* here w is a read pointer */
	while(*t->w) {
		assure(script, 4*sizeof(int));
		loc = script->w - script->s;
		synl = t->w;
		naddr = 0;
		while(blank(t)) ;
		naddr += addr(script, t);
		if(naddr && *t->w ==',') {
			t->w++;
			naddr += addr(script, t);
			if(naddr < 2)
				syntax("missing address");
		}
		q = (int*)script->w;
		if(naddr == 2)
			*q++ = INACT;
		script->w = (uchar*)(q+1);
		neg = 0;
		for(;;) {
			while(blank(t));
			cmd = *t->w++;
			if(neg && docom[cmd&0xff]==Ic)
				syntax("improper !");
			if(cmd != '!')
				break;
			neg = NEG;
		}
		if(!neg) {
			switch(adrs[cmd]) {
			case 1:
				if(naddr <= 1)
					break;
			case 0:
				if(naddr == 0)
					break;
				syntax("too many addresses");
			}
		}
		docom[cmd&0xff](script, t);
		switch(*t->w) {
		case 0:
			script->w = script->s + loc;
			break;
		default:
			if(cmd == '{')
				break;
			syntax("junk after command");
		case ';':
			if(!semicolon++)
				synwarn("semicolon separators");
		case '\n':
				t->w++;
		}
		*q = pack(neg,cmd,script->w-script->s-loc);
	}
	fixbrack(script);
	fixlabels(script);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x10(%rsi), %rax
movq %rax, (%rsi)
cmpb $0x0, (%rax)
je 0x5e9b
movq %rsi, %r14
leaq 0x452(%rip), %r15       # 0x6025
movq %r15, %rbp
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x5bef
movq (%rbx), %r13
movq 0x8(%rbx), %rcx
addq $-0x11, %rcx
cmpq %rcx, %r13
jb 0x5c06
movq %rbx, %rdi
movl $0x10, %esi
callq 0x5a81
movq (%rbx), %r13
movq 0x10(%rbx), %r15
movq (%r14), %rax
movq %rax, 0xdb4b(%rip)      # 0x13758
movq (%r14), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x5c21
cmpl $0x9, %ecx
jne 0x5c26
movq %rax, (%r14)
jmp 0x5c10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ed7
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x5c9e
movq (%r14), %rax
cmpb $0x2c, (%rax)
jne 0x5c9e
incq %rax
movq %rax, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ed7
testl %eax, %eax
je 0x5c6c
movq (%rbx), %rax
movl $0x80000000, (%rax)     # imm = 0x80000000
addq $0x4, %rax
movl $0x0, (%rsp)
jmp 0x5ca6
movq 0xdae5(%rip), %r12      # 0x13758
movq %r12, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r12, %rax
leaq 0x76c4(%rip), %rdi      # 0xd34e
leaq 0x745d(%rip), %rsi      # 0xd0ee
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x589a
movq (%rbx), %rax
movb $0x1, %cl
movl %ecx, (%rsp)
subq %r15, %r13
movq %r13, 0x8(%rsp)
movq %rax, 0x10(%rsp)
addq $0x4, %rax
movq %rax, (%rbx)
xorl %ecx, %ecx
movb $0x1, %al
movq %rbp, %r15
movl %ecx, %r13d
movq (%r14), %rcx
incq %rcx
movzbl -0x1(%rcx), %edx
cmpl $0x20, %edx
je 0x5cd8
cmpl $0x9, %edx
jne 0x5cdd
movq %rcx, (%r14)
jmp 0x5cc7
movq %rcx, (%r14)
movzbl -0x1(%rcx), %r12d
testb $0x1, %al
je 0x5cf8
movl $0x1000000, %ecx        # imm = 0x1000000
xorl %eax, %eax
cmpl $0x21, %r12d
je 0x5cc1
jmp 0x5d4d
leaq 0xc061(%rip), %rax      # 0x11d60
cmpq %r15, (%rax,%r12,8)
jne 0x5d3a
movq 0xda4c(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x762b(%rip), %rdi      # 0xd34e
leaq 0x73d4(%rip), %rsi      # 0xd0fe
movq %rax, %rdx
movq %r15, %rcx
movq %rbp, %r15
xorl %eax, %eax
callq 0x589a
movl $0x1000000, %ecx        # imm = 0x1000000
xorl %eax, %eax
cmpl $0x21, %r12d
je 0x5cc1
jmp 0x5dad
leaq 0xd44c(%rip), %rax      # 0x131a0
movzbl (%r12,%rax), %eax
testl %eax, %eax
je 0x5d71
cmpl $0x1, %eax
jne 0x5dad
cmpl $0x0, 0x4(%rsp)
sete %al
orb (%rsp), %al
je 0x5d78
jmp 0x5dad
cmpl $0x0, 0x4(%rsp)
je 0x5dad
movq 0xd9d9(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x75b8(%rip), %rdi      # 0xd34e
leaq 0x736c(%rip), %rsi      # 0xd109
movq %rax, %rdx
movq %r15, %rcx
movq %rbp, %r15
xorl %eax, %eax
callq 0x589a
movq %rbx, %rdi
movq %r14, %rsi
leaq 0xbfa6(%rip), %rax      # 0x11d60
callq *(%rax,%r12,8)
movq (%r14), %rax
movzbl (%rax), %eax
cmpl $0x3b, %eax
je 0x5e26
cmpl $0xa, %eax
je 0x5e6e
testl %eax, %eax
jne 0x5de7
movslq 0x8(%rsp), %rax
addq 0x10(%rbx), %rax
movq %rax, (%rbx)
jmp 0x5e71
cmpl $0x7b, %r12d
je 0x5e71
movq 0xd960(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x753f(%rip), %rdi      # 0xd34e
leaq 0x7306(%rip), %rsi      # 0xd11c
movq %rax, %rdx
movq %r15, %rcx
movq %rbp, %r15
xorl %eax, %eax
callq 0x589a
movl 0xd90c(%rip), %eax      # 0x13738
leal 0x1(%rax), %ecx
movl %ecx, 0xd903(%rip)      # 0x13738
testl %eax, %eax
jne 0x5e6e
movq 0xd918(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x74f7(%rip), %rdi      # 0xd34e
leaq 0x72d1(%rip), %rsi      # 0xd12f
movq %rax, %rdx
movq %r15, %rcx
movq %rbp, %r15
xorl %eax, %eax
callq 0x5320
incq (%r14)
movl (%rbx), %edx
movq 0x8(%rsp), %rax
addl 0x10(%rbx), %eax
subl %eax, %edx
movl %r13d, %edi
movl %r12d, %esi
callq 0x6065
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movq (%r14), %rax
cmpb $0x0, (%rax)
jne 0x5bd3
movq %rbx, %rdi
callq 0x60cb
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6198