// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_string
static int json_serialize_string(const char *string, char *buf) {
    size_t i = 0, len = strlen(string);
    char c = '\0';
    int written = -1, written_total = 0;
    APPEND_STRING("\"");
    for (i = 0; i < len; i++) {
        c = string[i];
        switch (c) {
            case '\"': APPEND_STRING("\\\""); break;
            case '\\': APPEND_STRING("\\\\"); break;
            case '/':  APPEND_STRING("\\/"); break; /* to make json embeddable in xml\/html */
            case '\b': APPEND_STRING("\\b"); break;
            case '\f': APPEND_STRING("\\f"); break;
            case '\n': APPEND_STRING("\\n"); break;
            case '\r': APPEND_STRING("\\r"); break;
            case '\t': APPEND_STRING("\\t"); break;
            case '\x00': APPEND_STRING("\\u0000"); break;
            case '\x01': APPEND_STRING("\\u0001"); break;
            case '\x02': APPEND_STRING("\\u0002"); break;
            case '\x03': APPEND_STRING("\\u0003"); break;
            case '\x04': APPEND_STRING("\\u0004"); break;
            case '\x05': APPEND_STRING("\\u0005"); break;
            case '\x06': APPEND_STRING("\\u0006"); break;
            case '\x07': APPEND_STRING("\\u0007"); break;
            /* '\x08' duplicate: '\b' */
            /* '\x09' duplicate: '\t' */
            /* '\x0a' duplicate: '\n' */
            case '\x0b': APPEND_STRING("\\u000b"); break;
            /* '\x0c' duplicate: '\f' */
            /* '\x0d' duplicate: '\r' */
            case '\x0e': APPEND_STRING("\\u000e"); break;
            case '\x0f': APPEND_STRING("\\u000f"); break;
            case '\x10': APPEND_STRING("\\u0010"); break;
            case '\x11': APPEND_STRING("\\u0011"); break;
            case '\x12': APPEND_STRING("\\u0012"); break;
            case '\x13': APPEND_STRING("\\u0013"); break;
            case '\x14': APPEND_STRING("\\u0014"); break;
            case '\x15': APPEND_STRING("\\u0015"); break;
            case '\x16': APPEND_STRING("\\u0016"); break;
            case '\x17': APPEND_STRING("\\u0017"); break;
            case '\x18': APPEND_STRING("\\u0018"); break;
            case '\x19': APPEND_STRING("\\u0019"); break;
            case '\x1a': APPEND_STRING("\\u001a"); break;
            case '\x1b': APPEND_STRING("\\u001b"); break;
            case '\x1c': APPEND_STRING("\\u001c"); break;
            case '\x1d': APPEND_STRING("\\u001d"); break;
            case '\x1e': APPEND_STRING("\\u001e"); break;
            case '\x1f': APPEND_STRING("\\u001f"); break;
            default:
                if (buf != NULL) {
                    buf[0] = c;
                    buf += 1;
                }
                written_total += 1;
                break;
        }
    }
    APPEND_STRING("\"");
    return written_total;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %r14
callq 0x2110
movq %rax, %r15
leaq 0x12e0(%rip), %rsi      # 0x74b3
movq %r13, %rdi
callq 0x6144
movl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x6401
movl %ebp, %r12d
addq %r13, %r12
testq %r13, %r13
cmoveq %r13, %r12
testq %r15, %r15
je 0x63df
xorl %r13d, %r13d
leaq 0x119a(%rip), %rbx      # 0x73a4
movzbl (%r14,%r13), %eax
cmpq $0x2f, %rax
ja 0x622a
movslq (%rbx,%rax,4), %rcx
addq %rbx, %rcx
jmpq *%rcx
leaq 0x12a5(%rip), %rsi      # 0x74ca
jmp 0x63b0
cmpl $0x5c, %eax
jne 0x623e
movq %r12, %rdi
leaq 0x127c(%rip), %rsi      # 0x74b5
jmp 0x63b3
testq %r12, %r12
je 0x63d8
movb %al, (%r12)
incq %r12
jmp 0x63db
leaq 0x1258(%rip), %rsi      # 0x74b2
jmp 0x63b0
leaq 0x1252(%rip), %rsi      # 0x74b8
jmp 0x63b0
leaq 0x12d6(%rip), %rsi      # 0x7548
jmp 0x63b0
leaq 0x12e6(%rip), %rsi      # 0x7564
jmp 0x63b0
leaq 0x12f6(%rip), %rsi      # 0x7580
jmp 0x63b0
leaq 0x12b9(%rip), %rsi      # 0x754f
jmp 0x63b0
leaq 0x121c(%rip), %rsi      # 0x74be
jmp 0x63b0
leaq 0x1277(%rip), %rsi      # 0x7525
jmp 0x63b0
leaq 0x1256(%rip), %rsi      # 0x7510
jmp 0x63b0
leaq 0x123c(%rip), %rsi      # 0x7502
jmp 0x63b0
leaq 0x11f5(%rip), %rsi      # 0x74c7
jmp 0x63b0
leaq 0x122b(%rip), %rsi      # 0x7509
jmp 0x63b0
leaq 0x1211(%rip), %rsi      # 0x74fb
jmp 0x63b0
leaq 0x1267(%rip), %rsi      # 0x755d
jmp 0x63b0
leaq 0x1238(%rip), %rsi      # 0x753a
jmp 0x63b0
leaq 0x11d8(%rip), %rsi      # 0x74e6
jmp 0x63b0
leaq 0x1204(%rip), %rsi      # 0x751e
jmp 0x63b0
leaq 0x120d(%rip), %rsi      # 0x7533
jmp 0x63b0
leaq 0x11a6(%rip), %rsi      # 0x74d8
jmp 0x63b0
leaq 0x1196(%rip), %rsi      # 0x74d1
jmp 0x63b0
leaq 0x117d(%rip), %rsi      # 0x74c1
jmp 0x63b0
leaq 0x11a7(%rip), %rsi      # 0x74f4
jmp 0x63b0
leaq 0x1189(%rip), %rsi      # 0x74df
jmp 0x63b0
leaq 0x1165(%rip), %rsi      # 0x74c4
jmp 0x63b0
leaq 0x1153(%rip), %rsi      # 0x74bb
jmp 0x63b0
leaq 0x1201(%rip), %rsi      # 0x7572
jmp 0x63b0
leaq 0x1173(%rip), %rsi      # 0x74ed
jmp 0x63b0
leaq 0x11e8(%rip), %rsi      # 0x756b
jmp 0x63b0
leaq 0x118b(%rip), %rsi      # 0x7517
jmp 0x63b0
leaq 0x11ac(%rip), %rsi      # 0x7541
jmp 0x63b0
leaq 0x11b8(%rip), %rsi      # 0x7556
jmp 0x63b0
leaq 0x1185(%rip), %rsi      # 0x752c
jmp 0x63b0
leaq 0x11c9(%rip), %rsi      # 0x7579
movq %r12, %rdi
callq 0x6144
testl %eax, %eax
js 0x63fc
movl %eax, %ecx
addq %r12, %rcx
testq %r12, %r12
cmovneq %rcx, %r12
addl %eax, %ebp
incq %r13
cmpq %r13, %r15
jne 0x620a
jmp 0x63df
xorl %r12d, %r12d
incl %ebp
jmp 0x63ca
leaq 0x10cd(%rip), %rsi      # 0x74b3
movq %r12, %rdi
callq 0x6144
addl %eax, %ebp
testl %eax, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnsl %ebp, %eax
jmp 0x6401
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq