// File: /workspace/github_c_makefile_star2_O1/bluecmd[P]fst-example/gtkwave/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_t_internal*) LZ4_streamDecode;
    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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r9
movq 0x10(%rdi), %rdx
movq 0x18(%rdi), %r10
movslq %ecx, %rax
addq %rsi, %rax
movq %rax, -0x70(%rbp)
movslq %r8d, %rax
addq %r9, %rax
movq %rax, -0x68(%rbp)
cmpq %r9, %rdx
movq %r9, -0x40(%rbp)
movq %rdi, -0x48(%rbp)
movq %rsi, -0xa0(%rbp)
je 0x117da
movq %r10, 0x8(%rdi)
movq %rdx, %rax
subq %r10, %rax
movq %rax, (%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movq $-0x1, -0xc8(%rbp)
movq $0x1, -0xb8(%rbp)
movq $0x2, -0xb0(%rbp)
movq $0x3, -0xa8(%rbp)
testl %r8d, %r8d
je 0x11bf9
movq %rdx, -0x50(%rbp)
movq %r9, %rax
subq %r10, %rax
movq %rax, -0x90(%rbp)
movq -0x68(%rbp), %rcx
leaq -0xc(%rcx), %r11
movq -0x70(%rbp), %rax
leaq -0xf(%rax), %r14
leaq -0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
leaq -0x8(%rcx), %rdx
movq %rdx, -0x78(%rbp)
addq $-0x5, %rax
movq %rax, -0x88(%rbp)
leaq -0x5(%rcx), %rax
movq %rax, -0x58(%rbp)
leaq 0x4642(%rip), %r8       # 0x15b14
movq %r9, %r13
movq %rsi, %r12
movq %r10, -0x38(%rbp)
movq %r11, -0x30(%rbp)
movzbl (%r12), %ebx
movq %r12, %rsi
incq %rsi
movl %ebx, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0x11522
movl $0xf, %edx
movzbl (%rsi), %eax
incq %rsi
addq %rax, %rdx
cmpq %r14, %rsi
jae 0x1150c
cmpb $-0x1, %al
je 0x114fa
movl $0x6, %eax
testq %rdx, %rdx
movl $0x0, %ecx
cmovnsl %ecx, %eax
js 0x115fc
leaq (%rdx,%r13), %r15
leaq (%rsi,%rdx), %r12
cmpq %r11, %r15
ja 0x115c6
cmpq -0x98(%rbp), %r12
ja 0x115c6
movq (%rsi), %rax
movq %rax, (%r13)
addq $0x8, %r13
addq $0x8, %rsi
cmpq %r15, %r13
jb 0x11540
movzwl (%r12), %eax
movq %r15, %rcx
subq %rax, %rcx
addq $0x2, %r12
movl $0x6, %eax
cmpq $0xffff, %r10           # imm = 0xFFFF
ja 0x1157e
cmpq -0x90(%rbp), %rcx
jb 0x116ef
andl $0xf, %ebx
cmpq $0xf, %rbx
jne 0x11614
movl $0xf, %ebx
movq -0x88(%rbp), %rsi
cmpq %rsi, %r12
ja 0x11604
movzbl (%r12), %edx
incq %r12
addq %rdx, %rbx
cmpq $0xff, %rdx
je 0x11597
testq %rbx, %rbx
setns %sil
movl $0x6, %edx
movl $0x0, %edi
cmovnsl %edi, %edx
jmp 0x1160b
movl $0x6, %eax
cmpq -0x70(%rbp), %r12
jne 0x115fc
cmpq -0x68(%rbp), %r15
ja 0x115fc
movq %r13, %rdi
callq 0x2240
leaq 0x452e(%rip), %r8       # 0x15b14
movq -0x30(%rbp), %r11
movq -0x38(%rbp), %r10
movq -0x40(%rbp), %r9
movl $0x3, %eax
jmp 0x116ef
movq %rsi, %r12
jmp 0x1172d
movl $0x6, %edx
xorl %esi, %esi
testb %sil, %sil
je 0x116ed
leaq (%r15,%rbx), %r13
addq $0x4, %r13
cmpq %r9, %rcx
jae 0x116ac
cmpq -0x58(%rbp), %r13
ja 0x116ef
addq $0x4, %rbx
movq %r9, %rax
subq %rcx, %rax
movq -0x50(%rbp), %rsi
subq %rax, %rsi
movq %rbx, %rcx
subq %rax, %rcx
jbe 0x116f4
movq %r15, %rdi
movq %rax, -0x60(%rbp)
movq %rcx, -0x80(%rbp)
movq -0x60(%rbp), %rdx
callq 0x2240
movq -0x80(%rbp), %rdx
movq -0x60(%rbp), %rcx
addq %rcx, %r15
movq %r15, %rax
movq -0x40(%rbp), %r9
subq %r9, %rax
cmpq %rax, %rdx
jbe 0x1170a
movl $0x2, %eax
cmpq %rcx, %rbx
movq -0x38(%rbp), %r10
movq -0x30(%rbp), %r11
leaq 0x447f(%rip), %r8       # 0x15b14
jle 0x116ef
movq %r9, %rcx
movb (%rcx), %dl
incq %rcx
movb %dl, (%r15)
incq %r15
cmpq %r13, %r15
jb 0x1169a
jmp 0x116ef
movq %r15, %rsi
subq %rcx, %rsi
cmpq $0x7, %rsi
jle 0x11741
movq (%rcx), %rdx
movq %rdx, (%r15)
addq $0x8, %rcx
movq %rcx, %rdx
addq $0x8, %r15
cmpq %r11, %r13
ja 0x1178a
movq (%rdx), %rax
movq %rax, (%r15)
addq $0x8, %r15
addq $0x8, %rdx
cmpq %r13, %r15
jb 0x116d6
xorl %eax, %eax
jmp 0x1172d
movl %edx, %eax
movq %r15, %r13
jmp 0x1172d
movq %r15, %rdi
movq %rbx, %rdx
callq 0x22f0
movl $0x2, %eax
movq -0x40(%rbp), %r9
jmp 0x1171e
movq %r15, %rdi
movq %r9, %rsi
callq 0x2240
movq -0x40(%rbp), %r9
movl $0x2, %eax
movq -0x38(%rbp), %r10
movq -0x30(%rbp), %r11
leaq 0x43e7(%rip), %r8       # 0x15b14
cmpl $0x6, %eax
ja 0x11b8f
movl %eax, %eax
movslq (%r8,%rax,4), %rax
addq %r8, %rax
jmpq *%rax
movb (%rcx), %dil
leaq 0x4575(%rip), %rdx      # 0x15cc0
movq (%rdx,%rsi,8), %r8
leaq (%rcx,%r8), %rdx
subq -0xe0(%rbp,%rsi,8), %rdx
movb %dil, (%r15)
movb 0x1(%rcx), %sil
movb %sil, 0x1(%r15)
movb 0x2(%rcx), %sil
movb %sil, 0x2(%r15)
movb 0x3(%rcx), %sil
movb %sil, 0x3(%r15)
movl (%rcx,%r8), %ecx
leaq 0x4393(%rip), %r8       # 0x15b14
movl %ecx, 0x4(%r15)
jmp 0x116c9
cmpq -0x58(%rbp), %r13
ja 0x116ef
movq -0x78(%rbp), %rdi
cmpq %rdi, %r15
jae 0x117c2
movq %rdx, %rax
movq %r15, %rcx
movq (%rax), %rsi
movq %rsi, (%rcx)
addq $0x8, %rcx
addq $0x8, %rax
cmpq %rdi, %rcx
jb 0x117a3
movq %rdi, %rax
subq %r15, %rax
addq %rax, %rdx
movq %rdi, %r15
xorl %eax, %eax
cmpq %r13, %r15
jae 0x1172d
movb (%rdx), %cl
incq %rdx
movb %cl, (%r15)
incq %r15
jmp 0x117c4
movq 0x8(%rdi), %r11
movq (%rdi), %rax
addq %r11, %rax
movq %rax, -0x80(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movq $-0x1, -0xc8(%rbp)
movq $0x1, -0xb8(%rbp)
movq $0x2, -0xb0(%rbp)
movq $0x3, -0xa8(%rbp)
testl %r8d, %r8d
je 0x11c0f
subq %r10, %rdx
movq %rdx, -0x50(%rbp)
subq %r11, %rdx
movq %rdx, -0x90(%rbp)
movq -0x68(%rbp), %rcx
leaq -0xc(%rcx), %r10
movq -0x70(%rbp), %rax
leaq -0xf(%rax), %r14
leaq -0x8(%rax), %rdx
movq %rdx, -0x98(%rbp)
leaq -0x8(%rcx), %rdx
movq %rdx, -0xe8(%rbp)
addq $-0x5, %rax
movq %rax, -0x88(%rbp)
leaq -0x5(%rcx), %rax
movq %rax, -0x58(%rbp)
leaq 0x42a3(%rip), %r8       # 0x15b30
movq %r9, %r13
movq %rsi, %r12
movq %r11, -0x38(%rbp)
movq %r10, -0x30(%rbp)
movzbl (%r12), %ebx
movq %r12, %rsi
incq %rsi
movl %ebx, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0x118dd
movl $0xf, %edx
movzbl (%rsi), %eax
incq %rsi
addq %rax, %rdx
cmpq %r14, %rsi
jae 0x118c7
cmpb $-0x1, %al
je 0x118b5
movl $0x6, %eax
testq %rdx, %rdx
movl $0x0, %ecx
cmovnsl %ecx, %eax
js 0x119b7
leaq (%rdx,%r13), %r15
leaq (%rsi,%rdx), %r12
cmpq %r10, %r15
ja 0x11981
cmpq -0x98(%rbp), %r12
ja 0x11981
movq (%rsi), %rax
movq %rax, (%r13)
addq $0x8, %r13
addq $0x8, %rsi
cmpq %r15, %r13
jb 0x118fb
movzwl (%r12), %eax
movq %r15, %rcx
subq %rax, %rcx
addq $0x2, %r12
movl $0x6, %eax
cmpq $0xffff, %r11           # imm = 0xFFFF
ja 0x11939
cmpq -0x90(%rbp), %rcx
jb 0x11aad
andl $0xf, %ebx
cmpq $0xf, %rbx
jne 0x119cf
movl $0xf, %ebx
movq -0x88(%rbp), %rsi
cmpq %rsi, %r12
ja 0x119bf
movzbl (%r12), %edx
incq %r12
addq %rdx, %rbx
cmpq $0xff, %rdx
je 0x11952
testq %rbx, %rbx
setns %sil
movl $0x6, %edx
movl $0x0, %edi
cmovnsl %edi, %edx
jmp 0x119c6
movl $0x6, %eax
cmpq -0x70(%rbp), %r12
jne 0x119b7
cmpq -0x68(%rbp), %r15
ja 0x119b7
movq %r13, %rdi
callq 0x2240
leaq 0x418f(%rip), %r8       # 0x15b30
movq -0x30(%rbp), %r10
movq -0x38(%rbp), %r11
movq -0x40(%rbp), %r9
movl $0x3, %eax
jmp 0x11aad
movq %rsi, %r12
jmp 0x11adf
movl $0x6, %edx
xorl %esi, %esi
testb %sil, %sil
je 0x11aab
leaq (%r15,%rbx), %r13
addq $0x4, %r13
cmpq -0x50(%rbp), %rcx
jae 0x11a6e
cmpq -0x58(%rbp), %r13
ja 0x11aad
addq $0x4, %rbx
movq -0x50(%rbp), %rdx
subq %rcx, %rdx
movq -0x80(%rbp), %rsi
subq %rdx, %rsi
movq %rbx, %rcx
subq %rdx, %rcx
jbe 0x11ab2
movq %r15, %rdi
movq %rdx, -0x60(%rbp)
movq -0x60(%rbp), %rdx
movq %rcx, -0x78(%rbp)
callq 0x2240
movq -0x78(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x50(%rbp), %rsi
addq %rcx, %r15
movq %r15, %rax
subq %rsi, %rax
cmpq %rax, %rdx
jbe 0x11abf
movl $0x2, %eax
cmpq %rcx, %rbx
movq -0x40(%rbp), %r9
movq -0x38(%rbp), %r11
movq -0x30(%rbp), %r10
leaq 0x40da(%rip), %r8       # 0x15b30
jle 0x11aad
movq -0x50(%rbp), %rcx
movb (%rcx), %dl
incq %rcx
movb %dl, (%r15)
incq %r15
cmpq %r13, %r15
jb 0x11a5c
jmp 0x11aad
movq %r15, %rsi
subq %rcx, %rsi
cmpq $0x7, %rsi
jle 0x11af3
movq (%rcx), %rdx
movq %rdx, (%r15)
addq $0x8, %rcx
movq %rcx, %rdx
addq $0x8, %r15
cmpq %r10, %r13
ja 0x11b3c
movq (%rdx), %rax
movq %rax, (%r15)
addq $0x8, %r15
addq $0x8, %rdx
cmpq %r13, %r15
jb 0x11a94
xorl %eax, %eax
jmp 0x11adf
movl %edx, %eax
movq %r15, %r13
jmp 0x11adf
movq %r15, %rdi
movq %rbx, %rdx
callq 0x22f0
jmp 0x11ac7
movq %r15, %rdi
callq 0x2240
movl $0x2, %eax
movq -0x40(%rbp), %r9
movq -0x38(%rbp), %r11
movq -0x30(%rbp), %r10
leaq 0x4051(%rip), %r8       # 0x15b30
cmpl $0x6, %eax
ja 0x11bb8
movl %eax, %eax
movslq (%r8,%rax,4), %rax
addq %r8, %rax
jmpq *%rax
movb (%rcx), %dil
leaq 0x41c3(%rip), %rdx      # 0x15cc0
movq (%rdx,%rsi,8), %r8
leaq (%rcx,%r8), %rdx
subq -0xe0(%rbp,%rsi,8), %rdx
movb %dil, (%r15)
movb 0x1(%rcx), %sil
movb %sil, 0x1(%r15)
movb 0x2(%rcx), %sil
movb %sil, 0x2(%r15)
movb 0x3(%rcx), %sil
movb %sil, 0x3(%r15)
movl (%rcx,%r8), %ecx
leaq 0x3ffd(%rip), %r8       # 0x15b30
movl %ecx, 0x4(%r15)
jmp 0x11a87
cmpq -0x58(%rbp), %r13
ja 0x11aad
movq -0xe8(%rbp), %rdi
cmpq %rdi, %r15
jae 0x11b77
movq %rdx, %rax
movq %r15, %rcx
movq (%rax), %rsi
movq %rsi, (%rcx)
addq $0x8, %rcx
addq $0x8, %rax
cmpq %rdi, %rcx
jb 0x11b58
movq %rdi, %rax
subq %r15, %rax
addq %rax, %rdx
movq %rdi, %r15
xorl %eax, %eax
cmpq %r13, %r15
jae 0x11adf
movb (%rdx), %cl
incq %rdx
movb %cl, (%r15)
incq %r15
jmp 0x11b79
jmp 0x11ba3
notl %r12d
addl -0xa0(%rbp), %r12d
movl %r12d, %r13d
jmp 0x11ba3
subl %r9d, %r13d
movq -0x48(%rbp), %rdi
testl %r13d, %r13d
jle 0x11be4
movl %r13d, %eax
movq %rax, 0x18(%rdi)
addq %rax, %r9
jmp 0x11be0
jmp 0x11bcc
notl %r12d
addl -0xa0(%rbp), %r12d
movl %r12d, %r13d
jmp 0x11bcc
subl %r9d, %r13d
movq -0x48(%rbp), %rdi
testl %r13d, %r13d
jle 0x11be4
movl %r13d, %r9d
addq %r9, 0x18(%rdi)
addq 0x10(%rdi), %r9
movq %r9, 0x10(%rdi)
movl %r13d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $0x1, %ecx
jne 0x11ba7
xorl %r13d, %r13d
cmpb (%rsi), %r13b
sbbl %r13d, %r13d
jmp 0x11ba7
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $0x1, %ecx
jne 0x11bd0
xorl %r13d, %r13d
cmpb (%rsi), %r13b
sbbl %r13d, %r13d
jmp 0x11bd0