// File: /workspace/github_c_makefile_star2_O1/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliStoreLitLenDist
void ZopfliStoreLitLenDist(unsigned short length, unsigned short dist,
                           size_t pos, ZopfliLZ77Store* store) {
  size_t i;
  /* Needed for using ZOPFLI_APPEND_DATA multiple times. */
  size_t origsize = store->size;
  size_t llstart = ZOPFLI_NUM_LL * (origsize / ZOPFLI_NUM_LL);
  size_t dstart = ZOPFLI_NUM_D * (origsize / ZOPFLI_NUM_D);

  /* Everytime the index wraps around, a new cumulative histogram is made: we're
  keeping one histogram value per LZ77 symbol rather than a full histogram for
  each to save memory. */
  if (origsize % ZOPFLI_NUM_LL == 0) {
    size_t llsize = origsize;
    for (i = 0; i < ZOPFLI_NUM_LL; i++) {
      ZOPFLI_APPEND_DATA(
          origsize == 0 ? 0 : store->ll_counts[origsize - ZOPFLI_NUM_LL + i],
          &store->ll_counts, &llsize);
    }
  }
  if (origsize % ZOPFLI_NUM_D == 0) {
    size_t dsize = origsize;
    for (i = 0; i < ZOPFLI_NUM_D; i++) {
      ZOPFLI_APPEND_DATA(
          origsize == 0 ? 0 : store->d_counts[origsize - ZOPFLI_NUM_D + i],
          &store->d_counts, &dsize);
    }
  }

  ZOPFLI_APPEND_DATA(length, &store->litlens, &store->size);
  store->size = origsize;
  ZOPFLI_APPEND_DATA(dist, &store->dists, &store->size);
  store->size = origsize;
  ZOPFLI_APPEND_DATA(pos, &store->pos, &store->size);
  assert(length < 259);

  if (dist == 0) {
    store->size = origsize;
    ZOPFLI_APPEND_DATA(length, &store->ll_symbol, &store->size);
    store->size = origsize;
    ZOPFLI_APPEND_DATA(0, &store->d_symbol, &store->size);
    store->ll_counts[llstart + length]++;
  } else {
    store->size = origsize;
    ZOPFLI_APPEND_DATA(ZopfliGetLengthSymbol(length),
                       &store->ll_symbol, &store->size);
    store->size = origsize;
    ZOPFLI_APPEND_DATA(ZopfliGetDistSymbol(dist),
                       &store->d_symbol, &store->size);
    store->ll_counts[llstart + ZopfliGetLengthSymbol(length)]++;
    store->d_counts[dstart + ZopfliGetDistSymbol(dist)]++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movl %esi, %ebp
movl %edi, 0x4(%rsp)
movq 0x10(%rcx), %r14
movabsq $-0x1c71c71c71c71c71, %rcx # imm = 0xE38E38E38E38E38F
movq %r14, %rax
mulq %rcx
shrq $0x3, %rdx
andq $-0x20, %rdx
leaq (%rdx,%rdx,8), %rax
movq %rax, 0x8(%rsp)
cmpq %rax, %r14
jne 0x115c9
leaq (,%r14,8), %r15
movq %r14, %r13
shlq $0x4, %r13
xorl %r12d, %r12d
leaq (%r14,%r12), %rax
leaq (%r14,%r12), %rcx
decq %rcx
testq %rcx, %rax
jne 0x11596
testq %rax, %rax
je 0x11588
movq 0x38(%rbx), %rdi
movq %r13, %rsi
callq 0x3430
jmp 0x11592
movl $0x8, %edi
callq 0x33d0
movq %rax, 0x38(%rbx)
testq %r14, %r14
je 0x115ac
movq 0x38(%rbx), %rax
addq %r15, %rax
movq -0x900(%rax,%r12,8), %rax
jmp 0x115ae
xorl %eax, %eax
movq 0x38(%rbx), %rcx
addq %r15, %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
addq $0x10, %r13
cmpq $0x120, %r12            # imm = 0x120
jne 0x11565
testb $0x1f, %r14b
jne 0x11642
leaq (,%r14,8), %r15
movq %r14, %r13
shlq $0x4, %r13
xorl %r12d, %r12d
leaq (%r14,%r12), %rax
leaq (%r14,%r12), %rcx
decq %rcx
testq %rcx, %rax
jne 0x11612
testq %rax, %rax
je 0x11604
movq 0x40(%rbx), %rdi
movq %r13, %rsi
callq 0x3430
jmp 0x1160e
movl $0x8, %edi
callq 0x33d0
movq %rax, 0x40(%rbx)
testq %r14, %r14
je 0x11628
movq 0x40(%rbx), %rax
addq %r15, %rax
movq -0x100(%rax,%r12,8), %rax
jmp 0x1162a
xorl %eax, %eax
movq 0x40(%rbx), %rcx
addq %r15, %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
addq $0x10, %r13
cmpq $0x20, %r12
jne 0x115e1
movq 0x10(%rbx), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
movl 0x4(%rsp), %r13d
jne 0x11674
testq %rsi, %rsi
je 0x11667
movq (%rbx), %rdi
shlq $0x2, %rsi
callq 0x3430
jmp 0x11671
movl $0x2, %edi
callq 0x33d0
movq %rax, (%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movw %r13w, (%rax,%rcx,2)
movq %r14, 0x10(%rbx)
movq %r14, %rax
shrq %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
andq %rax, %rcx
movq %r14, %rax
subq %rcx, %rax
movabsq $0x3333333333333333, %rcx # imm = 0x3333333333333333
movq %rax, %rdx
andq %rcx, %rdx
shrq $0x2, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rax, %rcx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %r15 # imm = 0x101010101010101
imulq %rax, %r15
shrq $0x38, %r15
cmpq $0x1, %r15
ja 0x116fe
testq %r14, %r14
je 0x1170d
movq 0x8(%rbx), %rdi
leaq (,%r14,4), %rsi
callq 0x3430
jmp 0x11717
movq 0x8(%rbx), %rax
movw %bp, (%rax,%r14,2)
movq %r14, 0x10(%rbx)
jmp 0x1174c
movl $0x2, %edi
callq 0x33d0
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rcx
movw %bp, (%rax,%rcx,2)
movq %r14, 0x10(%rbx)
testq %r14, %r14
je 0x1173e
movq 0x20(%rbx), %rdi
movq %r14, %rsi
shlq $0x4, %rsi
callq 0x3430
jmp 0x11748
movl $0x8, %edi
callq 0x33d0
movq %rax, 0x20(%rbx)
movq 0x10(%rsp), %rdx
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rdx, (%rcx,%rax,8)
incq 0x10(%rbx)
movzwl %r13w, %r12d
cmpl $0x103, %r12d           # imm = 0x103
jae 0x1190a
movq %r14, 0x10(%rbx)
testw %bp, %bp
je 0x117a3
movq %r14, %r13
andq $-0x20, %r13
movzwl %bp, %ebp
cmpl $0x1, %r15d
ja 0x117c8
testq %r14, %r14
je 0x117f4
movq 0x28(%rbx), %rdi
leaq (,%r14,4), %rsi
callq 0x3430
jmp 0x117fe
cmpl $0x1, %r15d
ja 0x117e2
testq %r14, %r14
je 0x11892
movq 0x28(%rbx), %rdi
leaq (,%r14,4), %rsi
callq 0x3430
jmp 0x1189c
movl %r12d, %edi
callq 0x14249
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
movq %r14, 0x10(%rbx)
jmp 0x1183f
movq 0x28(%rbx), %rax
movw %r13w, (%rax,%r14,2)
movq %r14, 0x10(%rbx)
jmp 0x118d2
movl $0x2, %edi
callq 0x33d0
movq %rax, 0x28(%rbx)
movl %r12d, %edi
callq 0x14249
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
movq %r14, 0x10(%rbx)
testq %r14, %r14
je 0x11831
movq 0x30(%rbx), %rdi
shlq $0x2, %r14
movq %r14, %rsi
callq 0x3430
jmp 0x1183b
movl $0x2, %edi
callq 0x33d0
movq %rax, 0x30(%rbx)
movl %ebp, %edi
callq 0x14208
movq 0x10(%rbx), %rcx
movq 0x30(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
incq %rcx
movq %rcx, 0x10(%rbx)
movq 0x8(%rsp), %r14
shlq $0x3, %r14
addq 0x38(%rbx), %r14
movl %r12d, %edi
callq 0x14249
cltq
incq (%r14,%rax,8)
shlq $0x3, %r13
addq 0x40(%rbx), %r13
movl %ebp, %edi
callq 0x14208
cltq
leaq (,%rax,8), %rax
addq %r13, %rax
jmp 0x118f8
movl $0x2, %edi
callq 0x33d0
movq %rax, 0x28(%rbx)
movq 0x10(%rbx), %rcx
movw %r13w, (%rax,%rcx,2)
movq %r14, 0x10(%rbx)
testq %r14, %r14
je 0x118c4
movq 0x30(%rbx), %rdi
shlq $0x2, %r14
movq %r14, %rsi
callq 0x3430
jmp 0x118ce
movl $0x2, %edi
callq 0x33d0
movq %rax, 0x30(%rbx)
movq 0x10(%rbx), %rax
movq 0x30(%rbx), %rcx
movw $0x0, (%rcx,%rax,2)
incq %rax
movq %rax, 0x10(%rbx)
movq 0x8(%rsp), %rax
shlq $0x3, %rax
addq 0x38(%rbx), %rax
leaq (%rax,%r12,8), %rax
incq (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a32(%rip), %rdi      # 0x17343
leaq 0x5a38(%rip), %rsi      # 0x17350
leaq 0x5a4a(%rip), %rcx      # 0x17369
movl $0x83, %edx
callq 0x3220