// File: /workspace/github_cpp_makefile_star2_O1/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 0x5eae
movq %rsi, %r14
cmpq $0x0, 0x10(%rbx)
je 0x5bf8
movq 0x8(%rbx), %rax
addq $-0x11, %rax
cmpq %rax, (%rbx)
jb 0x5c05
movq %rbx, %rdi
movl $0x10, %esi
callq 0x5a80
movq (%rbx), %r13
movq 0x10(%rbx), %r15
movq (%r14), %rax
movq %rax, 0xdb42(%rip)      # 0x13758
movq (%r14), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x5c2a
cmpl $0x9, %ecx
jne 0x5c2f
movq %rax, (%r14)
jmp 0x5c19
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5eea
movb $0x1, %cl
movl %eax, (%rsp)
testl %eax, %eax
je 0x5c6b
movq (%r14), %rax
cmpb $0x2c, (%rax)
jne 0x5c6b
incq %rax
movq %rax, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5eea
testl %eax, %eax
je 0x5e73
movb $0x1, %bpl
xorl %ecx, %ecx
jmp 0x5c6d
xorl %ebp, %ebp
movq (%rbx), %rax
testb %bpl, %bpl
movl %ecx, 0x4(%rsp)
je 0x5c83
movl $0x80000000, (%rax)     # imm = 0x80000000
addq $0x4, %rax
subq %r15, %r13
movq %r13, 0x8(%rsp)
movq %rax, 0x10(%rsp)
addq $0x4, %rax
movq %rax, (%rbx)
xorl %eax, %eax
movb $0x1, %cl
leaq 0xc0be(%rip), %r15      # 0x11d60
movl %eax, %r13d
movl %ecx, %ebp
movq (%r14), %rax
incq %rax
movzbl -0x1(%rax), %ecx
cmpl $0x20, %ecx
je 0x5cbb
cmpl $0x9, %ecx
jne 0x5cc0
movq %rax, (%r14)
jmp 0x5caa
movq (%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movzbl (%rax), %r12d
testb $0x1, %bpl
jne 0x5d1a
leaq 0x358(%rip), %rax       # 0x6033
cmpq %rax, (%r15,%r12,8)
jne 0x5d1a
movq 0xda70(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x7652(%rip), %rdi      # 0xd351
leaq 0x73fb(%rip), %rsi      # 0xd101
movq %rax, %rdx
movq %r15, %rcx
leaq 0xc04d(%rip), %r15      # 0x11d60
xorl %eax, %eax
callq 0x5899
movl $0x1000000, %eax        # imm = 0x1000000
xorl %ecx, %ecx
cmpl $0x21, %r12d
je 0x5ca2
testb $0x1, %bpl
je 0x5d94
leaq 0xd468(%rip), %rax      # 0x131a0
movzbl (%r12,%rax), %eax
testl %eax, %eax
je 0x5d55
cmpl $0x1, %eax
jne 0x5d94
cmpl $0x0, (%rsp)
sete %al
orb 0x4(%rsp), %al
je 0x5d5b
jmp 0x5d94
cmpl $0x0, (%rsp)
je 0x5d94
movq 0xd9f6(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x75d8(%rip), %rdi      # 0xd351
leaq 0x738c(%rip), %rsi      # 0xd10c
movq %rax, %rdx
movq %r15, %rcx
leaq 0xbfd3(%rip), %r15      # 0x11d60
xorl %eax, %eax
callq 0x5899
movq %rbx, %rdi
movq %r14, %rsi
callq *(%r15,%r12,8)
movq (%r14), %rax
movzbl (%rax), %eax
cmpl $0x3b, %eax
je 0x5dff
cmpl $0xa, %eax
je 0x5e44
testl %eax, %eax
jne 0x5dc7
movslq 0x8(%rsp), %rax
addq 0x10(%rbx), %rax
movq %rax, (%rbx)
jmp 0x5e47
cmpl $0x7b, %r12d
je 0x5e47
movq 0xd984(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x7566(%rip), %rdi      # 0xd351
leaq 0x732d(%rip), %rsi      # 0xd11f
movq %rax, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x5899
movl 0xd933(%rip), %eax      # 0x13738
leal 0x1(%rax), %ecx
movl %ecx, 0xd92a(%rip)      # 0x13738
testl %eax, %eax
jne 0x5e44
movq 0xd93f(%rip), %r15      # 0x13758
movq %r15, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r15, %rax
leaq 0x7521(%rip), %rdi      # 0xd351
leaq 0x72fb(%rip), %rsi      # 0xd132
movq %rax, %rdx
movq %r15, %rcx
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 0x6073
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movq (%r14), %rax
cmpb $0x0, (%rax)
jne 0x5be4
jmp 0x5eae
movq 0xd8de(%rip), %r12      # 0x13758
movq %r12, %rdi
movl $0xa, %esi
callq 0x50c0
subq %r12, %rax
xorl %ebp, %ebp
leaq 0x74be(%rip), %rdi      # 0xd351
leaq 0x7257(%rip), %rsi      # 0xd0f1
movq %rax, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x5899
movb $0x1, %cl
jmp 0x5c6d
movq %rbx, %rdi
callq 0x60d9
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x61a6