// File: /workspace/github_c_makefile_star2_O0/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: process_string
static char* process_string(const char *input, size_t len) {
    const char *input_ptr = input;
    size_t initial_size = (len + 1) * sizeof(char);
    size_t final_size = 0;
    char *output = NULL, *output_ptr = NULL, *resized_output = NULL;
    output = (char*)parson_malloc(initial_size);
    if (output == NULL) {
        goto error;
    }
    output_ptr = output;
    while ((*input_ptr != '\0') && (size_t)(input_ptr - input) < len) {
        if (*input_ptr == '\\') {
            input_ptr++;
            switch (*input_ptr) {
                case '\"': *output_ptr = '\"'; break;
                case '\\': *output_ptr = '\\'; break;
                case '/':  *output_ptr = '/';  break;
                case 'b':  *output_ptr = '\b'; break;
                case 'f':  *output_ptr = '\f'; break;
                case 'n':  *output_ptr = '\n'; break;
                case 'r':  *output_ptr = '\r'; break;
                case 't':  *output_ptr = '\t'; break;
                case 'u':
                    if (parse_utf16(&input_ptr, &output_ptr) == JSONFailure) {
                        goto error;
                    }
                    break;
                default:
                    goto error;
            }
        } else if ((unsigned char)*input_ptr < 0x20) {
            goto error; /* 0x00-0x19 are invalid characters for json string (http://www.ietf.org/rfc/rfc4627.txt) */
        } else {
            *output_ptr = *input_ptr;
        }
        output_ptr++;
        input_ptr++;
    }
    *output_ptr = '\0';
    /* resize to new length */
    final_size = (size_t)(output_ptr-output) + 1;
    /* todo: don't resize if final_size == initial_size */
    resized_output = (char*)parson_malloc(final_size);
    if (resized_output == NULL) {
        goto error;
    }
    memcpy(resized_output, output, final_size);
    parson_free(output);
    return resized_output;
error:
    parson_free(output);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
shlq $0x0, %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq 0x6301(%rip), %rax      # 0xd180
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x6e95
jmp 0x7013
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x49(%rbp)
je 0x6ec3
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x6ecf
jmp 0x6fb7
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x6f7b
movq -0x20(%rbp), %rax
incq %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0x53, %eax
ja 0x6f74
movq -0x58(%rbp), %rax
leaq 0x264e(%rip), %rcx      # 0x9558
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x40(%rbp), %rax
movb $0x22, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0x5c, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0x2f, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0x8, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0xc, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0xa, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0xd, (%rax)
jmp 0x6f79
movq -0x40(%rbp), %rax
movb $0x9, (%rax)
jmp 0x6f79
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7040
cmpl $-0x1, %eax
jne 0x6f72
jmp 0x7013
jmp 0x6f79
jmp 0x7013
jmp 0x6f9a
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
jge 0x6f8c
jmp 0x7013
movq -0x20(%rbp), %rax
movb (%rax), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
jmp 0x6f9a
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x6e9d
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq 0x61a8(%rip), %rax      # 0xd180
movq -0x30(%rbp), %rdi
callq *%rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x6feb
jmp 0x7013
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x1210
movq 0x6175(%rip), %rax      # 0xd178
movq -0x38(%rbp), %rdi
callq *%rax
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7028
movq 0x615e(%rip), %rax      # 0xd178
movq -0x38(%rbp), %rdi
callq *%rax
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)