// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/geo.c
// Function: geoGetPointsInRange
int geoGetPointsInRange(robj *zobj, double min, double max, double lon, double lat, double radius, geoArray *ga) {
    /* minex 0 = include min in range; maxex 1 = exclude max in range */
    /* That's: min <= val < max */
    zrangespec range = { .min = min, .max = max, .minex = 0, .maxex = 1 };
    size_t origincount = ga->used;
    sds member;

    if (zobj->encoding == OBJ_ENCODING_ZIPLIST) {
        unsigned char *zl = zobj->ptr;
        unsigned char *eptr, *sptr;
        unsigned char *vstr = NULL;
        unsigned int vlen = 0;
        long long vlong = 0;
        double score = 0;

        if ((eptr = zzlFirstInRange(zl, &range)) == NULL) {
            /* Nothing exists starting at our min.  No results. */
            return 0;
        }

        sptr = ziplistNext(zl, eptr);
        while (eptr) {
            score = zzlGetScore(sptr);

            /* If we fell out of range, break. */
            if (!zslValueLteMax(score, &range))
                break;

            /* We know the element exists. ziplistGet should always succeed */
            ziplistGet(eptr, &vstr, &vlen, &vlong);
            member = (vstr == NULL) ? sdsfromlonglong(vlong) :
                                      sdsnewlen(vstr,vlen);
            if (geoAppendIfWithinRadius(ga,lon,lat,radius,score,member)
                == C_ERR) sdsfree(member);
            zzlNext(zl, &eptr, &sptr);
        }
    } else if (zobj->encoding == OBJ_ENCODING_SKIPLIST) {
        zset *zs = zobj->ptr;
        zskiplist *zsl = zs->zsl;
        zskiplistNode *ln;

        if ((ln = zslFirstInRange(zsl, &range)) == NULL) {
            /* Nothing exists starting at our min.  No results. */
            return 0;
        }

        while (ln) {
            robj *o = ln->obj;
            /* Abort when the node is no longer in range. */
            if (!zslValueLteMax(ln->score, &range))
                break;

            member = (o->encoding == OBJ_ENCODING_INT) ?
                        sdsfromlonglong((long)o->ptr) :
                        sdsdup(o->ptr);
            if (geoAppendIfWithinRadius(ga,lon,lat,radius,ln->score,member)
                == C_ERR) sdsfree(member);
            ln = ln->level[0].forward;
        }
    }
    return ga->used - origincount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movsd %xmm3, -0x30(%rbp)
movsd %xmm4, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x1, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
jne 0xa3fb1
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
movq $0x0, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movq $0x0, -0x98(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x70(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x603a0
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
jne 0xa3eb9
movl $0x0, -0x4(%rbp)
jmp 0xa40ff
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x412e0
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0xa3fac
movq -0x80(%rbp), %rdi
callq 0x5fe60
movsd %xmm0, -0xa0(%rbp)
movsd -0xa0(%rbp), %xmm0
leaq -0x58(%rbp), %rdi
callq 0x5ea10
cmpl $0x0, %eax
jne 0xa3f01
jmp 0xa3fac
movq -0x78(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x8c(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x41470
cmpq $0x0, -0x88(%rbp)
jne 0xa3f3e
movq -0x98(%rbp), %rdi
callq 0x393f0
movq %rax, -0xc8(%rbp)
jmp 0xa3f59
movq -0x88(%rbp), %rdi
movl -0x8c(%rbp), %eax
movl %eax, %esi
callq 0x38230
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
movsd -0xa0(%rbp), %xmm3
movq -0x68(%rbp), %rsi
callq 0xa3d10
cmpl $-0x1, %eax
jne 0xa3f96
movq -0x68(%rbp), %rdi
callq 0x38620
movq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x600e0
jmp 0xa3eca
jmp 0xa40f0
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x7, %eax
jne 0xa40ee
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x5eb90
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
jne 0xa4010
movl $0x0, -0x4(%rbp)
jmp 0xa40ff
jmp 0xa4012
cmpq $0x0, -0xb8(%rbp)
je 0xa40ec
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rax
movsd 0x8(%rax), %xmm0
leaq -0x58(%rbp), %rdi
callq 0x5ea10
cmpl $0x0, %eax
jne 0xa4050
jmp 0xa40ec
movq -0xc0(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0xa407d
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x393f0
movq %rax, -0xd0(%rbp)
jmp 0xa4094
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x38560
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x40(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
movq -0xb8(%rbp), %rax
movsd 0x8(%rax), %xmm3
movq -0x68(%rbp), %rsi
callq 0xa3d10
cmpl $-0x1, %eax
jne 0xa40d5
movq -0x68(%rbp), %rdi
callq 0x38620
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xb8(%rbp)
jmp 0xa4012
jmp 0xa40ee
jmp 0xa40f0
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
subq -0x60(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)