// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/geohash-int/geohash.c
// Function: geohashDecode
int geohashDecode(const GeoHashRange long_range, const GeoHashRange lat_range,
                   const GeoHashBits hash, GeoHashArea *area) {
    if (HASHISZERO(hash) || NULL == area || RANGEISZERO(lat_range) ||
        RANGEISZERO(long_range)) {
        return 0;
    }

    area->hash = hash;
    uint8_t step = hash.step;
    uint64_t hash_sep = deinterleave64(hash.bits); /* hash = [LAT][LONG] */

    double lat_scale = lat_range.max - lat_range.min;
    double long_scale = long_range.max - long_range.min;

    uint32_t ilato = hash_sep;       /* get lat part of deinterleaved hash */
    uint32_t ilono = hash_sep >> 32; /* shift over to get long part of hash */

    /* divide by 2**step.
     * Then, for 0-1 coordinate, multiply times scale and add
       to the min to get the absolute coordinate. */
    area->latitude.min =
        lat_range.min + (ilato * 1.0 / (1ull << step)) * lat_scale;
    area->latitude.max =
        lat_range.min + ((ilato + 1) * 1.0 / (1ull << step)) * lat_scale;
    area->longitude.min =
        long_range.min + (ilono * 1.0 / (1ull << step)) * long_scale;
    area->longitude.max =
        long_range.min + ((ilono + 1) * 1.0 / (1ull << step)) * long_scale;

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movb %sil, %al
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd %xmm2, -0x28(%rbp)
movsd %xmm3, -0x20(%rbp)
movq %rdi, -0x38(%rbp)
movb %al, -0x30(%rbp)
movq %rdx, -0x40(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xd3a37
cmpb $0x0, -0x30(%rbp)
je 0xd3a81
xorl %eax, %eax
cmpq -0x40(%rbp), %rax
je 0xd3a81
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd3a61
jp 0xd3a61
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd3a61
jp 0xd3a61
jmp 0xd3a81
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd3a8d
jp 0xd3a8d
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xd3a8d
jp 0xd3a8d
movl $0x0, -0x4(%rbp)
jmp 0xd3c22
movq -0x40(%rbp), %rax
movups -0x38(%rbp), %xmm0
movups %xmm0, (%rax)
movb -0x30(%rbp), %al
movb %al, -0x41(%rbp)
movq -0x38(%rbp), %rdi
callq 0xd3c30
movq %rax, -0x50(%rbp)
movsd -0x28(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x18(%rbp), %xmm1
movsd -0x10(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x68(%rbp)
movsd -0x28(%rbp), %xmm1
movl -0x64(%rbp), %eax
cvtsi2sd %rax, %xmm0
movb -0x41(%rbp), %cl
movl $0x1, %eax
movq %rax, %rdx
shlq %cl, %rdx
movq %rdx, %rcx
movq %rcx, %xmm2
movaps 0x63999(%rip), %xmm4    # 0x1374a0
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
movapd 0x6399d(%rip), %xmm3    # 0x1374b0
subpd %xmm3, %xmm2
movaps %xmm2, %xmm5
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm5, %xmm2
divsd %xmm2, %xmm0
movsd -0x58(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rcx
movsd %xmm0, 0x20(%rcx)
movsd -0x28(%rbp), %xmm1
movl -0x64(%rbp), %ecx
incl %ecx
cvtsi2sd %rcx, %xmm0
movb -0x41(%rbp), %cl
movq %rax, %rdx
shlq %cl, %rdx
movq %rdx, %rcx
movq %rcx, %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm5
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm5, %xmm2
divsd %xmm2, %xmm0
movsd -0x58(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rcx
movsd %xmm0, 0x28(%rcx)
movsd -0x18(%rbp), %xmm1
movl -0x68(%rbp), %ecx
cvtsi2sd %rcx, %xmm0
movb -0x41(%rbp), %cl
movq %rax, %rdx
shlq %cl, %rdx
movq %rdx, %rcx
movq %rcx, %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm5
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm5, %xmm2
divsd %xmm2, %xmm0
movsd -0x60(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rcx
movsd %xmm0, 0x10(%rcx)
movsd -0x18(%rbp), %xmm1
movl -0x68(%rbp), %ecx
incl %ecx
cvtsi2sd %rcx, %xmm0
movb -0x41(%rbp), %cl
shlq %cl, %rax
movq %rax, %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm0
movsd -0x60(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)