// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/hiredis/sds.c
// Function: sdsIncrLen
void sdsIncrLen(sds s, int incr) {
    unsigned char flags = s[-1];
    size_t len;
    switch(flags&SDS_TYPE_MASK) {
        case SDS_TYPE_5: {
            unsigned char *fp = ((unsigned char*)s)-1;
            unsigned char oldlen = SDS_TYPE_5_LEN(flags);
            assert((incr > 0 && oldlen+incr < 32) || (incr < 0 && oldlen >= (unsigned int)(-incr)));
            *fp = SDS_TYPE_5 | ((oldlen+incr) << SDS_TYPE_BITS);
            len = oldlen+incr;
            break;
        }
        case SDS_TYPE_8: {
            SDS_HDR_VAR(8,s);
            assert((incr >= 0 && sh->alloc-sh->len >= incr) || (incr < 0 && sh->len >= (unsigned int)(-incr)));
            len = (sh->len += incr);
            break;
        }
        case SDS_TYPE_16: {
            SDS_HDR_VAR(16,s);
            assert((incr >= 0 && sh->alloc-sh->len >= incr) || (incr < 0 && sh->len >= (unsigned int)(-incr)));
            len = (sh->len += incr);
            break;
        }
        case SDS_TYPE_32: {
            SDS_HDR_VAR(32,s);
            assert((incr >= 0 && sh->alloc-sh->len >= (unsigned int)incr) || (incr < 0 && sh->len >= (unsigned int)(-incr)));
            len = (sh->len += incr);
            break;
        }
        case SDS_TYPE_64: {
            SDS_HDR_VAR(64,s);
            assert((incr >= 0 && sh->alloc-sh->len >= (uint64_t)incr) || (incr < 0 && sh->len >= (uint64_t)(-incr)));
            len = (sh->len += incr);
            break;
        }
        default: len = 0; /* Just to avoid compilation warnings. */
    }
    s[len] = '\0';
}

// Assembly:
pushq %rax
movzbl -0x1(%rdi), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x1dfdc
leaq 0x28f59(%rip), %rdx     # 0x46e70
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
testl %esi, %esi
jle 0x1e070
addl %esi, %eax
cmpl $0x20, %eax
jb 0x1e07f
jmp 0x1e0c0
testl %esi, %esi
js 0x1dfe3
movq -0x11(%rdi), %rcx
movq -0x9(%rdi), %rax
subq %rcx, %rax
movl %esi, %edx
cmpq %rdx, %rax
jb 0x1dff4
movslq %esi, %rax
addq %rcx, %rax
movq %rax, -0x11(%rdi)
jmp 0x1e08b
testl %esi, %esi
js 0x1e013
movzwl -0x3(%rdi), %ecx
movzwl -0x5(%rdi), %eax
subl %eax, %ecx
cmpl %esi, %ecx
jl 0x1e023
addl %esi, %eax
movw %ax, -0x5(%rdi)
movzwl %ax, %eax
jmp 0x1e08b
testl %esi, %esi
js 0x1e042
movl -0x9(%rdi), %eax
movl -0x5(%rdi), %ecx
subl %eax, %ecx
cmpl %esi, %ecx
jb 0x1e051
addl %esi, %eax
movl %eax, -0x9(%rdi)
jmp 0x1e08b
testl %esi, %esi
js 0x1e091
movzbl -0x2(%rdi), %ecx
movzbl -0x3(%rdi), %eax
subl %eax, %ecx
cmpl %esi, %ecx
jl 0x1e0a1
addb %al, %sil
movb %sil, -0x3(%rdi)
movzbl %sil, %eax
jmp 0x1e08b
xorl %eax, %eax
jmp 0x1e08b
movq -0x11(%rdi), %rcx
movl %esi, %eax
negl %eax
cmpq %rax, %rcx
jae 0x1df59
leaq 0x292b9(%rip), %rdi     # 0x472b4
leaq 0x291ce(%rip), %rsi     # 0x471d0
leaq 0x291cd(%rip), %rcx     # 0x471d6
movl $0x158, %edx            # imm = 0x158
callq 0x10250
movzwl -0x5(%rdi), %eax
movl %esi, %ecx
negl %ecx
cmpl %ecx, %eax
jae 0x1df82
leaq 0x291c6(%rip), %rdi     # 0x471f0
leaq 0x2919f(%rip), %rsi     # 0x471d0
leaq 0x2919e(%rip), %rcx     # 0x471d6
movl $0x14c, %edx            # imm = 0x14C
callq 0x10250
movl -0x9(%rdi), %eax
movl %esi, %ecx
negl %ecx
cmpl %ecx, %eax
jae 0x1dfa8
leaq 0x291f3(%rip), %rdi     # 0x4724b
leaq 0x29171(%rip), %rsi     # 0x471d0
leaq 0x29170(%rip), %rcx     # 0x471d6
movl $0x152, %edx            # imm = 0x152
callq 0x10250
jns 0x1e0c0
movzbl %al, %eax
movl %esi, %ecx
negl %ecx
cmpl %ecx, %eax
jb 0x1e0c0
addl %esi, %eax
leal (,%rax,8), %ecx
movb %cl, -0x1(%rdi)
cltq
movb $0x0, (%rdi,%rax)
popq %rax
retq
movzbl -0x3(%rdi), %eax
movl %esi, %ecx
negl %ecx
cmpl %ecx, %eax
jae 0x1dfcc
leaq 0x29148(%rip), %rdi     # 0x471f0
leaq 0x29121(%rip), %rsi     # 0x471d0
leaq 0x29120(%rip), %rcx     # 0x471d6
movl $0x146, %edx            # imm = 0x146
callq 0x10250
leaq 0x290b9(%rip), %rdi     # 0x47180
leaq 0x29102(%rip), %rsi     # 0x471d0
leaq 0x29101(%rip), %rcx     # 0x471d6
movl $0x13f, %edx            # imm = 0x13F
callq 0x10250