// File: /workspace/github_c_makefile_star2_O3/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), %r15
movabsq $-0x1c71c71c71c71c71, %rcx # imm = 0xE38E38E38E38E38F
movq %r15, %rax
mulq %rcx
shrq $0x3, %rdx
andq $-0x20, %rdx
leaq (%rdx,%rdx,8), %rax
movq %rax, 0x8(%rsp)
cmpq %rax, %r15
jne 0x11b08
movq %r15, %r12
shlq $0x4, %r12
xorl %r13d, %r13d
movq %r15, %r14
leaq -0x1(%r14), %rax
testq %rax, %r14
jne 0x11acf
testq %r14, %r14
je 0x11ad5
movq 0x38(%rbx), %rdi
leaq (%r12,%r13), %rsi
callq 0x3440
jmp 0x11adf
movq 0x38(%rbx), %rax
jmp 0x11ae3
movl $0x8, %edi
callq 0x33e0
movq %rax, 0x38(%rbx)
testq %r15, %r15
je 0x11af2
movq -0x900(%rax,%r14,8), %rcx
jmp 0x11af4
xorl %ecx, %ecx
movq %rcx, (%rax,%r14,8)
incq %r14
addq $0x10, %r13
cmpq $0x1200, %r13           # imm = 0x1200
jne 0x11ab2
testb $0x1f, %r15b
jne 0x11b72
movq %r15, %r14
shlq $0x4, %r14
xorl %r13d, %r13d
movq %r15, %r12
leaq -0x1(%r12), %rax
testq %rax, %r12
jne 0x11b39
testq %r12, %r12
je 0x11b3f
movq 0x40(%rbx), %rdi
leaq (%r14,%r13), %rsi
callq 0x3440
jmp 0x11b49
movq 0x40(%rbx), %rax
jmp 0x11b4d
movl $0x8, %edi
callq 0x33e0
movq %rax, 0x40(%rbx)
testq %r15, %r15
je 0x11b5c
movq -0x100(%rax,%r12,8), %rcx
jmp 0x11b5e
xorl %ecx, %ecx
movq %rcx, (%rax,%r12,8)
incq %r12
addq $0x10, %r13
cmpq $0x200, %r13            # imm = 0x200
jne 0x11b1b
movq 0x10(%rbx), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x11b96
testq %rsi, %rsi
je 0x11ba0
movq (%rbx), %rdi
shlq $0x2, %rsi
callq 0x3440
movq 0x10(%rbx), %rsi
jmp 0x11bac
movq (%rbx), %rax
movl 0x4(%rsp), %r14d
jmp 0x11bb4
movl $0x2, %edi
callq 0x33e0
xorl %esi, %esi
movl 0x4(%rsp), %r14d
movq %rax, (%rbx)
movw %r14w, (%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, %r13 # imm = 0x101010101010101
imulq %rax, %r13
shrq $0x38, %r13
cmpq $0x1, %r13
ja 0x11c5b
testq %r15, %r15
je 0x11c71
movq 0x8(%rbx), %rdi
leaq (,%r15,4), %rsi
callq 0x3440
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rcx
movw %bp, (%rax,%rcx,2)
movq %r15, 0x10(%rbx)
movq 0x20(%rbx), %rdi
movq %r15, %rsi
shlq $0x4, %rsi
callq 0x3440
movq 0x10(%rbx), %rcx
jmp 0x11c96
movq 0x8(%rbx), %rax
movw %bp, (%rax,%r15,2)
movq %r15, 0x10(%rbx)
movq 0x20(%rbx), %rax
movq %r15, %rcx
jmp 0x11c9a
movl $0x2, %edi
callq 0x33e0
movq %rax, 0x8(%rbx)
movw %bp, (%rax)
movq $0x0, 0x10(%rbx)
movl $0x8, %edi
callq 0x33e0
xorl %ecx, %ecx
movq %rax, 0x20(%rbx)
movq 0x10(%rsp), %rdx
movq %rdx, (%rax,%rcx,8)
incq 0x10(%rbx)
movzwl %r14w, %r12d
cmpl $0x103, %r12d           # imm = 0x103
jae 0x11e51
movq %r15, 0x10(%rbx)
testw %bp, %bp
je 0x11cf0
movq %r15, %r14
andq $-0x20, %r14
movzwl %bp, %ebp
cmpl $0x1, %r13d
ja 0x11d3a
testq %r15, %r15
je 0x11d66
movq 0x28(%rbx), %rdi
leaq (,%r15,4), %rsi
callq 0x3440
jmp 0x11d70
cmpl $0x1, %r13d
ja 0x11d54
testq %r15, %r15
je 0x11dfd
movq 0x28(%rbx), %rdi
movl %r14d, %ebp
movq %r15, %r14
shlq $0x2, %r14
movq %r14, %rsi
callq 0x3440
movq %rax, 0x28(%rbx)
movq 0x10(%rbx), %rcx
movw %bp, (%rax,%rcx,2)
movq %r15, 0x10(%rbx)
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x3440
movq 0x10(%rbx), %r15
jmp 0x11e1c
movl %r12d, %edi
callq 0x14f25
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
movq %r15, 0x10(%rbx)
jmp 0x11db1
movq 0x28(%rbx), %rax
movw %r14w, (%rax,%r15,2)
movq 0x30(%rbx), %rax
jmp 0x11e20
movl $0x2, %edi
callq 0x33e0
movq %rax, 0x28(%rbx)
movl %r12d, %edi
callq 0x14f25
movq 0x10(%rbx), %rcx
movq 0x28(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
movq %r15, 0x10(%rbx)
testq %r15, %r15
je 0x11da3
movq 0x30(%rbx), %rdi
shlq $0x2, %r15
movq %r15, %rsi
callq 0x3440
jmp 0x11dad
movl $0x2, %edi
callq 0x33e0
movq %rax, 0x30(%rbx)
movl %ebp, %edi
callq 0x14ee4
movq 0x10(%rbx), %rcx
movq 0x30(%rbx), %rdx
movw %ax, (%rdx,%rcx,2)
incq %rcx
movq %rcx, 0x10(%rbx)
movq 0x8(%rsp), %r15
shlq $0x3, %r15
addq 0x38(%rbx), %r15
movl %r12d, %edi
callq 0x14f25
cltq
incq (%r15,%rax,8)
shlq $0x3, %r14
addq 0x40(%rbx), %r14
movl %ebp, %edi
callq 0x14ee4
cltq
leaq (%r14,%rax,8), %rax
jmp 0x11e3f
movl $0x2, %edi
callq 0x33e0
movq %rax, 0x28(%rbx)
movw %r14w, (%rax)
movl $0x2, %edi
callq 0x33e0
xorl %r15d, %r15d
movq %rax, 0x30(%rbx)
movw $0x0, (%rax,%r15,2)
incq %r15
movq %r15, 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 0x552b(%rip), %rdi      # 0x17383
leaq 0x5531(%rip), %rsi      # 0x17390
leaq 0x5543(%rip), %rcx      # 0x173a9
movl $0x83, %edx
callq 0x3220