// File: /workspace/github_c_makefile_star2_O0/phase[P]o/libregexp/regcomp.c
// Function: regcomp1
static	Reprog*
regcomp1(char *s, int literal, int dot_type)
{
	int token;
	Reprog *volatile pp;

	/* get memory for the program */
	pp = malloc(sizeof(Reprog) + 6*sizeof(Reinst)*strlen(s));
	if(pp == 0){
		regerror("out of memory");
		return 0;
	}
	freep = pp->firstinst;
	classp = pp->class;
	errors = 0;

	if(setjmp(regkaboom))
		goto out;

	/* go compile the sucker */
	lexdone = 0;
	exprp = s;
	nclass = 0;
	nbra = 0;
	atorp = atorstack;
	andp = andstack;
	subidp = subidstack;
	lastwasand = FALSE;
	cursubid = 0;

	/* Start with a low priority operator to prime parser */
	pushator(START-1);
	while((token = lex(literal, dot_type)) != END){
		if((token&0300) == OPERATOR)
			operator(token);
		else
			operand(token);
	}

	/* Close with a low priority operator */
	evaluntil(START);

	/* Force END */
	operand(END);
	evaluntil(START);
#ifdef DEBUG
	dumpstack();
#endif
	if(nbra)
		rcerror("unmatched left paren");
	--andp;	/* points to first and only operand */
	pp->startinst = andp->first;
#ifdef DEBUG
	dump(pp);
#endif
	pp = optimize(pp);
#ifdef DEBUG
	printf("start: %d\n", (int)(andp->first-pp->firstinst));
	dump(pp);
#endif
out:
	if(errors){
		free(pp);
		pp = 0;
	}
	return pp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20e0
imulq $0x90, %rax, %rdi
addq $0x1100, %rdi           # imm = 0x1100
callq 0x21e0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, %rax
jne 0x8125
leaq 0x3445(%rip), %rdi      # 0xb558
callq 0x9290
movq $0x0, -0x8(%rbp)
jmp 0x8293
movq -0x28(%rbp), %rax
addq $0x1088, %rax           # imm = 0x1088
movq %rax, 0x7f6a(%rip)      # 0x100a0
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, 0x7f63(%rip)      # 0x100a8
movl $0x0, 0x7f61(%rip)      # 0x100b0
leaq 0x7f6a(%rip), %rdi      # 0x100c0
callq 0x2170
cmpl $0x0, %eax
je 0x8165
jmp 0x8271
movl $0x0, 0x8019(%rip)      # 0x10188
movq -0x10(%rbp), %rax
movq %rax, 0x8016(%rip)      # 0x10190
movl $0x0, 0x8014(%rip)      # 0x10198
movl $0x0, 0x800e(%rip)      # 0x1019c
leaq 0x800b(%rip), %rax      # 0x101a0
movq %rax, 0x8054(%rip)      # 0x101f0
leaq 0x805d(%rip), %rax      # 0x10200
movq %rax, 0x8196(%rip)      # 0x10340
leaq 0x819f(%rip), %rax      # 0x10350
movq %rax, 0x81e8(%rip)      # 0x103a0
movl $0x0, 0x81e6(%rip)      # 0x103a8
movl $0x0, 0x81e0(%rip)      # 0x103ac
movl $0x7f, %edi
callq 0x8300
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x8370
movl %eax, -0x1c(%rbp)
cmpl $0xff, %eax
je 0x820e
movl -0x1c(%rbp), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x8204
movl -0x1c(%rbp), %edi
callq 0x84b0
jmp 0x820c
movl -0x1c(%rbp), %edi
callq 0x8590
jmp 0x81d6
movl $0x80, %edi
callq 0x8610
movl $0xff, %edi
callq 0x8590
movl $0x80, %edi
callq 0x8610
cmpl $0x0, 0x7f69(%rip)      # 0x1019c
je 0x8241
leaq 0x332a(%rip), %rdi      # 0xb566
callq 0x88d0
movq 0x80f8(%rip), %rax      # 0x10340
addq $-0x10, %rax
movq %rax, 0x80ed(%rip)      # 0x10340
movq 0x80e6(%rip), %rax      # 0x10340
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rdi
callq 0x8910
movq %rax, -0x28(%rbp)
cmpl $0x0, 0x7e38(%rip)      # 0x100b0
je 0x828b
movq -0x28(%rbp), %rdi
callq 0x2030
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)