// File: /workspace/github_cpp_makefile_star2_O1/cloudinary[P]fuif/encoding/../maniac/symbol.h
// Function: int reader<15, FinalCompoundSymbolBitCoder<SimpleBitChance, RacInput24<FileIO>, 15>>(FinalCompoundSymbolBitCoder<SimpleBitChance, RacInput24<FileIO>, 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, %ebx
cmpl %edx, %esi
jne 0x58df
movl %ebx, %eax
jmp 0x5a76
movl %edx, %r15d
movq %rdi, %r14
movq 0x8(%rdi), %rdi
movq 0x10(%r14), %rax
movzwl (%rax), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1c4fa
movq 0x10(%r14), %rcx
movzwl (%rcx), %edx
shlq $0x2, %rdx
addq (%r14), %rdx
movzbl %al, %esi
movzwl (%rdx,%rsi,2), %eax
movw %ax, (%rcx)
xorl %eax, %eax
testb %sil, %sil
jne 0x5a76
movb $0x1, %bpl
testl %ebx, %ebx
jns 0x5971
testl %r15d, %r15d
jle 0x596f
movq 0x8(%r14), %rdi
movzwl 0x2(%rcx), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1c4fa
movq 0x10(%r14), %rcx
movzwl 0x2(%rcx), %edx
shlq $0x2, %rdx
addq (%r14), %rdx
movl %eax, %ebp
movzbl %al, %eax
movzwl (%rdx,%rax,2), %eax
movw %ax, 0x2(%rcx)
jmp 0x5971
xorl %ebp, %ebp
negl %ebx
testb %bpl, %bpl
cmovnel %r15d, %ebx
testl %ebx, %ebx
setne %al
bsrl %ebx, %r12d
xorl $0x1f, %r12d
cmpl $0x1f, %r12d
setne %cl
andb %al, %cl
xorl %r15d, %r15d
cmpb $0x1, %cl
jne 0x59f0
xorl $0x1f, %r12d
xorl %r15d, %r15d
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rax
movzwl 0x4(%rax,%r15,2), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1c4fa
movq 0x10(%r14), %rcx
movzwl 0x4(%rcx,%r15,2), %edx
shlq $0x2, %rdx
addq (%r14), %rdx
movzbl %al, %eax
movzwl (%rdx,%rax,2), %edx
movw %dx, 0x4(%rcx,%r15,2)
testb %al, %al
jne 0x59f0
incq %r15
testl %ebx, %ebx
je 0x59f0
cmpq %r12, %r15
jb 0x599f
movl %ebp, 0x4(%rsp)
movl $0x1, %ebp
movl %r15d, %ecx
shll %cl, %ebp
testl %r15d, %r15d
jle 0x5a6a
movl %r15d, %r13d
leaq -0x1(%r13), %r15
movl %ebp, %r12d
btsl %r15d, %r12d
cmpl %ebx, %r12d
jg 0x5a5d
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rax
movzwl 0x1e(%rax,%r13,2), %esi
imulq 0x8(%rdi), %rsi
addq $0x800, %rsi            # imm = 0x800
shrq $0xc, %rsi
callq 0x1c4fa
movq 0x10(%r14), %rcx
movzwl 0x1e(%rcx,%r13,2), %edx
shlq $0x2, %rdx
addq (%r14), %rdx
movzbl %al, %eax
movzwl (%rdx,%rax,2), %edx
movw %dx, 0x1e(%rcx,%r13,2)
testb %al, %al
cmovnel %r12d, %ebp
leaq 0x1(%r15), %rax
movq %r15, %r13
cmpq $0x1, %rax
jg 0x5a06
movl %ebp, %eax
negl %eax
cmpb $0x0, 0x4(%rsp)
cmovnel %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop