// File: /workspace/github_c_makefile_star2_O1/madler[P]pigz/zopfli/src/zopfli/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,
    ZopfliHash* h, float* costs) {
  double cost = GetBestLengths(s, in, instart, inend, costmodel,
                costcontext, length_array, h, costs);
  free(*path);
  *path = 0;
  *pathsize = 0;
  TraceBackwards(inend - instart, length_array, path, pathsize);
  FollowPath(s, in, instart, inend, *path, *pathsize, store, h);
  assert(cost < ZOPFLI_LARGE_FLOAT);
  return cost;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %r9, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, %rbp
movq %rsi, 0x28(%rsp)
movq %rdi, 0x48(%rsp)
movq 0x2d0(%rsp), %rbx
movq 0x2c8(%rsp), %r14
movl $0x3, %r15d
xorl %r13d, %r13d
movsd 0x3d7f(%rip), %xmm0     # 0x17048
movsd %xmm0, 0x10(%rsp)
movl %r15d, %edi
movl $0x1, %esi
movq %rbx, %rdx
callq *%r14
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r15d, %r13d
minsd %xmm1, %xmm0
incl %r15d
cmpl $0x103, %r15d           # imm = 0x103
jne 0x132c9
xorl %ebx, %ebx
movsd 0x3d43(%rip), %xmm0     # 0x17048
xorl %r15d, %r15d
movsd %xmm0, 0x10(%rsp)
leaq 0x495b(%rip), %rax      # 0x17c70
movl (%rbx,%rax), %r12d
movl $0x3, %edi
movl %r12d, %esi
movq 0x2d0(%rsp), %rdx
callq *%r14
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r12d, %r15d
minsd %xmm1, %xmm0
addq $0x4, %rbx
cmpq $0x78, %rbx
jne 0x13308
movl %r13d, %edi
movl %r15d, %esi
movq 0x2d0(%rsp), %rdx
callq *%r14
movsd %xmm0, 0x70(%rsp)
movq 0x18(%rsp), %r15
movb $0x1, %al
subq %rbp, %r15
movq 0x2e0(%rsp), %r12
je 0x13772
movq %r15, 0x30(%rsp)
xorl %r13d, %r13d
movq %rbp, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %r13
movl $0x8000, %ebx           # imm = 0x8000
movl $0x8000, %edi           # imm = 0x8000
movq %r12, %rsi
callq 0x129a8
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %r15
movq %r15, %rdx
movq %r12, %rcx
callq 0x12ba9
cmpq %rbp, %r13
jae 0x133df
cmpq %rbx, %rbp
cmovbq %rbp, %rbx
negq %rbx
leaq (%rbx,%rbp), %rsi
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
callq 0x12a84
incq %rbx
jne 0x133c8
movq 0x30(%rsp), %r15
leaq -0x1(%r15), %rax
cmpq $-0x3, %rax
movq 0x2e8(%rsp), %rcx
ja 0x13408
xorl %eax, %eax
movl $0x7149f2ca, 0x4(%rcx,%rax,4) # imm = 0x7149F2CA
incq %rax
cmpq %rax, %r15
jne 0x133f8
movl $0x0, (%rcx)
movq 0x2c0(%rsp), %rax
movw $0x0, (%rax)
movq 0x18(%rsp), %r14
cmpq %rbp, %r14
movq 0x28(%rsp), %rbx
jbe 0x13744
leaq 0x103(%rbp), %rax
movq %rax, 0x78(%rsp)
movq 0x2c0(%rsp), %rcx
subq %rbp, %rcx
subq %rbp, %rcx
addq $0x204, %rcx            # imm = 0x204
movq %rcx, 0x68(%rsp)
leaq (,%rbp,4), %rax
movq 0x2e8(%rsp), %rcx
subq %rax, %rcx
movq %rcx, 0x60(%rsp)
movq %rbp, %rsi
movq %rsi, 0x20(%rsp)
movq %rsi, %rax
subq %rbp, %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x12a84
movq 0x20(%rsp), %r15
leaq 0x205(%r15), %rax
cmpq %r14, %rax
jae 0x13582
cmpq 0x78(%rsp), %r15
jbe 0x13582
movq 0x40(%r12), %rax
movl %r15d, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movzwl (%rax,%rcx,2), %ecx
cmpl $0x205, %ecx            # imm = 0x205
jb 0x13582
leal 0x7efe(%r15), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpw $0x103, (%rax,%rcx,2)   # imm = 0x103
jb 0x13582
movl $0x102, %edi            # imm = 0x102
movl $0x1, %esi
movq 0x2d0(%rsp), %rdx
callq *0x2c8(%rsp)
movq 0x20(%rsp), %rcx
movsd %xmm0, 0x38(%rsp)
movq 0x68(%rsp), %rax
leaq (%rax,%rcx,2), %r14
movq 0x60(%rsp), %rax
leaq (%rax,%rcx,4), %r15
movq %r12, %r13
movq %rbx, %r12
xorl %ebx, %ebx
xorps %xmm0, %xmm0
cvtss2sd (%r15,%rbx,4), %xmm0
addsd 0x38(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x408(%r15,%rbx,4)
movw $0x102, (%r14,%rbx,2)   # imm = 0x102
leaq 0x1(%rbx,%rcx), %rsi
movq %r12, %rdi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0x12a84
movq 0x20(%rsp), %rcx
incq %rbx
cmpq $0x102, %rbx            # imm = 0x102
jne 0x13522
addq %rbx, %rcx
addq %rbx, 0x10(%rsp)
movq %rcx, %r15
movq %r12, %rbx
movq %r13, %r12
movq 0x18(%rsp), %r14
subq $0x8, %rsp
movl $0x102, %r9d            # imm = 0x102
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r14, %r8
leaq 0x16(%rsp), %rax
pushq %rax
leaq 0x56(%rsp), %rax
pushq %rax
leaq 0x98(%rsp), %rax
pushq %rax
callq 0x11c6f
addq $0x20, %rsp
leaq 0x1(%r15), %rax
movq %rax, %r13
cmpq %r14, %rax
movq 0x10(%rsp), %rdx
ja 0x13634
movzbl (%rbx,%r15), %edi
xorl %esi, %esi
movq 0x2d0(%rsp), %rdx
callq *0x2c8(%rsp)
movq 0x10(%rsp), %rdx
movq 0x2e8(%rsp), %rax
xorps %xmm1, %xmm1
cvtss2sd (%rax,%rdx,4), %xmm1
addsd %xmm0, %xmm1
ucomisd 0x42dd(%rip), %xmm1     # 0x178e0
jb 0x13b0e
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax,%rdx,4), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x13634
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x4(%rax,%rdx,4)
movq 0x2c0(%rsp), %rax
movw $0x1, 0x2(%rax,%rdx,2)
movzwl 0xe(%rsp), %ecx
subq %r15, %r14
cmpq %r14, %rcx
cmovbq %rcx, %r14
cmpq $0x3, %r14
jb 0x13721
movq 0x2e8(%rsp), %rcx
leaq (%rcx,%rdx,4), %r12
xorps %xmm2, %xmm2
cvtss2sd (%r12), %xmm2
addsd 0x70(%rsp), %xmm2
movl $0x2, %ebx
subq %r14, %rbx
movq 0x2c0(%rsp), %rax
leaq (%rax,%rdx,2), %r14
movl $0x3, %r15d
movsd %xmm2, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtss2sd (%r12,%r15,4), %xmm0
ucomisd %xmm0, %xmm2
jae 0x1370d
movzwl 0x80(%rsp,%r15,2), %esi
movl %r15d, %edi
movq 0x2d0(%rsp), %rdx
callq *0x2c8(%rsp)
movq 0x2e8(%rsp), %rax
movq 0x10(%rsp), %rcx
xorps %xmm1, %xmm1
cvtss2sd (%rax,%rcx,4), %xmm1
addsd %xmm0, %xmm1
ucomisd 0x420d(%rip), %xmm1     # 0x178e0
jb 0x13a16
xorps %xmm0, %xmm0
cvtss2sd (%r12,%r15,4), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x20(%rsp), %xmm2
jbe 0x1370d
cmpq $0x103, %r15            # imm = 0x103
jae 0x13a35
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%r12,%r15,4)
movw %r15w, (%r14,%r15,2)
leaq (%rbx,%r15), %rax
incq %rax
incq %r15
cmpq $0x3, %rax
jne 0x13688
movq 0x18(%rsp), %r14
movq %r13, %rsi
cmpq %r14, %r13
movq 0x28(%rsp), %rbx
movq 0x2e0(%rsp), %r12
movq 0x30(%rsp), %r15
jb 0x1346f
movq 0x2e8(%rsp), %rax
movss (%rax,%r15,4), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x13b4c
cvtss2sd %xmm0, %xmm0
movsd 0x38dd(%rip), %xmm1     # 0x17048
ucomisd %xmm0, %xmm1
seta %al
movb %al, 0x30(%rsp)
movq 0x50(%rsp), %r14
movq (%r14), %rdi
callq 0x3050
xorl %eax, %eax
movq %rax, (%r14)
movq 0x58(%rsp), %rbx
movq %rax, (%rbx)
testq %r15, %r15
je 0x13836
movq (%rbx), %rsi
leaq -0x1(%rsi), %rax
testq %rax, %rsi
jne 0x137c5
testq %rsi, %rsi
je 0x137b8
movq (%r14), %rdi
shlq $0x2, %rsi
callq 0x3430
jmp 0x137c2
movl $0x2, %edi
callq 0x33d0
movq %rax, (%r14)
movq 0x2c0(%rsp), %rsi
movzwl (%rsi,%r15,2), %ecx
movq (%r14), %rax
movq (%rbx), %rdx
movw %cx, (%rax,%rdx,2)
leaq 0x1(%rdx), %rcx
movq %rcx, (%rbx)
movzwl (%rsi,%r15,2), %esi
cmpq %rsi, %r15
jb 0x13a54
cmpl $0x103, %esi            # imm = 0x103
jae 0x13a92
testq %rsi, %rsi
je 0x13a73
subq %rsi, %r15
jne 0x13799
cmpq $0x2, %rcx
jb 0x13836
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 0x1381a
cmpq %rbp, 0x18(%rsp)
je 0x139f9
movq (%r14), %rax
movq %rax, 0x38(%rsp)
movq (%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
movq %rbp, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %r15
movl $0x8000, %ebx           # imm = 0x8000
movl $0x8000, %edi           # imm = 0x8000
movq %r12, %rsi
callq 0x129a8
movq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq 0x18(%rsp), %r14
movq %r14, %rdx
movq %r12, %rcx
callq 0x12ba9
cmpq %rbp, %r15
jae 0x138b4
cmpq %rbx, %rbp
cmovbq %rbp, %rbx
negq %rbx
leaq (%rbx,%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x12a84
incq %rbx
jne 0x1389d
cmpq $0x0, 0x20(%rsp)
je 0x139f9
xorl %ecx, %ecx
movq 0x18(%rsp), %r14
cmpq %r14, %rbp
jae 0x13ad0
movq 0x38(%rsp), %rax
movq %rcx, 0x10(%rsp)
movzwl (%rax,%rcx,2), %r15d
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x12a84
cmpw $0x3, %r15w
jb 0x13980
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movq %r14, %r8
movq %r15, %r9
leaq 0x88(%rsp), %rax
pushq %rax
leaq 0x1e(%rsp), %rax
pushq %rax
pushq $0x0
callq 0x11c6f
addq $0x20, %rsp
movzwl 0x80(%rsp), %eax
cmpw %r15w, %ax
sete %cl
cmpw $0x3, %ax
setb %al
orb %cl, %al
je 0x13aef
movzwl 0xe(%rsp), %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movl %r15d, %r8d
callq 0x11bfb
movzwl 0xe(%rsp), %esi
movl %r15d, %edi
movq %rbp, %rdx
movq 0x2d8(%rsp), %rcx
callq 0x1150d
jmp 0x1399c
movzbl (%rbx,%rbp), %edi
xorl %esi, %esi
movq %rbp, %rdx
movq 0x2d8(%rsp), %rcx
callq 0x1150d
movl $0x1, %r15d
leaq (%r15,%rbp), %rbx
cmpq %r14, %rbx
ja 0x13ab1
cmpl $0x2, %r15d
movq 0x18(%rsp), %r14
movq 0x28(%rsp), %r12
movq 0x2e0(%rsp), %r13
jb 0x139e0
decq %r15
incq %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x12a84
incq %rbp
decq %r15
jne 0x139c7
movq 0x10(%rsp), %rcx
incq %rcx
movq %rbx, %rbp
cmpq 0x20(%rsp), %rcx
movq %r13, %r12
jne 0x138c2
cmpb $0x0, 0x30(%rsp)
je 0x13b2d
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ff1(%rip), %rdi      # 0x17a0e
leaq 0x3f0c(%rip), %rsi      # 0x17930
leaq 0x3ff0(%rip), %rcx      # 0x17a1b
movl $0x128, %edx            # imm = 0x128
callq 0x3220
leaq 0x4071(%rip), %rdi      # 0x17aad
leaq 0x3eed(%rip), %rsi      # 0x17930
leaq 0x3fd1(%rip), %rcx      # 0x17a1b
movl $0x12a, %edx            # imm = 0x12A
callq 0x3220
leaq 0x407e(%rip), %rdi      # 0x17ad9
leaq 0x3ece(%rip), %rsi      # 0x17930
leaq 0x408d(%rip), %rcx      # 0x17af6
movl $0x143, %edx            # imm = 0x143
callq 0x3220
leaq 0x40f5(%rip), %rdi      # 0x17b6f
leaq 0x3eaf(%rip), %rsi      # 0x17930
leaq 0x406e(%rip), %rcx      # 0x17af6
movl $0x145, %edx            # imm = 0x145
callq 0x3220
leaq 0x40ae(%rip), %rdi      # 0x17b47
leaq 0x3e90(%rip), %rsi      # 0x17930
leaq 0x404f(%rip), %rcx      # 0x17af6
movl $0x144, %edx            # imm = 0x144
callq 0x3220
leaq 0x419e(%rip), %rdi      # 0x17c56
leaq 0x3e71(%rip), %rsi      # 0x17930
leaq 0x40ce(%rip), %rcx      # 0x17b94
movl $0x17e, %edx            # imm = 0x17E
callq 0x3220
leaq 0x40b1(%rip), %rdi      # 0x17b88
leaq 0x3e52(%rip), %rsi      # 0x17930
leaq 0x40af(%rip), %rcx      # 0x17b94
movl $0x169, %edx            # imm = 0x169
callq 0x3220
leaq 0x4124(%rip), %rdi      # 0x17c1a
leaq 0x3e33(%rip), %rsi      # 0x17930
leaq 0x4090(%rip), %rcx      # 0x17b94
movl $0x173, %edx            # imm = 0x173
callq 0x3220
leaq 0x3ef9(%rip), %rdi      # 0x17a0e
leaq 0x3e14(%rip), %rsi      # 0x17930
leaq 0x3ef8(%rip), %rcx      # 0x17a1b
movl $0x117, %edx            # imm = 0x117
callq 0x3220
leaq 0x3de2(%rip), %rdi      # 0x17916
leaq 0x3df5(%rip), %rsi      # 0x17930
leaq 0x3e0a(%rip), %rcx      # 0x1794c
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x3220
leaq 0x3f70(%rip), %rdi      # 0x17ac3
leaq 0x3dd6(%rip), %rsi      # 0x17930
leaq 0x3eba(%rip), %rcx      # 0x17a1b
movl $0x131, %edx            # imm = 0x131
callq 0x3220