// File: /workspace/github_cpp_makefile_star2_O2/swxlion[P]swxJson/src/swxJson.cpp
// Function: JsonStringEscaper::escape(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*)
std::string escape(const std::string * const str)
	{
		const uint8_t mark2 = 0xe0;	//-- 1110 0000
		const uint8_t mark3 = 0xf0;	//-- 1111 0000
		const uint8_t mark4 = 0xf8;	//-- 1111 1000
		const uint8_t mark5 = 0xfc;	//-- 1111 1100
		const uint8_t mark6 = 0xfe;	//-- 1111 1110

		const uint8_t utf82 = 0xc0;	//-- 1100 0000
		const uint8_t utf83 = 0xe0;	//-- 1110 0000
		const uint8_t utf84 = 0xf0;	//-- 1111 0000
		const uint8_t utf85 = 0xf8;	//-- 1111 1000
		const uint8_t utf86 = 0xfc;	//-- 1111 1100

		std::ostringstream os;

		int len = (int)str->length();
		const char* p = str->data();
    	for (int i = 0; i < len; i++)
    	{
    		if ((p[i] & 0x80) == 0x00)
    			(this->*_callMap[(unsigned char)(p[i])])(os, p, len, i);
    		else
    		{
    			if ((p[i] & mark2) == utf82 && i + 1 < len)
				{
					os << p[i] << p[i+1];
					i += 1;
				}
				else if ((p[i] & mark3) == utf83 && i + 2 < len)
				{
					os << p[i] << p[i+1] << p[i+2];
					i += 2;
				}
				else if ((p[i] & mark4) == utf84 && i + 3 < len)
				{
					os << p[i] << p[i+1] << p[i+2] << p[i+3];
					i += 3;
				}
				else if ((p[i] & mark5) == utf85 && i + 4 < len)
				{
					os << p[i] << p[i+1] << p[i+2] << p[i+3] << p[i+4];
					i += 4;
				}
				else if ((p[i] & mark6) == utf86 && i + 5 < len)
				{
					os << p[i] << p[i+1] << p[i+2] << p[i+3] << p[i+4] << p[i+5];
					i += 5;
				}
				else
					(this->*_callMap[(unsigned char)(p[i])])(os, p, len, i);
    		}
    	}

    	return os.str();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xe2d0
movl 0x8(%r12), %ebp
movq (%r12), %r12
xorl %ecx, %ecx
leaq 0xc(%rsp), %r13
movl %ecx, 0xc(%rsp)
cmpl %ebp, %ecx
jge 0x1a7a3
movslq %ecx, %rax
movzbl (%r12,%rax), %eax
testb %al, %al
js 0x1a5bb
shll $0x4, %eax
movq (%r14,%rax), %r9
movq 0x8(%r14,%rax), %rdi
addq %r14, %rdi
testb $0x1, %r9b
je 0x1a5a8
movq (%rdi), %rax
movq -0x1(%rax,%r9), %r9
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq %r13, %r8
callq *%r9
jmp 0x1a798
movl %eax, %edx
andb $-0x20, %dl
cmpb $-0x40, %dl
jne 0x1a5f3
leal 0x1(%rcx), %edx
cmpl %ebp, %edx
jge 0x1a5f3
movsbl %al, %esi
movq %r15, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x1(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
incl 0xc(%rsp)
jmp 0x1a798
movl %eax, %edx
andb $-0x10, %dl
cmpb $-0x20, %dl
jne 0x1a63f
leal 0x2(%rcx), %edx
cmpl %ebp, %edx
jge 0x1a63f
movsbl %al, %esi
movq %r15, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x1(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x2(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
addl $0x2, 0xc(%rsp)
jmp 0x1a798
movl %eax, %edx
andb $-0x8, %dl
cmpb $-0x10, %dl
jne 0x1a69e
leal 0x3(%rcx), %edx
cmpl %ebp, %edx
jge 0x1a69e
movsbl %al, %esi
movq %r15, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x1(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x2(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x3(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
addl $0x3, 0xc(%rsp)
jmp 0x1a798
movl %eax, %edx
andb $-0x4, %dl
cmpb $-0x8, %dl
jne 0x1a710
leal 0x4(%rcx), %edx
cmpl %ebp, %edx
jge 0x1a710
movsbl %al, %esi
movq %r15, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x1(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x2(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x3(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x4(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
addl $0x4, 0xc(%rsp)
jmp 0x1a798
movl %eax, %edx
andb $-0x2, %dl
cmpb $-0x4, %dl
jne 0x1a58b
addl $0x5, %ecx
cmpl %ebp, %ecx
jge 0x1a58b
movsbl %al, %esi
movq %r15, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x1(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x2(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x3(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x4(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
movslq 0xc(%rsp), %rcx
movsbl 0x5(%r12,%rcx), %esi
movq %rax, %rdi
callq 0xe2a0
addl $0x5, 0xc(%rsp)
movl 0xc(%rsp), %ecx
incl %ecx
jmp 0x1a573
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0xe310
leaq 0x10(%rsp), %rdi
callq 0xe060
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a7d1
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xe060
movq %rbx, %rdi
callq 0xe3a0