LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/libforks.c
// Function: serv_print_error
__attribute__((format(printf, 1, 2)))
static void serv_print_error(const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  // XXX `dprintf` is guaranteed to be async-signal-safe on OpenBSD
  // but not on other systems.
  dprintf(STDERR_FILENO, "libforks server: ");
  vdprintf(STDERR_FILENO, format, ap);
  dprintf(STDERR_FILENO, "\n");
  va_end(ap);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x23ff
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
leaq 0x108b(%rip), %rsi      # 0x34b1
pushq $0x2
popq %rbp
movl %ebp, %edi
xorl %eax, %eax
callq 0x10d0
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x11a0
leaq 0xc98(%rip), %rsi       # 0x30de
movl %ebp, %edi
xorl %eax, %eax
callq 0x10d0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/libforks.c
// Function: serv_sigchld_handler
static void serv_sigchld_handler(int sig_) {
  (void)sig_;

  // This function uses `serv_DEBUG` and `serv_print_errno` which
  // could theoretically be async-signal-unsafe. But that’s only
  // when debugging is enabled or if a fatal error occurs.

  int prev_errno = errno;

  // We know that some children have exited but we don’t know which ones.
  // We can list them by calling `waitpid(-1, …, …)` repeatedly.

  serv_DEBUG("received SIGCHLD\n");

  while (true) {
    int status;
    pid_t child_pid = waitpid(-1, &status, WNOHANG);
    if (child_pid == 0 || (child_pid == -1 && errno == ECHILD)) {
      // no more stopped children
      break;
    }

    if (child_pid == -1) {
      serv_print_errno("waitpid(2) system call in SIGCHLD handler");
      serv_panic();
    }

    assert(WIFEXITED(status) || WIFSIGNALED(status));

    serv_DEBUG("child %d exited, informing main loop\n", (int)child_pid);

    libforks_ExitEvent event = {
      .pid = child_pid,
      .wait_status = status,
    };
    if (write_exact(serv_exit_pipe[WRITE_END], &event, sizeof event) == -1) {
      serv_print_errno("write(2) system call in SIGCHLD handler");
      serv_panic();
    }
  }

  serv_DEBUG("SIGCHLD handling done\n");

  errno = prev_errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x1050
movq %rax, %rbx
movl (%rax), %eax
movl %eax, 0x8(%rsp)
pushq $-0x1
popq %rbp
leaq 0xc(%rsp), %r14
pushq $0x1
popq %r15
leaq 0x10(%rsp), %r12
pushq $0x8
popq %r13
movl %ebp, %edi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1190
testl %eax, %eax
je 0x24f2
cmpl $-0x1, %eax
je 0x24ed
movl 0xc(%rsp), %ecx
movl %ecx, %edx
andl $0x7f, %edx
je 0x24be
shll $0x18, %edx
addl $0x1000000, %edx        # imm = 0x1000000
cmpl $0x1ffffff, %edx        # imm = 0x1FFFFFF
jle 0x2507
movl %eax, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movl 0x3c4c(%rip), %edi      # 0x6118
movq %r12, %rsi
movq %r13, %rdx
callq 0x1770
cmpl $-0x1, %eax
jne 0x248c
leaq 0x117c(%rip), %rdi      # 0x365f
callq 0x1898
callq 0x2389
cmpl $0xa, (%rbx)
jne 0x2526
movl 0x8(%rsp), %eax
movl %eax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1109(%rip), %rdi      # 0x3617
leaq 0xc7a(%rip), %rsi       # 0x318f
leaq 0x1124(%rip), %rcx      # 0x3640
movl $0x1b4, %edx            # imm = 0x1B4
callq 0x10b0
leaq 0x10c0(%rip), %rdi      # 0x35ed
jmp 0x24e3
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/libforks.c
// Function: serv_connected_clients
static unsigned serv_connected_clients(const serv_Client *c) {
  unsigned count = 0;
  while (c) {
    if (c->socket != -1) {
      count++;
    }
    c = c->next;
  }
  return count;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x2547
xorl %ecx, %ecx
cmpl $-0x1, 0x8(%rdi)
setne %cl
addl %ecx, %eax
movq 0x10(%rdi), %rdi
jmp 0x2531
retq
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/libforks.c
// Function: serv_handle_stop_all_request
__attribute__((noreturn))
static void serv_handle_stop_all_request(
    serv_Client *first_client,
    serv_Client *sender_client) {
  serv_DEBUG("STOP_ALL_REQUEST received\n");

  if (!sender_client->main) {
    // unfortunately we can't use wait(2) with our parent process
    serv_print_error(
      "Deadlock detected!\n"
      "Some libforks functions must be called from the process "
      "that started the fork server."
    );
    serv_panic();
  }

  // we don’t care about SIGCHLD anymore
  serv_uninstall_signal_handler(SIGCHLD);

  // We could send all the signals first and then wait
  // for termination. It’s a bit more complex but it
  // could be significantly faster.

  for (serv_Client *c = first_client; c; c = c->next) {
    if (c->pid != sender_client->pid) {
      serv_DEBUG("sending SIGTERM to %d\n", (int)c->pid);
      if (kill(c->pid, SIGTERM) == -1) {
        if (errno != ESRCH) {
          // ESRCH is normal if the process just exited for some
          // other reason.
          serv_print_errno("kill");
          serv_panic();
        }
      } else {
        serv_DEBUG("waiting for %d\n", (int)c->pid);
        int status;
        if (waitpid(c->pid, &status, 0) == -1) {
          serv_print_errno("waitpid");
          serv_panic();
        }
      }
    }
  }

  serv_DEBUG("all children exited, goodbye!\n");
  exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x4(%rsi)
je 0x25a7
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x11
popq %rdi
callq 0x25e3
pushq $0xf
popq %rbp
leaq 0x4(%rsp), %r15
testq %r14, %r14
je 0x25ba
movl (%r14), %edi
cmpl (%rbx), %edi
je 0x25a1
movl %ebp, %esi
callq 0x1150
cmpl $-0x1, %eax
je 0x2597
movl (%r14), %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x1190
cmpl $-0x1, %eax
jne 0x25a1
jmp 0x25c1
callq 0x1050
cmpl $0x3, (%rax)
jne 0x25ca
movq 0x10(%r14), %r14
jmp 0x256b
leaq 0x1137(%rip), %rdi      # 0x36e5
xorl %eax, %eax
callq 0x239d
callq 0x2389
xorl %edi, %edi
callq 0x11c0
leaq 0x118b(%rip), %rdi      # 0x3753
jmp 0x25d1
leaq 0x117d(%rip), %rdi      # 0x374e
callq 0x1898
callq 0x2389
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/libforks.c
// Function: serv_uninstall_signal_handler
static void serv_uninstall_signal_handler(int signal) {
  struct sigaction sa;
  sa.sa_handler = SIG_DFL;
  sa.sa_flags = 0;
  sigemptyset(&sa.sa_mask);
  if (sigaction(signal, &sa, NULL) == -1) {
    serv_print_errno(NULL);
    serv_panic();
  }
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x10(%rsp), %rax
andq $0x0, -0x8(%rax)
movl %edi, %ebx
andl $0x0, 0x80(%rax)
movq %rax, %rdi
callq 0x1120
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x1070
cmpl $-0x1, %eax
je 0x2622
addq $0xa0, %rsp
popq %rbx
retq
xorl %edi, %edi
callq 0x1898
callq 0x2389
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/blocksplitter.c
// Function: ZopfliBlockSplitSimple
void ZopfliBlockSplitSimple(const unsigned char* in,
                            size_t instart, size_t inend,
                            size_t blocksize,
                            size_t** splitpoints, size_t* npoints) {
  size_t i = instart;
  while (i < inend) {
    ZOPFLI_APPEND_DATA(i, splitpoints, npoints);
    i += blocksize;
  }
  (void)in;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
pushq $0x8
popq %rbp
cmpq %r12, %r13
jae 0x1aa7
movq (%rbx), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x1a89
testq %rsi, %rsi
je 0x1a8e
movq (%r14), %rdi
shlq $0x4, %rsi
callq 0x1140
movq (%rbx), %rsi
jmp 0x1a98
movq (%r14), %rax
jmp 0x1a9b
movq %rbp, %rdi
callq 0x1120
xorl %esi, %esi
movq %rax, (%r14)
movq %r13, (%rax,%rsi,8)
incq (%rbx)
addq %r15, %r13
jmp 0x1a62
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/cache.c
// Function: ZopfliInitCache
void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc) {
  size_t i;
  lmc->length = (unsigned short*)malloc(sizeof(unsigned short) * blocksize);
  lmc->dist = (unsigned short*)malloc(sizeof(unsigned short) * blocksize);
  /* Rather large amount of memory. */
  lmc->sublen = (unsigned char*)malloc(ZOPFLI_CACHE_LENGTH * 3 * blocksize);

  /* length > 0 and dist 0 is invalid combination, which indicates on purpose
  that this cache value is not filled in yet. */
  for (i = 0; i < blocksize; i++) lmc->length[i] = 1;
  for (i = 0; i < blocksize; i++) lmc->dist[i] = 0;
  for (i = 0; i < ZOPFLI_CACHE_LENGTH * blocksize * 3; i++) lmc->sublen[i] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
leaq (%rdi,%rdi), %r14
movq %r14, %rdi
callq 0x1120
movq %rax, %r13
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x1120
movq %rax, %r12
movq %rax, 0x8(%rbx)
imulq $0x18, %r15, %r14
movq %r14, %rdi
callq 0x1120
movq %rax, 0x10(%rbx)
xorl %eax, %eax
cmpq %rax, %r15
je 0x1b0c
movw $0x1, (%r13,%rax,2)
incq %rax
jmp 0x1afa
xorl %eax, %eax
cmpq %rax, %r15
je 0x1b1e
andw $0x0, (%r12,%rax,2)
incq %rax
jmp 0x1b0e
xorl %eax, %eax
cmpq %rax, %r14
je 0x1b32
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
incq %rax
jmp 0x1b20
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/cache.c
// Function: ZopfliSublenToCache
void ZopfliSublenToCache(const unsigned short* sublen,
                         size_t pos, size_t length,
                         ZopfliLongestMatchCache* lmc) {
  size_t i;
  size_t j = 0;
  unsigned bestlength = 0;
  unsigned char* cache;

#if ZOPFLI_CACHE_LENGTH == 0
  return;
#endif

  cache = &lmc->sublen[ZOPFLI_CACHE_LENGTH * pos * 3];
  if (length < 3) return;
  for (i = 3; i <= length; i++) {
    if (i == length || sublen[i] != sublen[i + 1]) {
      cache[j * 3] = i - 3;
      cache[j * 3 + 1] = sublen[i] % 256;
      cache[j * 3 + 2] = (sublen[i] >> 8) % 256;
      bestlength = i;
      j++;
      if (j >= ZOPFLI_CACHE_LENGTH) break;
    }
  }
  if (j < ZOPFLI_CACHE_LENGTH) {
    assert(bestlength == length);
    cache[(ZOPFLI_CACHE_LENGTH - 1) * 3] = bestlength - 3;
  } else {
    assert(bestlength <= length);
  }
  assert(bestlength == ZopfliMaxCachedSublen(lmc, pos, length));
}

// Assembly:
pushq %rbx
cmpq $0x3, %rdx
jb 0x1be8
imulq $0x18, %rsi, %rax
addq 0x10(%rcx), %rax
pushq $0x3
popq %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %ebx, %ebx
cmpq %rdx, %r8
ja 0x1bbd
je 0x1b8e
movzwl (%rdi,%r8,2), %r11d
cmpw 0x2(%rdi,%r8,2), %r11w
je 0x1bb5
leaq (%r10,%r10,2), %r11
movb %r9b, (%rax,%r11)
movb (%rdi,%r8,2), %bl
movb %bl, 0x1(%rax,%r11)
movb 0x1(%rdi,%r8,2), %bl
movb %bl, 0x2(%rax,%r11)
incq %r10
cmpq $0x7, %r10
ja 0x1bd2
movl %r8d, %ebx
incq %r8
incb %r9b
jmp 0x1b7a
cmpq $0x7, %r10
ja 0x1bd5
movl %ebx, %edi
cmpq %rdx, %rdi
jne 0x1c1c
leal -0x3(%rbx), %edx
movb %dl, 0x15(%rax)
jmp 0x1bdc
movl %r8d, %ebx
movl %ebx, %eax
cmpq %rdx, %rax
ja 0x1c03
movq %rcx, %rdi
callq 0x1c39
cmpl %eax, %ebx
jne 0x1bea
popq %rbx
retq
leaq 0x5684(%rip), %rdi      # 0x7275
leaq 0x5604(%rip), %rsi      # 0x71fc
leaq 0x5605(%rip), %rcx      # 0x7204
pushq $0x4e
jmp 0x1c33
leaq 0x5656(%rip), %rdi      # 0x7260
leaq 0x55eb(%rip), %rsi      # 0x71fc
leaq 0x55ec(%rip), %rcx      # 0x7204
pushq $0x4c
jmp 0x1c33
leaq 0x55c4(%rip), %rdi      # 0x71e7
leaq 0x55d2(%rip), %rsi      # 0x71fc
leaq 0x55d3(%rip), %rcx      # 0x7204
pushq $0x49
popq %rdx
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
callq 0x1c39
cmpq $0x3, %r12
jae 0x1c86
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
imulq $0x18, %r15, %rcx
addq 0x10(%r14), %rcx
xorl %edi, %edi
xorl %edx, %edx
cmpq $0x8, %rdx
je 0x1c7a
leaq (%rdx,%rdx,2), %r9
movzbl (%rcx,%r9), %esi
leaq 0x3(%rsi), %r8
movzwl 0x1(%rcx,%r9), %r9d
movl %edi, %edi
cmpq %r8, %rdi
ja 0x1cbc
movw %r9w, (%rbx,%rdi,2)
incq %rdi
jmp 0x1cad
cmpl %eax, %r8d
je 0x1c7a
addl $0x4, %esi
incq %rdx
movl %esi, %edi
jmp 0x1c92
nop
// File: /workspace/github_c_makefile_star2_O2/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:
xorl %eax, %eax
cmpq $0x90, %rax
je 0x1eea
movl $0x8, (%rdi,%rax,4)
incq %rax
jmp 0x1ed6
xorl %eax, %eax
cmpq $0x70, %rax
je 0x1f02
movl $0x9, 0x240(%rdi,%rax,4)
incq %rax
jmp 0x1eec
xorl %eax, %eax
cmpq $0x18, %rax
je 0x1f1a
movl $0x7, 0x400(%rdi,%rax,4)
incq %rax
jmp 0x1f04
xorl %eax, %eax
cmpq $0x8, %rax
je 0x1f32
movl $0x8, 0x460(%rdi,%rax,4)
incq %rax
jmp 0x1f1c
xorl %eax, %eax
cmpq $0x20, %rax
je 0x1f46
movl $0x5, (%rsi,%rax,4)
incq %rax
jmp 0x1f34
retq
// File: /workspace/github_c_makefile_star2_O2/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:
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x1e, %rax
je 0x1f61
cmpl $0x1, (%rdi,%rax,4)
sbbl $-0x1, %ecx
incq %rax
cmpl $0x1, %ecx
jbe 0x1f4b
retq
testl %ecx, %ecx
je 0x1f73
xorl %eax, %eax
cmpl $0x0, (%rdi)
setne %al
leaq (%rdi,%rax,4), %rdi
jmp 0x1f7a
movl $0x1, 0x4(%rdi)
movl $0x1, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/deflate.c
// Function: DeflateSplittingFirst
static void DeflateSplittingFirst(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) {
  size_t i;
  size_t* splitpoints = 0;
  size_t npoints = 0;
  if (btype == 0) {
    ZopfliBlockSplitSimple(in, instart, inend, 65535, &splitpoints, &npoints);
  } else if (btype == 1) {
    /* If all blocks are fixed tree, splitting into separate blocks only
    increases the total size. Leave npoints at 0, this represents 1 block. */
  } else {
    ZopfliBlockSplit(options, in, instart, inend,
                     options->blocksplittingmax, &splitpoints, &npoints);
  }

  for (i = 0; i <= npoints; i++) {
    size_t start = i == 0 ? instart : splitpoints[i - 1];
    size_t end = i == npoints ? inend : splitpoints[i];
    DeflateBlock(options, btype, i == npoints && final, in, start, end,
                 bp, out, outsize);
  }

  free(splitpoints);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x8(%rsp)
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
andq $0x0, (%rsp)
andq $0x0, 0x10(%rsp)
cmpl $0x1, %esi
je 0x2257
testl %r12d, %r12d
jne 0x222f
movq %rsp, %r8
leaq 0x10(%rsp), %r9
movl $0xffff, %ecx           # imm = 0xFFFF
movq %r15, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x1a45
jmp 0x2257
movslq 0x10(%r13), %r8
subq $0x8, %rsp
leaq 0x18(%rsp), %rax
leaq 0x8(%rsp), %r9
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
pushq %rax
callq 0x189c
popq %rax
popq %rcx
xorl %ebx, %ebx
movq 0x10(%rsp), %rax
cmpq %rax, %rbx
ja 0x22bd
movq %r14, %r8
testq %rbx, %rbx
je 0x2274
movq (%rsp), %rcx
movq -0x8(%rcx,%rbx,8), %r8
movq 0x8(%rsp), %r9
cmpq %rax, %rbx
je 0x2286
movq (%rsp), %rcx
movq (%rcx,%rbx,8), %r9
cmpq %rax, %rbx
sete %al
testl %ebp, %ebp
setne %cl
andb %al, %cl
movzbl %cl, %edx
subq $0x8, %rsp
movq %r13, %rdi
movl %r12d, %esi
movq %r15, %rcx
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq 0x68(%rsp)
callq 0x22d5
addq $0x20, %rsp
incq %rbx
jmp 0x2259
movq (%rsp), %rdi
callq 0x1030
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %rbx
movq %rcx, 0x8(%rsp)
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
xorl %r8d, %r8d
movl $0x1312d00, %r15d       # imm = 0x1312D00
movq %rbx, %r14
subq %r8, %r14
jbe 0x27da
testl %ebp, %ebp
setne %al
leaq (%r8,%r15), %rcx
cmpq %rbx, %rcx
cmovbq %r15, %r14
setae %cl
andb %al, %cl
movzbl %cl, %edx
addq %r8, %r14
subq $0x8, %rsp
movq %r13, %rdi
movl %r12d, %esi
movq 0x10(%rsp), %rcx
movq %r14, %r9
pushq 0x60(%rsp)
pushq 0x60(%rsp)
pushq 0x28(%rsp)
callq 0x1f81
addq $0x20, %rsp
movq %r14, %r8
jmp 0x278b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %edx
xorl %r13d, %r13d
movl %esi, 0x4(%rsp)
movl %edi, (%rsp)
cmpl %r13d, %edx
je 0x30c5
xorl %r12d, %r12d
btl %r13d, %edi
setb %bpl
movb (%r15), %cl
movq (%rbx), %rsi
andb $0x7, %cl
jne 0x30af
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x3083
testq %rsi, %rsi
je 0x3088
movq (%r14), %rdi
addq %rsi, %rsi
callq 0x1140
movq (%rbx), %rsi
jmp 0x3092
movq (%r14), %rax
jmp 0x309c
pushq $0x1
popq %rdi
callq 0x1120
xorl %esi, %esi
movq %rax, (%r14)
movl 0x4(%rsp), %edx
movl (%rsp), %edi
movb $0x0, (%rax,%rsi)
movq (%rbx), %rsi
incq %rsi
movq %rsi, (%rbx)
movb (%r15), %cl
andb $0x7, %cl
movb %bpl, %r12b
shll %cl, %r12d
movq (%r14), %rax
orb %r12b, -0x1(%rax,%rsi)
incb (%r15)
incl %r13d
jmp 0x304a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
decl %ebp
movl %edi, 0x4(%rsp)
cmpl $-0x1, %ebp
je 0x3166
xorl %r13d, %r13d
btl %ebp, %edi
setb %r12b
movb (%r15), %cl
movq (%rbx), %rsi
andb $0x7, %cl
jne 0x3151
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x3128
testq %rsi, %rsi
je 0x312d
movq (%r14), %rdi
addq %rsi, %rsi
callq 0x1140
movq (%rbx), %rsi
jmp 0x3137
movq (%r14), %rax
jmp 0x313e
pushq $0x1
popq %rdi
callq 0x1120
xorl %esi, %esi
movq %rax, (%r14)
movl 0x4(%rsp), %edi
movb $0x0, (%rax,%rsi)
movq (%rbx), %rsi
incq %rsi
movq %rsi, (%rbx)
movb (%r15), %cl
andb $0x7, %cl
movb %r12b, %r13b
shll %cl, %r13d
movq (%r14), %rax
orb %r13b, -0x1(%rax,%rsi)
incb (%r15)
decl %ebp
jmp 0x30f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/hash.c
// Function: ZopfliInitHash
void ZopfliInitHash(size_t window_size, ZopfliHash* h) {
  size_t i;

  h->val = 0;
  h->head = (int*)malloc(sizeof(*h->head) * 65536);
  h->prev = (unsigned short*)malloc(sizeof(*h->prev) * window_size);
  h->hashval = (int*)malloc(sizeof(*h->hashval) * window_size);
  for (i = 0; i < 65536; i++) {
    h->head[i] = -1;  /* -1 indicates no head so far. */
  }
  for (i = 0; i < window_size; i++) {
    h->prev[i] = i;  /* If prev[j] == j, then prev[j] is uninitialized. */
    h->hashval[i] = -1;
  }

#ifdef ZOPFLI_HASH_SAME
  h->same = (unsigned short*)malloc(sizeof(*h->same) * window_size);
  for (i = 0; i < window_size; i++) {
    h->same[i] = 0;
  }
#endif

#ifdef ZOPFLI_HASH_SAME_HASH
  h->val2 = 0;
  h->head2 = (int*)malloc(sizeof(*h->head2) * 65536);
  h->prev2 = (unsigned short*)malloc(sizeof(*h->prev2) * window_size);
  h->hashval2 = (int*)malloc(sizeof(*h->hashval2) * window_size);
  for (i = 0; i < 65536; i++) {
    h->head2[i] = -1;
  }
  for (i = 0; i < window_size; i++) {
    h->prev2[i] = i;
    h->hashval2[i] = -1;
  }
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
andl $0x0, 0x18(%rsi)
movl $0x40000, %edi          # imm = 0x40000
callq 0x1120
movq %rax, %rbp
movq %rax, (%r14)
leaq (%rbx,%rbx), %r15
movq %r15, %rdi
callq 0x1120
movq %rax, %r13
movq %rax, 0x8(%r14)
leaq (,%rbx,4), %r12
movq %r12, %rdi
callq 0x1120
movq %rax, 0x10(%r14)
xorl %ecx, %ecx
cmpq $0x10000, %rcx          # imm = 0x10000
je 0x3d49
orl $-0x1, (%rbp,%rcx,4)
incq %rcx
jmp 0x3d36
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x3d5f
movw %cx, (%r13,%rcx,2)
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x3d4b
movq %r15, %rdi
callq 0x1120
movq %rax, 0x40(%r14)
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x3d7c
andw $0x0, (%rax,%rcx,2)
incq %rcx
jmp 0x3d6d
andl $0x0, 0x38(%r14)
movl $0x40000, %edi          # imm = 0x40000
callq 0x1120
movq %rax, %r13
movq %rax, 0x20(%r14)
movq %r15, %rdi
callq 0x1120
movq %rax, %r15
movq %rax, 0x28(%r14)
movq %r12, %rdi
callq 0x1120
movq %rax, 0x30(%r14)
xorl %ecx, %ecx
cmpq $0x10000, %rcx          # imm = 0x10000
je 0x3dc3
orl $-0x1, (%r13,%rcx,4)
incq %rcx
jmp 0x3daf
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x3dd8
movw %cx, (%r15,%rcx,2)
orl $-0x1, (%rax,%rcx,4)
incq %rcx
jmp 0x3dc5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/hash.c
// Function: ZopfliUpdateHash
void ZopfliUpdateHash(const unsigned char* array, size_t pos, size_t end,
                ZopfliHash* h) {
  unsigned short hpos = pos & ZOPFLI_WINDOW_MASK;
#ifdef ZOPFLI_HASH_SAME
  size_t amount = 0;
#endif

  UpdateHashValue(h, pos + ZOPFLI_MIN_MATCH <= end ?
      array[pos + ZOPFLI_MIN_MATCH - 1] : 0);
  h->hashval[hpos] = h->val;
  if (h->head[h->val] != -1 && h->hashval[h->head[h->val]] == h->val) {
    h->prev[hpos] = h->head[h->val];
  }
  else h->prev[hpos] = hpos;
  h->head[h->val] = hpos;

#ifdef ZOPFLI_HASH_SAME
  /* Update "same". */
  if (h->same[(pos - 1) & ZOPFLI_WINDOW_MASK] > 1) {
    amount = h->same[(pos - 1) & ZOPFLI_WINDOW_MASK] - 1;
  }
  while (pos + amount + 1 < end &&
      array[pos] == array[pos + amount + 1] && amount < (unsigned short)(-1)) {
    amount++;
  }
  h->same[hpos] = amount;
#endif

#ifdef ZOPFLI_HASH_SAME_HASH
  h->val2 = ((h->same[hpos] - ZOPFLI_MIN_MATCH) & 255) ^ h->val;
  h->hashval2[hpos] = h->val2;
  if (h->head2[h->val2] != -1 && h->hashval2[h->head2[h->val2]] == h->val2) {
    h->prev2[hpos] = h->head2[h->val2];
  }
  else h->prev2[hpos] = hpos;
  h->head2[h->val2] = hpos;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x3(%rsi), %r9
xorl %r8d, %r8d
cmpq %rdx, %r9
ja 0x3e49
movzbl 0x2(%rdi,%rsi), %r8d
movl 0x18(%rcx), %r10d
shll $0x5, %r10d
andl $0x7fe0, %r10d          # imm = 0x7FE0
xorl %r8d, %r10d
movl %r10d, 0x18(%rcx)
movq 0x10(%rcx), %r9
movl %esi, %r8d
andl $0x7fff, %r8d           # imm = 0x7FFF
movl %r8d, %r11d
movl %r10d, (%r9,%r11,4)
movq (%rcx), %r10
movslq 0x18(%rcx), %r11
movslq (%r10,%r11,4), %rbx
movl %eax, %ebp
cmpq $-0x1, %rbx
je 0x3e90
cmpl %r11d, (%r9,%rbx,4)
cmovnel %eax, %ebx
movl %ebx, %ebp
movq 0x8(%rcx), %r9
movw %bp, (%r9,%r8,2)
movzwl %ax, %r9d
movl %r9d, (%r10,%r11,4)
movq 0x40(%rcx), %r10
leal -0x1(%rsi), %r11d
andl $0x7fff, %r11d          # imm = 0x7FFF
movzwl (%r10,%r11,2), %ebx
leal -0x1(%rbx), %r14d
xorl %r11d, %r11d
cmpl $0x2, %ebx
cmovaeq %r14, %r11
leaq 0x1(%rsi), %rbx
leaq (%rdi,%rsi), %r14
incq %r14
leaq (%rbx,%r11), %r15
cmpq %rdx, %r15
jae 0x3eef
cmpq $0xfffe, %r11           # imm = 0xFFFE
ja 0x3eef
movb (%r14,%r11), %bpl
cmpb %bpl, (%rdi,%rsi)
jne 0x3eef
incq %r11
jmp 0x3ece
movw %r11w, (%r10,%r8,2)
addl $0xfd, %r11d
movzbl %r11b, %edx
xorl 0x18(%rcx), %edx
movl %edx, 0x38(%rcx)
movq 0x30(%rcx), %r10
movl %edx, (%r10,%r8,4)
movq 0x20(%rcx), %rdx
movslq 0x38(%rcx), %rsi
movslq (%rdx,%rsi,4), %rdi
cmpq $-0x1, %rdi
je 0x3f28
cmpl %esi, (%r10,%rdi,4)
cmovnel %eax, %edi
movl %edi, %eax
movq 0x28(%rcx), %rcx
movw %ax, (%rcx,%r8,2)
movl %r9d, (%rdx,%rsi,4)
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/katajainen.c
// Function: BoundaryPM
static void BoundaryPM(Node* (*lists)[2], int maxbits,
    Node* leaves, int numsymbols, NodePool* pool, int index, char final) {
  Node* newchain;
  Node* oldchain;
  int lastcount = lists[index][1]->count;  /* Count of last chain of list. */

  if (index == 0 && lastcount >= numsymbols) return;

  newchain = GetFreeNode(lists, maxbits, pool);
  oldchain = lists[index][1];

  /* These are set up before the recursive calls below, so that there is a list
  pointing to the new node, to let the garbage collection know it's in use. */
  lists[index][0] = oldchain;
  lists[index][1] = newchain;

  if (index == 0) {
    /* New leaf node in list 0. */
    InitNode(leaves[lastcount].weight, lastcount + 1, 0, newchain);
  } else {
    size_t sum = lists[index - 1][0]->weight + lists[index - 1][1]->weight;
    if (lastcount < numsymbols && sum > leaves[lastcount].weight) {
      /* New leaf inserted in list, so count is incremented. */
      InitNode(leaves[lastcount].weight, lastcount + 1, oldchain->tail,
          newchain);
    } else {
      InitNode(sum, lastcount, lists[index - 1][1], newchain);
      if (!final) {
        /* Two lookahead chains of previous list used up, create new ones. */
        BoundaryPM(lists, maxbits, leaves, numsymbols, pool, index - 1, 0);
        BoundaryPM(lists, maxbits, leaves, numsymbols, pool, index - 1, 0);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, 0x20(%rsp)
movl %ecx, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movl %esi, 0xc(%rsp)
cmpb $0x0, 0x60(%rsp)
sete %bpl
movslq %r9d, %rbx
movq %rbx, %rax
shlq $0x4, %rax
movq %rdi, 0x18(%rsp)
leaq (%rax,%rdi), %r14
addq $0x8, %r14
leal -0x1(%rbx), %r13d
movq (%r14), %rax
movl 0x10(%rax), %r12d
testq %rbx, %rbx
jne 0x423a
cmpl 0x8(%rsp), %r12d
jge 0x42f5
movslq %r12d, %r15
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0x20(%rsp), %rdx
callq 0x4304
movq (%r14), %rcx
movq %rcx, -0x8(%r14)
movq %rax, (%r14)
addq $-0x1, %rbx
jae 0x42ce
movq -0x18(%r14), %rdx
movq -0x10(%r14), %rsi
movq (%rsi), %rdi
addq (%rdx), %rdi
cmpl 0x8(%rsp), %r12d
jge 0x4287
imulq $0x18, %r15, %rdx
movq 0x10(%rsp), %r8
movq (%r8,%rdx), %rdx
cmpq %rdx, %rdi
ja 0x42df
movq %rdi, (%rax)
movl %r12d, 0x10(%rax)
movq %rsi, 0x8(%rax)
movb $0x1, 0x14(%rax)
testb $0x1, %bpl
je 0x42f5
andl $0x0, (%rsp)
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %ecx
movq 0x20(%rsp), %r8
movl %r13d, %r9d
callq 0x41df
addq $-0x10, %r14
decl %r13d
movb $0x1, %bpl
jmp 0x4223
imulq $0x18, %r15, %rcx
movq 0x10(%rsp), %rdx
movq (%rdx,%rcx), %rdx
xorl %ecx, %ecx
jmp 0x42e3
movq 0x8(%rcx), %rcx
incl %r12d
movq %rdx, (%rax)
movl %r12d, 0x10(%rax)
movq %rcx, 0x8(%rax)
movb $0x1, 0x14(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 (%rdx), %rcx
movq 0x8(%rdx), %r10
movslq 0x10(%rdx), %rax
imulq $0x18, %rax, %r8
addq %rcx, %r8
addl %esi, %esi
xorl %r9d, %r9d
testl %eax, %eax
movl $0x0, %r11d
cmovgl %eax, %r11d
testl %esi, %esi
cmovlel %r9d, %esi
imulq $0x18, %r11, %r9
movq %r10, %rax
cmpq %r8, %r10
jb 0x438b
xorl %eax, %eax
cmpq %rax, %r9
je 0x434b
movb $0x0, 0x14(%rcx,%rax)
addq $0x18, %rax
jmp 0x433b
movq %rcx, %rax
testq %rdi, %rdi
je 0x438b
xorl %eax, %eax
cmpl %esi, %eax
je 0x4388
movl %eax, %r10d
shrl %r10d
movl %eax, %r11d
andl $0x1, %r11d
shlq $0x4, %r10
addq %rdi, %r10
leaq (%r10,%r11,8), %r10
movq (%r10), %r10
testq %r10, %r10
je 0x4384
movb $0x1, 0x14(%r10)
addq $0x8, %r10
jmp 0x4371
incl %eax
jmp 0x4355
movq %rcx, %rax
leaq 0x18(%rax), %r10
cmpb $0x0, 0x14(%rax)
movq %r10, 0x8(%rdx)
jne 0x4331
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x43a8
movq 0x10(%rbx), %r13
leaq (,%r13,2), %r12
movq %r12, %rdi
callq 0x1120
movq %rax, %r14
movq %rax, (%r15)
movq %r12, %rdi
callq 0x1120
movq %rax, 0x8(%r15)
testq %r14, %r14
je 0x443b
testq %rax, %rax
je 0x443b
movq %r13, 0x10(%r15)
movq 0x10(%rbx), %rcx
xorl %edx, %edx
cmpq %rcx, %rdx
jae 0x4431
movq (%rbx), %rsi
movzwl (%rsi,%rdx,2), %esi
movw %si, (%r14,%rdx,2)
movq 0x8(%rbx), %rsi
movzwl (%rsi,%rdx,2), %esi
movw %si, (%rax,%rdx,2)
incq %rdx
jmp 0x440f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $-0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rax
movl %r8d, %eax
leaq (%rax,%rdx), %r8
cmpq %rsi, %r8
ja 0x4525
addq %rdx, %rdi
movzwl %cx, %ecx
negq %rcx
subq $0x1, %rax
jb 0x4523
movb (%rdi,%rcx), %dl
leaq 0x1(%rdi), %rsi
cmpb (%rdi), %dl
movq %rsi, %rdi
je 0x44f2
leaq 0x346d(%rip), %rdi      # 0x797a
leaq 0x33ff(%rip), %rsi      # 0x7913
leaq 0x33ff(%rip), %rcx      # 0x791a
pushq $0x5a
popq %rdx
callq 0x10b0
popq %rax
retq
leaq 0x33ce(%rip), %rdi      # 0x78fa
leaq 0x33e0(%rip), %rsi      # 0x7913
leaq 0x33e0(%rip), %rcx      # 0x791a
pushq $0x57
jmp 0x451d
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %eax, %eax
cmpq $0x120, %rax            # imm = 0x120
je 0x5051
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0x503f
xorl %eax, %eax
cmpq $0x20, %rax
je 0x509a
andq $0x0, (%r14,%rax,8)
incq %rax
jmp 0x5053
cmpw $0x0, (%r13,%r12,2)
movzwl (%rbp,%r12,2), %edi
je 0x5090
callq 0x63d5
cltq
incq (%rbx,%rax,8)
movzwl (%r13,%r12,2), %edi
callq 0x6394
cltq
leaq (%r14,%rax,8), %rax
jmp 0x5094
leaq (%rbx,%rdi,8), %rax
incq (%rax)
incq %r12
cmpq %r15, %r12
jb 0x5063
movq $0x1, 0x800(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x900(%rsi), %r15
xorl %r12d, %r12d
cmpq 0x10(%r14), %r12
jae 0x5615
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpw $0x0, (%rcx,%r12,2)
movzwl (%rax,%r12,2), %edi
je 0x5609
callq 0x63d5
cltq
incq (%rbx,%rax,8)
movq 0x8(%r14), %rax
movzwl (%rax,%r12,2), %edi
callq 0x6394
cltq
leaq (%r15,%rax,8), %rax
jmp 0x560d
leaq (%rbx,%rdi,8), %rax
incq (%rax)
incq %r12
jmp 0x55ce
movq $0x1, 0x800(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5f78
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %edi, %r14d
testl %esi, %esi
je 0x5f63
movl %esi, %ebp
movl %r14d, %edi
callq 0x63d5
movl %eax, %r15d
movl %r14d, %edi
callq 0x63b9
movl %eax, %r14d
movl %ebp, %edi
callq 0x6394
movl %eax, %r12d
movl %ebp, %edi
callq 0x6358
movslq %r15d, %rcx
cvtsi2sd %r14d, %xmm1
addsd 0xa00(%rbx,%rcx,8), %xmm1
movslq %r12d, %rcx
addsd 0x1300(%rbx,%rcx,8), %xmm1
cvtsi2sd %eax, %xmm0
addsd %xmm1, %xmm0
jmp 0x5f6f
movl %r14d, %eax
movsd 0xa00(%rbx,%rax,8), %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: ZopfliLZ77OptimalFixed
void ZopfliLZ77OptimalFixed(ZopfliBlockState *s,
                            const unsigned char* in,
                            size_t instart, size_t inend,
                            ZopfliLZ77Store* store)
{
  /* Dist to get to here with smallest cost. */
  size_t blocksize = inend - instart;
  unsigned short* length_array =
      (unsigned short*)malloc(sizeof(unsigned short) * (blocksize + 1));
  unsigned short* path = 0;
  size_t pathsize = 0;

  if (!length_array) exit(-1); /* Allocation failed. */

  s->blockstart = instart;
  s->blockend = inend;

  /* Shortest path for fixed tree This one should give the shortest possible
  result for fixed tree, no repeated runs are needed since the tree is known. */
  LZ77OptimalRun(s, in, instart, inend, &path, &pathsize,
                 length_array, GetCostFixed, 0, store);

  free(length_array);
  free(path);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq %rcx, %rax
subq %rdx, %rax
leaq 0x2(,%rax,2), %rdi
callq 0x1120
andq $0x0, 0x10(%rsp)
andq $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x6040
movq %rax, %r14
movq %r12, 0x10(%rbp)
movq %r15, 0x18(%rbp)
leaq 0x4e(%rip), %rax        # 0x6048
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r8, %r15
pushq %rbx
pushq $0x0
pushq %rax
pushq %r14
callq 0x5633
addq $0x20, %rsp
movq %r14, %rdi
callq 0x1030
movq (%r15), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
pushq $-0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/squeeze.c
// Function: GetCostFixed
static double GetCostFixed(unsigned litlen, unsigned dist, void* unused) {
  (void)unused;
  if (dist == 0) {
    if (litlen <= 143) return 8;
    else return 9;
  } else {
    int dbits = ZopfliGetDistExtraBits(dist);
    int lbits = ZopfliGetLengthExtraBits(litlen);
    int lsym = ZopfliGetLengthSymbol(litlen);
    double cost = 0;
    if (lsym <= 279) cost += 7;
    else cost += 8;
    cost += 5;  /* Every dist symbol has length 5. */
    return cost + dbits + lbits;
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
testl %esi, %esi
je 0x6091
movl %esi, %edi
callq 0x6358
movl %eax, %ebp
movl %ebx, %edi
callq 0x63b9
movl %eax, %r14d
movl %ebx, %edi
callq 0x63d5
xorl %ecx, %ecx
cmpl $0x118, %eax            # imm = 0x118
cvtsi2sd %ebp, %xmm1
setl %cl
leaq 0x1c6f(%rip), %rax      # 0x7cf0
addsd (%rax,%rcx,8), %xmm1
cvtsi2sd %r14d, %xmm0
addsd %xmm1, %xmm0
jmp 0x60a8
xorl %eax, %eax
cmpl $0x90, %ebx
setb %al
leaq 0x1c5d(%rip), %rcx      # 0x7d00
movsd (%rcx,%rax,8), %xmm0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/tree.c
// Function: ZopfliLengthsToSymbols
void ZopfliLengthsToSymbols(const unsigned* lengths, size_t n, unsigned maxbits,
                            unsigned* symbols) {
  size_t* bl_count = (size_t*)malloc(sizeof(size_t) * (maxbits + 1));
  size_t* next_code = (size_t*)malloc(sizeof(size_t) * (maxbits + 1));
  unsigned bits, i;
  unsigned code;

  for (i = 0; i < n; i++) {
    symbols[i] = 0;
  }

  /* 1) Count the number of codes for each code length. Let bl_count[N] be the
  number of codes of length N, N >= 1. */
  for (bits = 0; bits <= maxbits; bits++) {
    bl_count[bits] = 0;
  }
  for (i = 0; i < n; i++) {
    assert(lengths[i] <= maxbits);
    bl_count[lengths[i]]++;
  }
  /* 2) Find the numerical value of the smallest code for each code length. */
  code = 0;
  bl_count[0] = 0;
  for (bits = 1; bits <= maxbits; bits++) {
    code = (code + bl_count[bits-1]) << 1;
    next_code[bits] = code;
  }
  /* 3) Assign numerical values to all codes, using consecutive values for all
  codes of the same length with the base values determined at step 2. */
  for (i = 0;  i < n; i++) {
    unsigned len = lengths[i];
    if (len != 0) {
      symbols[i] = next_code[len];
      next_code[len]++;
    }
  }

  free(bl_count);
  free(next_code);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leal 0x1(%rbp), %r13d
shlq $0x3, %r13
movq %r13, %rdi
callq 0x1120
movq %rax, %r12
movq %r13, %rdi
callq 0x1120
movq %rax, %r13
xorl %eax, %eax
movl %eax, %eax
cmpq %r14, %rax
jae 0x6189
andl $0x0, (%rbx,%rax,4)
incl %eax
jmp 0x617a
xorl %eax, %eax
cmpl %ebp, %eax
ja 0x619a
movl %eax, %ecx
andq $0x0, (%r12,%rcx,8)
incl %eax
jmp 0x618b
xorl %eax, %eax
cmpl %r14d, %eax
jae 0x61b2
movl (%r15,%rax,4), %ecx
cmpl %ebp, %ecx
ja 0x621e
incq (%r12,%rcx,8)
incq %rax
jmp 0x619c
andq $0x0, (%r12)
xorl %edx, %edx
xorl %eax, %eax
leaq 0x1(%rdx), %rcx
cmpl %ebp, %ecx
ja 0x61db
andl $-0x2, %eax
addq (%r12,%rdx,8), %rax
addq %rax, %rax
movl %eax, %edx
movl %ecx, %esi
movq %rdx, (%r13,%rsi,8)
movq %rcx, %rdx
jmp 0x61bb
xorl %eax, %eax
cmpl %r14d, %eax
jae 0x6200
movl (%r15,%rax,4), %ecx
testq %rcx, %rcx
je 0x61fb
movq (%r13,%rcx,8), %rdx
movl %edx, (%rbx,%rax,4)
incq %rdx
movq %rdx, (%r13,%rcx,8)
incq %rax
jmp 0x61dd
movq %r12, %rdi
callq 0x1030
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0x1e8b(%rip), %rdi      # 0x80b0
leaq 0x1e9a(%rip), %rsi      # 0x80c6
leaq 0x1e9a(%rip), %rcx      # 0x80cd
pushq $0x2f
popq %rdx
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/tree.c
// Function: ZopfliCalculateEntropy
void ZopfliCalculateEntropy(const size_t* count, size_t n, double* bitlengths) {
  static const double kInvLog2 = 1.4426950408889;  /* 1.0 / log(2.0) */
  unsigned sum = 0;
  unsigned i;
  double log2sum;
  for (i = 0; i < n; ++i) {
    sum += count[i];
  }
  log2sum = (sum == 0 ? log(n) : log(sum)) * kInvLog2;
  for (i = 0; i < n; ++i) {
    /* When the count of the symbol is 0, but its cost is requested anyway, it
    means the symbol will appear at least once anyway, so give it the cost as if
    its count is 1.*/
    if (count[i] == 0) bitlengths[i] = log2sum;
    else bitlengths[i] = log2sum - log(count[i]) * kInvLog2;
    /* Depending on compiler and architecture, the above subtraction of two
    floating point numbers may give a negative result very close to zero
    instead of zero (e.g. -5.973954e-17 with gcc 4.1.2 on Ubuntu 11.4). Clamp
    it to zero. These floating point imprecisions do not affect the cost model
    significantly so this is ok. */
    if (bitlengths[i] < 0 && bitlengths[i] > -1e-5) bitlengths[i] = 0;
    assert(bitlengths[i] >= 0);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ecx, %ecx
xorl %eax, %eax
movl %ecx, %ecx
cmpq %r14, %rcx
jae 0x625f
addl (%r15,%rcx,8), %eax
incl %ecx
jmp 0x6250
testl %eax, %eax
je 0x626c
movl %eax, %eax
cvtsi2sd %rax, %xmm0
jmp 0x6271
cvtsi2sd %r14, %xmm0
callq 0x10d0
movapd %xmm0, %xmm1
mulsd 0x1e16(%rip), %xmm1     # 0x8098
xorl %r12d, %r12d
xorpd %xmm2, %xmm2
movsd %xmm1, (%rsp)
movl %r12d, %r12d
cmpq %r14, %r12
jae 0x6306
movq (%r15,%r12,8), %rax
movapd %xmm1, %xmm0
testq %rax, %rax
je 0x62de
movq %rax, %xmm1
punpckldq 0x1000(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1008(%rip), %xmm1     # 0x72c0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x10d0
xorpd %xmm2, %xmm2
movsd (%rsp), %xmm1
mulsd 0x1dc6(%rip), %xmm0     # 0x80a0
addsd %xmm1, %xmm0
movsd %xmm0, (%rbx,%r12,8)
ucomisd %xmm0, %xmm2
jbe 0x62fb
ucomisd 0x1db6(%rip), %xmm0     # 0x80a8
jbe 0x62fb
andq $0x0, (%rbx,%r12,8)
jmp 0x6301
ucomisd %xmm2, %xmm0
jb 0x6312
incl %r12d
jmp 0x628e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1e0c(%rip), %rdi      # 0x8125
leaq 0x1da6(%rip), %rsi      # 0x80c6
leaq 0x1e11(%rip), %rcx      # 0x8138
pushq $0x5c
popq %rdx
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/zopfli_bin.c
// Function: AddStrings
static char* AddStrings(const char* str1, const char* str2) {
  size_t len = strlen(str1) + strlen(str2);
  char* result = (char*)malloc(len + 1);
  if (!result) exit(-1); /* Allocation failed. */
  strcpy(result, str1);
  strcat(result, str2);
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1090
movq %rax, %r15
movq %rbx, %rdi
callq 0x1090
leaq (%r15,%rax), %rdi
incq %rdi
callq 0x1120
testq %rax, %rax
je 0x6b98
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x1160
pushq $-0x1
popq %rdi
callq 0x1170
// File: /workspace/github_c_makefile_star2_O2/imaya[P]zopfli-for-emscripten/zopfli_lib.c
// Function: ZopfliCompress
void ZopfliCompress(const ZopfliOptions* options, ZopfliFormat output_type,
                    const unsigned char* in, size_t insize,
                    unsigned char** out, size_t* outsize)
{
  if (output_type == ZOPFLI_FORMAT_GZIP) {
    ZopfliGzipCompress(options, in, insize, out, outsize);
  } else if (output_type == ZOPFLI_FORMAT_ZLIB) {
    ZopfliZlibCompress(options, in, insize, out, outsize);
  } else if (output_type == ZOPFLI_FORMAT_DEFLATE) {
    unsigned char bp = 0;
    ZopfliDeflate(options, 2 /* Dynamic block */, 1,
                  in, insize, &bp, out, outsize);
  } else {
    assert(0);
  }
}

// Assembly:
pushq %rax
movq %r9, %rax
movq %r8, %r10
movq %rcx, %r8
movq %rdx, %rcx
cmpl $0x2, %esi
je 0x6bf1
cmpl $0x1, %esi
je 0x6bdf
testl %esi, %esi
jne 0x6c0c
movq %rcx, %rsi
movq %r8, %rdx
movq %r10, %rcx
movq %rax, %r8
popq %rax
jmp 0x3728
movq %rcx, %rsi
movq %r8, %rdx
movq %r10, %rcx
movq %rax, %r8
popq %rax
jmp 0x63e4
leaq 0x7(%rsp), %r9
movb $0x0, (%r9)
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
pushq %rax
pushq %r10
callq 0x275f
popq %rax
popq %rcx
popq %rax
retq
leaq 0x132d(%rip), %rdi      # 0x7f40
leaq 0x2596(%rip), %rsi      # 0x91b0
leaq 0x259c(%rip), %rcx      # 0x91bd
pushq $0x23
popq %rdx
callq 0x10b0