// File: /workspace/github_c_makefile_star2_O3/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), %r11
movq 0x18(%rdi), %rbx
movslq %ecx, %r10
addq %rsi, %r10
movslq %r8d, %rdx
addq %r9, %rdx
cmpq %r9, %r11
movq %rdi, -0xa0(%rbp)
movq %r9, -0x60(%rbp)
movq %rsi, -0x98(%rbp)
movq %rdx, -0x88(%rbp)
movq %r10, -0x90(%rbp)
je 0x10fae
movq %rbx, 0x8(%rdi)
movq %r11, %rax
subq %rbx, %rax
movq %rax, (%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0xc0(%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 0x1137e
movq %r9, %r8
movq %rbx, -0x70(%rbp)
subq %rbx, %r8
leaq -0xc(%rdx), %rax
leaq -0xf(%r10), %r14
leaq -0x8(%r10), %rcx
movq %rcx, -0x80(%rbp)
leaq -0x8(%rdx), %rcx
movq %rcx, -0x50(%rbp)
leaq -0x5(%r10), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, %r10
leaq -0x5(%rdx), %rax
movq %rax, -0x58(%rbp)
movq %r9, %rdi
movq %rsi, %r12
movq %r11, -0x40(%rbp)
movq %r8, -0x48(%rbp)
movq %r10, -0x30(%rbp)
movzbl (%r12), %ebx
incq %r12
movl %ebx, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0x10d6e
movl $0xf, %edx
movzbl (%r12), %eax
incq %r12
addq %rax, %rdx
cmpq %r14, %r12
jae 0x10d60
cmpb $-0x1, %al
je 0x10d4c
testq %rdx, %rdx
movq -0x70(%rbp), %rsi
jns 0x10d72
jmp 0x1131f
movq -0x70(%rbp), %rsi
leaq (%rdi,%rdx), %r15
leaq (%r12,%rdx), %rax
cmpq %r10, %r15
ja 0x112cf
cmpq -0x80(%rbp), %rax
ja 0x112cf
movq (%r12), %rcx
movq %rcx, (%rdi)
addq $0x8, %rdi
addq $0x8, %r12
cmpq %r15, %rdi
jb 0x10d8d
movzwl (%rax), %edx
movq %r15, %rcx
subq %rdx, %rcx
addq $0x2, %rax
cmpq $0xffff, %rsi           # imm = 0xFFFF
ja 0x10dc0
cmpq %r8, %rcx
jb 0x1131c
andl $0xf, %ebx
cmpq $0xf, %rbx
jne 0x10dfb
movl $0xf, %ebx
movq %rax, %r12
movq -0x78(%rbp), %rdx
cmpq %rdx, %r12
ja 0x1131f
movzbl (%r12), %eax
incq %r12
addq %rax, %rbx
cmpq $0xff, %rax
je 0x10dd5
testq %rbx, %rbx
jns 0x10dfe
jmp 0x1131f
movq %rax, %r12
leaq (%r15,%rbx), %r13
addq $0x4, %r13
cmpq %r9, %rcx
jae 0x10e9a
cmpq -0x58(%rbp), %r13
ja 0x1131f
addq $0x4, %rbx
movq %r9, %rax
subq %rcx, %rax
subq %rax, %r11
movq %rbx, %rcx
subq %rax, %rcx
jbe 0x10edf
movq %r15, %rdi
movq %r11, %rsi
movq %rax, -0x38(%rbp)
movq %rcx, -0x68(%rbp)
movq -0x38(%rbp), %rdx
callq 0x2240
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rcx
addq %rcx, %r15
movq %r15, %rax
movq -0x60(%rbp), %r9
subq %r9, %rax
cmpq %rax, %rdx
jbe 0x10ef6
movq %r15, %rdi
cmpq %rcx, %rbx
movq -0x40(%rbp), %r11
movq -0x48(%rbp), %r8
movq -0x30(%rbp), %r10
jle 0x10d35
movq %r9, %rax
movb (%rax), %cl
incq %rax
movb %cl, (%r15)
incq %r15
cmpq %r13, %r15
jb 0x10e82
movq %r15, %rdi
jmp 0x10d35
movq %r15, %rdx
subq %rcx, %rdx
cmpq $0x7, %rdx
jle 0x10f1b
movq (%rcx), %rax
movq %rax, (%r15)
addq $0x8, %rcx
movq %rcx, %rax
movq -0x50(%rbp), %rdi
addq $0x8, %r15
cmpq %r10, %r13
ja 0x10f59
movq (%rax), %rcx
movq %rcx, (%r15)
addq $0x8, %r15
addq $0x8, %rax
cmpq %r13, %r15
jb 0x10ec4
movq %r13, %rdi
jmp 0x10d35
movq %r15, %rdi
movq %r11, %rsi
movq %rbx, %rdx
callq 0x22f0
movq %r13, %rdi
movq -0x60(%rbp), %r9
jmp 0x10f0a
movq %r15, %rdi
movq %r9, %rsi
movq %r9, %rbx
callq 0x2240
movq %rbx, %r9
movq %r13, %rdi
movq -0x40(%rbp), %r11
movq -0x48(%rbp), %r8
movq -0x30(%rbp), %r10
jmp 0x10d35
movb (%rcx), %sil
leaq 0x3b9b(%rip), %rax      # 0x14ac0
movq (%rax,%rdx,8), %rdi
leaq (%rcx,%rdi), %rax
subq -0xe0(%rbp,%rdx,8), %rax
movb %sil, (%r15)
movb 0x1(%rcx), %dl
movb %dl, 0x1(%r15)
movb 0x2(%rcx), %dl
movb %dl, 0x2(%r15)
movb 0x3(%rcx), %dl
movb %dl, 0x3(%r15)
movl (%rcx,%rdi), %ecx
movl %ecx, 0x4(%r15)
jmp 0x10eb3
cmpq -0x58(%rbp), %r13
ja 0x1131f
cmpq %rdi, %r15
jae 0x10f8d
movq %rax, %rcx
movq %r15, %rdx
movq (%rcx), %rsi
movq %rsi, (%rdx)
addq $0x8, %rdx
addq $0x8, %rcx
cmpq %rdi, %rdx
jb 0x10f6e
movq %rdi, %rcx
subq %r15, %rcx
addq %rcx, %rax
movq %rdi, %r15
movq %r13, %rdi
cmpq %r13, %r15
jae 0x10d35
movb (%rax), %cl
incq %rax
movb %cl, (%r15)
incq %r15
cmpq %r13, %r15
jb 0x10f99
jmp 0x10ed7
movq 0x8(%rdi), %r15
movq (%rdi), %rax
addq %r15, %rax
movq %rax, -0x48(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0xc0(%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 0x1137e
subq %rbx, %r11
movq %r11, %rax
subq %r15, %rax
movq %rax, -0x80(%rbp)
leaq -0xc(%rdx), %rax
leaq -0xf(%r10), %r14
leaq -0x8(%r10), %rcx
movq %rcx, -0x70(%rbp)
leaq -0x8(%rdx), %rcx
movq %rcx, -0x50(%rbp)
leaq -0x5(%r10), %rcx
movq %rcx, -0x78(%rbp)
movq %rax, %r10
leaq -0x5(%rdx), %rax
movq %rax, -0x58(%rbp)
movq %r9, %rdi
movq %rsi, %r12
movq %r15, %r8
movq %r15, -0x30(%rbp)
movq %r10, -0x38(%rbp)
movq %r11, -0x40(%rbp)
movzbl (%r12), %ebx
incq %r12
movl %ebx, %edx
shrl $0x4, %edx
cmpl $0xf, %edx
jne 0x1108a
movl $0xf, %edx
movzbl (%r12), %eax
incq %r12
addq %rax, %rdx
cmpq %r14, %r12
jae 0x11081
cmpb $-0x1, %al
je 0x1106d
testq %rdx, %rdx
js 0x11344
leaq (%rdi,%rdx), %r15
leaq (%r12,%rdx), %rax
cmpq %r10, %r15
ja 0x112f7
cmpq -0x70(%rbp), %rax
ja 0x112f7
movq (%r12), %rcx
movq %rcx, (%rdi)
addq $0x8, %rdi
addq $0x8, %r12
cmpq %r15, %rdi
jb 0x110a5
movzwl (%rax), %edx
movq %r15, %rcx
subq %rdx, %rcx
addq $0x2, %rax
cmpq $0xffff, %r8            # imm = 0xFFFF
ja 0x110d9
cmpq -0x80(%rbp), %rcx
jb 0x11341
andl $0xf, %ebx
cmpq $0xf, %rbx
jne 0x11114
movl $0xf, %ebx
movq %rax, %r12
movq -0x78(%rbp), %rdx
cmpq %rdx, %r12
ja 0x11344
movzbl (%r12), %eax
incq %r12
addq %rax, %rbx
cmpq $0xff, %rax
je 0x110ee
testq %rbx, %rbx
jns 0x11117
jmp 0x11344
movq %rax, %r12
leaq (%r15,%rbx), %r13
addq $0x4, %r13
cmpq %r11, %rcx
jae 0x111ba
cmpq -0x58(%rbp), %r13
ja 0x11344
addq $0x4, %rbx
movq %r11, %rax
subq %rcx, %rax
movq -0x48(%rbp), %rsi
subq %rax, %rsi
movq %rbx, %rcx
subq %rax, %rcx
jbe 0x111ff
movq %r15, %rdi
movq %rax, -0x68(%rbp)
movq %rcx, -0xe8(%rbp)
movq -0x68(%rbp), %rdx
callq 0x2240
movq -0xe8(%rbp), %rdx
movq -0x68(%rbp), %rcx
addq %rcx, %r15
movq %r15, %rax
movq -0x40(%rbp), %r11
subq %r11, %rax
cmpq %rax, %rdx
jbe 0x11217
movq %r15, %rdi
cmpq %rcx, %rbx
movq -0x60(%rbp), %r9
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r10
jle 0x11056
movq %r11, %rax
movb (%rax), %cl
incq %rax
movb %cl, (%r15)
incq %r15
cmpq %r13, %r15
jb 0x111a2
movq %r15, %rdi
jmp 0x11056
movq %r15, %rdx
subq %rcx, %rdx
cmpq $0x7, %rdx
jle 0x1123c
movq (%rcx), %rax
movq %rax, (%r15)
addq $0x8, %rcx
movq %rcx, %rax
movq -0x50(%rbp), %rdi
addq $0x8, %r15
cmpq %r10, %r13
ja 0x1127a
movq (%rax), %rcx
movq %rcx, (%r15)
addq $0x8, %r15
addq $0x8, %rax
cmpq %r13, %r15
jb 0x111e4
movq %r13, %rdi
jmp 0x11056
movq %r15, %rdi
movq %rbx, %rdx
callq 0x22f0
movq %r13, %rdi
movq -0x60(%rbp), %r9
movq -0x40(%rbp), %r11
jmp 0x1122f
movq %r15, %rdi
movq %r11, %rsi
movq %r11, %rbx
callq 0x2240
movq %rbx, %r11
movq %r13, %rdi
movq -0x60(%rbp), %r9
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r10
jmp 0x11056
movb (%rcx), %sil
leaq 0x387a(%rip), %rax      # 0x14ac0
movq (%rax,%rdx,8), %rdi
leaq (%rcx,%rdi), %rax
subq -0xe0(%rbp,%rdx,8), %rax
movb %sil, (%r15)
movb 0x1(%rcx), %dl
movb %dl, 0x1(%r15)
movb 0x2(%rcx), %dl
movb %dl, 0x2(%r15)
movb 0x3(%rcx), %dl
movb %dl, 0x3(%r15)
movl (%rcx,%rdi), %ecx
movl %ecx, 0x4(%r15)
jmp 0x111d3
cmpq -0x58(%rbp), %r13
ja 0x11344
cmpq %rdi, %r15
jae 0x112ae
movq %rax, %rcx
movq %r15, %rdx
movq (%rcx), %rsi
movq %rsi, (%rdx)
addq $0x8, %rdx
addq $0x8, %rcx
cmpq %rdi, %rdx
jb 0x1128f
movq %rdi, %rcx
subq %r15, %rcx
addq %rcx, %rax
movq %rdi, %r15
movq %r13, %rdi
cmpq %r13, %r15
jae 0x11056
movb (%rax), %cl
incq %rax
movb %cl, (%r15)
incq %r15
cmpq %r13, %r15
jb 0x112ba
jmp 0x111f7
cmpq -0x90(%rbp), %rax
jne 0x1131f
cmpq -0x88(%rbp), %r15
ja 0x1131f
movq %r12, %rsi
movq %r9, %rbx
callq 0x2240
movq %rbx, %r9
subl %r9d, %r15d
movl %r15d, %r12d
jmp 0x11329
cmpq -0x90(%rbp), %rax
jne 0x11344
cmpq -0x88(%rbp), %r15
ja 0x11344
movq %r12, %rsi
movq %r9, %rbx
callq 0x2240
subl %ebx, %r15d
movl %r15d, %r12d
jmp 0x1134e
movq %rax, %r12
notl %r12d
addl -0x98(%rbp), %r12d
testl %r12d, %r12d
movq -0xa0(%rbp), %rcx
jle 0x11369
movl %r12d, %eax
movq %rax, 0x18(%rcx)
addq %rax, %r9
jmp 0x11365
movq %rax, %r12
notl %r12d
addl -0x98(%rbp), %r12d
testl %r12d, %r12d
movq -0xa0(%rbp), %rcx
jle 0x11369
movl %r12d, %r9d
addq %r9, 0x18(%rcx)
addq 0x10(%rcx), %r9
movq %r9, 0x10(%rcx)
movl %r12d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x1, %ecx
jne 0x11369
xorl %r12d, %r12d
cmpb (%rsi), %r12b
sbbl %r12d, %r12d
jmp 0x11369