// File: /workspace/github_c_makefile_star2_O0/madler[P]pigz/zopfli/src/zopfli/lz77.c
// Function: ZopfliCopyLZ77Store
void ZopfliCopyLZ77Store(
    const ZopfliLZ77Store* source, ZopfliLZ77Store* dest) {
  size_t i;
  size_t llsize = ZOPFLI_NUM_LL * CeilDiv(source->size, ZOPFLI_NUM_LL);
  size_t dsize = ZOPFLI_NUM_D * CeilDiv(source->size, ZOPFLI_NUM_D);
  ZopfliCleanLZ77Store(dest);
  ZopfliInitLZ77Store(source->data, dest);
  dest->litlens =
      (unsigned short*)malloc(sizeof(*dest->litlens) * source->size);
  dest->dists = (unsigned short*)malloc(sizeof(*dest->dists) * source->size);
  dest->pos = (size_t*)malloc(sizeof(*dest->pos) * source->size);
  dest->ll_symbol =
      (unsigned short*)malloc(sizeof(*dest->ll_symbol) * source->size);
  dest->d_symbol =
      (unsigned short*)malloc(sizeof(*dest->d_symbol) * source->size);
  dest->ll_counts = (size_t*)malloc(sizeof(*dest->ll_counts) * llsize);
  dest->d_counts = (size_t*)malloc(sizeof(*dest->d_counts) * dsize);

  /* Allocation failed. */
  if (!dest->litlens || !dest->dists) exit(-1);
  if (!dest->pos) exit(-1);
  if (!dest->ll_symbol || !dest->d_symbol) exit(-1);
  if (!dest->ll_counts || !dest->d_counts) exit(-1);

  dest->size = source->size;
  for (i = 0; i < source->size; i++) {
    dest->litlens[i] = source->litlens[i];
    dest->dists[i] = source->dists[i];
    dest->pos[i] = source->pos[i];
    dest->ll_symbol[i] = source->ll_symbol[i];
    dest->d_symbol[i] = source->d_symbol[i];
  }
  for (i = 0; i < llsize; i++) {
    dest->ll_counts[i] = source->ll_counts[i];
  }
  for (i = 0; i < dsize; i++) {
    dest->d_counts[i] = source->d_counts[i];
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x16f20
imulq $0x120, %rax, %rax      # imm = 0x120
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x20, %esi
callq 0x16f20
shlq $0x5, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x16bc0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x16b40
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
shlq $0x3, %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rdi
shlq $0x3, %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rdi
shlq $0x3, %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x16d5d
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x16d67
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3540
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x16d7c
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3540
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x16d92
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x16d9c
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3540
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x16db2
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x16dbc
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3540
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x16e95
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16dd4
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x16ed5
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16e9d
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x16f15
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16edd
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)