// File: /workspace/github_c_makefile_star2_O1/winton[P]redis_parse/hiredis/sds.c
// Function: sdscatrepr
sds sdscatrepr(sds s, char *p, size_t len) {
    s = sdscatlen(s,"\"",1);
    if (s == NULL) return NULL;

    while(len--) {
        switch(*p) {
        case '\\':
        case '"':
            s = sdscatprintf(s,"\\%c",*p);
            break;
        case '\n': s = sdscatlen(s,"\\n",2); break;
        case '\r': s = sdscatlen(s,"\\r",2); break;
        case '\t': s = sdscatlen(s,"\\t",2); break;
        case '\a': s = sdscatlen(s,"\\a",2); break;
        case '\b': s = sdscatlen(s,"\\b",2); break;
        default:
            if (isprint(*p))
                s = sdscatprintf(s,"%c",*p);
            else
                s = sdscatprintf(s,"\\x%02x",(unsigned char)*p);
            break;
        }
        p++;
        if (s == NULL) return NULL;
    }
    return sdscatlen(s,"\"",1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movslq -0x8(%rdi), %r15
movl $0x1, %esi
callq 0x4a44
testq %rax, %rax
je 0x5204
movq %rax, %r13
movb $0x22, (%rax,%r15)
leaq 0x1(%r15), %rax
movl %eax, -0x8(%r13)
decl -0x4(%r13)
movb $0x0, 0x1(%r13,%r15)
jmp 0x5207
xorl %r13d, %r13d
testq %r13, %r13
je 0x539f
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x5374
movsbl (%r14,%r15), %ebp
movzbl %bpl, %r12d
leal -0x7(%r12), %eax
cmpl $0x6, %eax
ja 0x5268
leaq 0x22ce(%rip), %rcx      # 0x7504
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movslq -0x8(%r13), %r12
movl $0x2, %esi
movq %r13, %rdi
callq 0x4a44
testq %rax, %rax
je 0x534b
movq %rax, %r13
movw $0x615c, (%rax,%r12)    # imm = 0x615C
jmp 0x5335
cmpl $0x5c, %r12d
je 0x5274
cmpl $0x22, %r12d
jne 0x5283
movq %r13, %rdi
leaq 0x22a2(%rip), %rsi      # 0x7520
jmp 0x535a
callq 0x2470
movq (%rax), %rax
movslq %ebp, %rcx
testb $0x40, 0x1(%rax,%rcx,2)
jne 0x5350
movq %r13, %rdi
leaq 0x2281(%rip), %rsi      # 0x7524
movl %r12d, %edx
jmp 0x535c
movslq -0x8(%r13), %r12
movl $0x2, %esi
movq %r13, %rdi
callq 0x4a44
testq %rax, %rax
je 0x534b
movq %rax, %r13
movw $0x625c, (%rax,%r12)    # imm = 0x625C
jmp 0x5335
movslq -0x8(%r13), %r12
movl $0x2, %esi
movq %r13, %rdi
callq 0x4a44
testq %rax, %rax
je 0x534b
movq %rax, %r13
movw $0x745c, (%rax,%r12)    # imm = 0x745C
jmp 0x5335
movslq -0x8(%r13), %r12
movl $0x2, %esi
movq %r13, %rdi
callq 0x4a44
testq %rax, %rax
je 0x534b
movq %rax, %r13
movw $0x6e5c, (%rax,%r12)    # imm = 0x6E5C
jmp 0x5335
movslq -0x8(%r13), %r12
movl $0x2, %esi
movq %r13, %rdi
callq 0x4a44
testq %rax, %rax
je 0x534b
movq %rax, %r13
movw $0x725c, (%rax,%r12)    # imm = 0x725C
leaq 0x2(%r12), %rax
movl %eax, -0x8(%r13)
addl $-0x2, -0x4(%r13)
movb $0x0, 0x2(%r13,%r12)
jmp 0x5366
xorl %r13d, %r13d
jmp 0x5366
movq %r13, %rdi
leaq 0x21c7(%rip), %rsi      # 0x7521
movl %ebp, %edx
xorl %eax, %eax
callq 0x2140
movq %rax, %r13
incq %r15
testq %r13, %r13
jne 0x5213
jmp 0x539f
movslq -0x8(%r13), %rbx
movl $0x1, %esi
movq %r13, %rdi
callq 0x4a44
testq %rax, %rax
je 0x539f
movb $0x22, (%rax,%rbx)
leaq 0x1(%rbx), %rcx
movl %ecx, -0x8(%rax)
decl -0x4(%rax)
movb $0x0, 0x1(%rax,%rbx)
jmp 0x53a1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq