// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: int reader<15, FinalCompoundSymbolBitCoder<SimpleBitChance, RacInput24<BlobReader>, 15>>(FinalCompoundSymbolBitCoder<SimpleBitChance, RacInput24<BlobReader>, 15>&, int, int)
int reader(SymbolCoder& coder, int min, int max) {
    assert(min<=max);
    if (min == max) return min;

    bool sign;
    assert(min <= 0 && max >= 0); // should always be the case, because guess should always be in valid range

      if (coder.read(BIT_ZERO)) return 0;
      if (min < 0) {
        if (max > 0) {
          sign = coder.read(BIT_SIGN);
        } else {sign = false; }
      } else {sign = true; }

    const int amax = (sign? max : -min);
    const int emax = maniac::util::ilog2(amax);

    int e = 0;
    for (; e < emax; e++) {
        if (coder.read(BIT_EXP,e)) break;
    }

    int have = (1 << e);

    for (int pos = e; pos>0;) {
        pos--;
        int minabs1 = have | (1<<pos);
        if (minabs1 > amax) continue; // 1-bit is impossible
        if (coder.read(BIT_MANT,pos)) have = minabs1;
    }
    return (sign ? have : -have);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
cmpl %edx, %esi
jne 0x5c9d
movl %r15d, %eax
jmp 0x5e45
movl %edx, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq 0x10(%rbx), %rax
movzwl (%rax), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1ca5a
movq 0x10(%rbx), %rdx
movzwl (%rdx), %ecx
shlq $0x2, %rcx
addq (%rbx), %rcx
movzbl %al, %esi
movzwl (%rcx,%rsi,2), %eax
movw %ax, (%rdx)
xorl %eax, %eax
testb %sil, %sil
jne 0x5e45
testl %r15d, %r15d
js 0x5cf2
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x5d4a
testl %ebp, %ebp
jle 0x5d3c
movq 0x8(%rbx), %rdi
movzwl 0x2(%rdx), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1ca5a
movq 0x10(%rbx), %rdx
movzwl 0x2(%rdx), %ecx
shlq $0x2, %rcx
addq (%rbx), %rcx
movl %eax, 0x4(%rsp)
movzbl %al, %eax
movzwl (%rcx,%rax,2), %ecx
movw %cx, 0x2(%rdx)
negl %r15d
testb %al, %al
cmovel %r15d, %ebp
jmp 0x5d4a
negl %r15d
movl $0x0, 0x4(%rsp)
movl %r15d, %ebp
testl %ebp, %ebp
setne %al
bsrl %ebp, %r13d
xorl $0x1f, %r13d
cmpl $0x1f, %r13d
setne %cl
andb %al, %cl
movl $0x1, %r14d
cmpb $0x1, %cl
jne 0x5e37
xorl $0x1f, %r13d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
movzwl 0x4(%rdx,%r15,2), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1ca5a
movq 0x10(%rbx), %rdx
movzwl 0x4(%rdx,%r15,2), %ecx
shlq $0x2, %rcx
addq (%rbx), %rcx
movzbl %al, %eax
movzwl (%rcx,%rax,2), %ecx
movw %cx, 0x4(%rdx,%r15,2)
testb %al, %al
jne 0x5dbf
incq %r15
cmpq %r13, %r15
jb 0x5d76
movl $0x1, %r14d
movl %r15d, %ecx
shll %cl, %r14d
testl %r15d, %r15d
jle 0x5e37
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq -0x1(%r15), %r13
movl %r14d, %r12d
btsl %r13d, %r12d
cmpl %ebp, %r12d
jg 0x5e2a
movq 0x8(%rbx), %rdi
movzwl 0x1e(%rdx,%r15,2), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1ca5a
movq 0x10(%rbx), %rdx
movzwl 0x1e(%rdx,%r15,2), %ecx
shlq $0x2, %rcx
addq (%rbx), %rcx
movzbl %al, %eax
movzwl (%rcx,%rax,2), %ecx
movw %cx, 0x1e(%rdx,%r15,2)
testb %al, %al
cmovnel %r12d, %r14d
leaq 0x1(%r13), %rax
movq %r13, %r15
cmpq $0x1, %rax
ja 0x5dd7
movl %r14d, %eax
negl %eax
cmpb $0x0, 0x4(%rsp)
cmovnel %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop