// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
callq 0x20e0
imulq $0x90, %rax, %rdi
addq $0x1100, %rdi           # imm = 0x1100
callq 0x21b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x6278
movl $0x1088, %eax           # imm = 0x1088
addq -0x30(%rbp), %rax
movq %rax, 0x7137(%rip)      # 0xd090
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, 0x7130(%rip)      # 0xd098
andl $0x0, 0x7131(%rip)      # 0xd0a0
leaq 0x713a(%rip), %rdi      # 0xd0b0
callq 0x2160
testl %eax, %eax
jne 0x639e
xorl %eax, %eax
andl $0x0, 0x71fc(%rip)      # 0xd188
andl $0x0, 0x71f9(%rip)      # 0xd18c
movb %al, 0x71df(%rip)       # 0xd178
movq %r15, 0x71e0(%rip)      # 0xd180
leaq 0x71e9(%rip), %rcx      # 0xd190
movq %rcx, 0x7232(%rip)      # 0xd1e0
leaq 0x723b(%rip), %rcx      # 0xd1f0
movq %rcx, 0x7374(%rip)      # 0xd330
leaq 0x737d(%rip), %rcx      # 0xd340
movq %rcx, 0x73c6(%rip)      # 0xd390
movb %al, 0x73c8(%rip)       # 0xd398
andl $0x0, 0x73c5(%rip)      # 0xd39c
pushq $0x7f
popq %rdi
callq 0x6423
leaq 0x73ba(%rip), %r12      # 0xd3a0
leaq -0x34(%rbp), %r13
movl %ebx, -0x38(%rbp)
movq %r12, %rdi
callq 0x6870
movl 0x73a5(%rip), %ecx      # 0xd3a0
orl %r14d, %eax
je 0x6014
pushq $0x7f
popq %rax
testl %ecx, %ecx
je 0x628b
movl %eax, %edi
callq 0x6527
jmp 0x5fed
movl %ecx, %eax
addl $-0x24, %eax
cmpl $0xa, %eax
ja 0x6035
leaq 0x2467(%rip), %rcx      # 0x848c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xc4, %eax
jmp 0x600b
cmpl $0x3f, %ecx
je 0x6095
cmpl $0x5b, %ecx
je 0x60a9
cmpl $0x5e, %ecx
je 0x611a
cmpl $0x7c, %ecx
je 0x609f
testl %ecx, %ecx
je 0x628b
pushq $0x7f
popq %rax
jmp 0x600b
movl %ebx, %eax
cmpl $0xff, %ebx
jne 0x6258
jmp 0x628b
movl $0x82, %edi
jmp 0x626e
movl $0x86, %edi
jmp 0x626e
movl $0x81, %edi
jmp 0x626e
movl $0x85, %edi
jmp 0x626e
movl $0x87, %edi
jmp 0x626e
movl $0x83, %edi
jmp 0x626e
movl 0x70d9(%rip), %eax      # 0xd188
cmpq $0x10, %rax
jae 0x63e6
movl %eax, %ecx
incl %ecx
movl %ecx, 0x70c5(%rip)      # 0xd188
imulq $0x108, %rax, %rax      # imm = 0x108
addq 0x6fc7(%rip), %rax      # 0xd098
movq %rax, 0x72d0(%rip)      # 0xd3a8
movq %r13, %rdi
callq 0x6870
movl %eax, %ecx
movl $0xc5, %esi
xorl %edx, %edx
testl %eax, %eax
jne 0x6124
cmpl $0x5e, -0x34(%rbp)
movl %esi, %eax
jne 0x6126
movq %r13, %rdi
callq 0x6870
movl %eax, %ecx
movabsq $0xa0000000a, %rax      # imm = 0xA0000000A
movq %rax, -0x140(%rbp)
movl $0xc6, %eax
pushq $0x8
popq %rdx
jmp 0x6126
movl $0xc3, %eax
jmp 0x600b
movl %esi, %eax
movq %rdx, %rbx
movl %eax, -0x3c(%rbp)
movl %ecx, %eax
cmpq $0xfb, %rbx
jg 0x63da
movl -0x34(%rbp), %ecx
testl %ecx, %ecx
je 0x63ce
leaq (%rbx,%rbp), %r15
addq $-0x140, %r15           # imm = 0xFEC0
movl %ecx, %edx
xorl $0x5d, %edx
orl %eax, %edx
je 0x61ae
movl %ecx, %edx
xorl $0x2d, %edx
orl %edx, %eax
jne 0x6192
testq %rbx, %rbx
je 0x63ce
movq %r13, %rdi
callq 0x6870
movl -0x34(%rbp), %ecx
movl %ecx, %edx
xorl $0x5d, %edx
orl %eax, %edx
je 0x63ce
testl %ecx, %ecx
je 0x63ce
movl %ecx, -0x4(%r15)
jmp 0x61a4
movl %ecx, -0x140(%rbp,%rbx)
movl %ecx, -0x13c(%rbp,%rbx)
addq $0x8, %rbx
movq %r13, %rdi
callq 0x6870
jmp 0x612e
leaq -0x140(%rbp), %rax
cmpq %r15, %rax
jae 0x61e6
movq %rax, %rcx
cmpq %r15, %rcx
jae 0x61e0
movl (%rcx), %edx
movl (%rax), %esi
cmpl %esi, %edx
jae 0x61da
movl %esi, (%rcx)
movl %edx, (%rax)
movl 0x4(%rcx), %edx
movl 0x4(%rax), %esi
movl %esi, 0x4(%rcx)
movl %edx, 0x4(%rax)
addq $0x8, %rcx
jmp 0x61bd
addq $0x8, %rax
jmp 0x61b5
movq 0x71bb(%rip), %rax      # 0xd3a8
leaq 0x8(%rax), %rcx
testq %rbx, %rbx
je 0x624f
movl -0x140(%rbp), %edx
movl %edx, 0x8(%rax)
movl -0x13c(%rbp), %edx
movl %edx, 0xc(%rax)
leaq -0x140(%rbp), %rdx
movl -0x38(%rbp), %ebx
addq $0x8, %rdx
cmpq %r15, %rdx
jae 0x6249
movl (%rdx), %esi
movl 0x4(%rcx), %edi
movl %edi, %r8d
incl %r8d
cmpl %r8d, %esi
ja 0x6237
movl 0x4(%rdx), %esi
cmpl %edi, %esi
jb 0x6212
movl %esi, 0x4(%rcx)
jmp 0x6212
leaq 0x8(%rcx), %rdi
movl %esi, 0x8(%rcx)
movl 0x4(%rdx), %esi
movl %esi, 0xc(%rcx)
movq %rdi, %rcx
jmp 0x6212
addq $0x8, %rcx
jmp 0x6252
movl -0x38(%rbp), %ebx
movq %rcx, (%rax)
movl -0x3c(%rbp), %eax
movl %eax, %ecx
movl %eax, %edi
andl $0xc0, %ecx
cmpl $0x80, %ecx
jne 0x600b
callq 0x646e
jmp 0x5fed
leaq 0x22d1(%rip), %rdi      # 0x8550
callq 0x6964
xorl %eax, %eax
jmp 0x63bc
movl $0x80, %ebx
movl %ebx, %edi
callq 0x659b
movl $0xff, %edi
callq 0x6527
movl %ebx, %edi
callq 0x659b
cmpl $0x0, 0x6edd(%rip)      # 0xd18c
jne 0x63f2
movq 0x7074(%rip), %rax      # 0xd330
leaq -0x10(%rax), %rcx
movq %rcx, 0x7069(%rip)      # 0xd330
movq -0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
movq -0x30(%rbp), %rbx
leaq 0x1088(%rbx), %rax
movq %rax, %rcx
cmpl $0xff, (%rcx)
je 0x6305
leaq 0x10(%rcx), %rsi
movq (%rsi), %rdx
leaq 0x10(%rdx), %rsi
cmpl $0xc2, (%rdx)
je 0x62ec
movq %rdx, 0x10(%rcx)
addq $0x18, %rcx
jmp 0x62e0
movq 0x6d84(%rip), %r14      # 0xd090
movl %r14d, %ecx
subl %eax, %ecx
addl $0x1100, %ecx           # imm = 0x1100
movslq %ecx, %rsi
movq %rbx, %rdi
callq 0x21e0
testq %rax, %rax
sete %cl
cmpq %rbx, %rax
sete %dl
orb %cl, %dl
jne 0x639a
movq %rax, %rcx
movl %ecx, %esi
subl %ebx, %esi
movslq %esi, %rdx
movq %r14, %rsi
addq %rdx, %rsi
movq %rsi, 0x6d47(%rip)      # 0xd090
addq $0x1090, %rax           # imm = 0x1090
leaq -0x8(%rax), %rdi
cmpq %rsi, %rdi
jae 0x6394
movl (%rdi), %edi
movl %edi, %r8d
addl $0xffffff7d, %r8d       # imm = 0xFFFFFF7D
cmpl $0x4, %r8d
ja 0x6373
movq %rax, %r9
cmpl $0x1, %r8d
jne 0x6387
addl $0xffffff3b, %edi       # imm = 0xFFFFFF3B
cmpl $0x2, %edi
jae 0x638a
movq (%rax), %r9
addq %rdx, %r9
movq %r9, (%rax)
addq %rdx, (%r9)
addq %rdx, 0x8(%rax)
addq $0x18, %rax
jmp 0x634f
addq %rdx, (%rcx)
movq %rcx, %rbx
movq %rbx, -0x30(%rbp)
cmpl $0x0, 0x6cfb(%rip)      # 0xd0a0
je 0x63b8
movq -0x30(%rbp), %rdi
callq 0x2030
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21b6(%rip), %rdi      # 0x858b
callq 0x6818
leaq 0x21b9(%rip), %rdi      # 0x859a
callq 0x6818
leaq 0x21df(%rip), %rdi      # 0x85cc
callq 0x6818
leaq 0x2165(%rip), %rdi      # 0x855e
callq 0x6818