// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movl %esi, (%rsp)
movl %edi, 0x4(%rsp)
movq 0x10(%rcx), %r15
movl $0x120, %ecx            # imm = 0x120
movq %r15, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, 0x10(%rsp)
testq %rdx, %rdx
je 0x10ca9
testb $0x1f, %r15b
je 0x10d12
movq 0x10(%rbx), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x10c9d
testq %rsi, %rsi
je 0x10d7d
movq (%rbx), %rdi
shlq $0x2, %rsi
callq 0x3430
movq 0x10(%rbx), %rsi
jmp 0x10d87
movq (%rbx), %rax
movl 0x4(%rsp), %ebp
jmp 0x10d8e
movq %r15, %rbp
shlq $0x4, %rbp
xorl %r13d, %r13d
pushq $0x8
popq %r12
movq %r15, %r14
cmpq $0x1200, %r13           # imm = 0x1200
je 0x10c68
leaq -0x1(%r14), %rax
testq %rax, %r14
jne 0x10ce2
testq %r14, %r14
je 0x10ce8
movq 0x38(%rbx), %rdi
movq %rbp, %rsi
addq %r13, %rsi
callq 0x3430
jmp 0x10cf0
movq 0x38(%rbx), %rax
jmp 0x10cf4
movq %r12, %rdi
callq 0x33d0
movq %rax, 0x38(%rbx)
testq %r15, %r15
je 0x10d03
movq -0x900(%rax,%r14,8), %rcx
jmp 0x10d05
xorl %ecx, %ecx
movq %rcx, (%rax,%r14,8)
incq %r14
addq $0x10, %r13
jmp 0x10cba
movq %r15, %r14
shlq $0x4, %r14
xorl %r13d, %r13d
pushq $0x8
popq %r12
movq %r15, %rbp
cmpq $0x200, %r13            # imm = 0x200
je 0x10c72
leaq -0x1(%rbp), %rax
testq %rax, %rbp
jne 0x10d4d
testq %rbp, %rbp
je 0x10d53
movq 0x40(%rbx), %rdi
leaq (%r14,%r13), %rsi
callq 0x3430
jmp 0x10d5b
movq 0x40(%rbx), %rax
jmp 0x10d5f
movq %r12, %rdi
callq 0x33d0
movq %rax, 0x40(%rbx)
testq %r15, %r15
je 0x10d6e
movq -0x100(%rax,%rbp,8), %rcx
jmp 0x10d70
xorl %ecx, %ecx
movq %rcx, (%rax,%rbp,8)
incq %rbp
addq $0x10, %r13
jmp 0x10d23
pushq $0x2
popq %rdi
callq 0x33d0
xorl %esi, %esi
movl 0x4(%rsp), %ebp
movq %rax, (%rbx)
movw %bp, (%rax,%rsi,2)
movq %r15, 0x10(%rbx)
movq %r15, %rax
shrq %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
andq %rax, %rcx
movq %r15, %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, %r12 # imm = 0x101010101010101
imulq %rax, %r12
shrq $0x38, %r12
cmpq $0x1, %r12
ja 0x10e37
testq %r15, %r15
je 0x10e50
movq 0x8(%rbx), %rdi
leaq (,%r15,4), %rsi
callq 0x3430
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rbx)
movl (%rsp), %edx
movw %dx, (%rax,%rcx,2)
movq %r15, 0x10(%rbx)
movq 0x20(%rbx), %rdi
movq %r15, %rsi
shlq $0x4, %rsi
callq 0x3430
movq 0x10(%rbx), %rcx
jmp 0x10e70
movq 0x8(%rbx), %rax
movl (%rsp), %edx
movw %dx, (%rax,%r15,2)
movq %r15, 0x10(%rbx)
movq 0x20(%rbx), %rax
movq %r15, %rcx
jmp 0x10e77
pushq $0x2
popq %rdi
callq 0x33d0
movq %rax, 0x8(%rbx)
movl (%rsp), %ecx
movw %cx, (%rax)
movq %r15, 0x10(%rbx)
pushq $0x8
popq %rdi
callq 0x33d0
xorl %ecx, %ecx
movq %rax, 0x20(%rbx)
movl (%rsp), %edx
movq 0x8(%rsp), %rsi
movq %rsi, (%rax,%rcx,8)
incq 0x10(%rbx)
cmpw $0x103, %bp             # imm = 0x103
jae 0x11034
movq %r15, %r13
subq 0x10(%rsp), %r13
movzwl %bp, %ecx
movq %r15, 0x10(%rbx)
testw %dx, %dx
je 0x10ed5
movq %r15, %r14
andq $-0x20, %r14
movzwl %dx, %ebp
cmpl $0x1, %r12d
ja 0x10f1f
testq %r15, %r15
movq %rcx, %r12
je 0x10f51
movq 0x28(%rbx), %rdi
leaq (,%r15,4), %rsi
callq 0x3430
jmp 0x10f59
cmpl $0x1, %r12d
ja 0x10f3c
testq %r15, %r15
movq %rcx, %r12
je 0x10fe0
movq 0x28(%rbx), %rdi
movq %r15, %r14
shlq $0x2, %r14
movq %r14, %rsi
callq 0x3430
movq 0x10(%rbx), %rcx
movq %rax, 0x28(%rbx)
movw %bp, (%rax,%rcx,2)
movq %r15, 0x10(%rbx)
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x3430
movq 0x10(%rbx), %r15
jmp 0x10ffe
movq %rcx, %r12
movl %r12d, %edi
callq 0x137a5
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
movq %r15, 0x10(%rbx)
jmp 0x10f98
movq 0x28(%rbx), %rax
movw %bp, (%rax,%r15,2)
movq 0x30(%rbx), %rax
movq %rcx, %r12
jmp 0x11002
pushq $0x2
popq %rdi
callq 0x33d0
movq %rax, 0x28(%rbx)
movl %r12d, %edi
callq 0x137a5
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
movq %r15, 0x10(%rbx)
testq %r15, %r15
je 0x10f8c
movq 0x30(%rbx), %rdi
shlq $0x2, %r15
movq %r15, %rsi
callq 0x3430
jmp 0x10f94
pushq $0x2
popq %rdi
callq 0x33d0
movq %rax, 0x30(%rbx)
movl %ebp, %edi
callq 0x13764
movq 0x10(%rbx), %rcx
movq 0x30(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
incq %rcx
movq %rcx, 0x10(%rbx)
shlq $0x3, %r13
addq 0x38(%rbx), %r13
movl %r12d, %edi
callq 0x137a5
cltq
incq (%r13,%rax,8)
shlq $0x3, %r14
addq 0x40(%rbx), %r14
movl %ebp, %edi
callq 0x13764
cltq
leaq (%r14,%rax,8), %rax
jmp 0x11022
pushq $0x2
popq %r14
movq %r14, %rdi
callq 0x33d0
movq %rax, 0x28(%rbx)
movw %bp, (%rax)
movq %r14, %rdi
callq 0x33d0
xorl %r15d, %r15d
movq %rax, 0x30(%rbx)
andw $0x0, (%rax,%r15,2)
incq %r15
movq %r15, 0x10(%rbx)
shlq $0x3, %r13
addq 0x38(%rbx), %r13
leaq (,%r12,8), %rax
addq %r13, %rax
incq (%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5348(%rip), %rdi      # 0x16383
leaq 0x534e(%rip), %rsi      # 0x16390
leaq 0x5360(%rip), %rcx      # 0x163a9
movl $0x83, %edx
callq 0x3220