// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %r9, 0x30(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r13
movq %rsi, 0x20(%rsp)
movq %rdi, 0x68(%rsp)
movq 0x330(%rsp), %r12
movl $0x3, %r14d
xorl %ebp, %ebp
movsd 0x24c2(%rip), %xmm0     # 0xa008
movsd %xmm0, 0x8(%rsp)
movl %r14d, %edi
movl $0x1, %esi
movq %r12, %rdx
callq *0x328(%rsp)
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r14d, %ebp
minsd %xmm1, %xmm0
incl %r14d
cmpl $0x103, %r14d           # imm = 0x103
jne 0x7b46
xorl %ebx, %ebx
movsd 0x2482(%rip), %xmm0     # 0xa008
xorl %r14d, %r14d
movsd %xmm0, 0x8(%rsp)
leaq 0x35ea(%rip), %rax      # 0xb180
movl (%rbx,%rax), %r15d
movl $0x3, %edi
movl %r15d, %esi
movq %r12, %rdx
callq *0x328(%rsp)
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r15d, %r14d
minsd %xmm1, %xmm0
addq $0x4, %rbx
cmpq $0x78, %rbx
jne 0x7b89
xorl %ecx, %ecx
movq %r13, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %rcx
movq %rcx, 0x58(%rsp)
movl %ebp, %edi
movl %r14d, %esi
movq %r12, %rdx
callq *0x328(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rsp), %r14
movb $0x1, %al
subq %r13, %r14
movq 0x20(%rsp), %rbp
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r12
je 0x8178
leaq 0x4(,%r14,4), %rdi
callq 0x1120
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x8540
movq %r14, 0x60(%rsp)
leaq 0x1(%r14), %rax
movq %rax, 0x18(%rsp)
movl $0x8000, %r15d          # imm = 0x8000
leaq 0x98(%rsp), %r14
movl $0x8000, %edi           # imm = 0x8000
movq %r14, %rsi
callq 0x4424
movq %rbp, %rdi
movq 0x58(%rsp), %rbx
movq %rbx, %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdx
movq %r14, %rcx
callq 0x4c16
cmpq %r13, %rbx
jae 0x7c9d
cmpq %r15, %r13
cmovbq %r13, %r15
negq %r15
leaq 0x98(%rsp), %r14
leaq (%r15,%r13), %rsi
movq %rbp, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x4af1
incq %r15
jne 0x7c86
cmpq $0x2, 0x18(%rsp)
movq %r12, %rdx
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %r12
movq 0x60(%rsp), %r14
movq 0x330(%rsp), %rbp
movq 0x40(%rsp), %rdi
jb 0x7dbf
leaq 0x3(%r14), %rax
andq $-0x4, %rax
leaq -0x1(%r14), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa 0x2528(%rip), %xmm1     # 0xa210
movdqa 0x2530(%rip), %xmm2     # 0xa220
movdqa 0x2538(%rip), %xmm3     # 0xa230
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rcx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x7d4b
movl $0x7149f2ca, 0x4(%rdi,%rcx,4) # imm = 0x7149F2CA
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x7d62
movl $0x7149f2ca, 0x8(%rdi,%rcx,4) # imm = 0x7149F2CA
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %esi
testb $0x1, %sil
je 0x7d9f
movl $0x7149f2ca, 0xc(%rdi,%rcx,4) # imm = 0x7149F2CA
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x7db2
movl $0x7149f2ca, 0x10(%rdi,%rcx,4) # imm = 0x7149F2CA
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x7d00
movl $0x0, (%rdi)
movq 0x320(%rsp), %rax
movw $0x0, (%rax)
cmpq %r13, %rdx
jbe 0x812d
leaq 0x103(%r13), %rax
movq %rax, 0x80(%rsp)
movq 0x320(%rsp), %rcx
subq %r13, %rcx
subq %r13, %rcx
addq $0x204, %rcx            # imm = 0x204
movq %rcx, 0x78(%rsp)
leaq (,%r13,4), %rax
subq %rax, %rdi
movq %rdi, 0x70(%rsp)
movq %r13, %r15
movq %r15, %rax
subq %r13, %rax
movq %rax, 0x48(%rsp)
movq 0x20(%rsp), %rdi
movq %r15, %rsi
leaq 0x98(%rsp), %r14
movq %r14, %rcx
callq 0x4af1
movq 0x10(%rsp), %r12
leaq 0x205(%r15), %rax
cmpq %r12, %rax
jae 0x7f3f
cmpq 0x80(%rsp), %r15
movq 0x328(%rsp), %rbx
jbe 0x7f47
movq 0xd8(%rsp), %rax
movl %r15d, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movzwl (%rax,%rcx,2), %ecx
cmpl $0x205, %ecx            # imm = 0x205
jb 0x7f47
leal 0x7efe(%r15), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpw $0x103, (%rax,%rcx,2)   # imm = 0x103
jb 0x7f47
movl $0x102, %edi            # imm = 0x102
movl $0x1, %esi
movq %rbp, %rdx
callq *%rbx
movsd %xmm0, 0x18(%rsp)
movq 0x78(%rsp), %rax
leaq (%rax,%r15,2), %r14
movq 0x70(%rsp), %rax
movq %r15, %r12
leaq (%rax,%r15,4), %r15
xorl %ebx, %ebx
movq 0x20(%rsp), %rbp
xorps %xmm0, %xmm0
cvtss2sd (%r15,%rbx,4), %xmm0
addsd 0x18(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x408(%r15,%rbx,4)
movw $0x102, (%r14,%rbx,2)   # imm = 0x102
leaq 0x1(%rbx,%r12), %rsi
movq %rbp, %rdi
movq 0x10(%rsp), %rdx
leaq 0x98(%rsp), %rcx
callq 0x4af1
incq %rbx
cmpq $0x102, %rbx            # imm = 0x102
jne 0x7ed0
addq %rbx, %r12
addq %rbx, 0x48(%rsp)
movq %r12, %r15
movq 0x330(%rsp), %rbp
movq 0x328(%rsp), %rbx
leaq 0x98(%rsp), %r14
jmp 0x7f47
movq 0x328(%rsp), %rbx
subq $0x8, %rsp
movl $0x102, %r9d            # imm = 0x102
movq 0x70(%rsp), %rdi
movq %r14, %rsi
movq 0x28(%rsp), %rdx
movq %r15, %rcx
movq 0x18(%rsp), %r8
leaq 0xe(%rsp), %rax
pushq %rax
leaq 0x66(%rsp), %rax
pushq %rax
leaq 0xf8(%rsp), %rax
pushq %rax
callq 0x684e
movq 0x30(%rsp), %rdx
addq $0x20, %rsp
leaq 0x1(%r15), %rax
movq %rax, 0x88(%rsp)
cmpq %rdx, %rax
movq 0x38(%rsp), %r12
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
ja 0x801c
movq %rbx, %rcx
movq %r12, %rbx
xorps %xmm0, %xmm0
cvtss2sd (%rdi,%rsi,4), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rdi, %r14
movzbl (%rax,%r15), %edi
movq %rsi, %r12
xorl %esi, %esi
movq %rbp, %rdx
callq *%rcx
addsd 0x18(%rsp), %xmm0
ucomisd 0x2e16(%rip), %xmm0     # 0xadf8
jb 0x8502
cvtss2sd 0x4(%r14,%r12,4), %xmm1
ucomisd %xmm0, %xmm1
movq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %r12
jbe 0x801c
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rdi,%rsi,4)
movq 0x320(%rsp), %rax
movw $0x1, 0x2(%rax,%rsi,2)
leaq 0x3(%r15), %rax
cmpq %rdx, %rax
ja 0x8112
cmpw $0x3, 0x6(%rsp)
jb 0x8112
movq 0x320(%rsp), %rax
leaq (%rax,%rsi,2), %rax
movq %rax, 0x90(%rsp)
leaq (%rdi,%rsi,4), %rbx
movl $0x3, %r14d
movss (%rbx,%r14,4), %xmm3
movss (%rdi,%rsi,4), %xmm0
movaps %xmm3, %xmm1
subss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm2
ucomisd %xmm1, %xmm2
jae 0x80f1
movss %xmm3, 0x2c(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movzwl 0xe0(%rsp,%r14,2), %esi
movl %r14d, %edi
movq %rbp, %rdx
callq *0x328(%rsp)
addsd 0x18(%rsp), %xmm0
ucomisd 0x2d4f(%rip), %xmm0     # 0xadf8
jb 0x840a
xorps %xmm1, %xmm1
cvtss2sd 0x2c(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movq 0x10(%rsp), %rdx
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
jbe 0x80f1
cmpq $0x103, %r14            # imm = 0x103
jae 0x8429
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx,%r14,4)
movq 0x90(%rsp), %rax
movw %r14w, (%rax,%r14,2)
leaq (%r14,%r15), %rax
incq %rax
cmpq %rdx, %rax
ja 0x8112
leaq 0x1(%r14), %rax
movzwl 0x6(%rsp), %ecx
cmpq %rcx, %r14
movq %rax, %r14
jb 0x8053
movq 0x88(%rsp), %r15
cmpq %rdx, %r15
movq 0x30(%rsp), %rbx
movq 0x60(%rsp), %r14
jb 0x7e17
movss (%rdi,%r14,4), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x854a
movq %rdi, %r15
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x4aae
movq %r15, %rdi
callq 0x1030
movsd 0x1e9e(%rip), %xmm0     # 0xa008
ucomisd 0x8(%rsp), %xmm0
seta %al
movq 0x20(%rsp), %rbp
movb %al, 0x2c(%rsp)
movq (%r12), %rdi
callq 0x1030
xorl %eax, %eax
movq %rax, (%r12)
movq %rax, (%rbx)
testq %r14, %r14
je 0x8237
movq (%rbx), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x81c5
testq %rsi, %rsi
je 0x81b7
movq (%r12), %rdi
shlq $0x2, %rsi
callq 0x1140
jmp 0x81c1
movl $0x2, %edi
callq 0x1120
movq %rax, (%r12)
movq 0x320(%rsp), %rsi
movzwl (%rsi,%r14,2), %ecx
movq (%r12), %rax
movq (%rbx), %rdx
movw %cx, (%rax,%rdx,2)
leaq 0x1(%rdx), %rcx
movq %rcx, (%rbx)
movzwl (%rsi,%r14,2), %esi
cmpq %rsi, %r14
jb 0x8448
cmpl $0x103, %esi            # imm = 0x103
jae 0x8486
testq %rsi, %rsi
je 0x8467
subq %rsi, %r14
jne 0x8197
cmpq $0x2, %rcx
jb 0x8237
shrq %rcx
leaq (%rax,%rdx,2), %rdx
xorl %esi, %esi
movzwl (%rax,%rsi,2), %edi
movzwl (%rdx), %r8d
movw %r8w, (%rax,%rsi,2)
movw %di, (%rdx)
incq %rsi
addq $-0x2, %rdx
cmpq %rsi, %rcx
jne 0x821b
movq 0x10(%rsp), %r15
cmpq %r13, %r15
je 0x83ed
movq (%r12), %rax
movq %rax, 0x18(%rsp)
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
movl $0x8000, %ebx           # imm = 0x8000
leaq 0xe0(%rsp), %r14
movl $0x8000, %edi           # imm = 0x8000
movq %r14, %rsi
callq 0x4424
movq %rbp, %rdi
movq 0x58(%rsp), %r12
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4c16
cmpq %r13, %r12
jae 0x82b4
cmpq %rbx, %r13
cmovbq %r13, %rbx
negq %rbx
leaq 0xe0(%rsp), %r14
leaq (%rbx,%r13), %rsi
movq %rbp, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x4af1
incq %rbx
jne 0x829d
cmpq $0x0, 0x8(%rsp)
je 0x83e0
movq %r15, %rdx
xorl %r14d, %r14d
leaq 0xe0(%rsp), %r15
cmpq %rdx, %r13
jae 0x84c4
movq 0x18(%rsp), %rax
movzwl (%rax,%r14,2), %r12d
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rcx
movq %rbp, %rbx
movq %rdx, %rbp
callq 0x4af1
cmpw $0x3, %r12w
jb 0x8379
subq $0x8, %rsp
movq 0x70(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %r12, %r9
leaq 0xa0(%rsp), %rax
pushq %rax
leaq 0x16(%rsp), %rax
pushq %rax
pushq $0x0
callq 0x684e
addq $0x20, %rsp
movzwl 0x98(%rsp), %eax
cmpw %r12w, %ax
sete %cl
cmpw $0x3, %ax
setb %al
orb %cl, %al
je 0x84e3
movzwl 0x6(%rsp), %ecx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movl %r12d, %r8d
callq 0x67da
movzwl 0x6(%rsp), %esi
movl %r12d, %edi
movq 0x338(%rsp), %rdx
callq 0x673f
jmp 0x8393
movzbl (%rbx,%r13), %edi
xorl %esi, %esi
movq 0x338(%rsp), %rdx
callq 0x673f
movl $0x1, %r12d
leaq (%r12,%r13), %rbx
cmpq %rbp, %rbx
ja 0x84a5
movq %rbp, %rdx
cmpl $0x2, %r12d
movq 0x20(%rsp), %rbp
jb 0x83cf
decq %r12
incq %r13
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rcx
callq 0x4af1
movq 0x10(%rsp), %rdx
incq %r13
decq %r12
jne 0x83b4
incq %r14
movq %rbx, %r13
cmpq 0x8(%rsp), %r14
jne 0x82ce
leaq 0xe0(%rsp), %rdi
callq 0x4aae
cmpb $0x0, 0x2c(%rsp)
je 0x8521
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b2e(%rip), %rdi      # 0xaf3f
leaq 0x2a72(%rip), %rsi      # 0xae8a
leaq 0x2b2d(%rip), %rcx      # 0xaf4c
movl $0x121, %edx            # imm = 0x121
callq 0x10b0
leaq 0x2b97(%rip), %rdi      # 0xafc7
leaq 0x2a53(%rip), %rsi      # 0xae8a
leaq 0x2b0e(%rip), %rcx      # 0xaf4c
movl $0x123, %edx            # imm = 0x123
callq 0x10b0
leaq 0x2ba4(%rip), %rdi      # 0xaff3
leaq 0x2a34(%rip), %rsi      # 0xae8a
leaq 0x2bb3(%rip), %rcx      # 0xb010
movl $0x13f, %edx            # imm = 0x13F
callq 0x10b0
leaq 0x2c1b(%rip), %rdi      # 0xb089
leaq 0x2a15(%rip), %rsi      # 0xae8a
leaq 0x2b94(%rip), %rcx      # 0xb010
movl $0x141, %edx            # imm = 0x141
callq 0x10b0
leaq 0x2bd4(%rip), %rdi      # 0xb061
leaq 0x29f6(%rip), %rsi      # 0xae8a
leaq 0x2b75(%rip), %rcx      # 0xb010
movl $0x140, %edx            # imm = 0x140
callq 0x10b0
leaq 0x2cb6(%rip), %rdi      # 0xb162
leaq 0x29d7(%rip), %rsi      # 0xae8a
leaq 0x2bf4(%rip), %rcx      # 0xb0ae
movl $0x17d, %edx            # imm = 0x17D
callq 0x10b0
leaq 0x2bd7(%rip), %rdi      # 0xb0a2
leaq 0x29b8(%rip), %rsi      # 0xae8a
leaq 0x2bd5(%rip), %rcx      # 0xb0ae
movl $0x168, %edx            # imm = 0x168
callq 0x10b0
leaq 0x2c3c(%rip), %rdi      # 0xb126
leaq 0x2999(%rip), %rsi      # 0xae8a
leaq 0x2bb6(%rip), %rcx      # 0xb0ae
movl $0x172, %edx            # imm = 0x172
callq 0x10b0
leaq 0x2a36(%rip), %rdi      # 0xaf3f
leaq 0x297a(%rip), %rsi      # 0xae8a
leaq 0x2a35(%rip), %rcx      # 0xaf4c
movl $0x112, %edx            # imm = 0x112
callq 0x10b0
leaq 0x2948(%rip), %rdi      # 0xae70
leaq 0x295b(%rip), %rsi      # 0xae8a
leaq 0x295e(%rip), %rcx      # 0xae94
movl $0x1bb, %edx            # imm = 0x1BB
callq 0x10b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1170
leaq 0x2a8c(%rip), %rdi      # 0xafdd
leaq 0x2932(%rip), %rsi      # 0xae8a
leaq 0x29ed(%rip), %rcx      # 0xaf4c
movl $0x12a, %edx            # imm = 0x12A
callq 0x10b0