// File: /workspace/github_c_makefile_star2_O1/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 0x1099(%rip), %rsi      # 0x74c9
movq %r13, %rdi
callq 0x63a1
movl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x665e
movl %ebp, %r12d
addq %r13, %r12
testq %r13, %r13
cmoveq %r13, %r12
testq %r15, %r15
je 0x663c
xorl %r13d, %r13d
leaq 0xf4d(%rip), %rbx       # 0x73b4
movzbl (%r14,%r13), %eax
cmpq $0x2f, %rax
ja 0x6487
movslq (%rbx,%rax,4), %rcx
addq %rbx, %rcx
jmpq *%rcx
leaq 0x105e(%rip), %rsi      # 0x74e0
jmp 0x660d
cmpl $0x5c, %eax
jne 0x649b
movq %r12, %rdi
leaq 0x1035(%rip), %rsi      # 0x74cb
jmp 0x6610
testq %r12, %r12
je 0x6635
movb %al, (%r12)
incq %r12
jmp 0x6638
leaq 0x1011(%rip), %rsi      # 0x74c8
jmp 0x660d
leaq 0x100b(%rip), %rsi      # 0x74ce
jmp 0x660d
leaq 0x108f(%rip), %rsi      # 0x755e
jmp 0x660d
leaq 0x109f(%rip), %rsi      # 0x757a
jmp 0x660d
leaq 0x10af(%rip), %rsi      # 0x7596
jmp 0x660d
leaq 0x1072(%rip), %rsi      # 0x7565
jmp 0x660d
leaq 0xfd5(%rip), %rsi       # 0x74d4
jmp 0x660d
leaq 0x1030(%rip), %rsi      # 0x753b
jmp 0x660d
leaq 0x100f(%rip), %rsi      # 0x7526
jmp 0x660d
leaq 0xff5(%rip), %rsi       # 0x7518
jmp 0x660d
leaq 0xfae(%rip), %rsi       # 0x74dd
jmp 0x660d
leaq 0xfe4(%rip), %rsi       # 0x751f
jmp 0x660d
leaq 0xfca(%rip), %rsi       # 0x7511
jmp 0x660d
leaq 0x1020(%rip), %rsi      # 0x7573
jmp 0x660d
leaq 0xff1(%rip), %rsi       # 0x7550
jmp 0x660d
leaq 0xf91(%rip), %rsi       # 0x74fc
jmp 0x660d
leaq 0xfbd(%rip), %rsi       # 0x7534
jmp 0x660d
leaq 0xfc6(%rip), %rsi       # 0x7549
jmp 0x660d
leaq 0xf5f(%rip), %rsi       # 0x74ee
jmp 0x660d
leaq 0xf4f(%rip), %rsi       # 0x74e7
jmp 0x660d
leaq 0xf36(%rip), %rsi       # 0x74d7
jmp 0x660d
leaq 0xf60(%rip), %rsi       # 0x750a
jmp 0x660d
leaq 0xf42(%rip), %rsi       # 0x74f5
jmp 0x660d
leaq 0xf1e(%rip), %rsi       # 0x74da
jmp 0x660d
leaq 0xf0c(%rip), %rsi       # 0x74d1
jmp 0x660d
leaq 0xfba(%rip), %rsi       # 0x7588
jmp 0x660d
leaq 0xf2c(%rip), %rsi       # 0x7503
jmp 0x660d
leaq 0xfa1(%rip), %rsi       # 0x7581
jmp 0x660d
leaq 0xf44(%rip), %rsi       # 0x752d
jmp 0x660d
leaq 0xf65(%rip), %rsi       # 0x7557
jmp 0x660d
leaq 0xf71(%rip), %rsi       # 0x756c
jmp 0x660d
leaq 0xf3e(%rip), %rsi       # 0x7542
jmp 0x660d
leaq 0xf82(%rip), %rsi       # 0x758f
movq %r12, %rdi
callq 0x63a1
testl %eax, %eax
js 0x6659
movl %eax, %ecx
addq %r12, %rcx
testq %r12, %r12
cmovneq %rcx, %r12
addl %eax, %ebp
incq %r13
cmpq %r13, %r15
jne 0x6467
jmp 0x663c
xorl %r12d, %r12d
incl %ebp
jmp 0x6627
leaq 0xe86(%rip), %rsi       # 0x74c9
movq %r12, %rdi
callq 0x63a1
addl %eax, %ebp
testl %eax, %eax
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnsl %ebp, %eax
jmp 0x665e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq