// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/hiredis/sds.c
// Function: sdscatfmt
sds sdscatfmt(sds s, char const *fmt, ...) {
    size_t initlen = sdslen(s);
    const char *f = fmt;
    int i;
    va_list ap;

    va_start(ap,fmt);
    f = fmt;    /* Next format specifier byte to process. */
    i = initlen; /* Position of the next byte to write to dest str. */
    while(*f) {
        char next, *str;
        size_t l;
        long long num;
        unsigned long long unum;

        /* Make sure there is always space for at least 1 char. */
        if (sdsavail(s)==0) {
            s = sdsMakeRoomFor(s,1);
        }

        switch(*f) {
        case '%':
            next = *(f+1);
            f++;
            switch(next) {
            case 's':
            case 'S':
                str = va_arg(ap,char*);
                l = (next == 's') ? strlen(str) : sdslen(str);
                if (sdsavail(s) < l) {
                    s = sdsMakeRoomFor(s,l);
                }
                memcpy(s+i,str,l);
                sdsinclen(s,l);
                i += l;
                break;
            case 'i':
            case 'I':
                if (next == 'i')
                    num = va_arg(ap,int);
                else
                    num = va_arg(ap,long long);
                {
                    char buf[SDS_LLSTR_SIZE];
                    l = sdsll2str(buf,num);
                    if (sdsavail(s) < l) {
                        s = sdsMakeRoomFor(s,l);
                    }
                    memcpy(s+i,buf,l);
                    sdsinclen(s,l);
                    i += l;
                }
                break;
            case 'u':
            case 'U':
                if (next == 'u')
                    unum = va_arg(ap,unsigned int);
                else
                    unum = va_arg(ap,unsigned long long);
                {
                    char buf[SDS_LLSTR_SIZE];
                    l = sdsull2str(buf,unum);
                    if (sdsavail(s) < l) {
                        s = sdsMakeRoomFor(s,l);
                    }
                    memcpy(s+i,buf,l);
                    sdsinclen(s,l);
                    i += l;
                }
                break;
            default: /* Handle %% and generally %<unknown>. */
                s[i++] = next;
                sdsinclen(s,1);
                break;
            }
            break;
        default:
            s[i++] = *f;
            sdsinclen(s,1);
            break;
        }
        f++;
    }
    va_end(ap);

    /* Add null-term */
    s[i] = '\0';
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
testb %al, %al
je 0x1ff07
movaps %xmm0, -0x120(%rbp)
movaps %xmm1, -0x110(%rbp)
movaps %xmm2, -0x100(%rbp)
movaps %xmm3, -0xf0(%rbp)
movaps %xmm4, -0xe0(%rbp)
movaps %xmm5, -0xd0(%rbp)
movaps %xmm6, -0xc0(%rbp)
movaps %xmm7, -0xb0(%rbp)
movq %r9, -0x128(%rbp)
movq %r8, -0x130(%rbp)
movq %rcx, -0x138(%rbp)
movq %rdx, -0x140(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1edf0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x40(%rbp), %rax
leaq -0x150(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x20407
movq -0x8(%rbp), %rdi
callq 0x1f180
cmpq $0x0, %rax
jne 0x1ffa1
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x1efd0
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movb (%rax), %al
subb $0x25, %al
jne 0x203cd
jmp 0x1ffb1
movq -0x20(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x41(%rbp)
movq -0x20(%rbp), %rax
incq %rax
movq %rax, -0x20(%rbp)
movsbl -0x41(%rbp), %eax
movl %eax, -0x154(%rbp)
subl $0x49, %eax
je 0x2011f
jmp 0x1ffdb
movl -0x154(%rbp), %eax
subl $0x53, %eax
je 0x2002b
jmp 0x1ffe8
movl -0x154(%rbp), %eax
subl $0x55, %eax
je 0x20261
jmp 0x1fff9
movl -0x154(%rbp), %eax
subl $0x69, %eax
je 0x2011f
jmp 0x2000a
movl -0x154(%rbp), %eax
subl $0x73, %eax
je 0x2002b
jmp 0x20017
movl -0x154(%rbp), %eax
subl $0x75, %eax
je 0x20261
jmp 0x203a5
leaq -0x40(%rbp), %rax
movq %rax, -0x160(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x158(%rbp)
cmpl $0x28, %eax
ja 0x20066
movq -0x160(%rbp), %rcx
movl -0x158(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x168(%rbp)
jmp 0x20083
movq -0x160(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movsbl -0x41(%rbp), %eax
cmpl $0x73, %eax
jne 0x200ac
movq -0x50(%rbp), %rdi
callq 0x101a0
movq %rax, -0x170(%rbp)
jmp 0x200bc
movq -0x50(%rbp), %rdi
callq 0x1edf0
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f180
cmpq -0x58(%rbp), %rax
jae 0x200e7
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1efd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x24(%rbp), %rax
addq %rax, %rdi
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x103b0
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x20420
movq -0x58(%rbp), %rcx
movslq -0x24(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x24(%rbp)
jmp 0x203cb
movsbl -0x41(%rbp), %eax
cmpl $0x69, %eax
jne 0x20190
leaq -0x40(%rbp), %rax
movq %rax, -0x180(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x174(%rbp)
cmpl $0x28, %eax
ja 0x20163
movq -0x180(%rbp), %rcx
movl -0x174(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x188(%rbp)
jmp 0x20180
movq -0x180(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x201f6
leaq -0x40(%rbp), %rax
movq %rax, -0x198(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x18c(%rbp)
cmpl $0x28, %eax
ja 0x201cb
movq -0x198(%rbp), %rcx
movl -0x18c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1a0(%rbp)
jmp 0x201e8
movq -0x198(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
leaq -0x80(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x1fa90
cltq
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f180
cmpq -0x58(%rbp), %rax
jae 0x20229
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1efd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x24(%rbp), %rax
addq %rax, %rdi
leaq -0x80(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x103b0
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x20420
movq -0x58(%rbp), %rcx
movslq -0x24(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x24(%rbp)
jmp 0x203cb
movsbl -0x41(%rbp), %eax
cmpl $0x75, %eax
jne 0x202d1
leaq -0x40(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x1a4(%rbp)
cmpl $0x28, %eax
ja 0x202a5
movq -0x1b0(%rbp), %rcx
movl -0x1a4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1b8(%rbp)
jmp 0x202c2
movq -0x1b0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x68(%rbp)
jmp 0x20337
leaq -0x40(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x1bc(%rbp)
cmpl $0x28, %eax
ja 0x2030c
movq -0x1c8(%rbp), %rcx
movl -0x1bc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x1d0(%rbp)
jmp 0x20329
movq -0x1c8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
leaq -0xa0(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x1fb90
cltq
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1f180
cmpq -0x58(%rbp), %rax
jae 0x2036d
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x1efd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x24(%rbp), %rax
addq %rax, %rdi
leaq -0xa0(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x103b0
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x20420
movq -0x58(%rbp), %rcx
movslq -0x24(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x24(%rbp)
jmp 0x203cb
movb -0x41(%rbp), %dl
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x20420
jmp 0x203f6
movq -0x20(%rbp), %rax
movb (%rax), %dl
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x20420
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1ff73
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq