// File: /workspace/github_cpp_makefile_star2_O3/cloudinary[P]fuif/encoding/encoding.cpp
// Function: bool fuif_encode_channels<BlobIO, RacOutput24<BlobIO>, FinalPropertySymbolCoder<SimpleBitChance, RacOutput24<BlobIO>, 15>, false, true>(BlobIO&, Tree&, fuif_options&, int, int, int, Image const&, unsigned long&)
bool fuif_encode_channels(IO& io, Tree &tree, fuif_options &options, int predictor, int beginc, int endc, const Image &image, size_t &header_pos) {
  assert(endc >= beginc);
  write_big_endian_varint(io, ((endc-beginc) << 4) + (predictor << 1) + (compress?1:0));
  if (endc>beginc) v_printf(5,"Encoding%s channels %i-%i\n", (compress?"":" uncompressed"), beginc, endc);

  pixel_type global_minv=LARGEST_VAL;
  pixel_type global_maxv=SMALLEST_VAL;
  for (int i=beginc; i<=endc; i++) {
    const Channel &channel = image.channel[i];
    if (channel.w * channel.h <= 0) continue; // zero pixel channel? could happen
    pixel_type minv = channel.minval;
    pixel_type maxv = channel.maxval;
    if (minv<global_minv) global_minv=minv;
    if (maxv>global_maxv) global_maxv=maxv;
  }
  if (global_minv <= 0) {
    write_big_endian_varint(io, 1-global_minv);
  } else {
    write_big_endian_varint(io, 0);
    write_big_endian_varint(io, global_minv);
  }
  write_big_endian_varint(io, global_maxv-global_minv);


  int firstrealc = beginc;
  for (int i=beginc; i<=endc; i++) {
    const Channel &channel = image.channel[i];
    if (channel.w * channel.h <= 0) continue; // zero pixel channel? could happen

    pixel_type minv = channel.minval;
    pixel_type maxv = channel.maxval;

    if (endc > beginc && global_minv < global_maxv) {
      write_big_endian_varint(io, minv-global_minv);
      write_big_endian_varint(io, maxv-minv);
    }
    if (minv == maxv) { firstrealc++; }

    if (!check_bit_depth(minv,maxv,predictor)) return false;

    if (minv == 0 && maxv == 0) continue; // don't need quantization factor if it's all zeroes anyway

    write_big_endian_varint(io, channel.q);

    if (!learn) v_printf(6,"Encoding %ix%i channel %i with range %i..%i (predictor %i, quantization %i), (shift=%i,%i, cshift=%i,%i)\n", channel.w, channel.h, i, minv, maxv, predictor, channel.q, channel.hshift, channel.vshift, channel.hcshift, channel.vcshift);
    else  v_printf(7,"Learning %ix%i channel %i with range %i..%i (predictor %i)\n", channel.w, channel.h, i, minv, maxv, predictor);

    channel.setzero();
  }

  header_pos = io.ftell();

  if (firstrealc > endc) return true; // all trivial


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

  int predictability = 2048; // 50%
  {
    const Channel &channel = image.channel[firstrealc];
    if (predictor == 0 && compress) {
        uint64_t zeroes = 0;
        uint64_t pixels = channel.h*channel.w;
        for (int y=0; y<channel.h; y++)
          for (int x=0; x<channel.w; x++)
            if ( channel.value(y,x) == 0) zeroes++;
        int rounded = zeroes * 128 / pixels;
        if (rounded < 1) rounded = 1;
        if (rounded > 127) rounded = 127;
        write_big_endian_varint(io, rounded);
        predictability = rounded * 32;
        v_printf(5,"Found %i zeroes in %i pixels (zero chance=%i/4096)\n",zeroes,pixels,predictability);
    }
  }

  Rac rac(io);

  if (!compress) {
    UniformSymbolCoder<Rac> coder(rac);
    for (int i=beginc; i<=endc; i++) {
        const Channel &channel = image.channel[i];
        for (int y=0; y<channel.h; y++) {
            for (int x=0; x<channel.w; x++) {
                coder.write_int(channel.minval,channel.maxval,channel.value(y,x)); // TODO: use predictor? (only makes sense if the predictor residues have a smaller range)
                if (!learn && options.debug)
                    options.heatmap.channel[i].value(y,x) = (x);
            }
        }
    }
  } else {
    if (!learn) {
        // encode tree here
        MetaPropertySymbolCoder<FUIFBitChanceTree, Rac> metacoder(rac, propRanges);
        metacoder.write_tree(tree);
    }
    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++) {
        const Channel &channel = image.channel[i];
        pixel_type minv = channel.minval;
        pixel_type maxv = channel.maxval;
        if (minv==maxv) continue;
        int rowslearned=0;
        Channel references(properties.size() - NB_NONREF_PROPERTIES, channel.w, 0, 0);
        for (int y=0; y<channel.h; y++) {
            if (learn) { if (++rowslearned > options.nb_repeats*channel.h) break; }
            if (learn) y=rand()%channel.h; // try random rows, to avoid giving priority to the top of the image (because then the y property cannot be learned)
            precompute_references(channel, y, image, beginc, options, references);
            for (int x=0; x<channel.w; x++) {
                pixel_type guess;
        //        guess = predict_and_compute_properties_with_reference(properties, channel, x, y, predictor, image, beginc, options);
                guess = predict_and_compute_properties_with_precomputed_reference(properties, channel, x, y, predictor, image, beginc, options, references);
                pixel_type diff = channel.value(y,x)-guess;
                if (!learn && options.debug) {
                    int estimate = coder.estimate_int(properties, minv-guess, maxv-guess, diff);
                    options.heatmap.channel[i].value(y,x) = estimate;
                }
                coder.write_int(properties, minv-guess, maxv-guess, diff);
            }
            if (learn) { y=0; } // set to zero in case random row was channel.h-1
        }
    }
    coder.simplify();
  }

  rac.flush();
  io.flush();
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4138, %rsp           # imm = 0x4138
movl %r9d, %ebx
movl %r8d, %ebp
movq %rdx, 0x60(%rsp)
movq %rsi, %r15
movq %rdi, %r12
movl %r9d, %eax
subl %r8d, %eax
shll $0x4, %eax
movq %rcx, 0x70(%rsp)
leal (%rax,%rcx,2), %eax
incl %eax
movslq %eax, %rsi
movl $0x1, %edx
callq 0x12233
cmpl %ebp, %ebx
jle 0x13129
leaq 0x13980(%rip), %rsi     # 0x26a91
leaq 0x1486f(%rip), %rdx     # 0x27987
movl $0x5, %edi
movl %ebp, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x1cede
movq 0x4170(%rsp), %r14
movq %rbx, 0x20(%rsp)
movl %ebx, %eax
subl %ebp, %eax
movl %ebp, 0x14(%rsp)
movq %r15, 0xb8(%rsp)
jge 0x1315a
movw $0x8001, %bx            # imm = 0x8001
movw $0x7fff, %bp            # imm = 0x7FFF
movl $0x7fff, 0x18(%rsp)     # imm = 0x7FFF
jmp 0x131ae
movq (%r14), %rcx
movslq %ebp, %rdx
shlq $0x6, %rdx
addq %rdx, %rcx
addq $0x22, %rcx
incl %eax
movw $0x8001, %bx            # imm = 0x8001
movw $0x7fff, %bp            # imm = 0x7FFF
movl -0x6(%rcx), %edx
imull -0xa(%rcx), %edx
testl %edx, %edx
jle 0x13196
movl -0x2(%rcx), %edx
movzwl (%rcx), %esi
cmpw %bp, %dx
cmovgel %ebp, %edx
cmpw %bx, %si
cmovlel %ebx, %esi
movl %esi, %ebx
movl %edx, %ebp
addq $0x40, %rcx
decl %eax
jne 0x13175
movswl %bp, %eax
testw %ax, %ax
movl %eax, 0x18(%rsp)
jle 0x134b0
movq %r12, %rdi
xorl %esi, %esi
callq 0x14526
movzwl %bp, %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x12233
movswl %bx, %eax
subl 0x18(%rsp), %eax
movslq %eax, %rsi
movq %r12, 0x50(%rsp)
movq %r12, %rdi
movl $0x1, %edx
callq 0x12233
movb $0x1, %dl
movl 0x14(%rsp), %eax
movl %eax, 0x28(%rsp)
cmpl %eax, 0x20(%rsp)
jge 0x132e7
movq 0x4178(%rsp), %rax
movq 0x50(%rsp), %r12
movslq 0x18(%r12), %rcx
movq %rcx, (%rax)
movq 0x20(%rsp), %rbx
cmpl %ebx, 0x28(%rsp)
movl %edx, 0x68(%rsp)
jg 0x13a27
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %r14, %rsi
movl 0x14(%rsp), %ebp
movl %ebp, %edx
movl %ebx, %ecx
movq 0x60(%rsp), %r8
callq 0x106d2
movw $0x800, %r13w           # imm = 0x800
cmpl $0x0, 0x70(%rsp)
movq 0xb8(%rsp), %r15
jne 0x13533
movslq 0x28(%rsp), %rax
shlq $0x6, %rax
addq (%r14), %rax
movslq 0x1c(%rax), %rcx
movl 0x18(%rax), %edx
movl %edx, %esi
imull %ecx, %esi
movslq %esi, %r14
testq %rcx, %rcx
jle 0x134bc
leaq 0x24(%rax), %rsi
leaq (%rdx,%rdx), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %r12d, %r12d
testl %edx, %edx
jle 0x132d4
movq (%rax), %r11
movq 0x8(%rax), %rbx
subq %r11, %rbx
sarq %rbx
addq %r9, %r11
movq %rdx, %r15
movq %r8, %r13
cmpq %r13, %rbx
movq %rsi, %rbp
cmovaq %r11, %rbp
cmpw $0x1, (%rbp)
adcq $0x0, %r12
addq $0x2, %r11
incq %r13
decq %r15
jne 0x132b5
incq %r10
addq %rdi, %r9
addq %rdx, %r8
cmpq %rcx, %r10
jne 0x1329b
jmp 0x134bf
setg %al
cmpw %bx, %bp
setl %cl
andb %al, %cl
movb %cl, 0x13(%rsp)
movl 0x14(%rsp), %ecx
movslq %ecx, %rsi
movq 0x20(%rsp), %rax
movslq %eax, %rdx
movq %rdx, 0x80(%rsp)
incl %eax
movl %eax, 0x78(%rsp)
movq %rsi, %rbx
shlq $0x6, %rbx
orq $0x18, %rbx
movl %ecx, %edi
xorl %edx, %edx
movl %ecx, 0x28(%rsp)
movq (%r14), %r12
movl 0x4(%r12,%rbx), %eax
imull (%r12,%rbx), %eax
testl %eax, %eax
jle 0x13462
movl %edi, 0xc(%rsp)
movq %rsi, 0x58(%rsp)
movl %edx, 0x68(%rsp)
movswl 0x8(%r12,%rbx), %r13d
movswl 0xa(%r12,%rbx), %r15d
cmpb $0x0, 0x13(%rsp)
je 0x1338d
movl %r13d, %eax
subl 0x18(%rsp), %eax
movslq %eax, %rsi
movq 0x50(%rsp), %r14
movq %r14, %rdi
movl $0x1, %edx
callq 0x12233
movl %r15d, %eax
subl %r13d, %eax
movslq %eax, %rsi
movq %r14, %rdi
movl $0x1, %edx
callq 0x12233
xorl %r14d, %r14d
cmpw %r15w, %r13w
movq %r15, %rsi
sete %r15b
movl %r13d, %ebp
movl %r13d, %edi
movq %rsi, %r13
movq 0x70(%rsp), %rdx
callq 0x11273
testb %al, %al
je 0x13a27
movb %r15b, %r14b
addl %r14d, 0x28(%rsp)
movl %r13d, %eax
orw %bp, %ax
je 0x13451
movslq 0x10(%r12,%rbx), %rsi
movq 0x50(%rsp), %rdi
movl $0x1, %edx
callq 0x12233
movl (%r12,%rbx), %edx
movl 0x4(%r12,%rbx), %ecx
movl 0x10(%r12,%rbx), %eax
movq %rax, 0x68(%rsp)
movl 0x14(%r12,%rbx), %r11d
movl 0x18(%r12,%rbx), %r14d
movl 0x1c(%r12,%rbx), %r15d
movl 0x20(%r12,%rbx), %r10d
subq $0x8, %rsp
movl $0x6, %edi
leaq 0x136a5(%rip), %rsi     # 0x26aba
movl 0x14(%rsp), %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r10
pushq %r15
pushq %r14
pushq %r11
pushq 0x90(%rsp)
pushq 0xa0(%rsp)
pushq %r13
callq 0x1cede
addq $0x40, %rsp
movzwl 0x8(%r12,%rbx), %eax
testw %ax, %ax
jle 0x13486
movw %ax, 0xc(%r12,%rbx)
movq 0x4170(%rsp), %r14
movq 0x58(%rsp), %rsi
movl 0xc(%rsp), %edi
cmpq 0x80(%rsp), %rsi
leaq 0x1(%rsi), %rsi
setge %dl
incl %edi
addq $0x40, %rbx
cmpl %edi, 0x78(%rsp)
jne 0x13326
jmp 0x131f8
movzwl 0xa(%r12,%rbx), %eax
testw %ax, %ax
movq 0x4170(%rsp), %r14
movq 0x58(%rsp), %rsi
js 0x134a8
movw $0x0, 0xc(%r12,%rbx)
jmp 0x1345e
movw %ax, 0xc(%r12,%rbx)
jmp 0x1345e
movl $0x1, %esi
subl %eax, %esi
jmp 0x131bb
xorl %r12d, %r12d
movq %r12, %rax
shlq $0x7, %rax
xorl %edx, %edx
divq %r14
cmpl $0x2, %eax
movl $0x1, %ecx
cmovll %ecx, %eax
cmpl $0x7f, %eax
movl $0x7f, %r13d
cmovll %eax, %r13d
movq 0x50(%rsp), %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x12233
shll $0x5, %r13d
leaq 0x13624(%rip), %rsi     # 0x26b24
movl $0x5, %edi
movq %r12, %rdx
movq %r14, %rcx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x1cede
movq 0x20(%rsp), %rbx
movl 0x14(%rsp), %ebp
movq 0x4170(%rsp), %r14
movq 0xb8(%rsp), %r15
movq 0x50(%rsp), %r12
leaq 0x30(%rsp), %rsi
movq %r12, (%rsi)
movq $0x1000000, 0x8(%rsi)   # imm = 0x1000000
movq $0x0, 0x10(%rsi)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x18(%rsi)
leaq 0x100(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
movl $0x2, %ecx
movl $0xd79435e, %r8d        # imm = 0xD79435E
callq 0x1b2c8
leaq 0x100(%rsp), %rdi
movq %r15, %rsi
callq 0x1b3c6
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x135a1
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x135be
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x60(%rsp), %rcx
movl 0x14(%rcx), %eax
movl 0x18(%rcx), %r10d
movzwl %r13w, %r8d
leaq 0x100(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movq %r15, %rcx
movl $0x15550, %r9d          # imm = 0x15550
pushq %r10
pushq %rax
callq 0x1b46a
addq $0x10, %rsp
movq 0xa8(%rsp), %rsi
subq 0xa0(%rsp), %rsi
sarq $0x3, %rsi
leaq 0x88(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
callq 0x189c6
cmpl %ebp, %ebx
jl 0x138d6
movslq 0x14(%rsp), %rax
incl %ebx
leaq 0x88(%rsp), %r15
movq %rbx, 0x20(%rsp)
movq (%r14), %rbp
movq %rax, %rcx
shlq $0x6, %rcx
movswl 0x20(%rbp,%rcx), %edx
movswl 0x22(%rbp,%rcx), %esi
movl %edx, 0xc(%rsp)
movl %esi, 0x58(%rsp)
cmpw %si, %dx
je 0x138cb
movq %rax, 0x28(%rsp)
movq 0x90(%rsp), %rbx
subq 0x88(%rsp), %rbx
movq %rcx, 0x78(%rsp)
addq %rcx, %rbp
shrq $0x2, %rbx
addl $-0xd, %ebx
movl 0x18(%rbp), %r14d
movl %ebx, %eax
imull %r14d, %eax
movslq %eax, %rsi
movw $0x0, 0x1c(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x1c(%rsp), %rdx
leaq 0x1f(%rsp), %rcx
callq 0xe282
movl %ebx, 0xd8(%rsp)
movl %r14d, 0xdc(%rsp)
movl $0x0, 0xe0(%rsp)
movl $0x1, 0xe8(%rsp)
leaq 0xec(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movl $0xffffffff, 0xfc(%rsp) # imm = 0xFFFFFFFF
movw $0x0, 0xe4(%rsp)
cmpl $0x0, 0x1c(%rbp)
jle 0x1389c
leaq 0x24(%rbp), %rax
movq %rax, 0x80(%rsp)
xorl %ebx, %ebx
movq %rbp, %rdi
movl %ebx, %esi
movq 0x4170(%rsp), %rdx
movl 0x14(%rsp), %ecx
movq 0x60(%rsp), %r8
leaq 0xc0(%rsp), %r9
callq 0x10bd6
cmpl $0x0, 0x18(%rbp)
jle 0x13891
xorl %r14d, %r14d
movl 0xd8(%rsp), %esi
movl $0x0, %r9d
testl %esi, %esi
jle 0x137a4
movq 0xc0(%rsp), %rax
movq 0x88(%rsp), %rcx
movslq %r14d, %rdx
xorl %r9d, %r9d
imull %r14d, %esi
movslq %esi, %rsi
addq %r9, %rsi
movswl (%rax,%rsi,2), %esi
movl %esi, (%rcx,%r9,4)
movslq 0xd8(%rsp), %rsi
imulq %rdx, %rsi
addq %r9, %rsi
movswl 0x2(%rax,%rsi,2), %esi
movl %esi, 0x4(%rcx,%r9,4)
addq $0x2, %r9
movslq 0xd8(%rsp), %rsi
cmpq %rsi, %r9
jl 0x13768
movq %r15, %rdi
movq %rbp, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq 0x70(%rsp), %r8
callq 0x5019
movl 0x18(%rbp), %ecx
imull %ebx, %ecx
addl %r14d, %ecx
movslq %ecx, %rcx
movq (%rbp), %rdx
movq 0x8(%rbp), %rsi
subq %rdx, %rsi
sarq %rsi
cmpq %rcx, %rsi
leaq (%rdx,%rcx,2), %rcx
cmovbeq 0x80(%rsp), %rcx
movzwl (%rcx), %ecx
subl %eax, %ecx
cwtl
movq %r15, %rsi
movl 0xc(%rsp), %r15d
subl %eax, %r15d
movl 0x58(%rsp), %r12d
subl %eax, %r12d
movswl %cx, %r13d
movq 0x60(%rsp), %rax
cmpb $0x1, 0x24(%rax)
jne 0x13866
leaq 0x100(%rsp), %rdi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x1b540
movq 0x60(%rsp), %rcx
movq 0x40(%rcx), %rcx
movq 0x78(%rsp), %rdx
addq %rdx, %rcx
addq $0x24, %rcx
movl -0xc(%rcx), %edx
imull %ebx, %edx
addl %r14d, %edx
movslq %edx, %rdx
movq -0x24(%rcx), %rsi
movq -0x1c(%rcx), %rdi
subq %rsi, %rdi
sarq %rdi
cmpq %rdx, %rdi
leaq (%rsi,%rdx,2), %rdx
cmovbeq %rcx, %rdx
movw %ax, (%rdx)
leaq 0x88(%rsp), %rsi
leaq 0x100(%rsp), %rdi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x1b5d8
incl %r14d
cmpl 0x18(%rbp), %r14d
leaq 0x88(%rsp), %r15
jl 0x13741
incl %ebx
cmpl 0x1c(%rbp), %ebx
jl 0x13711
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
movq 0x4170(%rsp), %r14
je 0x138c1
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rax
incq %rax
cmpl %eax, %ebx
jne 0x1363d
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x138f3
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x4118(%rsp), %rdi
testq %rdi, %rdi
je 0x13910
movq 0x4128(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movl $0xffff, %ecx           # imm = 0xFFFF
movq 0x40(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movl 0x48(%rsp), %esi
movq %rax, %rbx
shrq $0x10, %rbx
testl %esi, %esi
js 0x1399a
addq %rax, %rcx
cmpq $0xffffff, %rcx         # imm = 0xFFFFFF
ja 0x1396a
movq 0x30(%rsp), %rdi
callq 0x14526
cmpl $0x0, 0x4c(%rsp)
je 0x1399a
movq 0x30(%rsp), %rdi
movl $0xff, %esi
callq 0x14526
decl 0x4c(%rsp)
jne 0x13953
jmp 0x1399a
cmpq $0x1000000, %rax        # imm = 0x1000000
jb 0x139cc
movq 0x30(%rsp), %rdi
incl %esi
callq 0x14526
cmpl $0x0, 0x4c(%rsp)
je 0x13997
movq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x14526
decl 0x4c(%rsp)
jne 0x13985
movzbl %bl, %ebx
movl %ebx, 0x48(%rsp)
movl 0x40(%rsp), %eax
movzwl %ax, %eax
shll $0x8, %eax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rcx
shlq $0x8, %rcx
movq %rcx, 0x38(%rsp)
movl %ebx, %esi
cmpq $0x10001, %rcx          # imm = 0x10001
jb 0x1392b
jmp 0x139d4
incl 0x4c(%rsp)
movl %esi, %ebx
jmp 0x1399e
leaq 0x30(%rsp), %rdi
movq $0xffff, 0x8(%rdi)      # imm = 0xFFFF
callq 0x18788
leaq 0x30(%rsp), %rdi
movq $0xffff, 0x8(%rdi)      # imm = 0xFFFF
callq 0x18788
leaq 0x30(%rsp), %rdi
movq $0xffff, 0x8(%rdi)      # imm = 0xFFFF
callq 0x18788
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x13a27
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movl 0x68(%rsp), %eax
andb $0x1, %al
addq $0x4138, %rsp           # imm = 0x4138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13a69
movq %rax, %rbx
jmp 0x13aad
jmp 0x13a69
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x1b43a
jmp 0x13aca
jmp 0x13a69
jmp 0x13a69
jmp 0x13a69
movq %rax, %rbx
jmp 0x13a90
jmp 0x13a69
jmp 0x13a69
movq %rax, %rbx
jmp 0x13aca
jmp 0x13a70
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x13a90
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x13aad
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0x4118(%rsp), %rdi
testq %rdi, %rdi
je 0x13aca
movq 0x4128(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x13ae7
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3590
nop