// File: /workspace/github_c_makefile_star2_O1/Aethlas[P]fflz4/./lib/lz4/lz4.c
// Function: LZ4_decompress_safe_continue
LZ4_FORCE_O2_GCC_PPC64LE
int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxOutputSize)
{
    LZ4_streamDecode_t_internal* lz4sd = &LZ4_streamDecode->internal_donotuse;
    int result;

    if (lz4sd->prefixSize == 0) {
        /* The first call, no dictionary yet. */
        assert(lz4sd->extDictSize == 0);
        result = LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
        if (result <= 0) return result;
        lz4sd->prefixSize = (size_t)result;
        lz4sd->prefixEnd = (BYTE*)dest + result;
    } else if (lz4sd->prefixEnd == (BYTE*)dest) {
        /* They're rolling the current segment. */
        if (lz4sd->prefixSize >= 64 KB - 1)
            result = LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize);
        else if (lz4sd->extDictSize == 0)
            result = LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize,
                                                         lz4sd->prefixSize);
        else
            result = LZ4_decompress_safe_doubleDict(source, dest, compressedSize, maxOutputSize,
                                                    lz4sd->prefixSize, lz4sd->externalDict, lz4sd->extDictSize);
        if (result <= 0) return result;
        lz4sd->prefixSize += (size_t)result;
        lz4sd->prefixEnd  += result;
    } else {
        /* The buffer wraps around, or they're switching to another buffer. */
        lz4sd->extDictSize = lz4sd->prefixSize;
        lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize;
        result = LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize,
                                                  lz4sd->externalDict, lz4sd->extDictSize);
        if (result <= 0) return result;
        lz4sd->prefixSize = (size_t)result;
        lz4sd->prefixEnd  = (BYTE*)dest + result;
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %r9
testq %r9, %r9
je 0xf1fb
movq 0x10(%rbx), %rax
cmpq %r14, %rax
jne 0xf20d
cmpq $0xffff, %r9            # imm = 0xFFFF
movq %rbx, 0x78(%rsp)
jae 0xf241
movq 0x8(%rbx), %r10
testq %r10, %r10
je 0xf253
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0xf286
movq %rsi, 0x30(%rsp)
movq (%rbx), %rax
leaq (%rax,%r10), %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq %rdx, 0x38(%rsp)
testl %r8d, %r8d
je 0xf273
movq %r14, 0x48(%rsp)
testl %ecx, %ecx
je 0xf286
movq 0x48(%rsp), %r12
movq %r12, %rax
subq %r9, %rax
movq %rax, 0x18(%rsp)
movslq %ecx, %rax
movq 0x30(%rsp), %r13
leaq (%rax,%r13), %r11
movslq %r8d, %rcx
leaq (%r12,%rcx), %rbx
leaq (%rax,%r13), %rbp
addq $-0x10, %rbp
leaq (%r12,%rcx), %rax
addq $-0x20, %rax
movq %rax, 0x88(%rsp)
cmpl $0x40, %r8d
movq %r10, 0x10(%rsp)
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %rbp, 0x20(%rsp)
jl 0xf576
leaq -0x11(%r11), %rax
movq %rax, 0x70(%rsp)
leaq -0xf(%r11), %r12
leaq -0x20(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq -0x20(%r11), %rax
movq %rax, 0x58(%rsp)
leaq -0x40(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq -0x4(%r11), %rax
movq %rax, 0x80(%rsp)
leaq -0x5(%rbx), %rax
movq %rax, 0x68(%rsp)
movq 0x30(%rsp), %r13
movq 0x48(%rsp), %rbp
movq 0x18(%rsp), %r9
movq %r12, 0x40(%rsp)
movzbl (%r13), %r14d
incq %r13
movl %r14d, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0xef19
cmpq %r12, %r13
jae 0xf192
xorl %eax, %eax
movq %r13, %rcx
movb (%rcx), %dl
movzbl %dl, %edx
incq %rcx
addl %edx, %eax
cmpq %r12, %rcx
setb %sil
cmpb $-0x1, %dl
sete %dl
testb %dl, %sil
jne 0xeeb2
movl %eax, %r15d
addq $0xf, %r15
movq %rbp, %rax
addq %r15, %rax
setb %dil
movq %rcx, %rdx
addq %r15, %rdx
setb %r8b
movl $0x5, %esi
cmpq %r12, %r13
jae 0xef3e
testb %dil, %dil
jne 0xef3e
testb %r8b, %r8b
jne 0xef3e
movl $0x6, %esi
cmpq 0x60(%rsp), %rax
ja 0xef14
cmpq 0x58(%rsp), %rdx
jbe 0xf164
movq %rcx, %rdx
jmp 0xef46
leaq (%rdx,%rbp), %rax
cmpq 0x70(%rsp), %r13
ja 0xf26b
movups (%r13), %xmm0
movups %xmm0, (%rbp)
addq %r13, %rdx
movq %rax, 0x28(%rsp)
movq %rax, %rbp
jmp 0xef53
movq %rcx, %rdx
movq 0x28(%rsp), %rax
testl %esi, %esi
jne 0xf1ca
movq %rax, 0x28(%rsp)
movzwl (%rdx), %ecx
movq %rdx, %r13
addq $0x2, %r13
movq %rbp, %rsi
subq %rcx, %rsi
andl $0xf, %r14d
cmpq $0xf, %r14
movq 0x80(%rsp), %r15
jne 0xefff
movl $0x5, %eax
cmpq $0xffff, %r10           # imm = 0xFFFF
ja 0xef94
leaq (%rsi,%r10), %rdx
cmpq %r9, %rdx
jb 0xf1bf
xorl %edx, %edx
movb (%r13), %dil
movzbl %dil, %edi
incq %r13
addl %edi, %edx
cmpq %r15, %r13
setae %r8b
cmpb $-0x1, %dil
setne %dil
orb %r8b, %dil
cmpb $0x1, %dil
jne 0xef96
movl %edx, %edx
leaq 0xf(%rdx), %r14
movq %rbp, %rdi
addq %r14, %rdi
setb %dil
cmpq %r15, %r13
jae 0xeff6
testb %dil, %dil
jne 0xeff6
leaq (%rdx,%rbp), %rax
addq $0x13, %rax
addq $0x13, %rdx
cmpq 0x50(%rsp), %rax
movl $0x7, %eax
movl $0x0, %edi
cmovbl %edi, %eax
movq %rdx, %r14
testl %eax, %eax
je 0xf040
jmp 0xf1e4
leaq (%r14,%rbp), %rax
addq $0x4, %rax
addq $0x4, %r14
cmpq 0x50(%rsp), %rax
jae 0xf45d
cmpq %r9, %rsi
jb 0xf040
cmpw $0x8, %cx
jb 0xf040
movq (%rsi), %rcx
movq %rcx, (%rbp)
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rbp)
movzwl 0x10(%rsi), %ecx
movw %cx, 0x10(%rbp)
movq %rax, %rbp
jmp 0xee91
cmpq $0xffff, %r10           # imm = 0xFFFF
ja 0xf056
leaq (%rsi,%r10), %rax
cmpq %r9, %rax
jb 0xf625
leaq (%r14,%rbp), %r15
cmpq %r9, %rsi
jae 0xf0da
cmpq 0x68(%rsp), %r15
ja 0xf625
movq %r9, %r12
subq %rsi, %r12
movq %r14, %rbx
subq %r12, %rbx
jbe 0xf114
movq 0x38(%rsp), %rsi
subq %r12, %rsi
movq %rbp, %rdi
movq %r12, %rdx
callq 0x1140
addq %r12, %rbp
movq %rbp, %rax
movq 0x18(%rsp), %r9
subq %r9, %rax
cmpq %rax, %rbx
jbe 0xf136
cmpq %r12, %r14
movq 0x10(%rsp), %r10
movq (%rsp), %rbx
movq 0x8(%rsp), %r11
movq 0x40(%rsp), %r12
jle 0xee91
movq %r9, %rax
movb (%rax), %cl
incq %rax
movb %cl, (%rbp)
incq %rbp
cmpq %r15, %rbp
jb 0xf0c5
jmp 0xee91
cmpw $0x10, %cx
jb 0xf1a0
movl $0x10, %eax
subq %rcx, %rax
movups -0x10(%rbp,%rax), %xmm0
movups %xmm0, (%rbp)
movups (%rbp,%rax), %xmm0
movups %xmm0, 0x10(%rbp)
addq $0x20, %rbp
cmpq %r15, %rbp
jb 0xf0ec
movq %r15, 0x28(%rsp)
movq %r15, %rbp
jmp 0xee91
movq 0x38(%rsp), %rsi
subq %r12, %rsi
movq %rbp, %rdi
movq %r14, %rdx
callq 0x1190
movq %r15, %rbp
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r9
jmp 0xf151
movq %rbp, %rdi
movq %r9, %rsi
movq %rbx, %rdx
callq 0x1140
movq 0x18(%rsp), %r9
movq %r15, %rbp
movq 0x10(%rsp), %r10
movq (%rsp), %rbx
movq 0x8(%rsp), %r11
movq 0x40(%rsp), %r12
jmp 0xee91
xorl %esi, %esi
movups (%rcx,%rsi), %xmm0
leaq (%rsi,%rbp), %rdi
addq $0x20, %rdi
movups %xmm0, -0x20(%rdi)
movups 0x10(%rcx,%rsi), %xmm0
movups %xmm0, -0x10(%rdi)
addq $0x20, %rsi
cmpq %rax, %rdi
jb 0xf166
xorl %esi, %esi
movq %rax, %rbp
jmp 0xef46
movl $0xf, %r15d
movq %r13, %rcx
jmp 0xeed5
movq %rbp, %rdi
movq %r15, %rdx
callq 0x104a4
movq 0x8(%rsp), %r11
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %r10
jmp 0xf107
movl $0xf, %r14d
jmp 0xeff6
movq %rdx, %r13
cmpl $0x5, %esi
je 0xf625
cmpl $0x6, %esi
je 0xf3ba
jmp 0xf286
cmpl $0x5, %eax
je 0xf625
cmpl $0x7, %eax
je 0xf45d
jmp 0xf286
movq %rsi, %rdi
movq %r14, %rsi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x1430
jmp 0xf22a
movq %r9, 0x8(%rbx)
subq %r9, %rax
movq %rax, (%rbx)
movq %rsi, %rdi
movq %r14, %rsi
movl %ecx, %edx
movl %r8d, %ecx
movq %rax, %r8
callq 0x27d2
movl %eax, %r13d
testl %eax, %eax
jle 0xf29b
movl %r13d, %eax
movq %rax, 0x18(%rbx)
addq %rax, %r14
movq %r14, 0x10(%rbx)
jmp 0xf29b
movq %rsi, %rdi
movq %r14, %rsi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x20f9
jmp 0xf266
movq %rsi, %rdi
movq %r14, %rsi
movl %ecx, %edx
movl %r8d, %ecx
movq %r9, %r8
callq 0x304c
movl %eax, %r13d
jmp 0xf286
movq %rdx, %r15
jmp 0xf3ba
cmpl $0x1, %ecx
jne 0xf286
xorl %r13d, %r13d
movq 0x30(%rsp), %rax
cmpb (%rax), %r13b
sbbl %r13d, %r13d
testl %r13d, %r13d
jle 0xf29b
movl %r13d, %eax
movq 0x78(%rsp), %rcx
addq %rax, 0x18(%rcx)
addq %rax, 0x10(%rcx)
movl %r13d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %r9
movq 0x88(%rsp), %rdi
movl %ecx, %r15d
cmpq %rbp, %rax
jae 0xf342
cmpq %rdi, %r12
ja 0xf342
movups (%rax), %xmm0
movups %xmm0, (%r12)
addq %r15, %r12
andl $0xf, %r14d
leaq (%rax,%r15), %r13
addq $0x2, %r13
movzwl -0x2(%r13), %edx
movzwl %dx, %ecx
movq %r12, %rsi
subq %rcx, %rsi
cmpl $0xf, %r14d
je 0xf33a
cmpw $0x8, %dx
jb 0xf33a
cmpq %r9, %rsi
jb 0xf33a
addq %r15, %rax
movq (%rsi), %rcx
movq %rcx, (%r12)
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%r12)
movzwl 0x10(%rsi), %ecx
movw %cx, 0x10(%r12)
addq %r14, %r12
addq $0x4, %r12
movzbl 0x2(%rax), %r14d
addq $0x3, %rax
movl %r14d, %ecx
shrl $0x4, %ecx
cmpl $0xf, %ecx
jne 0xf2bd
jmp 0xf347
movq %r12, %rbp
jmp 0xf404
movq %rax, %r13
jmp 0xf3b3
leaq -0xf(%r11), %rcx
movl $0xf, %r15d
movq %rax, %r13
cmpq %rcx, %rax
jae 0xf386
xorl %edx, %edx
movq %rax, %r13
movb (%r13), %sil
movzbl %sil, %esi
incq %r13
addl %esi, %edx
cmpq %rcx, %r13
setb %dil
cmpb $-0x1, %sil
sete %sil
testb %sil, %dil
jne 0xf35e
movl %edx, %r15d
addq $0xf, %r15
movq %r12, %rdx
addq %r15, %rdx
setb %dl
movq %r13, %rsi
addq %r15, %rsi
setb %sil
cmpq %rcx, %rax
jae 0xf625
testb %dl, %dl
jne 0xf625
testb %sil, %sil
jne 0xf625
leaq (%r12,%r15), %rax
movq %r12, %rbp
leaq -0xc(%rbx), %rcx
leaq (%r15,%r13), %rdx
cmpq %rcx, %rax
ja 0xf5ae
leaq -0x8(%r11), %rcx
cmpq %rcx, %rdx
ja 0xf5ae
movq (%r13), %rcx
movq %rcx, (%rbp)
addq $0x8, %rbp
addq $0x8, %r13
cmpq %rax, %rbp
jb 0xf3d8
movzwl (%rdx), %ecx
addq $0x2, %rdx
movq %rax, %rsi
subq %rcx, %rsi
andl $0xf, %r14d
movq %rdx, %r13
movq %rax, %rbp
cmpl $0xf, %r14d
jne 0xf459
leaq -0x4(%r11), %rax
xorl %edx, %edx
movb (%r13), %dil
movzbl %dil, %edi
incq %r13
addl %edi, %edx
cmpq %rax, %r13
setb %r8b
cmpb $-0x1, %dil
sete %dil
testb %dil, %r8b
jne 0xf410
movl %edx, %r14d
addq $0xf, %r14
xorl %edx, %edx
movq %rbp, %rdi
addq %r14, %rdi
setb %dl
cmpq %rax, %r13
leal (%rdx,%rdx,4), %edx
movl $0x5, %eax
cmovbl %edx, %eax
testl %eax, %eax
jne 0xf5a3
addq $0x4, %r14
cmpq $0xffff, %r10           # imm = 0xFFFF
ja 0xf473
leaq (%rsi,%r10), %rax
cmpq %r9, %rax
jb 0xf625
leaq (%r14,%rbp), %r12
cmpq %r9, %rsi
jae 0xf4f4
leaq -0x5(%rbx), %rax
cmpq %rax, %r12
ja 0xf625
movq %r9, %r15
subq %rsi, %r15
movq %r14, %rbx
subq %r15, %rbx
jbe 0xf543
movq 0x38(%rsp), %rsi
subq %r15, %rsi
movq %rbp, %rdi
movq %r15, %rdx
callq 0x1140
addq %r15, %rbp
movq %rbp, %rax
movq 0x18(%rsp), %rsi
subq %rsi, %rax
cmpq %rax, %rbx
jbe 0xf558
cmpq %r15, %r14
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
jle 0xf59a
movq %rsi, %rax
movq (%rsp), %rbx
movb (%rax), %cl
incq %rax
movb %cl, (%rbp)
incq %rbp
cmpq %r12, %rbp
jb 0xf4df
movq %rbp, %r12
jmp 0xf571
leaq -0xc(%rbx), %r15
cmpl $0x7, %ecx
jbe 0xf5d5
movq (%rsi), %rax
movq %rax, (%rbp)
addq $0x8, %rsi
leaq 0x8(%rbp), %rcx
cmpq %r15, %r12
ja 0xf601
movq (%rsi), %rax
movq %rax, (%rcx)
cmpq $0x11, %r14
jb 0xf571
addq $0x10, %rbp
addq $0x8, %rsi
movq (%rsi), %rax
movq %rax, (%rbp)
addq $0x8, %rbp
addq $0x8, %rsi
cmpq %r12, %rbp
jb 0xf52d
jmp 0xf571
movq 0x38(%rsp), %rsi
subq %r15, %rsi
movq %rbp, %rdi
movq %r14, %rdx
callq 0x1190
jmp 0xf563
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x1140
movq 0x10(%rsp), %r10
movq (%rsp), %rbx
movq 0x8(%rsp), %r11
movq 0x20(%rsp), %rbp
movzbl (%r13), %r14d
movq %r13, %rax
incq %rax
movl %r14d, %ecx
shrl $0x4, %ecx
cmpl $0xf, %ecx
jne 0xf2b0
movq 0x18(%rsp), %r9
jmp 0xf347
movq %rbp, %r12
movq (%rsp), %rbx
jmp 0xf571
cmpl $0x5, %eax
jne 0xf286
jmp 0xf625
cmpq %r11, %rdx
jne 0xf625
cmpq %rbx, %rax
ja 0xf625
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1190
addl %r15d, %ebp
subl 0x48(%rsp), %ebp
movl %ebp, %r13d
jmp 0xf286
leaq 0x90(%rsp), %rbx
movq %rbp, %rdi
movq %rcx, %rdx
movq %rbx, %rcx
callq 0x36ec
movq 0x8(%rsp), %r11
movq 0x10(%rsp), %r10
movq (%rbx), %rsi
movq (%rsp), %rbx
jmp 0xf50c
leaq -0x5(%rbx), %rax
movl $0x5, %edx
cmpq %rax, %r12
movq 0x20(%rsp), %rbp
jbe 0xf632
testl %edx, %edx
je 0xf576
cmpl $0x5, %edx
jne 0xf286
notl %r13d
addl 0x30(%rsp), %r13d
jmp 0xf286
leaq -0x7(%rbx), %rax
cmpq %rax, %rcx
jae 0xf65f
movq %rsi, %rdx
movq %rcx, %rdi
movq (%rdx), %r8
movq %r8, (%rdi)
addq $0x8, %rdi
addq $0x8, %rdx
cmpq %rax, %rdi
jb 0xf641
movq %rax, %rdx
subq %rcx, %rdx
addq %rdx, %rsi
jmp 0xf662
movq %rcx, %rax
xorl %edx, %edx
cmpq %r12, %rax
jae 0xf614
movb (%rsi), %cl
incq %rsi
movb %cl, (%rax)
incq %rax
jmp 0xf664