// File: /workspace/github_c_makefile_star2_O2/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 $0x278, %rsp            # imm = 0x278
movq %r9, 0x50(%rsp)
movq %r8, 0x40(%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, 0x48(%rsp)
movq 0x2d0(%rsp), %r13
movsd 0x37d5(%rip), %xmm0     # 0x16088
xorl %ebp, %ebp
pushq $0x3
popq %r12
pushq $0x1
popq %r14
cmpl $0x103, %r12d           # imm = 0x103
je 0x128f8
movl %r12d, %edi
movl %r14d, %esi
movq 0x2c0(%rsp), %rdx
movsd %xmm0, 0x10(%rsp)
callq *0x2b8(%rsp)
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r12d, %ebp
minsd %xmm1, %xmm0
incl %r12d
jmp 0x128bd
movq %rbx, 0x10(%rsp)
movsd 0x3783(%rip), %xmm0     # 0x16088
xorl %ebx, %ebx
leaq 0x43a2(%rip), %r14      # 0x16cb0
xorl %r12d, %r12d
cmpq $0x78, %rbx
je 0x12956
movl (%rbx,%r14), %r13d
pushq $0x3
popq %rdi
movl %r13d, %esi
movq 0x2c0(%rsp), %rdx
movsd %xmm0, 0x20(%rsp)
callq *0x2b8(%rsp)
movsd 0x20(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r13d, %r12d
movq 0x2d0(%rsp), %r13
minsd %xmm1, %xmm0
addq $0x4, %rbx
jmp 0x12911
movl %ebp, %edi
movl %r12d, %esi
movq 0x2c0(%rsp), %rdx
callq *0x2b8(%rsp)
movsd %xmm0, 0x30(%rsp)
movq 0x18(%rsp), %rbp
movq %rbp, %r14
movb $0x1, 0x28(%rsp)
subq %r15, %r14
movq %r15, 0x20(%rsp)
je 0x12cf0
pushq $0x1
popq %rbx
xorl %r12d, %r12d
movq %r15, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %r12
movl $0x8000, %edi           # imm = 0x8000
movq %r13, %rsi
callq 0x12018
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x121f2
cmpq %r15, %r12
jae 0x129db
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x120e0
incq %r12
jmp 0x129be
leaq 0x1(%r14), %rax
movq 0x2d8(%rsp), %rdx
cmpq %rax, %rbx
jae 0x129f8
movl $0x7149f2ca, (%rdx,%rbx,4) # imm = 0x7149F2CA
incq %rbx
jmp 0x129e7
andl $0x0, (%rdx)
movq 0x2b0(%rsp), %rcx
andw $0x0, (%rcx)
leaq 0x103(%r15), %rax
movq %rax, 0x68(%rsp)
leaq (%r15,%r15), %rax
negq %rax
addq %rcx, %rax
addq $0x204, %rax            # imm = 0x204
movq %rax, 0x60(%rsp)
leaq (,%r15,4), %rax
movq %rdx, %rcx
subq %rax, %rcx
movq %rcx, 0x58(%rsp)
movq %r14, 0x28(%rsp)
cmpq %rbp, %r15
movq 0x10(%rsp), %rbx
jae 0x12cc3
movq %r15, %r12
subq 0x20(%rsp), %r12
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x120e0
leaq 0x205(%r15), %rax
cmpq %rbp, %rax
jae 0x12b2b
cmpq 0x68(%rsp), %r15
jbe 0x12b2b
movq 0x40(%r13), %rax
movl %r15d, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpw $0x205, (%rax,%rcx,2)   # imm = 0x205
jb 0x12b2b
leal 0x7efe(%r15), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpw $0x103, (%rax,%rcx,2)   # imm = 0x103
jb 0x12b2b
movl $0x102, %edi            # imm = 0x102
pushq $0x1
popq %rsi
movq 0x2c0(%rsp), %rdx
callq *0x2b8(%rsp)
movsd %xmm0, 0x8(%rsp)
movq 0x60(%rsp), %rax
leaq (%rax,%r15,2), %r14
movq 0x58(%rsp), %rax
leaq (%rax,%r15,4), %r13
xorl %ebx, %ebx
cmpq $0x102, %rbx            # imm = 0x102
je 0x12b30
cvtss2sd (%r13,%rbx,4), %xmm0
addsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x408(%r13,%rbx,4)
movw $0x102, (%r14,%rbx,2)   # imm = 0x102
leaq 0x1(%rbx,%r15), %rsi
movq 0x10(%rsp), %rdi
movq %rbp, %rdx
movq 0x2d0(%rsp), %rcx
callq 0x120e0
incq %rbx
jmp 0x12ae1
movq %r15, %rbp
jmp 0x12b46
addq %rbx, %r12
addq %rbx, %r15
movq %r15, %rbp
movq 0x10(%rsp), %rbx
movq 0x2d0(%rsp), %r13
subq $0x8, %rsp
movl $0x102, %r9d            # imm = 0x102
movq 0x50(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movq %rbx, %r14
movq 0x20(%rsp), %rbx
movq %rbx, %r8
leaq 0xe(%rsp), %rax
pushq %rax
leaq 0x4e(%rsp), %rax
pushq %rax
leaq 0x88(%rsp), %rax
pushq %rax
callq 0x11342
addq $0x20, %rsp
leaq 0x1(%rbp), %r15
cmpq %rbx, %r15
jbe 0x12ba0
movq 0x2d8(%rsp), %rdx
cvtss2sd (%rdx,%r12,4), %xmm2
jmp 0x12bfe
movzbl (%r14,%rbp), %edi
xorl %esi, %esi
movq 0x2c0(%rsp), %rdx
callq *0x2b8(%rsp)
movq 0x2d8(%rsp), %rdx
cvtss2sd (%rdx,%r12,4), %xmm2
addsd %xmm2, %xmm0
ucomisd 0x3d50(%rip), %xmm0     # 0x16920
jb 0x1308e
cvtss2sd 0x4(%rdx,%r12,4), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x12bfe
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rdx,%r12,4)
movq 0x2b0(%rsp), %rax
movw $0x1, 0x2(%rax,%r12,2)
movzwl 0x6(%rsp), %eax
movq 0x18(%rsp), %rbx
subq %rbp, %rbx
cmpq %rbx, %rax
cmovbq %rax, %rbx
addsd 0x30(%rsp), %xmm2
movq 0x2b0(%rsp), %rax
leaq (%rax,%r12,2), %r13
leaq (%rdx,%r12,4), %r14
pushq $0x3
popq %rbp
movsd %xmm2, 0x8(%rsp)
cmpq %rbx, %rbp
ja 0x12cac
cvtss2sd (%r14,%rbp,4), %xmm0
ucomisd %xmm0, %xmm2
jae 0x12ca7
movzwl 0x70(%rsp,%rbp,2), %esi
movl %ebp, %edi
movq 0x2c0(%rsp), %rdx
callq *0x2b8(%rsp)
movq 0x2d8(%rsp), %rdx
cvtss2sd (%rdx,%r12,4), %xmm1
addsd %xmm0, %xmm1
ucomisd 0x3cae(%rip), %xmm1     # 0x16920
jb 0x12f96
cvtss2sd (%r14,%rbp,4), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm2
jbe 0x12ca7
cmpq $0x103, %rbp            # imm = 0x103
jae 0x12fb5
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%r14,%rbp,4)
movw %bp, (%r13,%rbp,2)
incq %rbp
jmp 0x12c31
movq 0x18(%rsp), %rbp
movq 0x2d0(%rsp), %r13
movq 0x28(%rsp), %r14
jmp 0x12a40
movss (%rdx,%r14,4), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x130cc
cvtss2sd %xmm0, %xmm0
movsd 0x33a6(%rip), %xmm1     # 0x16088
ucomisd %xmm0, %xmm1
seta 0x28(%rsp)
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %rbx
movq (%rbx), %rdi
callq 0x3050
andq $0x0, (%rbx)
movq 0x50(%rsp), %rbx
andq $0x0, (%rbx)
testq %r14, %r14
je 0x12dda
movq $0x0, 0x8(%rsp)
pushq $0x2
popq %r12
xorl %ebp, %ebp
leaq -0x1(%rbp), %rax
testq %rax, %rbp
jne 0x12d46
testq %rbp, %rbp
je 0x12d50
shlq $0x2, %rbp
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x3430
movq (%rbx), %rdx
jmp 0x12d5a
movq %rbp, %rdx
movq 0x8(%rsp), %rax
jmp 0x12d62
movq %r12, %rdi
callq 0x33d0
xorl %edx, %edx
movq 0x40(%rsp), %rcx
movq %rax, (%rcx)
movq 0x2b0(%rsp), %rcx
movzwl (%rcx,%r14,2), %ecx
movq %rax, 0x8(%rsp)
movw %cx, (%rax,%rdx,2)
leaq 0x1(%rdx), %rbp
movq %rbp, (%rbx)
cmpq %rcx, %r14
jb 0x12fd4
cmpw $0x103, %cx             # imm = 0x103
jae 0x13012
testq %rcx, %rcx
je 0x12ff3
subq %rcx, %r14
jne 0x12d22
movq %rbp, %rcx
shrq %rcx
movq 0x8(%rsp), %rax
leaq (%rax,%rdx,2), %rax
xorl %edx, %edx
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r8
cmpq %rdx, %rcx
je 0x12dea
movzwl (%r8,%rdx,2), %esi
movzwl (%rax), %edi
movw %di, (%r8,%rdx,2)
movw %si, (%rax)
incq %rdx
addq $-0x2, %rax
jmp 0x12dbc
xorl %ebp, %ebp
movq $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rbx
cmpq %r15, 0x18(%rsp)
jne 0x12e0e
cmpb $0x0, 0x28(%rsp)
je 0x130ad
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
movq 0x20(%rsp), %r14
movq %r14, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %r12
movl $0x8000, %edi           # imm = 0x8000
movq %r13, %rsi
callq 0x12018
movq %rbx, %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0x121f2
cmpq %r14, %r12
jae 0x12e60
movq %rbx, %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0x120e0
incq %r12
jmp 0x12e43
xorl %ecx, %ecx
cmpq %rbp, %rcx
je 0x12df1
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %r13
cmpq %r14, %r13
jae 0x13050
movq 0x8(%rsp), %rax
movq %rcx, 0x30(%rsp)
movzwl (%rax,%rcx,2), %r12d
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %r15
movq 0x2d0(%rsp), %rbx
movq %rbx, %rcx
callq 0x120e0
cmpw $0x3, %r12w
jb 0x12f26
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %r14, %r8
movq %r12, %r9
leaq 0x78(%rsp), %rax
pushq %rax
leaq 0x16(%rsp), %rax
pushq %rax
pushq $0x0
callq 0x11342
addq $0x20, %rsp
movzwl 0x70(%rsp), %eax
cmpw %r12w, %ax
sete %cl
cmpw $0x3, %ax
setb %al
orb %cl, %al
je 0x1306f
movzwl 0x6(%rsp), %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movl %r12d, %r8d
callq 0x112d8
movzwl 0x6(%rsp), %esi
movl %r12d, %edi
movq %r13, %rdx
movq 0x2c8(%rsp), %rcx
callq 0x10c30
jmp 0x12f41
movzbl (%r15,%r13), %edi
xorl %esi, %esi
movq %r13, %rdx
movq 0x2c8(%rsp), %rcx
callq 0x10c30
pushq $0x1
popq %r12
leaq (%r12,%r13), %rbx
cmpq %r14, %rbx
ja 0x13031
pushq $0x1
popq %r14
movq 0x2d0(%rsp), %r13
cmpq %r12, %r14
jae 0x12f7f
movq 0x20(%rsp), %rax
leaq (%rax,%r14), %rsi
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq %r13, %rcx
callq 0x120e0
incq %r14
jmp 0x12f5a
movq 0x30(%rsp), %rcx
incq %rcx
movq %rbx, 0x20(%rsp)
movq 0x10(%rsp), %rbx
jmp 0x12e62
leaq 0x3ab1(%rip), %rdi      # 0x16a4e
leaq 0x39cc(%rip), %rsi      # 0x16970
leaq 0x3ab0(%rip), %rcx      # 0x16a5b
movl $0x128, %edx            # imm = 0x128
callq 0x3220
leaq 0x3b31(%rip), %rdi      # 0x16aed
leaq 0x39ad(%rip), %rsi      # 0x16970
leaq 0x3a91(%rip), %rcx      # 0x16a5b
movl $0x12a, %edx            # imm = 0x12A
callq 0x3220
leaq 0x3b3e(%rip), %rdi      # 0x16b19
leaq 0x398e(%rip), %rsi      # 0x16970
leaq 0x3b4d(%rip), %rcx      # 0x16b36
movl $0x143, %edx            # imm = 0x143
callq 0x3220
leaq 0x3bb5(%rip), %rdi      # 0x16baf
leaq 0x396f(%rip), %rsi      # 0x16970
leaq 0x3b2e(%rip), %rcx      # 0x16b36
movl $0x145, %edx            # imm = 0x145
callq 0x3220
leaq 0x3b6e(%rip), %rdi      # 0x16b87
leaq 0x3950(%rip), %rsi      # 0x16970
leaq 0x3b0f(%rip), %rcx      # 0x16b36
movl $0x144, %edx            # imm = 0x144
callq 0x3220
leaq 0x3c5e(%rip), %rdi      # 0x16c96
leaq 0x3931(%rip), %rsi      # 0x16970
leaq 0x3b8e(%rip), %rcx      # 0x16bd4
movl $0x17e, %edx            # imm = 0x17E
callq 0x3220
leaq 0x3b71(%rip), %rdi      # 0x16bc8
leaq 0x3912(%rip), %rsi      # 0x16970
leaq 0x3b6f(%rip), %rcx      # 0x16bd4
movl $0x169, %edx            # imm = 0x169
callq 0x3220
leaq 0x3be4(%rip), %rdi      # 0x16c5a
leaq 0x38f3(%rip), %rsi      # 0x16970
leaq 0x3b50(%rip), %rcx      # 0x16bd4
movl $0x173, %edx            # imm = 0x173
callq 0x3220
leaq 0x39b9(%rip), %rdi      # 0x16a4e
leaq 0x38d4(%rip), %rsi      # 0x16970
leaq 0x39b8(%rip), %rcx      # 0x16a5b
movl $0x117, %edx            # imm = 0x117
callq 0x3220
leaq 0x38a2(%rip), %rdi      # 0x16956
leaq 0x38b5(%rip), %rsi      # 0x16970
leaq 0x38ca(%rip), %rcx      # 0x1698c
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x3220
leaq 0x3a30(%rip), %rdi      # 0x16b03
leaq 0x3896(%rip), %rsi      # 0x16970
leaq 0x397a(%rip), %rcx      # 0x16a5b
movl $0x131, %edx            # imm = 0x131
callq 0x3220