// File: /workspace/github_cpp_makefile_star2_O1/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 0x3ffb(%rip), %rsi      # 0xa5e0
movl $0x1, %ecx
movq %rdx, %rdi
xorl %edx, %edx
callq 0x21f0
movq %rax, %r12
leaq 0x3dad(%rip), %rsi      # 0xa3ab
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x21f0
movq %rax, %r15
leaq 0x3fcb(%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
jne 0x6661
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0x6723
movq %rdx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x6729
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 0x66a2
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
movq %rbx, 0x50(%rsp)
cmpq $-0x1, %r13
je 0x6746
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movb -0x1(%rax,%rcx), %bl
movb (%rax), %bpl
cmpb %bl, %bpl
je 0x6794
leaq 0x8(%rsp), %r12
leaq 0x3ee4(%rip), %r13      # 0xa5e4
movsbl %bpl, %esi
movq %r12, %rdi
callq 0x2130
movq %r12, %rdi
movq %r13, %rsi
callq 0x2280
incb %bpl
cmpb %bpl, %bl
jne 0x6700
movl %ebx, %ebp
jmp 0x6794
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 0x6866
leaq -0x1(%r15), %rcx
movq %rcx, 0x48(%rsp)
cmpq %rcx, %rbp
je 0x6788
leaq -0x2(%r15), %rbx
leaq 0x8(%rsp), %r13
leaq 0x3e80(%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 0x6764
movq (%r14), %rax
movq 0x48(%rsp), %rcx
movb (%rax,%rcx), %bpl
movsbl %bpl, %esi
leaq 0x8(%rsp), %rdi
callq 0x2130
movq 0x50(%rsp), %rbx
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 0x67f0
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x3bd0(%rip), %rsi      # 0xa3c7
leaq 0x8(%rsp), %rdi
callq 0x2280
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
leaq 0x18(%rsp), %rdx
cmpq %rdx, %rcx
je 0x6825
movq %rcx, (%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x682b
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq %rdx, %rcx
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x686b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
leaq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdi
cmpq %rcx, %rdi
je 0x6882
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %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 0x68d4
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x68d4
jmp 0x68d1
jmp 0x68c8
jmp 0x68c8
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x68de
movq %rax, %rbx
jmp 0x68f0
jmp 0x68d1
jmp 0x68d1
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x68f0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x690c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2260