// File: /workspace/github_cpp_makefile_star2_O2/cloudinary[P]fuif/encoding/encoding.cpp
// Function: bool fuif_decode_channel<FileIO, FinalPropertySymbolCoder<SimpleBitChance, RacInput24<FileIO>, 15>>(FileIO&, fuif_options&, int&, Image&, unsigned long)
bool fuif_decode_channel(IO& io, fuif_options &options, int &beginc, Image &image, size_t bytes_to_load) {

  long unsigned filepos = io.ftell();
  if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) return true;
  int firstbyte = read_big_endian_varint(io);
  if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) return true;
  int endc = beginc + (firstbyte >> 4);
  bool compress = (firstbyte & 1);
  int predictor = (firstbyte & 14)>>1;
  pixel_type global_minv = 1-read_big_endian_varint(io);
  if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) return true;
  if (global_minv == 1) global_minv = read_big_endian_varint(io);
  if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) return true;
  pixel_type global_maxv = global_minv + read_big_endian_varint(io);
  if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) return true;
  if (endc>beginc) v_printf(3,"[File position %lu] Decoding%s channels %i-%i with range %i..%i\n", filepos, (compress?"":" uncompressed"), beginc, endc, global_minv, global_maxv);
  if (endc >= image.channel.size() || endc < beginc) {
    e_printf("Wrong channel range: %i-%i while we have only %i channels.\n",beginc,endc,image.channel.size());
    return false;
  }

  int firstrealc = beginc;
  for (int i=beginc; i<=endc; i++) {
    Channel &channel = image.channel[i];

    if (channel.w * channel.h <= 0) continue; //return true; // zero pixel channel? could happen

    channel.minval = global_minv;
    channel.maxval = global_maxv;
    if (endc>beginc && global_minv<global_maxv) {
        channel.minval += read_big_endian_varint(io);
        channel.maxval = channel.minval + read_big_endian_varint(io);
    }
    if (channel.minval == channel.maxval) {
        channel.data = std::vector<pixel_type>(channel.w * channel.h, channel.minval);
        v_printf(3,"[File position %lu] Decoding channel %i: %ix%i %s, constant %i\n", filepos, i, channel.w, channel.h, ch_describe(image,i), channel.minval);
        firstrealc++;
    }

    if (channel.minval == 0 && channel.maxval == 0) continue; // don't need quantization factor if it's all zeroes anyway

    channel.q = read_big_endian_varint(io);

    if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) return corrupt_or_truncated(io,channel,bytes_to_load);

    v_printf(3,"[File position %lu] Decoding%s channel %i: %ix%i %s with range %i..%i (qf=%i), predictor %i", filepos, (compress?"":" uncompressed"), i, channel.w, channel.h, ch_describe(image,i), channel.minval, channel.maxval, channel.q, predictor);
    v_printf(6," (shift=%i,%i, cshift=%i,%i)", channel.hshift, channel.vshift, channel.hcshift, channel.vcshift);
    v_printf(3,"\n");

    if (compress && !check_bit_depth(channel.minval,channel.maxval,predictor)) return false;
  }

  if (firstrealc > endc) { beginc=endc; return true; } // all trivial

  Ranges propRanges;
  init_properties(propRanges, image, beginc, endc, options);

  int predictability = 2048;

  if (predictor == 0 && compress) {
        Channel &channel = image.channel[firstrealc];
        uint64_t pixels = channel.h*channel.w;
        int rounded = read_big_endian_varint(io);
        if (rounded < 1 || rounded > 127) {
            return corrupt_or_truncated(io, channel, bytes_to_load);
        }
        predictability = rounded * 32;
        uint64_t zeroes = pixels*predictability/4096;
        v_printf(5,"Estimating %i zeroes in %i pixels (zero chance=%i/4096)\n",zeroes,pixels,predictability);
  }

  // decode trees
  RacIn<IO> rac(io);

  if (!compress) {
    UniformSymbolCoder<RacIn<IO>> coder(rac);
    for (int i=beginc; i<=endc; i++) {
        Channel &channel = image.channel[i];
        if (channel.minval==channel.maxval) continue;
        channel.setzero();
        channel.resize(channel.w, channel.h);
        for (int y=0; y<channel.h; y++) {
          if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) {
             v_printf(3,"Premature end-of-file at row %i.\n",y);
             break;
          }
          for (int x=0; x<channel.w; x++) {
             channel.value(y,x) = coder.read_int(channel.minval,channel.maxval-channel.minval);
          }
        }
        if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) break;
    }
    beginc = endc;
    return true;
  }

  Tree tree;
  MetaPropertySymbolCoder<FUIFBitChanceTree, RacIn<IO>> metacoder(rac, propRanges);
  if (!metacoder.read_tree(tree)) return corrupt_or_truncated(io, image.channel[beginc], bytes_to_load);

  Coder coder(rac, propRanges, tree, predictability, CONTEXT_TREE_SPLIT_THRESHOLD, options.maniac_cutoff, options.maniac_alpha);
  Properties properties(propRanges.size());


  // planar
  for (int i=beginc; i<=endc; i++) {
    Channel &channel = image.channel[i];
    if (channel.minval==channel.maxval) continue;
    channel.setzero();
    channel.resize(channel.w, channel.h);

    if (tree.size() == 1 && predictor == 0 && channel.zero == 0) {
      // special optimized case: no meta-adaptation, no predictor, so no need to compute properties
      v_printf(5,"Fast track.\n");
      for (int y=0; y<channel.h; y++) {
        if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) {
         v_printf(3,"Premature end-of-file at row %i of channel %i.\n",y,i);
         beginc = i;
         break;
        }
       for (int x=0; x<channel.w; x++) {
        channel.value(y,x) = coder.read_int(properties, channel.minval, channel.maxval);
       }
      }
    } else {

      v_printf(5,"Slow track.\n");

    Channel references(properties.size() - NB_NONREF_PROPERTIES, channel.w, 0, 0);
    for (int y=0; y<channel.h; y++) {
      if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) {
         v_printf(3,"Premature end-of-file at row %i of channel %i.\n",y,i);
         beginc = i;
         break;
      }
      precompute_references(channel, y, image, beginc, options, references);
      if (y <= 1 || predictor) {
       for (int x=0; x<channel.w; x++) {
        pixel_type guess;
        guess = predict_and_compute_properties_with_precomputed_reference(properties, channel, x, y, predictor, image, beginc, options, references);
        pixel_type diff = coder.read_int(properties, channel.minval-guess, channel.maxval-guess);
        channel.value(y,x) = diff + guess;
       }
      } else {
       int x=0;
       pixel_type guess, diff;
       for (; x<channel.w && x<2; x++) {
        guess = predict_and_compute_properties_with_precomputed_reference(properties, channel, x, y, predictor, image, beginc, options, references);
        diff = coder.read_int(properties, channel.minval-guess, channel.maxval-guess);
        channel.value(y,x) = diff + guess;
       }
       for (; x<channel.w-1; x++) {
        guess = predict_and_compute_properties_with_precomputed_reference_no_edge_case(properties, channel, x, y, references);
        diff = coder.read_int(properties, channel.minval-guess, channel.maxval-guess);
        channel.value(y,x) = diff + guess;
       }
       for (; x<channel.w; x++) {
        guess = predict_and_compute_properties_with_precomputed_reference(properties, channel, x, y, predictor, image, beginc, options, references);
        diff = coder.read_int(properties, channel.minval-guess, channel.maxval-guess);
        channel.value(y,x) = diff + guess;
       }
      }
    }
    }
    if (io.isEOF() || (bytes_to_load && io.ftell() >= bytes_to_load)) break;
  }

  beginc = endc;
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x41a8, %rsp           # imm = 0x41A8
movq %r8, %rbx
movq %rcx, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdi, %r14
callq 0xfe52
movq %rax, %r15
movq %r14, %rdi
callq 0x100ca
movb $0x1, %r13b
testb %al, %al
jne 0x10d7f
testq %rbx, %rbx
je 0x10131
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10d7f
movq %r14, %rdi
callq 0xfde8
movl %eax, %ebp
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10d7f
testq %rbx, %rbx
je 0x10161
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10d7f
movl %ebp, 0x30(%rsp)
movq 0x18(%rsp), %rax
movslq (%rax), %r12
movq %r14, %rdi
callq 0xfde8
movl %eax, %ebp
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10d7f
testq %rbx, %rbx
je 0x1019d
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10d7f
testw %bp, %bp
je 0x101a9
pushq $0x1
popq %rax
subl %ebp, %eax
jmp 0x101b1
movq %r14, %rdi
callq 0xfde8
movl %eax, 0xc(%rsp)
movl 0x30(%rsp), %ebp
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10d7f
testq %rbx, %rbx
je 0x101df
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10d7f
movq %r14, %rdi
callq 0xfde8
movl %eax, 0x8(%rsp)
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10d7f
testq %rbx, %rbx
je 0x10211
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10d7f
movq %rbx, 0x10(%rsp)
movl %ebp, %eax
sarl $0x4, %eax
cltq
movl %ebp, %ecx
movq %r12, %rbp
addq %rax, %rbp
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %r9d
addl %edi, %r9d
movq 0x18(%rsp), %r12
movl (%r12), %r8d
leaq 0xf6f6(%rip), %rbx      # 0x1f937
leaq 0xe814(%rip), %rax      # 0x1ea5c
cmpl %r8d, %ebp
movl %r9d, 0x8(%rsp)
movq %rax, 0x60(%rsp)
jle 0x1029b
movswl %di, %r10d
testb $0x1, %cl
movq %rax, %rcx
cmovneq %rbx, %rcx
movswl %r9w, %r11d
leaq 0xe98b(%rip), %rsi      # 0x1ebfb
pushq $0x3
popq %rdi
movq %r15, %rdx
movl %ebp, %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x16c30
movl 0x18(%rsp), %r9d
movl 0x1c(%rsp), %edi
addq $0x10, %rsp
movl (%r12), %eax
movl %eax, 0x2c(%rsp)
jmp 0x102a0
movl %r8d, 0x2c(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x6, %rcx
cmpq %rbp, %rcx
movl 0x2c(%rsp), %esi
jbe 0x105b9
cmpl %esi, %ebp
jl 0x105b9
movq %rbp, 0x40(%rsp)
movl 0x30(%rsp), %ecx
movl %ecx, %eax
shrl %eax
andl $0x7, %eax
movq %rax, 0x50(%rsp)
testb $0x1, %cl
movq 0x60(%rsp), %rax
cmovneq %rbx, %rax
movq %rax, 0x60(%rsp)
movslq %esi, %rcx
movq %rcx, %rbp
shlq $0x6, %rbp
orq $0x20, %rbp
movq 0x10(%rsp), %rbx
cmpq 0x40(%rsp), %rcx
jg 0x105d1
movq 0x20(%rsp), %rax
movq (%rax), %r12
movl -0x4(%r12,%rbp), %eax
imull -0x8(%r12,%rbp), %eax
testl %eax, %eax
jle 0x105ad
movq %rcx, 0x48(%rsp)
leaq (%r12,%rbp), %rax
movq %rax, 0x78(%rsp)
movw %di, (%r12,%rbp)
movw %r9w, 0x2(%r12,%rbp)
movl %r9d, %eax
movl %edi, %ecx
cmpw %r9w, %di
movq %rbp, 0x88(%rsp)
jge 0x103a2
movl %r9d, %eax
movl %edi, %ecx
movq 0x18(%rsp), %rdx
movq 0x40(%rsp), %rsi
cmpl (%rdx), %esi
jle 0x103a2
movq %r14, %rdi
callq 0xfde8
movl %eax, %ebx
movq 0x78(%rsp), %rbp
addw (%rbp), %bx
movw %bx, (%rbp)
movq %r14, %rdi
callq 0xfde8
movl 0x8(%rsp), %r9d
movl 0xc(%rsp), %edi
addl %ebx, %eax
movq 0x10(%rsp), %rbx
movw %ax, 0x2(%rbp)
movzwl (%rbp), %ecx
movq 0x88(%rsp), %rbp
leaq (%r12,%rbp), %rdx
addq $-0x20, %rdx
cmpw %ax, %cx
movq %rdx, 0x58(%rsp)
jne 0x1046a
movq 0x78(%rsp), %rbp
movslq -0x8(%rbp), %rax
movslq -0x4(%rbp), %rsi
imulq %rax, %rsi
leaq 0x170(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rdx
leaq 0xe0(%rsp), %rcx
callq 0xab22
movq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0xba76
movq %rbx, %rdi
callq 0xabc2
movl -0x8(%rbp), %eax
movl %eax, 0x70(%rsp)
movl -0x4(%rbp), %eax
movl %eax, 0x68(%rsp)
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rbx
movl %ebx, %esi
callq 0xcd41
movq %rax, %r10
movswl (%rbp), %r11d
pushq $0x3
popq %rdi
leaq 0xe84e(%rip), %rsi      # 0x1ec78
movq %r15, %rdx
movl %ebx, %ecx
movl 0x70(%rsp), %r8d
movq 0x10(%rsp), %rbx
movl 0x68(%rsp), %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x16c30
movl 0x18(%rsp), %r9d
movl 0x1c(%rsp), %edi
addq $0x10, %rsp
incl 0x2c(%rsp)
movzwl (%rbp), %ecx
movzwl 0x2(%rbp), %eax
movq 0x88(%rsp), %rbp
orw %cx, %ax
je 0x105a8
movq %r14, %rdi
callq 0xfde8
movl %eax, 0x8(%r12,%rbp)
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10bcc
testq %rbx, %rbx
je 0x104a6
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10bcc
movl -0x8(%r12,%rbp), %eax
movl %eax, 0x84(%rsp)
movl -0x4(%r12,%rbp), %eax
movq %rax, 0x58(%rsp)
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rbx
movl %ebx, %esi
callq 0xcd41
movq %rax, 0x70(%rsp)
movswl (%r12,%rbp), %eax
movq %rax, 0x68(%rsp)
movswl 0x2(%r12,%rbp), %r10d
movl 0x8(%r12,%rbp), %r11d
pushq $0x3
popq %rdi
leaq 0xe7c7(%rip), %rsi      # 0x1ecb8
movq %r15, %rdx
movq 0x60(%rsp), %rcx
movl %ebx, %r8d
movl 0x84(%rsp), %r9d
xorl %eax, %eax
movq 0x50(%rsp), %rbx
pushq %rbx
pushq %r11
pushq %r10
pushq 0x80(%rsp)
pushq 0x90(%rsp)
pushq 0x80(%rsp)
callq 0x16c30
addq $0x30, %rsp
movl 0xc(%r12,%rbp), %edx
movl 0x10(%r12,%rbp), %ecx
movl 0x14(%r12,%rbp), %r8d
movl 0x18(%r12,%rbp), %r9d
pushq $0x6
popq %rdi
leaq 0xe7c8(%rip), %rsi      # 0x1ed14
xorl %eax, %eax
callq 0x16c30
pushq $0x3
popq %rdi
leaq 0xf3d9(%rip), %rsi      # 0x1f936
xorl %eax, %eax
callq 0x16c30
testb $0x1, 0x30(%rsp)
je 0x1059a
movq 0x78(%rsp), %rax
movswl (%rax), %edi
movswl 0x2(%rax), %esi
movl %ebx, %edx
callq 0xccd0
testb %al, %al
movq 0x10(%rsp), %rbx
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %r9d
movq 0x48(%rsp), %rcx
jne 0x105ad
jmp 0x10cef
movq 0x10(%rsp), %rbx
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %r9d
movq 0x48(%rsp), %rcx
incq %rcx
addq $0x40, %rbp
jmp 0x102fe
leaq 0xe67c(%rip), %rdi      # 0x1ec3c
xorl %r13d, %r13d
movl %ebp, %edx
xorl %eax, %eax
callq 0x16b80
jmp 0x10d7f
movq 0x40(%rsp), %rcx
cmpl %ecx, 0x2c(%rsp)
jle 0x105e8
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0x10d7f
xorps %xmm0, %xmm0
leaq 0x90(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x18(%rsp), %r13
movl (%r13), %edx
movq 0x20(%rsp), %rsi
movq 0x38(%rsp), %r8
callq 0xc4ca
movl 0x30(%rsp), %ebp
testb $0x1, %bpl
sete %al
cmpl $0x0, 0x50(%rsp)
setne %cl
movl $0x800, %r15d           # imm = 0x800
orb %al, %cl
jne 0x1069b
movslq 0x2c(%rsp), %rbx
movq 0x20(%rsp), %rax
movq (%rax), %r13
shlq $0x6, %rbx
movslq 0x1c(%r13,%rbx), %rbp
movslq 0x18(%r13,%rbx), %r12
movq %r14, %rdi
callq 0xfde8
movl %eax, %r15d
leal -0x1(%r15), %eax
cmpl $0x7f, %eax
jae 0x10cf7
imulq %rbp, %r12
shll $0x5, %r15d
movq %r15, %rdx
imulq %r12, %rdx
shrq $0xc, %rdx
leaq 0xe6b4(%rip), %rsi      # 0x1ed31
pushq $0x5
popq %rdi
movq %r12, %rcx
movl %r15d, %r8d
xorl %eax, %eax
callq 0x16c30
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r13
movl 0x30(%rsp), %ebp
leaq 0x120(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x15a64
testb $0x1, %bpl
je 0x10be4
leaq 0xb0(%rsp), %rdi
callq 0xdb2e
leaq 0x138(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0x90(%rsp), %rdx
pushq $0x2
popq %rcx
movl $0xd79435e, %r8d        # imm = 0xD79435E
callq 0x1585c
leaq 0x138(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x158ce
testb %al, %al
je 0x10d0f
movq 0x38(%rsp), %rcx
movl 0x14(%rcx), %eax
movl 0x18(%rcx), %r10d
movzwl %r15w, %r8d
leaq 0x170(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
movl $0x15550, %r9d          # imm = 0x15550
pushq %r10
pushq %rax
callq 0x1598c
popq %rax
popq %rcx
movq 0x98(%rsp), %rsi
subq 0x90(%rsp), %rsi
sarq $0x3, %rsi
leaq 0xc8(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0xa562
movslq (%r13), %r15
leaq 0xc8(%rsp), %rbp
cmpq 0x40(%rsp), %r15
jg 0x10d2f
movq 0x20(%rsp), %rax
movq (%rax), %r13
movq %r15, %rax
shlq $0x6, %rax
movzwl 0x20(%r13,%rax), %ecx
cmpw 0x22(%r13,%rax), %cx
je 0x10bc4
addq %rax, %r13
movq %r13, %rdi
callq 0xab78
movq %r13, %rdi
callq 0xa72e
cmpl $0x0, 0x50(%rsp)
movq %r15, 0x30(%rsp)
jne 0x1087b
movq 0xb8(%rsp), %rax
subq 0xb0(%rsp), %rax
cmpq $0x8, %rax
jne 0x1087b
cmpw $0x0, 0x24(%r13)
jne 0x1087b
pushq $0x5
popq %rdi
leaq 0xe590(%rip), %rsi      # 0x1ed8c
xorl %eax, %eax
callq 0x16c30
xorl %r15d, %r15d
cmpl 0x1c(%r13), %r15d
jge 0x10b94
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10b3d
cmpq $0x0, 0x10(%rsp)
je 0x1083b
movq %r14, %rdi
callq 0xfe52
cmpq 0x10(%rsp), %rax
jae 0x10b3d
xorl %r12d, %r12d
cmpl 0x18(%r13), %r12d
jge 0x10876
movswl 0x20(%r13), %edx
movswl 0x22(%r13), %ecx
leaq 0x170(%rsp), %rdi
movq %rbp, %rsi
callq 0x48dc
movl %eax, %ebx
movq %r13, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xa44a
movw %bx, (%rax)
incl %r12d
jmp 0x1083e
incl %r15d
jmp 0x10806
pushq $0x5
popq %rdi
leaq 0xe544(%rip), %rsi      # 0x1edc9
xorl %eax, %eax
callq 0x16c30
movq 0xd0(%rsp), %rsi
subq 0xc8(%rsp), %rsi
shrq $0x2, %rsi
addl $-0xd, %esi
movl 0x18(%r13), %edx
leaq 0xe0(%rsp), %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
pushq $0x1
popq %r9
pushq $0x0
pushq $0x0
pushq $0x0
pushq $0x0
callq 0xa470
addq $0x20, %rsp
xorl %r15d, %r15d
cmpl 0x1c(%r13), %r15d
jge 0x10b87
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10b63
cmpq $0x0, 0x10(%rsp)
je 0x10901
movq %r14, %rdi
callq 0xfe52
cmpq 0x10(%rsp), %rax
jae 0x10b63
cmpl $0x0, 0x50(%rsp)
setne %bl
movq 0x18(%rsp), %rax
movl (%rax), %ecx
movq %r13, %rdi
movl %r15d, %esi
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %r8
leaq 0xe0(%rsp), %r9
callq 0xc89a
cmpl $0x2, %r15d
setb %al
xorl %r12d, %r12d
orb %bl, %al
je 0x109c4
cmpl 0x18(%r13), %r12d
jge 0x10b35
movq 0x18(%rsp), %rax
movl (%rax), %eax
subq $0x8, %rsp
movq %rbp, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
movq 0x58(%rsp), %r8
movq 0x28(%rsp), %r9
leaq 0xe8(%rsp), %r10
pushq %r10
pushq 0x48(%rsp)
pushq %rax
callq 0x4847
addq $0x20, %rsp
movq %rbp, %rsi
movl %eax, %ebp
movswl 0x20(%r13), %edx
cwtl
subl %eax, %edx
movswl 0x22(%r13), %ecx
subl %eax, %ecx
leaq 0x170(%rsp), %rdi
movq %rsi, %rbx
callq 0x48dc
addl %eax, %ebp
movq %r13, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xa44a
movw %bp, (%rax)
incl %r12d
movq %rbx, %rbp
jmp 0x1093f
movl 0x18(%r13), %eax
cmpl $0x1, %r12d
ja 0x10aae
cmpl %eax, %r12d
jge 0x10aae
movq 0x18(%rsp), %rax
movl (%rax), %eax
subq $0x8, %rsp
movq %rbp, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
movq 0x28(%rsp), %r9
leaq 0xe8(%rsp), %r10
pushq %r10
pushq 0x48(%rsp)
pushq %rax
callq 0x4847
addq $0x20, %rsp
movq %rbp, %rbx
movl %eax, %ebp
movswl 0x20(%r13), %edx
cwtl
subl %eax, %edx
movswl 0x22(%r13), %ecx
subl %eax, %ecx
leaq 0x170(%rsp), %rdi
movq %rbx, %rsi
callq 0x48dc
addl %eax, %ebp
movq %r13, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xa44a
movw %bp, (%rax)
incl %r12d
movq %rbx, %rbp
jmp 0x109c4
movq %rbp, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
leaq 0xe0(%rsp), %r8
callq 0x490a
movq %rbp, %rbx
movl %eax, %ebp
movswl 0x20(%r13), %edx
cwtl
subl %eax, %edx
movswl 0x22(%r13), %ecx
subl %eax, %ecx
leaq 0x170(%rsp), %rdi
movq %rbx, %rsi
callq 0x48dc
addl %eax, %ebp
movq %r13, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xa44a
movw %bp, (%rax)
incl %r12d
movl 0x18(%r13), %eax
movq %rbx, %rbp
leal -0x1(%rax), %ecx
cmpl %ecx, %r12d
jl 0x10a54
jmp 0x10b30
movq 0x18(%rsp), %rax
movl (%rax), %eax
subq $0x8, %rsp
movq %rbp, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
movq 0x28(%rsp), %r9
leaq 0xe8(%rsp), %r10
pushq %r10
pushq 0x48(%rsp)
pushq %rax
callq 0x4847
addq $0x20, %rsp
movq %rbp, %rbx
movl %eax, %ebp
movswl 0x20(%r13), %edx
cwtl
subl %eax, %edx
movswl 0x22(%r13), %ecx
subl %eax, %ecx
leaq 0x170(%rsp), %rdi
movq %rbx, %rsi
callq 0x48dc
addl %eax, %ebp
movq %r13, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xa44a
movw %bp, (%rax)
incl %r12d
movl 0x18(%r13), %eax
movq %rbx, %rbp
cmpl %eax, %r12d
jl 0x10ab8
incl %r15d
jmp 0x108cc
pushq $0x3
popq %rdi
leaq 0xe252(%rip), %rsi      # 0x1ed99
movl %r15d, %edx
movq 0x30(%rsp), %r15
movl %r15d, %ecx
xorl %eax, %eax
callq 0x16c30
movq 0x18(%rsp), %rax
movl %r15d, (%rax)
jmp 0x10b94
pushq $0x3
popq %rdi
leaq 0xe22c(%rip), %rsi      # 0x1ed99
movl %r15d, %edx
movq 0x30(%rsp), %r15
movl %r15d, %ecx
xorl %eax, %eax
callq 0x16c30
movq 0x18(%rsp), %rax
movl %r15d, (%rax)
leaq 0xe0(%rsp), %rdi
callq 0xabc2
movq %r14, %rdi
callq 0x100ca
testb %al, %al
movq 0x30(%rsp), %r15
jne 0x10d2f
cmpq $0x0, 0x10(%rsp)
je 0x10bc4
movq %r14, %rdi
callq 0xfe52
cmpq 0x10(%rsp), %rax
jae 0x10d2f
incq %r15
jmp 0x1077d
movq %r14, %rdi
movq 0x58(%rsp), %rsi
movq %rbx, %rdx
callq 0x15773
movl %eax, %r13d
jmp 0x10d7f
leaq 0x170(%rsp), %r15
movq %r12, (%r15)
movslq (%r13), %rax
movq %rax, 0x38(%rsp)
cmpq 0x40(%rsp), %rax
jg 0x10cdb
movq 0x20(%rsp), %rax
movq (%rax), %r13
movq 0x38(%rsp), %rax
shlq $0x6, %rax
movzwl 0x20(%r13,%rax), %ecx
cmpw 0x22(%r13,%rax), %cx
je 0x10cce
addq %rax, %r13
movq %r13, %rdi
callq 0xab78
movq %r13, %rdi
callq 0xa72e
xorl %r12d, %r12d
cmpl 0x1c(%r13), %r12d
jge 0x10cb0
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10c9c
testq %rbx, %rbx
je 0x10c60
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10c9c
xorl %ebp, %ebp
cmpl 0x18(%r13), %ebp
jge 0x10c97
movswl 0x20(%r13), %esi
movswl 0x22(%r13), %edx
subl %esi, %edx
movq %r15, %rdi
callq 0x1580e
movl %eax, %ebx
movq %r13, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0xa44a
movw %bx, (%rax)
incl %ebp
movq 0x10(%rsp), %rbx
jmp 0x10c62
incl %r12d
jmp 0x10c3c
pushq $0x3
popq %rdi
leaq 0xe0c4(%rip), %rsi      # 0x1ed6a
movl %r12d, %edx
xorl %eax, %eax
callq 0x16c30
movq %r14, %rdi
callq 0x100ca
testb %al, %al
jne 0x10cdb
testq %rbx, %rbx
je 0x10cce
movq %r14, %rdi
callq 0xfe52
cmpq %rbx, %rax
jae 0x10cdb
movq 0x38(%rsp), %rax
incq %rax
jmp 0x10bf3
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
movl %ecx, (%rax)
movb $0x1, %r13b
jmp 0x10d72
xorl %r13d, %r13d
jmp 0x10d7f
addq %rbx, %r13
movq %r14, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
callq 0x15773
movl %eax, %r13d
jmp 0x10d72
movslq (%r13), %rsi
shlq $0x6, %rsi
movq 0x20(%rsp), %rax
addq (%rax), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x15773
movl %eax, %r13d
jmp 0x10d58
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
movl %ecx, (%rax)
leaq 0xc8(%rsp), %rdi
callq 0x5374
leaq 0x4188(%rsp), %rdi
callq 0x152b8
movb $0x1, %r13b
leaq 0x138(%rsp), %rdi
callq 0x15a4e
leaq 0xb0(%rsp), %rdi
callq 0x124b8
leaq 0x90(%rsp), %rdi
callq 0xc00e
movl %r13d, %eax
addq $0x41a8, %rsp           # imm = 0x41A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x10deb
jmp 0x10da8
jmp 0x10e14
movq %rax, %rbx
jmp 0x10e05
jmp 0x10e14
jmp 0x10dc9
jmp 0x10ddb
movq %rax, %rbx
jmp 0x10df8
jmp 0x10e14
jmp 0x10e14
jmp 0x10ddb
jmp 0x10e14
jmp 0x10e14
jmp 0x10ddb
jmp 0x10e14
jmp 0x10dc9
jmp 0x10ddb
jmp 0x10e14
jmp 0x10dc9
jmp 0x10dc9
jmp 0x10dc9
jmp 0x10dc9
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xabc2
jmp 0x10dde
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x5374
leaq 0x4188(%rsp), %rdi
callq 0x152b8
leaq 0x138(%rsp), %rdi
callq 0x15a4e
leaq 0xb0(%rsp), %rdi
callq 0x124b8
jmp 0x10e17
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xc00e
movq %rbx, %rdi
callq 0x35d0