// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[P]mujs/./regexp.c
// Function: compile
static void compile(Reprog *prog, Renode *node)
{
	Reinst *inst, *split, *jump;
	int i;

loop:
	if (!node)
		return;

	switch (node->type) {
	case P_CAT:
		compile(prog, node->x);
		node = node->y;
		goto loop;

	case P_ALT:
		split = emit(prog, I_SPLIT);
		compile(prog, node->x);
		jump = emit(prog, I_JUMP);
		compile(prog, node->y);
		split->x = split + 1;
		split->y = jump + 1;
		jump->x = prog->end;
		break;

	case P_REP:
		inst = NULL; /* silence compiler warning. assert(node->m > 0). */
		for (i = 0; i < node->m; ++i) {
			inst = prog->end;
			compile(prog, node->x);
		}
		if (node->m == node->n)
			break;
		if (node->n < REPINF) {
			for (i = node->m; i < node->n; ++i) {
				split = emit(prog, I_SPLIT);
				compile(prog, node->x);
				if (node->ng) {
					split->y = split + 1;
					split->x = prog->end;
				} else {
					split->x = split + 1;
					split->y = prog->end;
				}
			}
		} else if (node->m == 0) {
			split = emit(prog, I_SPLIT);
			compile(prog, node->x);
			jump = emit(prog, I_JUMP);
			if (node->ng) {
				split->y = split + 1;
				split->x = prog->end;
			} else {
				split->x = split + 1;
				split->y = prog->end;
			}
			jump->x = split;
		} else {
			split = emit(prog, I_SPLIT);
			if (node->ng) {
				split->y = inst;
				split->x = prog->end;
			} else {
				split->x = inst;
				split->y = prog->end;
			}
		}
		break;

	case P_BOL: emit(prog, I_BOL); break;
	case P_EOL: emit(prog, I_EOL); break;
	case P_WORD: emit(prog, I_WORD); break;
	case P_NWORD: emit(prog, I_NWORD); break;

	case P_PAR:
		inst = emit(prog, I_LPAR);
		inst->n = node->n;
		compile(prog, node->x);
		inst = emit(prog, I_RPAR);
		inst->n = node->n;
		break;
	case P_PLA:
		split = emit(prog, I_PLA);
		compile(prog, node->x);
		emit(prog, I_END);
		split->x = split + 1;
		split->y = prog->end;
		break;
	case P_NLA:
		split = emit(prog, I_NLA);
		compile(prog, node->x);
		emit(prog, I_END);
		split->x = split + 1;
		split->y = prog->end;
		break;

	case P_ANY:
		emit(prog, I_ANY);
		break;
	case P_CHAR:
		inst = emit(prog, I_CHAR);
		inst->c = (prog->flags & REG_ICASE) ? canon(node->c) : node->c;
		break;
	case P_CCLASS:
		inst = emit(prog, I_CCLASS);
		inst->cc = prog->cclass + node->cc;
		break;
	case P_NCCLASS:
		inst = emit(prog, I_NCCLASS);
		inst->cc = prog->cclass + node->cc;
		break;
	case P_REF:
		inst = emit(prog, I_REF);
		inst->n = node->n;
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x1bb02
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%r14), %eax
testl %eax, %eax
jne 0x1b875
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
movq 0x18(%r14), %r14
testq %r14, %r14
jne 0x1b853
jmp 0x1bb02
decl %eax
cmpl $0xd, %eax
ja 0x1bb02
leaq 0x100dd(%rip), %rcx     # 0x2b964
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %r15
leaq 0x20(%r15), %r12
movq %r12, 0x8(%rbx)
movw $0x2, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r15)
movups %xmm0, 0x10(%r15)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
movq 0x8(%rbx), %r13
leaq 0x20(%r13), %rbp
movq %rbp, 0x8(%rbx)
movw $0x1, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r13)
movups %xmm0, 0x10(%r13)
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
movq %r12, 0x10(%r15)
movq %rbp, 0x18(%r15)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%r13)
jmp 0x1bb02
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0x8, (%rax)
jmp 0x1b936
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0xd, (%rax)
jmp 0x1b9f3
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0x9, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
movslq 0x8(%r14), %rcx
movq %rcx, %rdx
shlq $0x8, %rdx
leaq (%rdx,%rcx,8), %rcx
addq 0x10(%rbx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x1bb02
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0x6, (%rax)
jmp 0x1b9f3
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0xb, (%rax)
jmp 0x1b9f3
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0xc, (%rax)
jmp 0x1b9f3
movq 0x8(%rbx), %r15
leaq 0x20(%r15), %r12
movq %r12, 0x8(%rbx)
movw $0x3, (%r15)
jmp 0x1bac1
cmpb $0x0, 0x2(%r14)
je 0x1bb11
xorl %r12d, %r12d
movq 0x8(%rbx), %r15
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
incl %r12d
movb 0x2(%r14), %al
movzbl %al, %ebp
cmpl %ebp, %r12d
jb 0x1b9be
jmp 0x1bb18
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0xe, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
jmp 0x1bb02
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movb $0xa, (%rax)
jmp 0x1ba50
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movb $0xf, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
movb 0x3(%r14), %cl
movb %cl, 0x1(%rax)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movb $0x10, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
movb 0x3(%r14), %cl
movb %cl, 0x1(%rax)
jmp 0x1bb02
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0x7, (%rax)
leaq 0x4(%rax), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
testb $0x1, 0x18(%rbx)
movl 0x4(%r14), %ebx
je 0x1baaa
movl %ebx, %edi
callq 0x1c418
cmpl $0x80, %eax
movl %eax, %ecx
cmovll %ebx, %ecx
cmpl $0x7f, %ebx
cmovlel %eax, %ecx
movl %ecx, %ebx
movl %ebx, (%r15)
jmp 0x1bb02
movq 0x8(%rbx), %r15
leaq 0x20(%r15), %r12
movq %r12, 0x8(%rbx)
movw $0x4, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r15)
movups %xmm0, 0x10(%r15)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
movq %r12, 0x10(%r15)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
xorl %eax, %eax
xorl %ebp, %ebp
movzbl 0x3(%r14), %ecx
cmpb %cl, %al
je 0x1bb02
cmpl $0xff, %ecx
je 0x1bb87
cmpl %ecx, %ebp
jae 0x1bb02
movq 0x8(%rbx), %r15
leaq 0x20(%r15), %r12
movq %r12, 0x8(%rbx)
movw $0x2, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r15)
movups %xmm0, 0x10(%r15)
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
cmpb $0x0, 0x1(%r14)
movq 0x8(%rbx), %rax
movq %rax, %rcx
cmoveq %r12, %rcx
cmoveq %rax, %r12
movq %rcx, 0x10(%r15)
movq %r12, 0x18(%r15)
incl %ebp
movzbl 0x3(%r14), %ecx
movq %rax, %r15
cmpl %ecx, %ebp
jb 0x1bb31
jmp 0x1bb02
movq 0x8(%rbx), %r12
leaq 0x20(%r12), %r13
movq %r13, 0x8(%rbx)
movw $0x2, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r12)
movups %xmm0, 0x10(%r12)
testb %al, %al
je 0x1bbc8
cmpb $0x0, 0x1(%r14)
je 0x1bc17
movq %r15, 0x18(%r12)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%r12)
jmp 0x1bb02
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x1b839
movq 0x8(%rbx), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x8(%rbx)
movw $0x1, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movups %xmm0, 0x10(%rax)
cmpb $0x0, 0x1(%r14)
movq 0x8(%rbx), %rcx
movq %rcx, %rdx
cmoveq %r13, %rdx
cmovneq %r13, %rcx
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r12, 0x10(%rax)
jmp 0x1bb02
movq %r15, 0x10(%r12)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%r12)
jmp 0x1bb02