// File: /workspace/github_c_makefile_star2_O1/imaya[P]zopfli-for-emscripten/zlib_container.c
// Function: ZopfliZlibCompress
void ZopfliZlibCompress(const ZopfliOptions* options,
                        const unsigned char* in, size_t insize,
                        unsigned char** out, size_t* outsize) {
  unsigned char bitpointer = 0;
  unsigned checksum = adler32(in, (unsigned)insize);
  unsigned cmf = 120;  /* CM 8, CINFO 7. See zlib spec.*/
  unsigned flevel = 0;
  unsigned fdict = 0;
  unsigned cmfflg = 256 * cmf + fdict * 32 + flevel * 64;
  unsigned fcheck = 31 - cmfflg % 31;
  cmfflg += fcheck;

  ZOPFLI_APPEND_DATA(cmfflg / 256, out, outsize);
  ZOPFLI_APPEND_DATA(cmfflg % 256, out, outsize);

  ZopfliDeflate(options, 2 /* dynamic block */, 1 /* final */,
                in, insize, &bitpointer, out, outsize);

  ZOPFLI_APPEND_DATA((checksum >> 24) % 256, out, outsize);
  ZOPFLI_APPEND_DATA((checksum >> 16) % 256, out, outsize);
  ZOPFLI_APPEND_DATA((checksum >> 8) % 256, out, outsize);
  ZOPFLI_APPEND_DATA(checksum % 256, out, outsize);

  if (options->verbose) {
    fprintf(stderr,
            "Original Size: %d, Compressed: %d, Compression: %f%% Removed\n",
            (int)insize, (int)*outsize,
            100.0f * (float)(insize - *outsize) / (float)insize);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r15
movb $0x0, 0x7(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
andq %rdx, %rax
je 0x8b1c
movl $0x1, %ecx
xorl %ebx, %ebx
movl $0x15ae, %edx           # imm = 0x15AE
movl $0x80078071, %esi       # imm = 0x80078071
movq %r13, %rdi
cmpq %rdx, %rax
movl $0x15ae, %r8d           # imm = 0x15AE
cmovbq %rax, %r8
xorl %r9d, %r9d
movzbl (%rdi,%r9), %r10d
addl %r10d, %ecx
addl %ecx, %ebx
incq %r9
cmpq %r9, %r8
jne 0x8ad1
addq %r8, %rdi
movl %ecx, %r9d
imulq %rsi, %r9
shrq $0x2f, %r9
imull $0xfff1, %r9d, %r9d     # imm = 0xFFF1
subl %r9d, %ecx
movl %ebx, %r9d
imulq %rsi, %r9
shrq $0x2f, %r9
imull $0xfff1, %r9d, %r9d     # imm = 0xFFF1
subl %r9d, %ebx
subq %r8, %rax
jne 0x8ac1
shll $0x10, %ebx
orl %ecx, %ebx
jmp 0x8b21
movl $0x1, %ebx
movq (%r14), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x8b4e
testq %rsi, %rsi
je 0x8b40
movq (%r12), %rdi
addq %rsi, %rsi
callq 0x1140
jmp 0x8b4a
movl $0x1, %edi
callq 0x1120
movq %rax, (%r12)
movq (%r12), %rax
movq (%r14), %rcx
movb $0x78, (%rax,%rcx)
movq (%r14), %rax
leaq 0x1(%rax), %rsi
movq %rsi, (%r14)
testq %rax, %rsi
jne 0x8b89
testq %rsi, %rsi
je 0x8b7b
movq (%r12), %rdi
addq %rsi, %rsi
callq 0x1140
jmp 0x8b85
movl $0x1, %edi
callq 0x1120
movq %rax, (%r12)
movq (%r12), %rax
movq (%r14), %rcx
movb $0x1, (%rax,%rcx)
incq (%r14)
leaq 0x7(%rsp), %r9
movq %r15, %rdi
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rcx
movq %rbp, %r8
pushq %r14
pushq %r12
callq 0x2f24
addq $0x10, %rsp
movq (%r14), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x8be9
testq %rsi, %rsi
je 0x8bdb
movq (%r12), %rdi
addq %rsi, %rsi
callq 0x1140
jmp 0x8be5
movl $0x1, %edi
callq 0x1120
movq %rax, (%r12)
movl %ebx, %eax
shrl $0x18, %eax
movq (%r12), %rcx
movq (%r14), %rdx
movb %al, (%rcx,%rdx)
movq (%r14), %rax
leaq 0x1(%rax), %rsi
movq %rsi, (%r14)
testq %rax, %rsi
jne 0x8c28
testq %rsi, %rsi
je 0x8c1a
movq (%r12), %rdi
addq %rsi, %rsi
callq 0x1140
jmp 0x8c24
movl $0x1, %edi
callq 0x1120
movq %rax, (%r12)
movl %ebx, %eax
shrl $0x10, %eax
movq (%r12), %rcx
movq (%r14), %rdx
movb %al, (%rcx,%rdx)
movq (%r14), %rax
leaq 0x1(%rax), %rsi
movq %rsi, (%r14)
testq %rax, %rsi
jne 0x8c67
testq %rsi, %rsi
je 0x8c59
movq (%r12), %rdi
addq %rsi, %rsi
callq 0x1140
jmp 0x8c63
movl $0x1, %edi
callq 0x1120
movq %rax, (%r12)
movq (%r12), %rax
movq (%r14), %rcx
movb %bh, (%rax,%rcx)
movq (%r14), %rax
leaq 0x1(%rax), %rsi
movq %rsi, (%r14)
testq %rax, %rsi
jne 0x8ca1
testq %rsi, %rsi
je 0x8c93
movq (%r12), %rdi
addq %rsi, %rsi
callq 0x1140
jmp 0x8c9d
movl $0x1, %edi
callq 0x1120
movq %rax, (%r12)
movq (%r12), %rax
movq (%r14), %rcx
movb %bl, (%rax,%rcx)
movq (%r14), %rdi
incq %rdi
movq %rdi, (%r14)
cmpl $0x0, (%r15)
jne 0x8cc9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rsi
movl %ebp, %edx
callq 0x12e4
jmp 0x8cba
nopl (%rax)