// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
cmpq $0x0, 0x8f84(%rip)      # 0x138c0
jne 0xa969
movl $0x18, %edi
callq 0x5170
movb $0x11, 0x8(%rax)
movq $0x0, 0x10(%rax)
leaq 0x805d(%rip), %rcx      # 0x129b8
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rax, 0x8f57(%rip)      # 0x138c0
movl %ebp, %eax
shrl $0x9, %eax
andl $0x1, %eax
movl %ebp, %r14d
andl $0x3cf, %r14d           # imm = 0x3CF
orl %eax, %r14d
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xa200
movl $0xc, %r15d
testb $0x4, 0x1(%r12)
jne 0xaae0
leaq 0x8(%rsp), %rsi
movl $0x1, %edi
callq 0xabf4
movq %rax, 0x8(%rbx)
xorl %r13d, %r13d
testq %rax, %rax
je 0xaa45
movq %rax, %r12
movzbl 0x8(%rax), %eax
cmpq $0x9, %rax
ja 0xaa42
leaq 0x2aca(%rip), %rcx      # 0xd4a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1000, %r13d          # imm = 0x1000
testb $0x40, 0x8(%rsp)
jne 0xaa45
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
movq $0x0, 0x8(%rbx)
jmp 0xaa42
movq 0x20(%r12), %r12
movzbl 0x8(%r12), %eax
cmpl $0x9, %eax
je 0xaa00
cmpl $0x1, %eax
je 0xaa35
cmpl $0x3, %eax
jne 0xaa45
cmpl $0x0, 0x18(%r12)
jne 0xaa42
movl $0x1000, %r13d          # imm = 0x1000
cmpl $0x40000000, 0x1c(%r12) # imm = 0x40000000
jne 0xaa42
jmp 0xaa45
movl $0x1000, %r13d          # imm = 0x1000
testb $0x8, 0x8(%rsp)
je 0xaa45
xorl %r13d, %r13d
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xaa8c
movq (%rdi), %rax
movl $0x1, %esi
callq *0x18(%rax)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
callq *0x10(%rax)
movq %rdx, %rcx
shrq $0x28, %rcx
testb %cl, %cl
je 0xaaa2
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0xaa82
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rbx)
jmp 0xaae0
testb $0x4, 0x9(%rsp)
movl $0x2, %eax
movl $0xc, %r15d
cmovel %eax, %r15d
jmp 0xaae0
movq %rax, %rcx
shrq $0x30, %rcx
movzbl %cl, %esi
movl $0x800, %ecx            # imm = 0x800
orl %edx, %esi
je 0xab34
orl %ecx, %r13d
shll $0x5, %ebp
andl $0x1000, %ebp           # imm = 0x1000
orl %r13d, %ebp
orl %r14d, %ebp
movl %ebp, 0x10(%rbx)
shrq $0x20, %rdx
movzbl %dl, %eax
movq %rax, (%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl 0x8(%rsp), %eax
testl $0x180, %eax            # imm = 0x180
jne 0xaa45
movl $0x88, %edi
callq 0x5170
movq 0x18(%r12), %rsi
movl 0x20(%r12), %edx
leaq 0x8(%rsp), %rcx
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x867e
testb $0x4, 0x9(%rsp)
jne 0xab81
movq (%rsp), %rcx
jmp 0xab8d
movabsq $-0x1ff010000000000, %rsi # imm = 0xFE00FF0000000000
testq %rsi, %rax
je 0xab7a
movq %rax, %rsi
shrq $0x38, %rsi
jne 0xaab5
movq %rax, %rsi
shrq $0x28, %rsi
movl $0x0, %ecx
cmpb $0x2, %sil
jb 0xaab5
shrq $0x20, %rax
xorl %ecx, %ecx
cmpb %sil, %al
setne %cl
shll $0xb, %ecx
jmp 0xaab5
xorl %ecx, %ecx
jmp 0xaab5
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
xorl %ecx, %ecx
testq %rcx, %rcx
je 0xaa45
testb $0x4, 0x9(%rsp)
movl $0x0, %r13d
jne 0xaa45
movq 0x10(%r12), %rax
movq %rax, 0x10(%rcx)
movq %rcx, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movl $0x0, 0x20(%r12)
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
movl $0x1000, %r13d          # imm = 0x1000
jmp 0xaa45
movq %rax, %rbx
movl $0x88, %esi
movq (%rsp), %rdi
callq 0x5180
movq %rbx, %rdi
callq 0x52b0