// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/hyperloglog.c
// Function: hllSparseAdd
int hllSparseAdd(robj *o, unsigned char *ele, size_t elesize) {
    struct hllhdr *hdr;
    uint8_t oldcount, count, *sparse, *end, *p, *prev, *next;
    long index, first, span;
    long is_zero = 0, is_xzero = 0, is_val = 0, runlen = 0;

    /* Update the register if this element produced a longer run of zeroes. */
    count = hllPatLen(ele,elesize,&index);

    /* If the count is too big to be representable by the sparse representation
     * switch to dense representation. */
    if (count > HLL_SPARSE_VAL_MAX_VALUE) goto promote;

    /* When updating a sparse representation, sometimes we may need to
     * enlarge the buffer for up to 3 bytes in the worst case (XZERO split
     * into XZERO-VAL-XZERO). Make sure there is enough space right now
     * so that the pointers we take during the execution of the function
     * will be valid all the time. */
    o->ptr = sdsMakeRoomFor(o->ptr,3);

    /* Step 1: we need to locate the opcode we need to modify to check
     * if a value update is actually needed. */
    sparse = p = ((uint8_t*)o->ptr) + HLL_HDR_SIZE;
    end = p + sdslen(o->ptr) - HLL_HDR_SIZE;

    first = 0;
    prev = NULL; /* Points to previos opcode at the end of the loop. */
    next = NULL; /* Points to the next opcode at the end of the loop. */
    span = 0;
    while(p < end) {
        long oplen;

        /* Set span to the number of registers covered by this opcode.
         *
         * This is the most performance critical loop of the sparse
         * representation. Sorting the conditionals from the most to the
         * least frequent opcode in many-bytes sparse HLLs is faster. */
        oplen = 1;
        if (HLL_SPARSE_IS_ZERO(p)) {
            span = HLL_SPARSE_ZERO_LEN(p);
        } else if (HLL_SPARSE_IS_VAL(p)) {
            span = HLL_SPARSE_VAL_LEN(p);
        } else { /* XZERO. */
            span = HLL_SPARSE_XZERO_LEN(p);
            oplen = 2;
        }
        /* Break if this opcode covers the register as 'index'. */
        if (index <= first+span-1) break;
        prev = p;
        p += oplen;
        first += span;
    }
    if (span == 0) return -1; /* Invalid format. */

    next = HLL_SPARSE_IS_XZERO(p) ? p+2 : p+1;
    if (next >= end) next = NULL;

    /* Cache current opcode type to avoid using the macro again and
     * again for something that will not change.
     * Also cache the run-length of the opcode. */
    if (HLL_SPARSE_IS_ZERO(p)) {
        is_zero = 1;
        runlen = HLL_SPARSE_ZERO_LEN(p);
    } else if (HLL_SPARSE_IS_XZERO(p)) {
        is_xzero = 1;
        runlen = HLL_SPARSE_XZERO_LEN(p);
    } else {
        is_val = 1;
        runlen = HLL_SPARSE_VAL_LEN(p);
    }

    /* Step 2: After the loop:
     *
     * 'first' stores to the index of the first register covered
     *  by the current opcode, which is pointed by 'p'.
     *
     * 'next' ad 'prev' store respectively the next and previous opcode,
     *  or NULL if the opcode at 'p' is respectively the last or first.
     *
     * 'span' is set to the number of registers covered by the current
     *  opcode.
     *
     * There are different cases in order to update the data structure
     * in place without generating it from scratch:
     *
     * A) If it is a VAL opcode already set to a value >= our 'count'
     *    no update is needed, regardless of the VAL run-length field.
     *    In this case PFADD returns 0 since no changes are performed.
     *
     * B) If it is a VAL opcode with len = 1 (representing only our
     *    register) and the value is less than 'count', we just update it
     *    since this is a trivial case. */
    if (is_val) {
        oldcount = HLL_SPARSE_VAL_VALUE(p);
        /* Case A. */
        if (oldcount >= count) return 0;

        /* Case B. */
        if (runlen == 1) {
            HLL_SPARSE_VAL_SET(p,count,1);
            goto updated;
        }
    }

    /* C) Another trivial to handle case is a ZERO opcode with a len of 1.
     * We can just replace it with a VAL opcode with our value and len of 1. */
    if (is_zero && runlen == 1) {
        HLL_SPARSE_VAL_SET(p,count,1);
        goto updated;
    }

    /* D) General case.
     *
     * The other cases are more complex: our register requires to be updated
     * and is either currently represented by a VAL opcode with len > 1,
     * by a ZERO opcode with len > 1, or by an XZERO opcode.
     *
     * In those cases the original opcode must be split into muliple
     * opcodes. The worst case is an XZERO split in the middle resuling into
     * XZERO - VAL - XZERO, so the resulting sequence max length is
     * 5 bytes.
     *
     * We perform the split writing the new sequence into the 'new' buffer
     * with 'newlen' as length. Later the new sequence is inserted in place
     * of the old one, possibly moving what is on the right a few bytes
     * if the new sequence is longer than the older one. */
    uint8_t seq[5], *n = seq;
    int last = first+span-1; /* Last register covered by the sequence. */
    int len;

    if (is_zero || is_xzero) {
        /* Handle splitting of ZERO / XZERO. */
        if (index != first) {
            len = index-first;
            if (len > HLL_SPARSE_ZERO_MAX_LEN) {
                HLL_SPARSE_XZERO_SET(n,len);
                n += 2;
            } else {
                HLL_SPARSE_ZERO_SET(n,len);
                n++;
            }
        }
        HLL_SPARSE_VAL_SET(n,count,1);
        n++;
        if (index != last) {
            len = last-index;
            if (len > HLL_SPARSE_ZERO_MAX_LEN) {
                HLL_SPARSE_XZERO_SET(n,len);
                n += 2;
            } else {
                HLL_SPARSE_ZERO_SET(n,len);
                n++;
            }
        }
    } else {
        /* Handle splitting of VAL. */
        int curval = HLL_SPARSE_VAL_VALUE(p);

        if (index != first) {
            len = index-first;
            HLL_SPARSE_VAL_SET(n,curval,len);
            n++;
        }
        HLL_SPARSE_VAL_SET(n,count,1);
        n++;
        if (index != last) {
            len = last-index;
            HLL_SPARSE_VAL_SET(n,curval,len);
            n++;
        }
    }

    /* Step 3: substitute the new sequence with the old one.
     *
     * Note that we already allocated space on the sds string
     * calling sdsMakeRoomFor(). */
     int seqlen = n-seq;
     int oldlen = is_xzero ? 2 : 1;
     int deltalen = seqlen-oldlen;

     if (deltalen > 0 &&
         sdslen(o->ptr)+deltalen > server.hll_sparse_max_bytes) goto promote;
     if (deltalen && next) memmove(next+deltalen,next,end-next);
     sdsIncrLen(o->ptr,deltalen);
     memcpy(p,seq,seqlen);
     end += deltalen;

updated:
    /* Step 4: Merge adjacent values if possible.
     *
     * The representation was updated, however the resulting representation
     * may not be optimal: adjacent VAL opcodes can sometimes be merged into
     * a single one. */
    p = prev ? prev : sparse;
    int scanlen = 5; /* Scan up to 5 upcodes starting from prev. */
    while (p < end && scanlen--) {
        if (HLL_SPARSE_IS_XZERO(p)) {
            p += 2;
            continue;
        } else if (HLL_SPARSE_IS_ZERO(p)) {
            p++;
            continue;
        }
        /* We need two adjacent VAL opcodes to try a merge, having
         * the same value, and a len that fits the VAL opcode max len. */
        if (p+1 < end && HLL_SPARSE_IS_VAL(p+1)) {
            int v1 = HLL_SPARSE_VAL_VALUE(p);
            int v2 = HLL_SPARSE_VAL_VALUE(p+1);
            if (v1 == v2) {
                int len = HLL_SPARSE_VAL_LEN(p)+HLL_SPARSE_VAL_LEN(p+1);
                if (len <= HLL_SPARSE_VAL_MAX_LEN) {
                    HLL_SPARSE_VAL_SET(p+1,v1,len);
                    memmove(p,p+1,end-p);
                    sdsIncrLen(o->ptr,-1);
                    end--;
                    /* After a merge we reiterate without incrementing 'p'
                     * in order to try to merge the just merged value with
                     * a value on its right. */
                    continue;
                }
            }
        }
        p++;
    }

    /* Invalidate the cached cardinality. */
    hdr = o->ptr;
    HLL_INVALIDATE_CACHE(hdr);
    return 1;

promote: /* Promote to dense representation. */
    if (hllSparseToDense(o) == C_ERR) return -1; /* Corrupted HLL. */
    hdr = o->ptr;

    /* We need to call hllDenseAdd() to perform the operation after the
     * conversion. However the result must be 1, since if we need to
     * convert from sparse to dense a register requires to be updated.
     *
     * Note that this in turn means that PFADD will make sure the command
     * is propagated to slaves / AOF, so if there is a sparse -> dense
     * convertion, it will be performed in all the slaves as well. */
    int dense_retval = hllDenseAdd(hdr->registers, ele, elesize);
    serverAssert(dense_retval == 1);
    return dense_retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x9dd30
movb %al, -0x2a(%rbp)
movzbl -0x2a(%rbp), %eax
cmpl $0x20, %eax
jle 0x9e74f
jmp 0x9ef9d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x3, %esi
callq 0x38770
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x9e660
movq %rax, %rcx
movq -0xe8(%rbp), %rax
addq %rcx, %rax
addq $-0x10, %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x9e89e
movq $0x1, -0x98(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x0, %eax
jne 0x9e80c
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3f, %eax
addl $0x1, %eax
cltq
movq %rax, -0x70(%rbp)
jmp 0x9e85f
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x9e832
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3, %eax
addl $0x1, %eax
cltq
movq %rax, -0x70(%rbp)
jmp 0x9e85d
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3f, %eax
shll $0x8, %eax
movq -0x48(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
orl %ecx, %eax
addl $0x1, %eax
cltq
movq %rax, -0x70(%rbp)
movq $0x2, -0x98(%rbp)
jmp 0x9e85f
movq -0x60(%rbp), %rax
movq -0x68(%rbp), %rcx
addq -0x70(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jg 0x9e876
jmp 0x9e89e
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x98(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x70(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x9e7cd
cmpq $0x0, -0x70(%rbp)
jne 0x9e8b1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9f011
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x40, %eax
jne 0x9e8d3
movq -0x48(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xf0(%rbp)
jmp 0x9e8e2
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jb 0x9e8ff
movq $0x0, -0x58(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x0, %eax
jne 0x9e930
movq $0x1, -0x78(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3f, %eax
addl $0x1, %eax
cltq
movq %rax, -0x90(%rbp)
jmp 0x9e991
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x40, %eax
jne 0x9e96e
movq $0x1, -0x80(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3f, %eax
shll $0x8, %eax
movq -0x48(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
orl %ecx, %eax
addl $0x1, %eax
cltq
movq %rax, -0x90(%rbp)
jmp 0x9e98f
movq $0x1, -0x88(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3, %eax
addl $0x1, %eax
cltq
movq %rax, -0x90(%rbp)
jmp 0x9e991
cmpq $0x0, -0x88(%rbp)
je 0x9e9f3
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
sarl $0x2, %eax
andl $0x1f, %eax
addl $0x1, %eax
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
movzbl -0x2a(%rbp), %ecx
cmpl %ecx, %eax
jl 0x9e9c6
movl $0x0, -0x4(%rbp)
jmp 0x9f011
cmpq $0x1, -0x90(%rbp)
jne 0x9e9f1
jmp 0x9e9d2
movzbl -0x2a(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
orl $0x0, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, (%rax)
jmp 0x9edb7
jmp 0x9e9f3
cmpq $0x0, -0x78(%rbp)
je 0x9ea25
cmpq $0x1, -0x90(%rbp)
jne 0x9ea25
jmp 0x9ea06
movzbl -0x2a(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
orl $0x0, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, (%rax)
jmp 0x9edb7
leaq -0x9d(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x68(%rbp), %rax
addq -0x70(%rbp), %rax
subq $0x1, %rax
movl %eax, -0xac(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x9ea57
cmpq $0x0, -0x80(%rbp)
je 0x9ebda
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0x9eaf9
movq -0x60(%rbp), %rax
subq -0x68(%rbp), %rax
movl %eax, -0xb0(%rbp)
cmpl $0x40, -0xb0(%rbp)
jle 0x9eacf
jmp 0x9ea7e
movl -0xb0(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
sarl $0x8, %eax
orl $0x40, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movl -0xb4(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xa8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xa8(%rbp)
jmp 0x9eaf7
jmp 0x9ead1
movl -0xb0(%rbp), %eax
subl $0x1, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x9eaf9
jmp 0x9eafb
movzbl -0x2a(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
orl $0x0, %eax
orl $0x80, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
movq -0x60(%rbp), %rax
movslq -0xac(%rbp), %rcx
cmpq %rcx, %rax
je 0x9ebd5
movslq -0xac(%rbp), %rax
subq -0x60(%rbp), %rax
movl %eax, -0xb0(%rbp)
cmpl $0x40, -0xb0(%rbp)
jle 0x9ebab
jmp 0x9eb5a
movl -0xb0(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
sarl $0x8, %eax
orl $0x40, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movl -0xb8(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xa8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0xa8(%rbp)
jmp 0x9ebd3
jmp 0x9ebad
movl -0xb0(%rbp), %eax
subl $0x1, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x9ebd5
jmp 0x9ecce
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
sarl $0x2, %eax
andl $0x1f, %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0x9ec41
movq -0x60(%rbp), %rax
subq -0x68(%rbp), %rax
movl %eax, -0xb0(%rbp)
movl -0xbc(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
movl -0xb0(%rbp), %ecx
subl $0x1, %ecx
orl %ecx, %eax
orl $0x80, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x9ec43
movzbl -0x2a(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
orl $0x0, %eax
orl $0x80, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
movq -0x60(%rbp), %rax
movslq -0xac(%rbp), %rcx
cmpq %rcx, %rax
je 0x9eccc
movslq -0xac(%rbp), %rax
subq -0x60(%rbp), %rax
movl %eax, -0xb0(%rbp)
movl -0xbc(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
movl -0xb0(%rbp), %ecx
subl $0x1, %ecx
orl %ecx, %eax
orl $0x80, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x9ecce
movq -0xa8(%rbp), %rax
leaq -0x9d(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0xc0(%rbp)
movq -0x80(%rbp), %rdx
movl $0x1, %eax
movl $0x2, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, -0xc4(%rbp)
movl -0xc0(%rbp), %eax
subl -0xc4(%rbp), %eax
movl %eax, -0xc8(%rbp)
cmpl $0x0, -0xc8(%rbp)
jle 0x9ed47
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x9e660
movslq -0xc8(%rbp), %rcx
addq %rcx, %rax
leaq 0xd949f(%rip), %rcx     # 0x1781d8
cmpq 0x968(%rcx), %rax
jbe 0x9ed47
jmp 0x9ef9d
cmpl $0x0, -0xc8(%rbp)
je 0x9ed79
cmpq $0x0, -0x58(%rbp)
je 0x9ed79
movq -0x58(%rbp), %rdi
movslq -0xc8(%rbp), %rax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x58(%rbp), %rax
subq %rax, %rdx
callq 0x267e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc8(%rbp), %esi
callq 0x38ce0
movq -0x48(%rbp), %rdi
leaq -0x9d(%rbp), %rsi
movslq -0xc0(%rbp), %rdx
callq 0x26c60
movl -0xc8(%rbp), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x9edcb
movq -0x50(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x9edd6
movq -0x38(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x5, -0xcc(%rbp)
movq -0x48(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0xf9(%rbp)
jae 0x9ee1a
movl -0xcc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xcc(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x9ee29
jmp 0x9ef77
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x40, %eax
jne 0x9ee48
movq -0x48(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x48(%rbp)
jmp 0x9edeb
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x0, %eax
jne 0x9ee67
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x9edeb
jmp 0x9ee69
movq -0x48(%rbp), %rax
addq $0x1, %rax
cmpq -0x40(%rbp), %rax
jae 0x9ef66
movq -0x48(%rbp), %rax
movzbl 0x1(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x9ef66
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
sarl $0x2, %eax
andl $0x1f, %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
movq -0x48(%rbp), %rax
movzbl 0x1(%rax), %eax
sarl $0x2, %eax
andl $0x1f, %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jne 0x9ef64
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
andl $0x3, %eax
addl $0x1, %eax
movq -0x48(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
andl $0x3, %ecx
addl $0x1, %ecx
addl %ecx, %eax
movl %eax, -0xd8(%rbp)
cmpl $0x4, -0xd8(%rbp)
jg 0x9ef62
jmp 0x9eefe
movl -0xd0(%rbp), %eax
subl $0x1, %eax
shll $0x2, %eax
movl -0xd8(%rbp), %ecx
subl $0x1, %ecx
orl %ecx, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x48(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x1, %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rax
subq %rax, %rdx
callq 0x267e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x38ce0
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x9edeb
jmp 0x9ef64
jmp 0x9ef66
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x9edeb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzbl 0xf(%rax), %ecx
orl $0x80, %ecx
movb %cl, 0xf(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x9f011
movq -0x10(%rbp), %rdi
callq 0x9e3b0
cmpl $-0x1, %eax
jne 0x9efb4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9f011
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x9ddd0
movl %eax, -0xdc(%rbp)
cmpl $0x1, -0xdc(%rbp)
jne 0x9efe6
jmp 0x9f008
leaq 0xa87c3(%rip), %rdi     # 0x1477b0
leaq 0xa87ce(%rip), %rsi     # 0x1477c2
movl $0x370, %edx            # imm = 0x370
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movl -0xdc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)