// File: 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:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0xa8(%rsp)
movq %rdi, %rax
movq %rax, 0xb0(%rsp)
movq %rdi, 0x280(%rsp)
movq %rsi, 0x278(%rsp)
movq %rdx, 0x270(%rsp)
movq 0x278(%rsp), %rax
movq %rax, 0xb8(%rsp)
movb $-0x20, 0x26f(%rsp)
movb $-0x10, 0x26e(%rsp)
movb $-0x8, 0x26d(%rsp)
movb $-0x4, 0x26c(%rsp)
movb $-0x2, 0x26b(%rsp)
movb $-0x40, 0x26a(%rsp)
movb $-0x20, 0x269(%rsp)
movb $-0x10, 0x268(%rsp)
movb $-0x8, 0x267(%rsp)
movb $-0x4, 0x266(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x223d0
movq 0x270(%rsp), %rdi
callq 0x22410
movl %eax, 0xe4(%rsp)
movq 0x270(%rsp), %rdi
callq 0x223b0
movq %rax, 0xd8(%rsp)
movl $0x0, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
cmpl 0xe4(%rsp), %eax
jge 0x3e9ba
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x3e483
movq 0xb8(%rsp), %rcx
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rdx
movzbl (%rax,%rdx), %eax
shll $0x4, %eax
movl %eax, %edx
movq (%rcx,%rdx), %rax
movq %rax, 0x98(%rsp)
movq 0x8(%rcx,%rdx), %rdx
addq %rdx, %rcx
movq %rcx, 0xa0(%rsp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0x3e415
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, 0x90(%rsp)
jmp 0x3e425
movq 0x98(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0xa0(%rsp), %rdi
movq 0x90(%rsp), %rax
movq 0xd8(%rsp), %rdx
movl 0xe4(%rsp), %ecx
leaq 0xe8(%rsp), %rsi
leaq 0xd4(%rsp), %r8
callq *%rax
jmp 0x3e458
jmp 0x3e9a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x22090
jmp 0x3e9ee
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
andl $0xe0, %eax
cmpl $0xc0, %eax
jne 0x3e51b
movl 0xd4(%rsp), %eax
addl $0x1, %eax
cmpl 0xe4(%rsp), %eax
jge 0x3e51b
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0xe8(%rsp), %rdi
callq 0x22380
movq %rax, 0x88(%rsp)
jmp 0x3e4e1
movq 0x88(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x1(%rax,%rcx), %esi
callq 0x22380
jmp 0x3e505
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3e9a0
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
jne 0x3e5e1
movl 0xd4(%rsp), %eax
addl $0x2, %eax
cmpl 0xe4(%rsp), %eax
jge 0x3e5e1
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0xe8(%rsp), %rdi
callq 0x22380
movq %rax, 0x80(%rsp)
jmp 0x3e581
movq 0x80(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x1(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x78(%rsp)
jmp 0x3e5aa
movq 0x78(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x2(%rax,%rcx), %esi
callq 0x22380
jmp 0x3e5cb
movl 0xd4(%rsp), %eax
addl $0x2, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3e99e
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
andl $0xf8, %eax
cmpl $0xf0, %eax
jne 0x3e6c7
movl 0xd4(%rsp), %eax
addl $0x3, %eax
cmpl 0xe4(%rsp), %eax
jge 0x3e6c7
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0xe8(%rsp), %rdi
callq 0x22380
movq %rax, 0x70(%rsp)
jmp 0x3e644
movq 0x70(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x1(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x68(%rsp)
jmp 0x3e66a
movq 0x68(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x2(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x60(%rsp)
jmp 0x3e690
movq 0x60(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x3(%rax,%rcx), %esi
callq 0x22380
jmp 0x3e6b1
movl 0xd4(%rsp), %eax
addl $0x3, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3e99c
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
andl $0xfc, %eax
cmpl $0xf8, %eax
jne 0x3e7d3
movl 0xd4(%rsp), %eax
addl $0x4, %eax
cmpl 0xe4(%rsp), %eax
jge 0x3e7d3
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0xe8(%rsp), %rdi
callq 0x22380
movq %rax, 0x58(%rsp)
jmp 0x3e72a
movq 0x58(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x1(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x50(%rsp)
jmp 0x3e750
movq 0x50(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x2(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x48(%rsp)
jmp 0x3e776
movq 0x48(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x3(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x40(%rsp)
jmp 0x3e79c
movq 0x40(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x4(%rax,%rcx), %esi
callq 0x22380
jmp 0x3e7bd
movl 0xd4(%rsp), %eax
addl $0x4, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3e99a
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %eax
andl $0xfe, %eax
cmpl $0xfc, %eax
jne 0x3e905
movl 0xd4(%rsp), %eax
addl $0x5, %eax
cmpl 0xe4(%rsp), %eax
jge 0x3e905
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rcx
movsbl (%rax,%rcx), %esi
leaq 0xe8(%rsp), %rdi
callq 0x22380
movq %rax, 0x38(%rsp)
jmp 0x3e836
movq 0x38(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x1(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x30(%rsp)
jmp 0x3e85c
movq 0x30(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x2(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x28(%rsp)
jmp 0x3e882
movq 0x28(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x3(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x20(%rsp)
jmp 0x3e8a8
movq 0x20(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x4(%rax,%rcx), %esi
callq 0x22380
movq %rax, 0x18(%rsp)
jmp 0x3e8ce
movq 0x18(%rsp), %rdi
movq 0xd8(%rsp), %rcx
movslq 0xd4(%rsp), %rax
movsbl 0x5(%rax,%rcx), %esi
callq 0x22380
jmp 0x3e8ef
movl 0xd4(%rsp), %eax
addl $0x5, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3e998
movq 0xb8(%rsp), %rcx
movq 0xd8(%rsp), %rax
movslq 0xd4(%rsp), %rdx
movzbl (%rax,%rdx), %eax
shll $0x4, %eax
movl %eax, %edx
movq (%rcx,%rdx), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rcx,%rdx), %rdx
addq %rdx, %rcx
movq %rcx, 0x10(%rsp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0x3e961
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, (%rsp)
jmp 0x3e96a
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq 0xd8(%rsp), %rdx
movl 0xe4(%rsp), %ecx
leaq 0xe8(%rsp), %rsi
leaq 0xd4(%rsp), %r8
callq *%rax
jmp 0x3e996
jmp 0x3e998
jmp 0x3e99a
jmp 0x3e99c
jmp 0x3e99e
jmp 0x3e9a0
jmp 0x3e9a2
jmp 0x3e9a4
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x3e373
movq 0xa8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x222d0
jmp 0x3e9d1
leaq 0xe8(%rsp), %rdi
callq 0x22090
movq 0xb0(%rsp), %rax
addq $0x288, %rsp            # imm = 0x288
retq
movq 0xc8(%rsp), %rdi
callq 0x224a0
nopl (%rax,%rax)