// File: /workspace/github_cpp_makefile_star2_O3/davinash[P]regex/src/regex.cpp
// Function: RegEx::PreProcessBracket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string RegEx::PreProcessBracket( std::string strRegEx) {
	std::string::size_type startPos, endPos, separatorPos;
	std::string ReplacedStrRegEx;

	startPos = strRegEx.find_first_of("[");
	endPos   = strRegEx.find_first_of("]");
	separatorPos = strRegEx.find_first_of("-");

	if ( startPos == std::string::npos || endPos == std::string::npos )
		return strRegEx;

	ReplacedStrRegEx += strRegEx.substr( 0, startPos );
	ReplacedStrRegEx.push_back('(');
	std::string result = strRegEx.substr( startPos + 1, endPos - startPos - 1);
	char first = result[0];
	char last  = result[result.size() - 1 ];

	if ( separatorPos != std::string::npos ) {		
		while ( first != last ) {
			ReplacedStrRegEx.push_back(first);
			ReplacedStrRegEx += "|";
			first++;
		}
		ReplacedStrRegEx.push_back(first);				
	} else {
		startPos++;
		while ( startPos != endPos - 1) {
			ReplacedStrRegEx.push_back(strRegEx[startPos]);
			ReplacedStrRegEx += "|";
			startPos++;
		}
		ReplacedStrRegEx.push_back(strRegEx[endPos - 1]);
	}
	ReplacedStrRegEx += strRegEx.substr( endPos + 1, strRegEx.size() - endPos );
	ReplacedStrRegEx += ")";

	return ReplacedStrRegEx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x4023(%rip), %rsi      # 0xa5e0
movl $0x1, %ecx
movq %rdx, %rdi
xorl %edx, %edx
callq 0x21f0
movq %rax, %r12
leaq 0x3dd5(%rip), %rsi      # 0xa3ab
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x21f0
movq %rax, %r15
leaq 0x3ff3(%rip), %rsi      # 0xa5e2
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x21f0
movq %rax, %r13
cmpq $-0x1, %r12
setne %al
cmpq $-0x1, %r15
setne %cl
testb %cl, %al
movq %rbx, 0x48(%rsp)
jne 0x663e
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0x66f7
movq %rdx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x66fd
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x2170
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x2050
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x667f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x8(%rsp), %rdi
movl $0x28, %esi
callq 0x2130
leaq 0x1(%r12), %rbp
movq %r12, %rcx
notq %rcx
addq %r15, %rcx
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x2170
cmpq $-0x1, %r13
je 0x671a
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movb -0x1(%rax,%rcx), %bpl
movb (%rax), %bl
cmpb %bpl, %bl
je 0x6768
leaq 0x8(%rsp), %r12
leaq 0x3f0c(%rip), %r13      # 0xa5e4
movsbl %bl, %esi
movq %r12, %rdi
callq 0x2130
movq %r12, %rdi
movq %r13, %rsi
callq 0x2280
incb %bl
cmpb %bl, %bpl
jne 0x66d8
jmp 0x6768
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
jmp 0x683a
leaq -0x1(%r15), %rcx
movq %rcx, 0x50(%rsp)
cmpq %rcx, %rbp
je 0x675c
leaq -0x2(%r15), %rbx
leaq 0x8(%rsp), %r13
leaq 0x3eac(%rip), %rbp      # 0xa5e4
movq (%r14), %rax
movsbl 0x1(%rax,%r12), %esi
movq %r13, %rdi
callq 0x2130
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2280
incq %r12
cmpq %r12, %rbx
jne 0x6738
movq (%r14), %rax
movq 0x50(%rsp), %rcx
movb (%rax,%rcx), %bpl
movsbl %bpl, %esi
leaq 0x8(%rsp), %rdi
callq 0x2130
movq 0x8(%r14), %rcx
subq %r15, %rcx
incq %r15
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2170
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
leaq 0x8(%rsp), %rdi
callq 0x2050
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x67bf
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x3c01(%rip), %rsi      # 0xa3c7
leaq 0x8(%rsp), %rdi
callq 0x2280
movq 0x48(%rsp), %rsi
leaq 0x10(%rsi), %rax
movq %rax, (%rsi)
movq 0x8(%rsp), %rcx
leaq 0x18(%rsp), %rdx
cmpq %rdx, %rcx
je 0x67f9
movq %rcx, (%rsi)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsi)
jmp 0x67ff
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq %rdx, %rcx
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsi)
movq %rdx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x683f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdi
cmpq %rcx, %rdi
je 0x6856
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x48(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x68aa
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x68aa
jmp 0x68a7
jmp 0x689e
jmp 0x689e
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x68b4
movq %rax, %rbx
jmp 0x68c6
jmp 0x68a7
jmp 0x68a7
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x68c6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x68e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2260