// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb -0x1(%rax), %al
movb %al, -0xd(%rbp)
movzbl -0xd(%rbp), %eax
andl $0x7, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x4, %eax
ja 0x1f7e2
movq -0x50(%rbp), %rax
leaq 0x6e69e(%rip), %rcx     # 0x8dc18
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movzbl -0xd(%rbp), %eax
sarl $0x3, %eax
movb %al, -0x21(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x1f5ab
movzbl -0x21(%rbp), %eax
addl -0xc(%rbp), %eax
cmpl $0x20, %eax
jl 0x1f5be
cmpl $0x0, -0xc(%rbp)
jge 0x1f5c0
movzbl -0x21(%rbp), %eax
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jb 0x1f5c0
jmp 0x1f5df
leaq 0x6e7a5(%rip), %rdi     # 0x8dd6c
leaq 0x6e7ee(%rip), %rsi     # 0x8ddbc
movl $0x13f, %edx            # imm = 0x13F
leaq 0x6e7e8(%rip), %rcx     # 0x8ddc2
callq 0x10230
movzbl -0x21(%rbp), %eax
addl -0xc(%rbp), %eax
shll $0x3, %eax
orl $0x0, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movzbl -0x21(%rbp), %eax
addl -0xc(%rbp), %eax
cltq
movq %rax, -0x18(%rbp)
jmp 0x1f7ea
movq -0x8(%rbp), %rax
addq $-0x3, %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x1f62e
movq -0x30(%rbp), %rax
movzbl 0x1(%rax), %eax
movq -0x30(%rbp), %rcx
movzbl (%rcx), %ecx
subl %ecx, %eax
cmpl -0xc(%rbp), %eax
jge 0x1f644
cmpl $0x0, -0xc(%rbp)
jge 0x1f646
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jb 0x1f646
jmp 0x1f665
leaq 0x6e78f(%rip), %rdi     # 0x8dddc
leaq 0x6e768(%rip), %rsi     # 0x8ddbc
movl $0x146, %edx            # imm = 0x146
leaq 0x6e762(%rip), %rcx     # 0x8ddc2
callq 0x10230
movl -0xc(%rbp), %edx
movq -0x30(%rbp), %rcx
movzbl (%rcx), %eax
addl %edx, %eax
movb %al, (%rcx)
movzbl %al, %eax
movq %rax, -0x18(%rbp)
jmp 0x1f7ea
movq -0x8(%rbp), %rax
addq $-0x5, %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x1f6a7
movq -0x38(%rbp), %rax
movzwl 0x2(%rax), %eax
movq -0x38(%rbp), %rcx
movzwl (%rcx), %ecx
subl %ecx, %eax
cmpl -0xc(%rbp), %eax
jge 0x1f6bd
cmpl $0x0, -0xc(%rbp)
jge 0x1f6bf
movq -0x38(%rbp), %rax
movzwl (%rax), %eax
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jb 0x1f6bf
jmp 0x1f6de
leaq 0x6e716(%rip), %rdi     # 0x8dddc
leaq 0x6e6ef(%rip), %rsi     # 0x8ddbc
movl $0x14c, %edx            # imm = 0x14C
leaq 0x6e6e9(%rip), %rcx     # 0x8ddc2
callq 0x10230
movl -0xc(%rbp), %edx
movq -0x38(%rbp), %rcx
movzwl (%rcx), %eax
addl %edx, %eax
movw %ax, (%rcx)
movzwl %ax, %eax
movq %rax, -0x18(%rbp)
jmp 0x1f7ea
movq -0x8(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x1f71d
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x40(%rbp), %rcx
subl (%rcx), %eax
cmpl -0xc(%rbp), %eax
jae 0x1f732
cmpl $0x0, -0xc(%rbp)
jge 0x1f734
movq -0x40(%rbp), %rax
movl (%rax), %eax
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
jb 0x1f734
jmp 0x1f753
leaq 0x6e6fc(%rip), %rdi     # 0x8de37
leaq 0x6e67a(%rip), %rsi     # 0x8ddbc
movl $0x152, %edx            # imm = 0x152
leaq 0x6e674(%rip), %rcx     # 0x8ddc2
callq 0x10230
movl -0xc(%rbp), %eax
movq -0x40(%rbp), %rcx
addl (%rcx), %eax
movl %eax, (%rcx)
movl %eax, %eax
movq %rax, -0x18(%rbp)
jmp 0x1f7ea
movq -0x8(%rbp), %rax
addq $-0x11, %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x1f793
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
subq (%rcx), %rax
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
jae 0x1f7ad
cmpl $0x0, -0xc(%rbp)
jge 0x1f7af
movq -0x48(%rbp), %rax
movq (%rax), %rax
xorl %ecx, %ecx
subl -0xc(%rbp), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jb 0x1f7af
jmp 0x1f7ce
leaq 0x6e6ea(%rip), %rdi     # 0x8dea0
leaq 0x6e5ff(%rip), %rsi     # 0x8ddbc
movl $0x158, %edx            # imm = 0x158
leaq 0x6e5f9(%rip), %rcx     # 0x8ddc2
callq 0x10230
movslq -0xc(%rbp), %rax
movq -0x48(%rbp), %rcx
addq (%rcx), %rax
movq %rax, (%rcx)
movq %rax, -0x18(%rbp)
jmp 0x1f7ea
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)