LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/cache.c
// Function: ZopfliCacheToSublen
void ZopfliCacheToSublen(const ZopfliLongestMatchCache* lmc,
                         size_t pos, size_t length,
                         unsigned short* sublen) {
  size_t i, j;
  unsigned maxlength = ZopfliMaxCachedSublen(lmc, pos, length);
  unsigned prevlength = 0;
  unsigned char* cache;
#if ZOPFLI_CACHE_LENGTH == 0
  return;
#endif
  if (length < 3) return;
  cache = &lmc->sublen[ZOPFLI_CACHE_LENGTH * pos * 3];
  for (j = 0; j < ZOPFLI_CACHE_LENGTH; j++) {
    unsigned length = cache[j * 3] + 3;
    unsigned dist = cache[j * 3 + 1] + 256 * cache[j * 3 + 2];
    for (i = prevlength; i <= length; i++) {
      sublen[i] = dist;
    }
    if (length == maxlength) break;
    prevlength = length + 1;
  }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x25f0
movl %eax, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
cmpq $0x3, 0x30(%rsp)
jae 0x26a5
jmp 0x277b
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x38(%rsp), %rcx
shlq $0x3, %rcx
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x8, 0x18(%rsp)
jae 0x277b
movq 0x8(%rsp), %rax
imulq $0x3, 0x18(%rsp), %rcx
movzbl (%rax,%rcx), %eax
addl $0x3, %eax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rax
imulq $0x3, 0x18(%rsp), %rcx
movzbl 0x1(%rax,%rcx), %eax
movq 0x8(%rsp), %rcx
imulq $0x3, 0x18(%rsp), %rdx
movzbl 0x2(%rcx,%rdx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movl %eax, (%rsp)
movl 0x10(%rsp), %eax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl 0x4(%rsp), %ecx
cmpq %rcx, %rax
ja 0x2751
movl (%rsp), %eax
movw %ax, %dx
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x271f
movl 0x4(%rsp), %eax
cmpl 0x14(%rsp), %eax
jne 0x275d
jmp 0x277b
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x26cc
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: ZopfliCalculateBlockSize
double ZopfliCalculateBlockSize(const unsigned short* litlens,
                                const unsigned short* dists,
                                size_t lstart, size_t lend, int btype) {
  size_t ll_counts[288];
  size_t d_counts[32];

  unsigned ll_lengths[288];
  unsigned d_lengths[32];

  double result = 3; /*bfinal and btype bits*/

  assert(btype == 1 || btype == 2); /* This is not for uncompressed blocks. */

  if(btype == 1) {
    GetFixedTree(ll_lengths, d_lengths);
  } else {
    ZopfliLZ77Counts(litlens, dists, lstart, lend, ll_counts, d_counts);
    ZopfliCalculateBitLengths(ll_counts, 288, 15, ll_lengths);
    ZopfliCalculateBitLengths(d_counts, 32, 15, d_lengths);
    PatchDistanceCodesForBuggyDecoders(d_lengths);
    result += CalculateTreeSize(ll_lengths, d_lengths, ll_counts, d_counts);
  }

  result += CalculateBlockSymbolSize(
      ll_lengths, d_lengths, litlens, dists, lstart, lend);

  return result;
}

// Assembly:
subq $0xf58, %rsp            # imm = 0xF58
movq %rdi, 0xf50(%rsp)
movq %rsi, 0xf48(%rsp)
movq %rdx, 0xf40(%rsp)
movq %rcx, 0xf38(%rsp)
movl %r8d, 0xf34(%rsp)
movsd 0xaaf9(%rip), %xmm0     # 0xd2b0
movsd %xmm0, 0x28(%rsp)
cmpl $0x1, 0xf34(%rsp)
je 0x27d1
cmpl $0x2, 0xf34(%rsp)
jne 0x27d3
jmp 0x27f2
leaq 0xab06(%rip), %rdi      # 0xd2e0
leaq 0xab18(%rip), %rsi      # 0xd2f9
movl $0x144, %edx            # imm = 0x144
leaq 0xab16(%rip), %rcx      # 0xd303
callq 0x10b0
cmpl $0x1, 0xf34(%rsp)
jne 0x2813
leaq 0xb0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2960
jmp 0x28ea
movq 0xf50(%rsp), %rdi
movq 0xf48(%rsp), %rsi
movq 0xf40(%rsp), %rdx
movq 0xf38(%rsp), %rcx
leaq 0x630(%rsp), %r8
movq %r8, 0x18(%rsp)
leaq 0x530(%rsp), %r9
movq %r9, 0x20(%rsp)
callq 0x9140
movq 0x18(%rsp), %rdi
movl $0x120, %esi            # imm = 0x120
movl $0xf, %edx
movl %edx, 0x4(%rsp)
leaq 0xb0(%rsp), %rcx
movq %rcx, 0x8(%rsp)
callq 0xb2f0
movl 0x4(%rsp), %edx
movq 0x20(%rsp), %rdi
movl $0x20, %esi
leaq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
callq 0xb2f0
movq 0x10(%rsp), %rdi
callq 0x2a80
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x2b20
movq %rax, %xmm0
movaps 0xa9fd(%rip), %xmm1     # 0xd2c0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xaa01(%rip), %xmm1     # 0xd2d0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0xf50(%rsp), %rdx
movq 0xf48(%rsp), %rcx
movq 0xf40(%rsp), %r8
movq 0xf38(%rsp), %r9
leaq 0xb0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2ba0
movq %rax, %xmm0
movaps 0xa998(%rip), %xmm1     # 0xd2c0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xa99c(%rip), %xmm1     # 0xd2d0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
addq $0xf58, %rsp            # imm = 0xF58
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: GetFixedTree
static void GetFixedTree(unsigned* ll_lengths, unsigned* d_lengths) {
  size_t i;
  for (i = 0; i < 144; i++) ll_lengths[i] = 8;
  for (i = 144; i < 256; i++) ll_lengths[i] = 9;
  for (i = 256; i < 280; i++) ll_lengths[i] = 7;
  for (i = 280; i < 288; i++) ll_lengths[i] = 8;
  for (i = 0; i < 32; i++) d_lengths[i] = 5;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq $0x0, -0x18(%rsp)
cmpq $0x90, -0x18(%rsp)
jae 0x299f
movq -0x8(%rsp), %rax
movq -0x18(%rsp), %rcx
movl $0x8, (%rax,%rcx,4)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0x2973
movq $0x90, -0x18(%rsp)
cmpq $0x100, -0x18(%rsp)     # imm = 0x100
jae 0x29d4
movq -0x8(%rsp), %rax
movq -0x18(%rsp), %rcx
movl $0x9, (%rax,%rcx,4)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0x29a8
movq $0x100, -0x18(%rsp)     # imm = 0x100
cmpq $0x118, -0x18(%rsp)     # imm = 0x118
jae 0x2a09
movq -0x8(%rsp), %rax
movq -0x18(%rsp), %rcx
movl $0x7, (%rax,%rcx,4)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0x29dd
movq $0x118, -0x18(%rsp)     # imm = 0x118
cmpq $0x120, -0x18(%rsp)     # imm = 0x120
jae 0x2a3e
movq -0x8(%rsp), %rax
movq -0x18(%rsp), %rcx
movl $0x8, (%rax,%rcx,4)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0x2a12
movq $0x0, -0x18(%rsp)
cmpq $0x20, -0x18(%rsp)
jae 0x2a70
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movl $0x5, (%rax,%rcx,4)
movq -0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0x2a47
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: PatchDistanceCodesForBuggyDecoders
static void PatchDistanceCodesForBuggyDecoders(unsigned* d_lengths) {
  int num_dist_codes = 0; /* Amount of non-zero distance codes */
  int i;
  for (i = 0; i < 30 /* Ignore the two unused codes from the spec */; i++) {
    if (d_lengths[i]) num_dist_codes++;
    if (num_dist_codes >= 2) return; /* Two or more codes is fine. */
  }

  if (num_dist_codes == 0) {
    d_lengths[0] = d_lengths[1] = 1;
  } else if (num_dist_codes == 1) {
    d_lengths[d_lengths[0] ? 1 : 0] = 1;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0xc(%rsp)
movl $0x0, -0x10(%rsp)
cmpl $0x1e, -0x10(%rsp)
jge 0x2acf
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x2ab7
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
cmpl $0x2, -0xc(%rsp)
jl 0x2ac0
jmp 0x2b1b
jmp 0x2ac2
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x2a95
cmpl $0x0, -0xc(%rsp)
jne 0x2aef
movq -0x8(%rsp), %rax
movl $0x1, 0x4(%rax)
movq -0x8(%rsp), %rax
movl $0x1, (%rax)
jmp 0x2b1b
cmpl $0x1, -0xc(%rsp)
jne 0x2b19
movq -0x8(%rsp), %rax
movq -0x8(%rsp), %rcx
movl (%rcx), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x2b1b
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: CalculateTreeSize
static size_t CalculateTreeSize(const unsigned* ll_lengths,
                                const unsigned* d_lengths,
                                size_t* ll_counts, size_t* d_counts) {
  unsigned char* dummy = 0;
  size_t dummysize = 0;
  unsigned char bp = 0;

  (void)ll_counts;
  (void)d_counts;

  AddDynamicTree(ll_lengths, d_lengths, &bp, &dummy, &dummysize);
  free(dummy);

  return dummysize * 8 + (bp & 7);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x7(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x35e0
movq 0x10(%rsp), %rdi
callq 0x1030
movq 0x8(%rsp), %rax
shlq $0x3, %rax
movzbl 0x7(%rsp), %ecx
andl $0x7, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: CalculateBlockSymbolSize
static size_t CalculateBlockSymbolSize(const unsigned* ll_lengths,
                                       const unsigned* d_lengths,
                                       const unsigned short* litlens,
                                       const unsigned short* dists,
                                       size_t lstart, size_t lend) {
  size_t result = 0;
  size_t i;
  for (i = lstart; i < lend; i++) {
    if (dists[i] == 0) {
      result += ll_lengths[litlens[i]];
    } else {
      result += ll_lengths[ZopfliGetLengthSymbol(litlens[i])];
      result += d_lengths[ZopfliGetDistSymbol(dists[i])];
      result += ZopfliGetLengthExtraBits(litlens[i]);
      result += ZopfliGetDistExtraBits(dists[i]);
    }
  }
  result += ll_lengths[256]; /*end symbol*/
  return result;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movq %r9, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x2cd8
movq 0x38(%rsp), %rax
movq 0x18(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x2c1d
movq 0x50(%rsp), %rax
movq 0x40(%rsp), %rcx
movq 0x18(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movl (%rax,%rcx,4), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x2cc3
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb4a0
movl %eax, %ecx
movq 0x8(%rsp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb400
movl %eax, %ecx
movq 0x10(%rsp), %rax
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq 0x18(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb460
cltq
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb360
cltq
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x2cc5
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2bd5
movq 0x50(%rsp), %rax
movl 0x400(%rax), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x58, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: ZopfliDeflatePart
void ZopfliDeflatePart(const ZopfliOptions* options, int btype, int final,
                       const unsigned char* in, size_t instart, size_t inend,
                       unsigned char* bp, unsigned char** out,
                       size_t* outsize) {
  if (options->blocksplitting) {
    if (options->blocksplittinglast) {
      DeflateSplittingLast(options, btype, final, in, instart, inend,
                           bp, out, outsize);
    } else {
      DeflateSplittingFirst(options, btype, final, in, instart, inend,
                            bp, out, outsize);
    }
  } else {
    DeflateBlock(options, btype, final, in, instart, inend, bp, out, outsize);
  }
}

// Assembly:
subq $0x48, %rsp
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rax
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movl %edx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %r9, 0x20(%rsp)
movq 0x40(%rsp), %rax
cmpl $0x0, 0x8(%rax)
je 0x2dc9
movq 0x40(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x2d89
movq 0x40(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movq 0x50(%rsp), %r11
movq 0x58(%rsp), %r10
movq 0x60(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x2e10
jmp 0x2dc7
movq 0x40(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movq 0x50(%rsp), %r11
movq 0x58(%rsp), %r10
movq 0x60(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x31c0
jmp 0x2e07
movq 0x40(%rsp), %rdi
movl 0x3c(%rsp), %esi
movl 0x38(%rsp), %edx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movq 0x50(%rsp), %r11
movq 0x58(%rsp), %r10
movq 0x60(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x33b0
addq $0x48, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: DeflateBlock
static void DeflateBlock(const ZopfliOptions* options,
                         int btype, int final,
                         const unsigned char* in, size_t instart, size_t inend,
                         unsigned char* bp,
                         unsigned char** out, size_t* outsize) {
  if (btype == 0) {
    DeflateNonCompressedBlock(
        options, final, in, instart, inend, bp, out, outsize);
  } else if (btype == 1) {
     DeflateFixedBlock(options, final, in, instart, inend, bp, out, outsize);
  } else {
    assert (btype == 2);
    DeflateDynamicBlock(options, final, in, instart, inend, bp, out, outsize);
  }
}

// Assembly:
subq $0x38, %rsp
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rax
movq 0x40(%rsp), %rax
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %r9, 0x10(%rsp)
cmpl $0x0, 0x2c(%rsp)
jne 0x3420
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x48(%rsp), %r10
movq 0x50(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x5220
jmp 0x34bd
cmpl $0x1, 0x2c(%rsp)
jne 0x345e
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x48(%rsp), %r10
movq 0x50(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x56b0
jmp 0x34bb
cmpl $0x2, 0x2c(%rsp)
jne 0x3467
jmp 0x3486
leaq 0x9e80(%rip), %rdi      # 0xd2ee
leaq 0x9e84(%rip), %rsi      # 0xd2f9
movl $0x225, %edx            # imm = 0x225
leaq 0xa2c8(%rip), %rcx      # 0xd749
callq 0x10b0
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x48(%rsp), %r10
movq 0x50(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x57f0
jmp 0x34bd
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: ZopfliDeflate
void ZopfliDeflate(const ZopfliOptions* options, int btype, int final,
                   const unsigned char* in, size_t insize,
                   unsigned char* bp, unsigned char** out, size_t* outsize) {
#if ZOPFLI_MASTER_BLOCK_SIZE == 0
  ZopfliDeflatePart(options, btype, final, in, 0, insize, bp, out, outsize);
#else
  size_t i = 0;
  while (i < insize) {
    int masterfinal = (i + ZOPFLI_MASTER_BLOCK_SIZE >= insize);
    int final2 = final && masterfinal;
    size_t size = masterfinal ? insize - i : ZOPFLI_MASTER_BLOCK_SIZE;
    ZopfliDeflatePart(options, btype, final2,
                      in, i, i + size, bp, out, outsize);
    i += size;
  }
#endif
}

// Assembly:
subq $0x68, %rsp
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rax
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movl %edx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r9, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x35da
movq 0x38(%rsp), %rax
addq $0x1312d00, %rax        # imm = 0x1312D00
cmpq 0x48(%rsp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x34(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x58(%rsp)
movb %al, 0x27(%rsp)
je 0x3548
cmpl $0x0, 0x34(%rsp)
setne %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x30(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x356d
movq 0x48(%rsp), %rax
subq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x3579
movl $0x1312d00, %eax        # imm = 0x1312D00
movq %rax, 0x18(%rsp)
jmp 0x3579
movq 0x18(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rdi
movl 0x5c(%rsp), %esi
movl 0x30(%rsp), %edx
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x38(%rsp), %r9
addq 0x28(%rsp), %r9
movq 0x40(%rsp), %r11
movq 0x70(%rsp), %r10
movq 0x78(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x2d00
movq 0x28(%rsp), %rax
addq 0x38(%rsp), %rax
movq %rax, 0x38(%rsp)
jmp 0x3503
addq $0x68, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: AddBits
static void AddBits(unsigned symbol, unsigned length,
                    unsigned char* bp, unsigned char** out, size_t* outsize) {
  /* TODO(lode): make more efficient (add more bits at once). */
  unsigned i;
  for (i = 0; i < length; i++) {
    unsigned bit = (symbol >> i) & 1;
    if (((*bp) & 7) == 0) ZOPFLI_APPEND_DATA(0, out, outsize);
    (*out)[*outsize - 1] |= bit << ((*bp) & 7);
    (*bp)++;
  }
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movl %esi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x30(%rsp), %eax
jae 0x47fa
movl 0x34(%rsp), %eax
movl 0x14(%rsp), %ecx
shrl %cl, %eax
andl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
jne 0x47b0
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x478d
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x475f
movl $0x1, %edi
callq 0x1120
movq %rax, 0x8(%rsp)
jmp 0x4780
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rsi
shlq %rsi
shlq $0x0, %rsi
callq 0x1140
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl 0x10(%rsp), %esi
movq 0x28(%rsp), %rax
movzbl (%rax), %ecx
andl $0x7, %ecx
shll %cl, %esi
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq 0x28(%rsp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x46f3
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: AddHuffmanBits
static void AddHuffmanBits(unsigned symbol, unsigned length,
                           unsigned char* bp, unsigned char** out,
                           size_t* outsize) {
  /* TODO(lode): make more efficient (add more bits at once). */
  unsigned i;
  for (i = 0; i < length; i++) {
    unsigned bit = (symbol >> (length - i - 1)) & 1;
    if (((*bp) & 7) == 0) ZOPFLI_APPEND_DATA(0, out, outsize);
    (*out)[*outsize - 1] |= bit << ((*bp) & 7);
    (*bp)++;
  }
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movl %esi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x30(%rsp), %eax
jae 0x4931
movl 0x34(%rsp), %eax
movl 0x30(%rsp), %ecx
subl 0x14(%rsp), %ecx
subl $0x1, %ecx
shrl %cl, %eax
andl $0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
jne 0x48e7
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x48c4
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x4896
movl $0x1, %edi
callq 0x1120
movq %rax, 0x8(%rsp)
jmp 0x48b7
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rsi
shlq %rsi
shlq $0x0, %rsi
callq 0x1140
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movl 0x10(%rsp), %esi
movq 0x28(%rsp), %rax
movzbl (%rax), %ecx
andl $0x7, %ecx
shll %cl, %esi
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq 0x28(%rsp), %rax
movb (%rax), %cl
addb $0x1, %cl
movb %cl, (%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x4823
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/deflate.c
// Function: DeflateFixedBlock
static void DeflateFixedBlock(const ZopfliOptions* options, int final,
                              const unsigned char* in,
                              size_t instart, size_t inend,
                              unsigned char* bp,
                              unsigned char** out, size_t* outsize) {
  ZopfliBlockState s;
  size_t blocksize = inend - instart;
  ZopfliLZ77Store store;

  ZopfliInitLZ77Store(&store);

  s.options = options;
  s.blockstart = instart;
  s.blockend = inend;
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
  s.lmc = (ZopfliLongestMatchCache*)malloc(sizeof(ZopfliLongestMatchCache));
  ZopfliInitCache(blocksize, s.lmc);
#endif

  ZopfliLZ77OptimalFixed(&s, in, instart, inend, &store);

  AddLZ77Block(s.options, 1, final, store.litlens, store.dists, 0, store.size,
               blocksize, bp, out, outsize);

#ifdef ZOPFLI_LONGEST_MATCH_CACHE
  ZopfliCleanCache(s.lmc);
  free(s.lmc);
#endif
  ZopfliCleanLZ77Store(&store);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rax
movq %rdi, 0x90(%rsp)
movl %esi, 0x8c(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movq %r9, 0x68(%rsp)
movq 0x70(%rsp), %rax
subq 0x78(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x7820
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x18, %edi
callq 0x1120
movq %rax, 0x50(%rsp)
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x22c0
movq 0x80(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %rcx
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %r8
callq 0x9cd0
movq 0x48(%rsp), %rdi
movl 0x8c(%rsp), %edx
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x38(%rsp), %r14
movq 0x40(%rsp), %rbx
movq 0x68(%rsp), %r11
movq 0xb0(%rsp), %r10
movq 0xb8(%rsp), %rax
movl $0x1, %esi
xorl %r9d, %r9d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x4940
movq 0x50(%rsp), %rdi
callq 0x23c0
movq 0x50(%rsp), %rdi
callq 0x1030
leaq 0x28(%rsp), %rdi
callq 0x7850
addq $0x98, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/gzip_container.c
// Function: UpdateCRC
static unsigned long UpdateCRC(unsigned long crc,
                               const unsigned char *buf, size_t len) {
  unsigned long c = crc ^ 0xffffffffL;
  unsigned n;

  if (!crc_table_computed)
    MakeCRCTable();
  for (n = 0; n < len; n++) {
    c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8);
  }
  return c ^ 0xffffffffL;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
xorq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0xb812(%rip)      # 0x120f0
jne 0x68e5
callq 0x6960
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpq 0x10(%rsp), %rax
jae 0x693d
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movl 0x4(%rsp), %edx
movzbl (%rax,%rdx), %eax
xorq %rax, %rcx
andq $0xff, %rcx
leaq 0xb7e5(%rip), %rax      # 0x12100
movq (%rax,%rcx,8), %rax
movq 0x8(%rsp), %rcx
shrq $0x8, %rcx
xorq %rcx, %rax
movq %rax, 0x8(%rsp)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x68ed
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
xorq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/gzip_container.c
// Function: MakeCRCTable
static void MakeCRCTable() {
  unsigned long c;
  int n, k;
  for (n = 0; n < 256; n++) {
    c = (unsigned long) n;
    for (k = 0; k < 8; k++) {
      if (c & 1) {
        c = 0xedb88320L ^ (c >> 1);
      } else {
        c = c >> 1;
      }
    }
    crc_table[n] = c;
  }
  crc_table_computed = 1;
}

// Assembly:
movl $0x0, -0xc(%rsp)
cmpl $0x100, -0xc(%rsp)      # imm = 0x100
jge 0x69fb
movslq -0xc(%rsp), %rax
movq %rax, -0x8(%rsp)
movl $0x0, -0x10(%rsp)
cmpl $0x8, -0x10(%rsp)
jge 0x69d6
movq -0x8(%rsp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x69ba
movq -0x8(%rsp), %rax
shrq %rax
movabsq $0xedb88320, %rcx       # imm = 0xEDB88320
xorq %rcx, %rax
movq %rax, -0x8(%rsp)
jmp 0x69c7
movq -0x8(%rsp), %rax
shrq %rax
movq %rax, -0x8(%rsp)
jmp 0x69c9
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x6988
movq -0x8(%rsp), %rdx
movslq -0xc(%rsp), %rcx
leaq 0xb719(%rip), %rax      # 0x12100
movq %rdx, (%rax,%rcx,8)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
jmp 0x6968
movl $0x1, 0xb6eb(%rip)      # 0x120f0
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/hash.c
// Function: ZopfliCleanHash
void ZopfliCleanHash(ZopfliHash* h) {
  free(h->head);
  free(h->prev);
  free(h->hashval);

#ifdef ZOPFLI_HASH_SAME_HASH
  free(h->head2);
  free(h->prev2);
  free(h->hashval2);
#endif

#ifdef ZOPFLI_HASH_SAME
  free(h->same);
#endif
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x1030
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/katajainen.c
// Function: InitLists
static void InitLists(
    NodePool* pool, const Node* leaves, int maxbits, Node* (*lists)[2]) {
  int i;
  Node* node0 = GetFreeNode(0, maxbits, pool);
  Node* node1 = GetFreeNode(0, maxbits, pool);
  InitNode(leaves[0].weight, 1, 0, node0);
  InitNode(leaves[1].weight, 2, 0, node1);
  for (i = 0; i < maxbits; i++) {
    lists[i][0] = node0;
    lists[i][1] = node1;
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq %rcx, 0x18(%rsp)
movl 0x24(%rsp), %esi
movq 0x30(%rsp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x7670
movq %rax, 0x8(%rsp)
movl 0x24(%rsp), %esi
movq 0x30(%rsp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x7670
movq %rax, (%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rcx
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x77d0
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
movq (%rsp), %rcx
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x77d0
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x73cb
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq (%rsp), %rcx
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x7382
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/katajainen.c
// Function: ExtractBitLengths
static void ExtractBitLengths(Node* chain, Node* leaves, unsigned* bitlengths) {
  Node* node;
  for (node = chain; node; node = node->tail) {
    int i;
    for (i = 0; i < node->count; i++) {
      bitlengths[leaves[i].count]++;
    }
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
cmpq $0x0, -0x20(%rsp)
je 0x7669
movl $0x0, -0x24(%rsp)
movl -0x24(%rsp), %eax
movq -0x20(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x7657
movq -0x18(%rsp), %rax
movq -0x10(%rsp), %rcx
movslq -0x24(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x10(%rcx), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0x7619
jmp 0x7659
movq -0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x7609
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/katajainen.c
// Function: GetFreeNode
static Node* GetFreeNode(Node* (*lists)[2], int maxbits, NodePool* pool) {
  for (;;) {
    if (pool->next >= &pool->nodes[pool->size]) {
      /* Garbage collection. */
      int i;
      for (i = 0; i < pool->size; i++) {
        pool->nodes[i].inuse = 0;
      }
      if (lists) {
        for (i = 0; i < maxbits * 2; i++) {
          Node* node;
          for (node = lists[i / 2][i % 2]; node; node = node->tail) {
            node->inuse = 1;
          }
        }
      }
      pool->next = &pool->nodes[0];
    }
    if (!pool->next->inuse) break;  /* Found one. */
    pool->next++;
  }
  return pool->next++;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rsp), %rcx
movq (%rcx), %rcx
movq -0x18(%rsp), %rdx
movslq 0x10(%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x7794
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movq -0x18(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x76e3
movq -0x18(%rsp), %rax
movq (%rax), %rax
movslq -0x1c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x14(%rax)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x76b0
cmpq $0x0, -0x8(%rsp)
je 0x7783
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movl -0xc(%rsp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x7781
movq -0x8(%rsp), %rax
movq %rax, -0x38(%rsp)
movl -0x1c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x38(%rsp), %rax
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rsp)
movl -0x1c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movq -0x30(%rsp), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rsp)
cmpq $0x0, -0x28(%rsp)
je 0x776f
movq -0x28(%rsp), %rax
movb $0x1, 0x14(%rax)
movq -0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rsp)
jmp 0x774e
jmp 0x7771
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x76f7
jmp 0x7783
movq -0x18(%rsp), %rax
movq (%rax), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rsp), %rax
movq 0x8(%rax), %rax
cmpb $0x0, 0x14(%rax)
jne 0x77a5
jmp 0x77bb
movq -0x18(%rsp), %rax
movq 0x8(%rax), %rcx
addq $0x18, %rcx
movq %rcx, 0x8(%rax)
jmp 0x767e
movq -0x18(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x18, %rdx
movq %rdx, 0x8(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/katajainen.c
// Function: InitNode
static void InitNode(size_t weight, int count, Node* tail, Node* node) {
  node->weight = weight;
  node->count = count;
  node->tail = tail;
  node->inuse = 1;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movq -0x8(%rsp), %rcx
movq -0x20(%rsp), %rax
movq %rcx, (%rax)
movl -0xc(%rsp), %ecx
movq -0x20(%rsp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rsp), %rcx
movq -0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rsp), %rax
movb $0x1, 0x14(%rax)
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/lz77.c
// Function: ZopfliCopyLZ77Store
void ZopfliCopyLZ77Store(
    const ZopfliLZ77Store* source, ZopfliLZ77Store* dest) {
  size_t i;
  ZopfliCleanLZ77Store(dest);
  dest->litlens =
      (unsigned short*)malloc(sizeof(*dest->litlens) * source->size);
  dest->dists = (unsigned short*)malloc(sizeof(*dest->dists) * source->size);

  if (!dest->litlens || !dest->dists) exit(-1); /* Allocation failed. */

  dest->size = source->size;
  for (i = 0; i < source->size; i++) {
    dest->litlens[i] = source->litlens[i];
    dest->dists[i] = source->dists[i];
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
callq 0x7850
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
callq 0x1120
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
shlq %rdi
callq 0x1120
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x78d8
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x78e2
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1170
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq $0x0, (%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x795b
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rcx
movw (%rax,%rcx,2), %dx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rsp), %rcx
movw (%rax,%rcx,2), %dx
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rsp), %rcx
movw %dx, (%rax,%rcx,2)
movq (%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0x78fc
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/lz77.c
// Function: ZopfliVerifyLenDist
void ZopfliVerifyLenDist(const unsigned char* data, size_t datasize, size_t pos,
                         unsigned short dist, unsigned short length) {

  /* TODO(lode): make this only run in a debug compile, it's for assert only. */
  size_t i;

  assert(pos + length <= datasize);
  for (i = 0; i < length; i++) {
    if (data[pos - dist + i] != data[pos + i]) {
      assert(data[pos - dist + i] == data[pos + i]);
      break;
    }
  }
}

// Assembly:
subq $0x28, %rsp
movw %r8w, %ax
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movw %cx, 0xe(%rsp)
movw %ax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movzwl 0xc(%rsp), %ecx
addq %rcx, %rax
cmpq 0x18(%rsp), %rax
ja 0x7ad7
jmp 0x7af6
leaq 0x5e30(%rip), %rdi      # 0xd90e
leaq 0x5e42(%rip), %rsi      # 0xd927
movl $0x57, %edx
leaq 0x5e3d(%rip), %rcx      # 0xd92e
callq 0x10b0
movq $0x0, (%rsp)
movq (%rsp), %rax
movzwl 0xc(%rsp), %ecx
cmpq %rcx, %rax
jae 0x7ba6
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movzwl 0xe(%rsp), %edx
subq %rdx, %rcx
addq (%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rdx
addq (%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x7b93
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movzwl 0xe(%rsp), %edx
subq %rdx, %rcx
addq (%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rdx
addq (%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x7b72
jmp 0x7b91
leaq 0x5e15(%rip), %rdi      # 0xd98e
leaq 0x5da7(%rip), %rsi      # 0xd927
movl $0x5a, %edx
leaq 0x5da2(%rip), %rcx      # 0xd92e
callq 0x10b0
jmp 0x7ba6
jmp 0x7b95
movq (%rsp), %rax
addq $0x1, %rax
movq %rax, (%rsp)
jmp 0x7afe
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/lz77.c
// Function: ZopfliLZ77Counts
void ZopfliLZ77Counts(const unsigned short* litlens,
                      const unsigned short* dists,
                      size_t start, size_t end,
                      size_t* ll_count, size_t* d_count) {
  size_t i;

  for (i = 0; i < 288; i++) {
    ll_count[i] = 0;
  }
  for (i = 0; i < 32; i++) {
    d_count[i] = 0;
  }

  for (i = start; i < end; i++) {
    if (dists[i] == 0) {
      ll_count[litlens[i]]++;
    } else {
      ll_count[ZopfliGetLengthSymbol(litlens[i])]++;
      d_count[ZopfliGetDistSymbol(dists[i])]++;
    }
  }

  ll_count[256] = 1;  /* End symbol. */
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x120, 0x10(%rsp)      # imm = 0x120
jae 0x9198
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x916b
movq $0x0, 0x10(%rsp)
cmpq $0x20, 0x10(%rsp)
jae 0x91cb
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x91a1
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x9292
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x9219
movq 0x20(%rsp), %rax
movq 0x40(%rsp), %rcx
movq 0x10(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x927d
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rax
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb4a0
movl %eax, %ecx
movq (%rsp), %rax
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb400
movl %eax, %ecx
movq 0x8(%rsp), %rax
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x927f
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x91d5
movq 0x20(%rsp), %rax
movq $0x1, 0x800(%rax)
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: InitStats
static void InitStats(SymbolStats* stats) {
  memset(stats->litlens, 0, 288 * sizeof(stats->litlens[0]));
  memset(stats->dists, 0, 32 * sizeof(stats->dists[0]));

  memset(stats->ll_symbols, 0, 288 * sizeof(stats->ll_symbols[0]));
  memset(stats->d_symbols, 0, 32 * sizeof(stats->d_symbols[0]));
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rdi
xorl %esi, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x10c0
movq (%rsp), %rdi
addq $0x900, %rdi            # imm = 0x900
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x10c0
movq (%rsp), %rdi
addq $0xa00, %rdi            # imm = 0xA00
xorl %esi, %esi
movl $0x900, %edx            # imm = 0x900
callq 0x10c0
movq (%rsp), %rdi
addq $0x1300, %rdi           # imm = 0x1300
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x10c0
popq %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: GetStatistics
static void GetStatistics(const ZopfliLZ77Store* store, SymbolStats* stats) {
  size_t i;
  for (i = 0; i < store->size; i++) {
    if (store->dists[i] == 0) {
      stats->litlens[store->litlens[i]]++;
    } else {
      stats->litlens[ZopfliGetLengthSymbol(store->litlens[i])]++;
      stats->dists[ZopfliGetDistSymbol(store->dists[i])]++;
    }
  }
  stats->litlens[256] = 1;  /* End symbol. */

  CalculateStatistics(stats);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x975e
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x96d6
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %rcx
movq 0x10(%rsp), %rdx
movzwl (%rcx,%rdx,2), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x9749
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb4a0
movl %eax, %ecx
movq (%rsp), %rax
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rsp), %rcx
movzwl (%rax,%rcx,2), %edi
callq 0xb400
movl %eax, %ecx
movq 0x8(%rsp), %rax
movslq %ecx, %rcx
movq 0x900(%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, 0x900(%rax,%rcx,8)
jmp 0x974b
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x9687
movq 0x18(%rsp), %rax
movq $0x1, 0x800(%rax)
movq 0x18(%rsp), %rdi
callq 0x9c30
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: LZ77OptimalRun
static double LZ77OptimalRun(ZopfliBlockState* s,
    const unsigned char* in, size_t instart, size_t inend,
    unsigned short** path, size_t* pathsize,
    unsigned short* length_array, CostModelFun* costmodel,
    void* costcontext, ZopfliLZ77Store* store) {
  double cost = GetBestLengths(
      s, in, instart, inend, costmodel, costcontext, length_array);
  free(*path);
  *path = 0;
  *pathsize = 0;
  TraceBackwards(inend - instart, length_array, path, pathsize);
  FollowPath(s, in, instart, inend, *path, *pathsize, store);
  assert(cost < ZOPFLI_LARGE_FLOAT);
  return cost;
}

// Assembly:
subq $0x48, %rsp
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %rax
movq 0x50(%rsp), %rax
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x58(%rsp), %r8
movq 0x60(%rsp), %r9
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
callq 0x9eb0
movsd %xmm0, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0x1030
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0x28(%rsp), %rdi
subq 0x30(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0xa680
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq (%rax), %r8
movq 0x18(%rsp), %rax
movq (%rax), %r9
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
callq 0xa8b0
movsd 0x37a3(%rip), %xmm0     # 0xd008
ucomisd 0x10(%rsp), %xmm0
jbe 0x986f
jmp 0x988e
leaq 0x44ee(%rip), %rdi      # 0xdd64
leaq 0x4501(%rip), %rsi      # 0xdd7e
movl $0x1bb, %edx            # imm = 0x1BB
leaq 0x44ff(%rip), %rcx      # 0xdd88
callq 0x10b0
movsd 0x10(%rsp), %xmm0
addq $0x48, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: GetCostStat
static double GetCostStat(unsigned litlen, unsigned dist, void* context) {
  SymbolStats* stats = (SymbolStats*)context;
  if (dist == 0) {
    return stats->ll_symbols[litlen];
  } else {
    int lsym = ZopfliGetLengthSymbol(litlen);
    int lbits = ZopfliGetLengthExtraBits(litlen);
    int dsym = ZopfliGetDistSymbol(dist);
    int dbits = ZopfliGetDistExtraBits(dist);
    return stats->ll_symbols[lsym] + lbits + stats->d_symbols[dsym] + dbits;
  }
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x2c(%rsp)
movl %esi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x28(%rsp)
jne 0x98dc
movq 0x18(%rsp), %rax
movl 0x2c(%rsp), %ecx
movsd 0xa00(%rax,%rcx,8), %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0x9950
movl 0x2c(%rsp), %edi
callq 0xb4a0
movl %eax, 0x14(%rsp)
movl 0x2c(%rsp), %edi
callq 0xb460
movl %eax, 0x10(%rsp)
movl 0x28(%rsp), %edi
callq 0xb400
movl %eax, 0xc(%rsp)
movl 0x28(%rsp), %edi
callq 0xb360
movl %eax, 0x8(%rsp)
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movsd 0xa00(%rax,%rcx,8), %xmm0
cvtsi2sdl 0x10(%rsp), %xmm1
addsd %xmm1, %xmm0
movq 0x18(%rsp), %rax
movslq 0xc(%rsp), %rcx
addsd 0x1300(%rax,%rcx,8), %xmm0
cvtsi2sdl 0x8(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: CopyStats
static void CopyStats(SymbolStats* source, SymbolStats* dest) {
  memcpy(dest->litlens, source->litlens, 288 * sizeof(dest->litlens[0]));
  memcpy(dest->dists, source->dists, 32 * sizeof(dest->dists[0]));

  memcpy(dest->ll_symbols, source->ll_symbols,
         288 * sizeof(dest->ll_symbols[0]));
  memcpy(dest->d_symbols, source->d_symbols, 32 * sizeof(dest->d_symbols[0]));
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x900, %edx            # imm = 0x900
callq 0x1110
movq 0x8(%rsp), %rdi
addq $0x900, %rdi            # imm = 0x900
movq 0x10(%rsp), %rsi
addq $0x900, %rsi            # imm = 0x900
movl $0x100, %edx            # imm = 0x100
callq 0x1110
movq 0x8(%rsp), %rdi
addq $0xa00, %rdi            # imm = 0xA00
movq 0x10(%rsp), %rsi
addq $0xa00, %rsi            # imm = 0xA00
movl $0x900, %edx            # imm = 0x900
callq 0x1110
movq 0x8(%rsp), %rdi
addq $0x1300, %rdi           # imm = 0x1300
movq 0x10(%rsp), %rsi
addq $0x1300, %rsi           # imm = 0x1300
movl $0x100, %edx            # imm = 0x100
callq 0x1110
addq $0x18, %rsp
retq
nopl (%rax)