Function at 0x580240
Capabilities:
Decompress data using lzo
Encode data using xor

Disassembly:
mov edx, dword [esp + 4]
mov ecx, dword [esp + 8]
push ebp
push esi
lea esi, [edx + ecx]
cmp edx, esi
push edi
mov eax, edx
je 0x580268
push ebx
mov bl, byte [eax]
mov cl, al
sub cl, dl
xor cl, bl
xor cl, 0xde
mov byte [eax], cl
inc eax
cmp eax, esi
jne 0x580255
pop ebx
mov cl, byte [edx]
cmp cl, 0x11
mov ebp, dword [esp + 0x18]
mov eax, ebp
mov esi, edx
jbe 0x58029b
movzx ecx, cl
sub ecx, 0x11
cmp ecx, 4
lea esi, [edx + 1]
jb 0x580350
lea esp, [esp]
mov dl, byte [esi]
mov byte [eax], dl
inc eax
inc esi
dec ecx
jne 0x580290
jmp 0x58030a
movzx ecx, byte [esi]
inc esi
cmp ecx, 0x10
jae 0x58035d
test ecx, ecx
jne 0x5802c7
cmp byte [esi], 0
jne 0x5802bf
mov dl, byte [esi + 1]
add ecx, 0xff
inc esi
test dl, dl
je 0x5802b1
movzx edx, byte [esi]
lea ecx, [ecx + edx + 0xf]
inc esi
mov edx, dword [esi]
mov dword [eax], edx
add eax, 4
add esi, 4
dec ecx
je 0x58030a
cmp ecx, 4
jb 0x580301
lea esp, [esp]
mov edx, dword [esi]
mov dword [eax], edx
sub ecx, 4
add eax, 4
add esi, 4
cmp ecx, 4
jae 0x5802e0
test ecx, ecx
jbe 0x58030a
mov dl, byte [esi]
mov byte [eax], dl
inc eax
inc esi
dec ecx
jne 0x5802f6
jmp 0x58030a
mov dl, byte [esi]
mov byte [eax], dl
inc eax
inc esi
dec ecx
jne 0x580301
movzx ecx, byte [esi]
inc esi
cmp ecx, 0x10
jae 0x58035d
movzx edi, byte [esi]
shl edi, 2
shr ecx, 2
mov edx, eax
sub edx, edi
sub edx, ecx
mov cl, byte [edx - 0x801]
sub edx, 0x801
inc esi
mov byte [eax], cl
inc eax
inc edx
mov cl, byte [edx]
mov byte [eax], cl
mov dl, byte [edx + 1]
inc eax
mov byte [eax], dl
inc eax
xor ecx, ecx
mov cl, byte [esi - 2]
and ecx, 3
je 0x58029b
lea esp, [esp]
mov dl, byte [esi]
mov byte [eax], dl
inc eax
inc esi
dec ecx
jne 0x580350
movzx ecx, byte [esi]
inc esi
cmp ecx, 0x40
jb 0x58039b
mov edx, ecx
shr edx, 2
and edx, 7
mov edi, eax
sub edi, edx
movzx edx, byte [esi]
shl edx, 3
sub edi, edx
dec edi
shr ecx, 5
inc esi
dec ecx
mov dl, byte [edi]
mov byte [eax], dl
mov dl, byte [edi + 1]
inc eax
inc edi
mov byte [eax], dl
inc eax
inc edi
lea esp, [esp]
mov dl, byte [edi]
mov byte [eax], dl
inc eax
inc edi
dec ecx
jne 0x580390
jmp 0x58033e
cmp ecx, 0x20
jb 0x5803d6
and ecx, 0x1f
jne 0x5803c6
cmp byte [esi], 0
jne 0x5803be
lea ebx, [ebx]
mov dl, byte [esi + 1]
add ecx, 0xff
inc esi
test dl, dl
je 0x5803b0
movzx edx, byte [esi]
lea ecx, [ecx + edx + 0x1f]
inc esi
movzx edx, word [esi]
shr edx, 2
mov edi, eax
sub edi, edx
dec edi
add esi, 2
jmp 0x580420
cmp ecx, 0x10
jb 0x58046e
mov edx, ecx
and edx, 8
shl edx, 0xb
mov edi, eax
sub edi, edx
and ecx, 7
jne 0x58040b
cmp byte [esi], 0
jne 0x580403
mov dl, byte [esi + 1]
add ecx, 0xff
inc esi
test dl, dl
je 0x5803f5
movzx edx, byte [esi]
lea ecx, [ecx + edx + 7]
inc esi
movzx edx, word [esi]
shr edx, 2
sub edi, edx
add esi, 2
cmp edi, eax
je 0x580484
sub edi, 0x4000
cmp ecx, 6
jb 0x58037c
mov edx, eax
sub edx, edi
cmp edx, 4
jl 0x58037c
mov edx, dword [edi]
mov dword [eax], edx
add eax, 4
add edi, 4
sub ecx, 2
mov edx, dword [edi]
mov dword [eax], edx
sub ecx, 4
add eax, 4
add edi, 4
cmp ecx, 4
jae 0x580443
test ecx, ecx
jbe 0x58033e
lea ecx, [ecx]
mov dl, byte [edi]
mov byte [eax], dl
inc eax
inc edi
dec ecx
jne 0x580460
jmp 0x58033e
movzx edi, byte [esi]
shl edi, 2
mov edx, eax
sub edx, edi
shr ecx, 2
sub edx, ecx
dec edx
inc esi
jmp 0x580333
pop edi
pop esi
sub eax, ebp
pop ebp
ret