// File: /workspace/github_c_makefile_star2_O3/kieselsteini[P]PiXL-old/lz4.c
// Function: LZ4_decompress_safe_continue
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->prefixEnd == (BYTE*)dest) {
        result = LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
                                        endOnInputSize, full, 0,
                                        usingExtDict, lz4sd->prefixEnd - lz4sd->prefixSize, lz4sd->externalDict, lz4sd->extDictSize);
        if (result <= 0) return result;
        lz4sd->prefixSize += result;
        lz4sd->prefixEnd  += result;
    } else {
        lz4sd->extDictSize = lz4sd->prefixSize;
        lz4sd->externalDict = lz4sd->prefixEnd - lz4sd->extDictSize;
        result = LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
                                        endOnInputSize, full, 0,
                                        usingExtDict, (BYTE*)dest, lz4sd->externalDict, lz4sd->extDictSize);
        if (result <= 0) return result;
        lz4sd->prefixSize = result;
        lz4sd->prefixEnd  = (BYTE*)dest + result;
    }

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r9
movq %rsi, %r11
movq %rdi, %r13
movq 0x10(%rdi), %r10
movq 0x18(%rdi), %r15
movslq %ecx, %rsi
addq %r11, %rsi
movslq %r8d, %rdx
addq %r9, %rdx
cmpq %r9, %r10
movq %rdx, 0x78(%rsp)
movq %rsi, 0x80(%rsp)
je 0x2be3a
movq %r15, 0x8(%r13)
movq %r10, %rax
subq %r15, %rax
movq %rax, (%r13)
testl %r8d, %r8d
je 0x2c1c7
movq %r9, %r8
subq %r15, %r8
leaq -0xc(%rdx), %rax
movq %rax, 0x40(%rsp)
leaq -0xf(%rsi), %r14
leaq -0x8(%rsi), %rax
movq %rax, 0x68(%rsp)
leaq -0x5(%rsi), %rax
movq %rax, 0x60(%rsp)
leaq -0x7(%rdx), %rax
movq %rax, 0x48(%rsp)
leaq -0x5(%rdx), %rax
movq %rax, 0x50(%rsp)
movq %r9, %rdi
movq %r11, %r12
leaq 0x1(%r12), %rsi
movzbl (%r12), %eax
movl %eax, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0x2bb81
addq $0x2, %r12
movl $0xf, %edx
movq %r12, %rcx
movq %rsi, %r12
movzbl (%r12), %esi
incq %r12
addq %rsi, %rdx
incq %rcx
cmpq %r14, %r12
jae 0x2bb68
cmpb $-0x1, %sil
je 0x2bb4f
movq %rdi, %rsi
addq %rdx, %rsi
jb 0x2c1e0
negq %rcx
cmpq %rcx, %rdx
jbe 0x2bb84
jmp 0x2c1e0
movq %rsi, %r12
leaq (%rdi,%rdx), %rbp
leaq (%r12,%rdx), %rcx
cmpq 0x40(%rsp), %rbp
ja 0x2c17d
cmpq 0x68(%rsp), %rcx
ja 0x2c17d
movq (%r12), %rdx
movq %rdx, (%rdi)
addq $0x8, %rdi
addq $0x8, %r12
cmpq %rbp, %rdi
jb 0x2bba2
movzwl (%rcx), %edi
addq $0x2, %rcx
movq %rbp, %rsi
subq %rdi, %rsi
cmpq $0xffff, %r15           # imm = 0xFFFF
movq 0x60(%rsp), %rbx
ja 0x2bbda
cmpq %r8, %rsi
jb 0x2c1dd
movl %edi, (%rbp)
andl $0xf, %eax
cmpq $0xf, %rax
jne 0x2bc17
movl $0xf, %eax
leaq 0x1(%rcx), %r12
cmpq %rbx, %r12
ja 0x2c1e0
movzbl (%rcx), %edx
addq %rdx, %rax
movq %r12, %rcx
cmpq $0xff, %rdx
je 0x2bbeb
movq %rbp, %rcx
addq %rax, %rcx
jae 0x2bc1a
jmp 0x2c1e0
movq %rcx, %r12
leaq 0x4(%rax), %rdx
leaq (%rax,%rbp), %rbx
addq $0x4, %rbx
cmpq %r9, %rsi
jae 0x2bcd9
cmpq 0x50(%rsp), %rbx
ja 0x2c1e0
movq %r8, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r13, 0x30(%rsp)
movq %r9, %r13
subq %rsi, %r13
movq %rdx, %r15
subq %r13, %r15
movq %r9, 0x8(%rsp)
jbe 0x2bd34
movq %rdx, 0x38(%rsp)
movq %r10, 0x10(%rsp)
movq %r10, %rsi
subq %r13, %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x63f0
addq %r13, %rbp
movq %rbp, %rax
movq 0x8(%rsp), %r9
subq %r9, %rax
cmpq %rax, %r15
jbe 0x2bd5c
movq %rbp, %rdi
cmpq %r13, 0x38(%rsp)
movq 0x30(%rsp), %r13
movq 0x28(%rsp), %r11
movq 0x10(%rsp), %r10
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r8
jle 0x2bb2c
movq %r9, %rax
movb (%rax), %cl
incq %rax
movb %cl, (%rbp)
incq %rbp
cmpq %rbx, %rbp
jb 0x2bcc1
movq %rbp, %rdi
jmp 0x2bb2c
cmpw $0x7, %di
jbe 0x2bd91
movq (%rsi), %rax
movq %rax, (%rbp)
addq $0x8, %rsi
leaq 0x8(%rbp), %rax
cmpq 0x40(%rsp), %rbx
ja 0x2bde0
movq (%rsi), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
cmpq $0x11, %rdx
jb 0x2bb2c
addq $0x10, %rbp
addq $0x8, %rsi
movq (%rsi), %rax
movq %rax, (%rbp)
addq $0x8, %rbp
addq $0x8, %rsi
cmpq %rbx, %rbp
jb 0x2bd18
movq %rbx, %rdi
jmp 0x2bb2c
movq %r10, %rsi
subq %r13, %rsi
movq %rbp, %rdi
movq %r10, %r15
callq 0x6720
movq %r15, %r10
movq %rbx, %rdi
movq 0x30(%rsp), %r13
movq 0x8(%rsp), %r9
movq 0x28(%rsp), %r11
jmp 0x2bd82
movq %rbp, %rdi
movq %r9, %rsi
movq %r15, %rdx
movq %r9, %r15
callq 0x63f0
movq %r15, %r9
movq %rbx, %rdi
movq 0x30(%rsp), %r13
movq 0x28(%rsp), %r11
movq 0x10(%rsp), %r10
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %r8
jmp 0x2bb2c
movq %rdx, 0x38(%rsp)
movq %rbp, %rdx
leaq 0x70(%rsp), %rcx
movq %r9, 0x8(%rsp)
movq %r15, 0x20(%rsp)
movq %r11, %r15
movq %r10, 0x10(%rsp)
movq %r8, 0x18(%rsp)
callq 0x8845
movq 0x38(%rsp), %rdx
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r10
movq %r15, %r11
movq 0x20(%rsp), %r15
movq 0x8(%rsp), %r9
movq 0x70(%rsp), %rsi
jmp 0x2bcee
cmpq 0x50(%rsp), %rbx
ja 0x2c1e0
movq 0x48(%rsp), %rbp
cmpq %rbp, %rax
jae 0x2be1a
movq %rsi, %rcx
movq %rax, %rdx
movq (%rcx), %rdi
movq %rdi, (%rdx)
addq $0x8, %rdx
addq $0x8, %rcx
cmpq %rbp, %rdx
jb 0x2bdfb
movq %rbp, %rcx
subq %rax, %rcx
addq %rcx, %rsi
movq %rbp, %rax
movq %rbx, %rdi
cmpq %rbx, %rax
jae 0x2bb2c
movb (%rsi), %cl
incq %rsi
movb %cl, (%rax)
incq %rax
cmpq %rbx, %rax
jb 0x2be26
jmp 0x2bd2c
testl %r8d, %r8d
je 0x2c1c7
subq %r15, %r10
movq 0x8(%r13), %rax
movq %r10, 0x10(%rsp)
subq %rax, %r10
movq %r10, 0x20(%rsp)
movq (%r13), %rcx
movq %rax, 0x60(%rsp)
addq %rax, %rcx
movq %rcx, 0x48(%rsp)
leaq -0xc(%rdx), %rax
movq %rax, 0x40(%rsp)
leaq -0xf(%rsi), %r14
leaq -0x8(%rsi), %rax
movq %rax, 0x68(%rsp)
leaq -0x5(%rsi), %rax
movq %rax, 0x50(%rsp)
leaq -0x7(%rdx), %rax
movq %rax, 0x38(%rsp)
leaq -0x5(%rdx), %rax
movq %rax, 0x18(%rsp)
movq %r9, %rdi
movq %r11, %r12
leaq 0x1(%r12), %rsi
movzbl (%r12), %eax
movl %eax, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0x2bef9
addq $0x2, %r12
movl $0xf, %edx
movq %r12, %rcx
movq %rsi, %r12
movzbl (%r12), %esi
incq %r12
addq %rsi, %rdx
incq %rcx
cmpq %r14, %r12
jae 0x2bedb
cmpb $-0x1, %sil
je 0x2bec2
movq %rdi, %rsi
addq %rdx, %rsi
movq 0x10(%rsp), %r8
jb 0x2c1fa
negq %rcx
cmpq %rcx, %rdx
jbe 0x2bf01
jmp 0x2c1fa
movq %rsi, %r12
movq 0x10(%rsp), %r8
leaq (%rdi,%rdx), %rbp
leaq (%r12,%rdx), %rcx
cmpq 0x40(%rsp), %rbp
ja 0x2c1a4
cmpq 0x68(%rsp), %rcx
ja 0x2c1a4
movq (%r12), %rdx
movq %rdx, (%rdi)
addq $0x8, %rdi
addq $0x8, %r12
cmpq %rbp, %rdi
jb 0x2bf1f
movzwl (%rcx), %edi
addq $0x2, %rcx
movq %rbp, %rsi
subq %rdi, %rsi
cmpq $0xffff, 0x60(%rsp)     # imm = 0xFFFF
movq 0x50(%rsp), %r10
ja 0x2bf5b
cmpq 0x20(%rsp), %rsi
jb 0x2c1f7
movl %edi, (%rbp)
andl $0xf, %eax
cmpq $0xf, %rax
jne 0x2bf98
movl $0xf, %eax
leaq 0x1(%rcx), %r12
cmpq %r10, %r12
ja 0x2c1fa
movzbl (%rcx), %edx
addq %rdx, %rax
movq %r12, %rcx
cmpq $0xff, %rdx
je 0x2bf6c
movq %rbp, %rcx
addq %rax, %rcx
jae 0x2bf9b
jmp 0x2c1fa
movq %rcx, %r12
leaq 0x4(%rax), %rdx
leaq (%rax,%rbp), %r15
addq $0x4, %r15
cmpq %r8, %rsi
jae 0x2c045
cmpq 0x18(%rsp), %r15
ja 0x2c1fa
movq %r11, 0x28(%rsp)
movq %r9, 0x8(%rsp)
movq %r13, 0x30(%rsp)
movq %r8, %r13
subq %rsi, %r13
movq %rdx, %rbx
subq %r13, %rbx
jbe 0x2c0a0
movq %rdx, 0x58(%rsp)
movq 0x48(%rsp), %rsi
subq %r13, %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x63f0
addq %r13, %rbp
movq %rbp, %rax
movq 0x10(%rsp), %rsi
subq %rsi, %rax
cmpq %rax, %rbx
jbe 0x2c0b2
movq %rbp, %rdi
cmpq %r13, 0x58(%rsp)
movq 0x30(%rsp), %r13
movq 0x8(%rsp), %r9
movq 0x28(%rsp), %r11
jle 0x2be9f
movq 0x10(%rsp), %rax
movb (%rax), %cl
incq %rax
movb %cl, (%rbp)
incq %rbp
cmpq %r15, %rbp
jb 0x2c02d
movq %rbp, %rdi
jmp 0x2be9f
cmpw $0x7, %di
jbe 0x2c0d4
movq (%rsi), %rax
movq %rax, (%rbp)
addq $0x8, %rsi
leaq 0x8(%rbp), %rax
cmpq 0x40(%rsp), %r15
ja 0x2c105
movq (%rsi), %rcx
movq %rcx, (%rax)
movq %r15, %rdi
cmpq $0x11, %rdx
jb 0x2be9f
addq $0x10, %rbp
addq $0x8, %rsi
movq (%rsi), %rax
movq %rax, (%rbp)
addq $0x8, %rbp
addq $0x8, %rsi
cmpq %r15, %rbp
jb 0x2c084
movq %r15, %rdi
jmp 0x2be9f
movq 0x48(%rsp), %rsi
subq %r13, %rsi
movq %rbp, %rdi
callq 0x6720
jmp 0x2c0bd
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x63f0
movq %r15, %rdi
movq 0x30(%rsp), %r13
movq 0x8(%rsp), %r9
movq 0x28(%rsp), %r11
jmp 0x2be9f
movq %rdx, 0x58(%rsp)
movq %rbp, %rdx
leaq 0x70(%rsp), %rcx
movq %r9, 0x8(%rsp)
movq %r11, %rbx
callq 0x888a
movq 0x58(%rsp), %rdx
movq %rbx, %r11
movq 0x8(%rsp), %r9
movq 0x70(%rsp), %rsi
jmp 0x2c05a
movq %r11, %rbx
movq %r13, %r8
cmpq 0x18(%rsp), %r15
ja 0x2c229
movq %r9, %r10
movq 0x38(%rsp), %r9
cmpq %r9, %rax
jae 0x2c148
movq %rsi, %rcx
movq %rax, %rdx
movq (%rcx), %rdi
movq %rdi, (%rdx)
addq $0x8, %rdx
addq $0x8, %rcx
cmpq %r9, %rdx
jb 0x2c129
movq %r9, %rcx
subq %rax, %rcx
addq %rcx, %rsi
movq %r9, %rax
movq %r15, %rdi
cmpq %r15, %rax
movq %r8, %r13
movq %r10, %r9
movq %rbx, %r11
jae 0x2be9f
movb (%rsi), %cl
incq %rsi
movb %cl, (%rax)
incq %rax
cmpq %r15, %rax
jb 0x2c15d
movq %r15, %rdi
movq %r8, %r13
movq %r10, %r9
movq %rbx, %r11
jmp 0x2be9f
cmpq 0x80(%rsp), %rcx
jne 0x2c1e0
cmpq 0x78(%rsp), %rbp
ja 0x2c1e0
movq %r12, %rsi
movq %r9, %rbx
callq 0x63f0
movq %rbx, %r9
subl %r9d, %ebp
movl %ebp, %r12d
jmp 0x2c1e6
cmpq 0x80(%rsp), %rcx
jne 0x2c1fa
cmpq 0x78(%rsp), %rbp
ja 0x2c1fa
movq %r12, %rsi
movq %r9, %rbx
callq 0x63f0
subl %ebx, %ebp
movl %ebp, %r12d
jmp 0x2c200
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x1, %ecx
jne 0x2c214
xorl %r12d, %r12d
cmpb (%r11), %r12b
sbbl %r12d, %r12d
jmp 0x2c214
movq %rcx, %r12
notl %r12d
addl %r11d, %r12d
testl %r12d, %r12d
jle 0x2c214
movl %r12d, %eax
movq %rax, 0x18(%r13)
addq %rax, %r9
jmp 0x2c210
movq %rcx, %r12
notl %r12d
addl %r11d, %r12d
testl %r12d, %r12d
jle 0x2c214
movl %r12d, %r9d
addq %r9, 0x18(%r13)
addq 0x10(%r13), %r9
movq %r9, 0x10(%r13)
movl %r12d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r8, %r13
movq %rbx, %r11
jmp 0x2c1fa