// File: /workspace/github_c_makefile_star2_O3/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, %rbx
movq %rcx, 0x18(%rsp)
movq %rdx, %r15
movq %rsi, 0x30(%rsp)
movq %rdi, 0x48(%rsp)
movq 0x2d0(%rsp), %r14
movq 0x2c8(%rsp), %r12
movl $0x3, %r13d
xorl %ebp, %ebp
movsd 0x326a(%rip), %xmm0     # 0x17088
movsd %xmm0, 0x10(%rsp)
movl %r13d, %edi
movl $0x1, %esi
movq %r14, %rdx
callq *%r12
movsd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
cmoval %r13d, %ebp
minsd %xmm1, %xmm0
incl %r13d
cmpl $0x103, %r13d           # imm = 0x103
jne 0x13e1e
movq %rbx, 0x50(%rsp)
xorl %ebx, %ebx
movsd 0x3229(%rip), %xmm0     # 0x17088
xorl %r13d, %r13d
movq %r12, %r14
movsd %xmm0, 0x10(%rsp)
leaq 0x3eee(%rip), %rax      # 0x17d60
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, %r13d
minsd %xmm1, %xmm0
addq $0x4, %rbx
cmpq $0x78, %rbx
jne 0x13e65
movl %ebp, %edi
movl %r13d, %esi
movq 0x2d0(%rsp), %rdx
callq *%r14
movsd %xmm0, 0x70(%rsp)
movq 0x18(%rsp), %rbp
movq %rbp, %r13
movb $0x1, 0x28(%rsp)
subq %r15, %r13
movq 0x30(%rsp), %r12
movq 0x2e0(%rsp), %r14
je 0x143f2
movq %r13, 0x28(%rsp)
xorl %r13d, %r13d
movq %r15, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %r13
movl $0x8000, %ebx           # imm = 0x8000
movl $0x8000, %edi           # imm = 0x8000
movq %r14, %rsi
callq 0x13440
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x1365e
cmpq %r15, %r13
jae 0x13f3c
cmpq %rbx, %r15
cmovbq %r15, %rbx
negq %rbx
leaq (%r15,%rbx), %rsi
movq %r12, %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x13539
incq %rbx
jne 0x13f25
movq 0x28(%rsp), %r13
leaq -0x1(%r13), %rcx
cmpq $-0x3, %rcx
ja 0x1405e
leaq 0x3(%r13), %rax
andq $-0x4, %rax
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa 0x38a5(%rip), %xmm1     # 0x17810
movdqa 0x38ad(%rip), %xmm2     # 0x17820
movdqa 0x38b5(%rip), %xmm3     # 0x17830
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, %edx
notl %edx
testb $0x1, %dl
je 0x13fd5
movq 0x2e8(%rsp), %rdx
movl $0x7149f2ca, 0x4(%rdx,%rcx,4) # imm = 0x7149F2CA
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x13ff3
movq 0x2e8(%rsp), %rdx
movl $0x7149f2ca, 0x8(%rdx,%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, %edx
testb $0x1, %dl
je 0x14037
movq 0x2e8(%rsp), %rdx
movl $0x7149f2ca, 0xc(%rdx,%rcx,4) # imm = 0x7149F2CA
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x14051
movq 0x2e8(%rsp), %rdx
movl $0x7149f2ca, 0x10(%rdx,%rcx,4) # imm = 0x7149F2CA
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x13f83
movq 0x2e8(%rsp), %rax
movl $0x0, (%rax)
movq 0x2c0(%rsp), %rax
movw $0x0, (%rax)
cmpq %r15, %rbp
jbe 0x143c2
leaq 0x103(%r15), %rax
movq %rax, 0x78(%rsp)
movq 0x2c0(%rsp), %rcx
subq %r15, %rcx
subq %r15, %rcx
addq $0x204, %rcx            # imm = 0x204
movq %rcx, 0x68(%rsp)
leaq (,%r15,4), %rax
movq 0x2e8(%rsp), %rcx
subq %rax, %rcx
movq %rcx, 0x60(%rsp)
movq %r15, %rsi
movq %rsi, 0x10(%rsp)
movq %rsi, %rbx
subq %r15, %rbx
movq %r12, %rdi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x13539
movq 0x10(%rsp), %r13
leaq 0x205(%r13), %rax
cmpq %rbp, %rax
jae 0x141e8
cmpq 0x78(%rsp), %r13
jbe 0x141e8
movq 0x40(%r14), %rax
movl %r13d, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movzwl (%rax,%rcx,2), %ecx
cmpl $0x205, %ecx            # imm = 0x205
jb 0x141e8
leal 0x7efe(%r13), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpw $0x103, (%rax,%rcx,2)   # imm = 0x103
jb 0x141e8
movq %rbx, 0x38(%rsp)
movl $0x102, %edi            # imm = 0x102
movl $0x1, %esi
movq 0x2d0(%rsp), %rdx
callq *0x2c8(%rsp)
movq 0x10(%rsp), %rcx
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rax
movq %r12, %rbp
movq %rax, %r12
movq 0x68(%rsp), %rax
leaq (%rax,%rcx,2), %r14
movq 0x60(%rsp), %rax
leaq (%rax,%rcx,4), %r13
xorl %ebx, %ebx
xorps %xmm0, %xmm0
cvtss2sd (%r13,%rbx,4), %xmm0
addsd 0x20(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x408(%r13,%rbx,4)
movw $0x102, (%r14,%rbx,2)   # imm = 0x102
leaq 0x1(%rbx,%rcx), %rsi
movq %rbp, %rdi
movq %r12, %rdx
movq 0x2e0(%rsp), %rcx
callq 0x13539
movq 0x10(%rsp), %rcx
incq %rbx
cmpq $0x102, %rbx            # imm = 0x102
jne 0x14178
addq %rbx, %rcx
movq 0x38(%rsp), %rax
addq %rbx, %rax
movq %rax, %rbx
movq %rcx, %r13
movq %r12, %rax
movq %rbp, %r12
movq %rax, %rbp
movq 0x2e0(%rsp), %r14
subq $0x8, %rsp
movl $0x102, %r9d            # imm = 0x102
movq 0x50(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
leaq 0x16(%rsp), %rax
pushq %rax
leaq 0x56(%rsp), %rax
pushq %rax
leaq 0x98(%rsp), %rax
pushq %rax
callq 0x121c8
addq $0x20, %rsp
leaq 0x1(%r13), %rax
movq %rax, 0x10(%rsp)
cmpq %rbp, %rax
jbe 0x14244
movq 0x2e8(%rsp), %rax
movq %rbx, %rdx
xorps %xmm2, %xmm2
cvtss2sd (%rax,%rbx,4), %xmm2
jmp 0x142ac
movzbl (%r12,%r13), %edi
xorl %esi, %esi
movq 0x2d0(%rsp), %rdx
callq *0x2c8(%rsp)
movq 0x2e8(%rsp), %rax
xorps %xmm2, %xmm2
cvtss2sd (%rax,%rbx,4), %xmm2
addsd %xmm2, %xmm0
ucomisd 0x3712(%rip), %xmm0     # 0x17988
jb 0x1479c
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rax,%rbx,4), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x142a9
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rax,%rbx,4)
movq 0x2c0(%rsp), %rax
movq %rbx, %rdx
movw $0x1, 0x2(%rax,%rbx,2)
jmp 0x142ac
movq %rbx, %rdx
movzwl 0xe(%rsp), %ecx
movq %rbp, %rax
subq %r13, %rax
cmpq %rax, %rcx
cmovbq %rcx, %rax
cmpq $0x3, %rax
movq 0x2e8(%rsp), %rbp
jb 0x1439d
addsd 0x70(%rsp), %xmm2
movl $0x2, %r14d
subq %rax, %r14
movq 0x2c0(%rsp), %rax
leaq (%rax,%rdx,2), %rax
movq %rax, 0x38(%rsp)
movq %rdx, %r12
leaq (,%rdx,4), %rbx
addq %rbp, %rbx
movl $0x3, %r13d
movsd %xmm2, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtss2sd (%rbx,%r13,4), %xmm0
ucomisd %xmm0, %xmm2
jae 0x14389
movzwl 0x80(%rsp,%r13,2), %esi
movl %r13d, %edi
movq 0x2d0(%rsp), %rdx
callq *0x2c8(%rsp)
xorps %xmm1, %xmm1
cvtss2sd (%rbp,%r12,4), %xmm1
addsd %xmm0, %xmm1
ucomisd 0x363e(%rip), %xmm1     # 0x17988
jb 0x146a4
xorps %xmm0, %xmm0
cvtss2sd (%rbx,%r13,4), %xmm0
ucomisd %xmm1, %xmm0
movsd 0x20(%rsp), %xmm2
jbe 0x14389
cmpq $0x103, %r13            # imm = 0x103
jae 0x146c3
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, (%rbx,%r13,4)
movq 0x38(%rsp), %rax
movw %r13w, (%rax,%r13,2)
leaq (%r14,%r13), %rax
incq %rax
incq %r13
cmpq $0x3, %rax
jne 0x1430a
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %rsi
cmpq %rbp, %rsi
movq 0x2e0(%rsp), %r14
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %r12
jb 0x140c3
movq 0x2e8(%rsp), %rax
movss (%rax,%r13,4), %xmm0
xorpd %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x147da
cvtss2sd %xmm0, %xmm0
movsd 0x2c9f(%rip), %xmm1     # 0x17088
ucomisd %xmm0, %xmm1
seta 0x28(%rsp)
movq 0x50(%rsp), %r14
movq (%r14), %rdi
callq 0x3050
xorl %ebp, %ebp
movq %rbp, (%r14)
movq 0x58(%rsp), %rbx
movq %rbp, (%rbx)
xorl %eax, %eax
testq %r13, %r13
je 0x1448c
xorl %ebp, %ebp
movq 0x2c0(%rsp), %r12
leaq -0x1(%rbp), %rcx
testq %rcx, %rbp
jne 0x1443f
testq %rbp, %rbp
je 0x14444
shlq $0x2, %rbp
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3440
movq (%rbx), %rdx
jmp 0x14450
movq %rbp, %rdx
jmp 0x14453
movl $0x2, %edi
callq 0x33e0
xorl %edx, %edx
movq %rax, (%r14)
movzwl (%r12,%r13,2), %ecx
movw %cx, (%rax,%rdx,2)
leaq 0x1(%rdx), %rbp
movq %rbp, (%rbx)
cmpq %rcx, %r13
jb 0x146e2
cmpl $0x103, %ecx            # imm = 0x103
jae 0x14720
testq %rcx, %rcx
je 0x14701
subq %rcx, %r13
jne 0x1441d
cmpq $0x2, %rbp
jae 0x14496
movq 0x2e0(%rsp), %r14
jmp 0x144c6
movq %rbp, %rcx
shrq %rcx
leaq (%rax,%rdx,2), %r8
xorl %edx, %edx
movq 0x2e0(%rsp), %r14
movzwl (%rax,%rdx,2), %esi
movzwl (%r8), %edi
movw %di, (%rax,%rdx,2)
movw %si, (%r8)
incq %rdx
addq $-0x2, %r8
cmpq %rdx, %rcx
jne 0x144aa
cmpq %r15, 0x18(%rsp)
je 0x14687
movq %rax, 0x20(%rsp)
xorl %r13d, %r13d
movq %r15, %rax
subq $0x8000, %rax           # imm = 0x8000
cmovaeq %rax, %r13
movq %r13, 0x10(%rsp)
movl $0x8000, %ebx           # imm = 0x8000
movl $0x8000, %edi           # imm = 0x8000
movq %r14, %rsi
callq 0x13440
movq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %r13
movq %r13, %rdx
movq %r14, %rcx
callq 0x1365e
cmpq %r15, 0x10(%rsp)
jae 0x14540
cmpq %rbx, %r15
cmovbq %r15, %rbx
negq %rbx
leaq (%r15,%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x13539
incq %rbx
jne 0x14529
testq %rbp, %rbp
movq 0x20(%rsp), %rax
je 0x14687
movq %r14, %r12
xorl %ecx, %ecx
movq 0x18(%rsp), %r14
cmpq %r14, %r15
jae 0x1473f
movq %rcx, 0x10(%rsp)
movzwl (%rax,%rcx,2), %r13d
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x13539
cmpw $0x3, %r13w
jb 0x14657
subq $0x8, %rsp
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %r13, %r9
leaq 0x88(%rsp), %rax
pushq %rax
leaq 0x1e(%rsp), %rax
pushq %rax
pushq $0x0
callq 0x121c8
addq $0x20, %rsp
movzwl 0x80(%rsp), %eax
cmpw %r13w, %ax
sete %cl
cmpw $0x3, %ax
setb %al
orb %cl, %al
je 0x1475e
movzwl 0xe(%rsp), %ecx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %r13d, %r8d
callq 0x12154
movzwl 0xe(%rsp), %esi
movl %r13d, %edi
movq %r15, %rdx
movq 0x2d8(%rsp), %rcx
callq 0x11a5f
leaq (%r15,%r13), %rax
movq %rax, 0x38(%rsp)
cmpq %r14, %rax
ja 0x1477d
decq %r13
incq %r15
movq 0x30(%rsp), %r14
movq 0x2e0(%rsp), %rbx
movq 0x18(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x13539
incq %r15
decq %r13
jne 0x14634
movq 0x38(%rsp), %r15
movq %rbx, %r12
jmp 0x14671
movzbl (%rbx,%r15), %edi
xorl %esi, %esi
movq %r15, %rdx
movq 0x2d8(%rsp), %rcx
callq 0x11a5f
incq %r15
movq 0x10(%rsp), %rcx
incq %rcx
cmpq %rbp, %rcx
movq 0x20(%rsp), %rax
jne 0x14553
cmpb $0x0, 0x28(%rsp)
je 0x147bb
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3453(%rip), %rdi      # 0x17afe
leaq 0x336e(%rip), %rsi      # 0x17a20
leaq 0x3452(%rip), %rcx      # 0x17b0b
movl $0x128, %edx            # imm = 0x128
callq 0x3220
leaq 0x34d3(%rip), %rdi      # 0x17b9d
leaq 0x334f(%rip), %rsi      # 0x17a20
leaq 0x3433(%rip), %rcx      # 0x17b0b
movl $0x12a, %edx            # imm = 0x12A
callq 0x3220
leaq 0x34e0(%rip), %rdi      # 0x17bc9
leaq 0x3330(%rip), %rsi      # 0x17a20
leaq 0x34ef(%rip), %rcx      # 0x17be6
movl $0x143, %edx            # imm = 0x143
callq 0x3220
leaq 0x3557(%rip), %rdi      # 0x17c5f
leaq 0x3311(%rip), %rsi      # 0x17a20
leaq 0x34d0(%rip), %rcx      # 0x17be6
movl $0x145, %edx            # imm = 0x145
callq 0x3220
leaq 0x3510(%rip), %rdi      # 0x17c37
leaq 0x32f2(%rip), %rsi      # 0x17a20
leaq 0x34b1(%rip), %rcx      # 0x17be6
movl $0x144, %edx            # imm = 0x144
callq 0x3220
leaq 0x3532(%rip), %rdi      # 0x17c78
leaq 0x32d3(%rip), %rsi      # 0x17a20
leaq 0x3530(%rip), %rcx      # 0x17c84
movl $0x169, %edx            # imm = 0x169
callq 0x3220
leaq 0x35a5(%rip), %rdi      # 0x17d0a
leaq 0x32b4(%rip), %rsi      # 0x17a20
leaq 0x3511(%rip), %rcx      # 0x17c84
movl $0x173, %edx            # imm = 0x173
callq 0x3220
leaq 0x35c2(%rip), %rdi      # 0x17d46
leaq 0x3295(%rip), %rsi      # 0x17a20
leaq 0x34f2(%rip), %rcx      # 0x17c84
movl $0x17e, %edx            # imm = 0x17E
callq 0x3220
leaq 0x335b(%rip), %rdi      # 0x17afe
leaq 0x3276(%rip), %rsi      # 0x17a20
leaq 0x335a(%rip), %rcx      # 0x17b0b
movl $0x117, %edx            # imm = 0x117
callq 0x3220
leaq 0x3244(%rip), %rdi      # 0x17a06
leaq 0x3257(%rip), %rsi      # 0x17a20
leaq 0x326c(%rip), %rcx      # 0x17a3c
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x3220
leaq 0x33d2(%rip), %rdi      # 0x17bb3
leaq 0x3238(%rip), %rsi      # 0x17a20
leaq 0x331c(%rip), %rcx      # 0x17b0b
movl $0x131, %edx            # imm = 0x131
callq 0x3220