// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %r9, 0x68(%rsp)
testb %al, %al
je 0x1e6eb
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %r8, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movzbl -0x1(%rdi), %ebp
movl %ebp, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x1e737
leaq 0x28815(%rip), %rcx     # 0x46f24
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %ebp
jmp 0x1e739
movq -0x11(%r14), %rbp
jmp 0x1e739
movzwl -0x5(%r14), %ebp
jmp 0x1e739
movl -0x9(%r14), %ebp
jmp 0x1e739
movzbl -0x3(%r14), %ebp
jmp 0x1e739
xorl %ebp, %ebp
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x130(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movb (%rbx), %al
testb %al, %al
je 0x1ed64
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movabsq $0x100000000, %r9       # imm = 0x100000000
leaq 0x287c5(%rip), %r15     # 0x46f48
leaq 0x287ae(%rip), %r13     # 0x46f38
movzbl -0x1(%r14), %ecx
andl $0x7, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x1e7d5
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movzbl -0x2(%r14), %ecx
movzbl -0x3(%r14), %edx
jmp 0x1e7cd
movl -0x5(%r14), %ecx
subl -0x9(%r14), %ecx
jmp 0x1e7d0
movq -0x9(%r14), %rcx
subq -0x11(%r14), %rcx
jmp 0x1e7d0
movzwl -0x3(%r14), %ecx
movzwl -0x5(%r14), %edx
subq %rdx, %rcx
testq %rcx, %rcx
jne 0x1e7fb
movl $0x1, %esi
movq %r14, %rdi
callq 0x1dabb
movabsq $0x100000000, %r9       # imm = 0x100000000
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movq %rax, %r14
movb (%rbx), %al
cmpb $0x25, %al
jne 0x1e844
movb 0x1(%rbx), %al
incq %rbx
movzbl %al, %ecx
cmpl $0x68, %ecx
jg 0x1e87a
cmpl $0x49, %ecx
je 0x1e8ad
cmpl $0x53, %ecx
je 0x1e88d
cmpl $0x55, %ecx
jne 0x1e8ed
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x1ea3e
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x1ea4c
movslq %ebp, %rcx
movb %al, (%r14,%rcx)
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
movl $0x1, %r12d
cmpl $0x4, %ecx
ja 0x1ed23
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
andb $-0x8, %al
addb $0x8, %al
movb %al, -0x1(%r14)
jmp 0x1ed23
cmpl $0x69, %ecx
je 0x1e8cd
cmpl $0x75, %ecx
je 0x1e9be
cmpl $0x73, %ecx
jne 0x1e8ed
movl (%rsp), %edx
cmpq $0x28, %rdx
ja 0x1e942
movq %rdx, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0x1e950
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x1e9de
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x1e9ec
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x1e9f1
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x1e9ff
movslq %ebp, %rcx
movb %al, (%r14,%rcx)
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
movl $0x1, %r12d
cmpl $0x4, %ecx
ja 0x1ed23
leaq 0x286c8(%rip), %rdx     # 0x46fdc
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
incb -0x3(%r14)
jmp 0x1ed23
incq -0x11(%r14)
jmp 0x1ed23
incw -0x5(%r14)
jmp 0x1ed23
incl -0x9(%r14)
jmp 0x1ed23
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx), %r13
cmpb $0x73, %al
jne 0x1e994
movq %r13, %rdi
callq 0x101c0
movq %rax, %r12
movzbl -0x1(%r14), %eax
andl $0x7, %eax
decl %eax
cmpl $0x3, %eax
ja 0x1ebe5
leaq 0x2863c(%rip), %rcx     # 0x46fb8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x2(%r14), %eax
movzbl -0x3(%r14), %ecx
jmp 0x1eb6c
movzbl -0x1(%r13), %r12d
movl %r12d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x1ed5c
leaq 0x285f5(%rip), %rcx     # 0x46fa4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r12d
jmp 0x1e962
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x1ea51
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x1ea5f
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
jmp 0x1ea02
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movslq (%rax), %rsi
leaq 0x20(%rsp), %rdi
callq 0x1e410
movzbl -0x1(%r14), %ecx
andl $0x7, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x1eb83
leaq 0x2855a(%rip), %rdx     # 0x46f80
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzbl -0x2(%r14), %ecx
movzbl -0x3(%r14), %edx
jmp 0x1eb29
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rcx
jmp 0x1ea61
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl (%rax), %ecx
xorl %r13d, %r13d
leaq 0x1f(%rsp), %rax
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rax, %rsi
addq %r9, %r13
movq %rcx, %rax
mulq %r8
shrq $0x3, %rdx
leal (%rdx,%rdx), %eax
leal (%rax,%rax,4), %eax
movl %ecx, %edi
subl %eax, %edi
orb $0x30, %dil
movb %dil, 0x20(%rsp,%r12)
incq %r12
addb $0x8, %r15b
leaq 0x1(%rsi), %rax
cmpq $0x9, %rcx
movq %rdx, %rcx
ja 0x1ea6f
movb $0x0, 0x20(%rsp,%r12)
leaq 0x1f(%rsp), %rax
addq %r12, %rax
leaq 0x20(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x1eadc
leaq 0x20(%rsp), %rax
movb (%rax), %cl
movb 0x1(%rsi), %dl
movb %dl, (%rax)
movb %cl, 0x1(%rsi)
incq %rax
leaq -0x1(%rsi), %rcx
cmpq %rsi, %rax
movq %rcx, %rsi
jb 0x1eac3
movzbl -0x1(%r14), %eax
andl $0x7, %eax
decl %eax
cmpl $0x3, %eax
ja 0x1ec84
leaq 0x28466(%rip), %rcx     # 0x46f5c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x2(%r14), %eax
movzbl -0x3(%r14), %ecx
jmp 0x1eb7b
movl -0x5(%r14), %ecx
subl -0x9(%r14), %ecx
jmp 0x1eb85
movq -0x9(%r14), %rcx
subq -0x11(%r14), %rcx
jmp 0x1eb85
movzwl -0x3(%r14), %ecx
movzwl -0x5(%r14), %edx
subq %rdx, %rcx
jmp 0x1eb85
movl -0x5(%r14), %eax
subl -0x9(%r14), %eax
jmp 0x1ebe7
movl -0x5(%r14), %eax
subl -0x9(%r14), %eax
jmp 0x1ec86
movq -0x9(%r14), %rax
subq -0x11(%r14), %rax
jmp 0x1ebe7
movq -0x9(%r14), %rax
subq -0x11(%r14), %rax
jmp 0x1ec86
movzwl -0x3(%r14), %eax
movzwl -0x5(%r14), %ecx
subq %rcx, %rax
jmp 0x1ebe7
movzwl -0x3(%r14), %eax
movzwl -0x5(%r14), %ecx
subq %rcx, %rax
jmp 0x1ec86
xorl %ecx, %ecx
movslq %eax, %r12
cmpq %r12, %rcx
jae 0x1eb9b
movq %r14, %rdi
movq %r12, %rsi
callq 0x1dabb
movq %rax, %r14
movslq %ebp, %rdi
addq %r14, %rdi
leaq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x10400
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movabsq $0x100000000, %r9       # imm = 0x100000000
ja 0x1ed23
leaq 0x283b4(%rip), %rdx     # 0x46f90
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %eax, %eax
cmpq %r12, %rax
jae 0x1ebfa
movq %r14, %rdi
movq %r12, %rsi
callq 0x1dabb
movq %rax, %r14
movslq %ebp, %rdi
addq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x10400
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movabsq $0x100000000, %r9       # imm = 0x100000000
leaq 0x28305(%rip), %r13     # 0x46f38
ja 0x1ed23
leaq 0x28388(%rip), %rdx     # 0x46fc8
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leal (,%r12,8), %ecx
addb %al, %cl
andb $-0x8, %cl
movb %cl, -0x1(%r14)
jmp 0x1ed23
addq %r12, -0x11(%r14)
jmp 0x1ed23
addw %r12w, -0x5(%r14)
jmp 0x1ed23
addl %r12d, -0x9(%r14)
jmp 0x1ed23
addb %r12b, -0x3(%r14)
jmp 0x1ed23
xorl %eax, %eax
sarq $0x20, %r13
cmpq %r13, %rax
jae 0x1ec9d
movq %r14, %rdi
movq %r13, %rsi
callq 0x1dabb
movq %rax, %r14
movslq %ebp, %rdi
addq %r14, %rdi
leaq 0x20(%rsp), %rsi
movq %r13, %rdx
callq 0x10400
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movabsq $0x100000000, %r9       # imm = 0x100000000
ja 0x1ed15
leaq 0x28292(%rip), %rdx     # 0x46f6c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
addb %r15b, %al
andb $-0x8, %al
movb %al, -0x1(%r14)
jmp 0x1ed15
addq %r13, -0x11(%r14)
jmp 0x1ed15
movzwl -0x5(%r14), %eax
addl %r12d, %eax
movw %ax, -0x5(%r14)
jmp 0x1ed15
addl %r12d, -0x9(%r14)
jmp 0x1ed15
movzbl -0x3(%r14), %eax
addl %r12d, %eax
movb %al, -0x3(%r14)
leaq 0x2822c(%rip), %r15     # 0x46f48
leaq 0x28215(%rip), %r13     # 0x46f38
addl %r12d, %ebp
movb 0x1(%rbx), %al
incq %rbx
testb %al, %al
jne 0x1e78a
jmp 0x1ed64
movq -0x11(%r13), %r12
jmp 0x1e962
movzwl -0x5(%r13), %r12d
jmp 0x1e962
movl -0x9(%r13), %r12d
jmp 0x1e962
movzbl -0x3(%r13), %r12d
jmp 0x1e962
xorl %r12d, %r12d
jmp 0x1e962
movslq %ebp, %rax
movb $0x0, (%r14,%rax)
movq %r14, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq