// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movq 0xa0(%rsp), %rax
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x80(%rsp)
movl %esi, 0x7c(%rsp)
movl %edx, 0x78(%rsp)
movq %rcx, 0x70(%rsp)
movq %r8, 0x68(%rsp)
movq %r9, 0x60(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
cmpl $0x0, 0x7c(%rsp)
jne 0x323c
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %rdx
movl $0xffff, %ecx           # imm = 0xFFFF
leaq 0x50(%rsp), %r8
leaq 0x48(%rsp), %r9
callq 0x21d0
jmp 0x327d
cmpl $0x1, 0x7c(%rsp)
jne 0x3245
jmp 0x327b
movq 0x80(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x80(%rsp), %rax
movslq 0x10(%rax), %r8
leaq 0x50(%rsp), %r9
leaq 0x48(%rsp), %rax
movq %rax, (%rsp)
callq 0x1f10
jmp 0x327d
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x48(%rsp), %rax
ja 0x3392
cmpq $0x0, 0x58(%rsp)
jne 0x32aa
movq 0x68(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x32c1
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x48(%rsp), %rax
jne 0x32e3
movq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x32f6
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x58(%rsp), %rcx
xorl %eax, %eax
cmpq 0x48(%rsp), %rcx
movb %al, 0x27(%rsp)
jne 0x3333
cmpl $0x0, 0x78(%rsp)
setne %al
movb %al, 0x27(%rsp)
movl 0x20(%rsp), %esi
movq 0x18(%rsp), %rdi
movb 0x27(%rsp), %al
andb $0x1, %al
movzbl %al, %edx
movq 0x70(%rsp), %rcx
movq 0x40(%rsp), %r8
movq 0x38(%rsp), %r9
movq 0x90(%rsp), %r11
movq 0x98(%rsp), %r10
movq 0xa0(%rsp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x33b0
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x3286
movq 0x50(%rsp), %rdi
callq 0x1030
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)