// File: /workspace/github_cpp_makefile_star2_O2/arnoldrobbins[P]mcilroy-regex/re2.cpp
// Function: regcomp
int
regcomp(regex_t *preg, const char *pattern, int cflags)
{
	preg->rex = 0;
	if(Done::done==0 && (Done::done=new Done)==0)
		return REG_ESPACE;
	if(cflags & REG_AUGMENTED)
		cflags |= REG_EXTENDED;
	cflags &= CFLAGS|GFLAGS;
	Cenv env(pattern, cflags);
	if(env.flags&SPACE)
		return REG_ESPACE;

	preg->rex = regAlt(1, &env);
	cflags |= special(preg, &env);
	if(preg->rex == ERROR)
		return env.flags&SPACE? REG_ESPACE: REG_BADPAT;

	preg->rex->serialize(1);
	Stat st = preg->rex->stat(&env);
	if(st.o) {
		regfree(preg);
		return REG_ESPACE;
	}
	cflags |= hard(&st);
	if(cflags & REG_ANCH)
		cflags |= ONCE;
	preg->flags = cflags;
	preg->re_nsub = st.p;
	preg->map = env.map;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
andq $0x0, 0x8(%rdi)
movl %edx, %ebp
movq %rsi, %r14
cmpq $0x0, 0x8e77(%rip)      # 0x128c0
jne 0x9a71
pushq $0x18
popq %rdi
callq 0x5170
movb $0x11, 0x8(%rax)
andq $0x0, 0x10(%rax)
leaq 0x7f55(%rip), %rcx      # 0x119b8
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rax, 0x8e4f(%rip)      # 0x128c0
movl %ebp, %eax
shrl $0x9, %eax
andl $0x1, %eax
andl $0x3cf, %ebp            # imm = 0x3CF
orl %eax, %ebp
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x9284
testb $0x4, 0x1(%r15)
jne 0x9b73
pushq $0x1
popq %rdi
leaq 0x10(%rsp), %rsi
callq 0x9c54
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x9b78
movq %rax, %r14
movzbl 0x8(%rax), %eax
cmpq $0x9, %rax
ja 0x9b2a
leaq 0x29e4(%rip), %rcx      # 0xc4b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1000, %r12d          # imm = 0x1000
testb $0x40, 0x10(%rsp)
jne 0x9b2d
movq %rbx, %rdi
callq 0x9d26
jmp 0x9b2a
movq 0x20(%r14), %r14
movzbl 0x8(%r14), %eax
cmpl $0x9, %eax
je 0x9aec
cmpl $0x1, %eax
je 0x9b1d
cmpl $0x3, %eax
jne 0x9b2a
cmpl $0x0, 0x18(%r14)
jne 0x9b2a
movl $0x1000, %r12d          # imm = 0x1000
cmpl $0x40000000, 0x1c(%r14) # imm = 0x40000000
jne 0x9b2a
jmp 0x9b2d
movl $0x1000, %r12d          # imm = 0x1000
testb $0x8, 0x10(%rsp)
je 0x9b2d
xorl %r12d, %r12d
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x9b78
movq (%rdi), %rax
pushq $0x1
popq %rsi
callq *0x18(%rax)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rsi
callq *0x10(%rax)
movq %rax, (%rsp)
movl %edx, 0x8(%rsp)
movq %rdx, %r14
shrq $0x20, %r14
movw %r14w, 0xc(%rsp)
shrq $0x28, %rdx
testb %dl, %dl
je 0x9b93
movq %rbx, %rdi
callq 0x9d26
pushq $0xc
popq %rax
jmp 0x9b86
testb $0x4, 0x11(%rsp)
pushq $0x2
popq %rcx
pushq $0xc
popq %rax
cmovel %ecx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdi
callq 0x98cd
orl %ebp, %r12d
orl %eax, %r12d
movl %r12d, %eax
shll $0x5, %eax
andl $0x1000, %eax           # imm = 0x1000
orl %r12d, %eax
movl %eax, 0x10(%rbx)
movzbl %r14b, %eax
movq %rax, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rbx)
xorl %eax, %eax
jmp 0x9b86
movzwl 0x10(%rsp), %eax
xorl %r12d, %r12d
testw $0x180, %ax             # imm = 0x180
jne 0x9b2d
movl $0x88, %edi
callq 0x5170
movq %rax, %r15
movq 0x18(%r14), %rsi
movl 0x20(%r14), %edx
leaq 0x10(%rsp), %rcx
movq %rax, %rdi
callq 0x7de6
testb $0x4, 0x11(%rsp)
jne 0x9c2e
movq 0x10(%r14), %rax
movq %rax, 0x10(%r15)
movq %r15, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
andl $0x0, 0x20(%r14)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movl $0x1000, %r12d          # imm = 0x1000
jmp 0x9b2d
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x9b2d
movq %rax, %rbx
movl $0x88, %esi
movq %r15, %rdi
callq 0x5180
movq %rbx, %rdi
callq 0x52b0