Function at 0x1002d8f0
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [0x10089350]
push ebx
mov eax, ecx
push esi
mov esi, dword [0x10089360]
xor ebx, ebx
cdq
sub eax, edx
push edi
sar eax, 1
test eax, eax
mov edi, esi
jle 0x1002d929
mov dword [edi], 0x80008000
mov ecx, dword [0x10089350]
mov eax, ecx
add edi, 4
cdq
sub eax, edx
inc ebx
sar eax, 1
cmp ebx, eax
jl 0x1002d90e
mov eax, dword [sym.alleg40.dll__sound_hq]
cmp eax, 2
jl 0x1002d9fa
mov eax, dword [0x10089354]
xor ebx, ebx
test eax, eax
jle 0x1002dc51
xor edi, edi
mov edx, dword [edi + 0x10088850]
lea eax, [edi + 0x10088850]
test edx, edx
je 0x1002d9e4
mov edx, dword [edi + 0x10097f48]
test edx, edx
jg 0x1002d985
mov edx, dword [edi + 0x10097f4c]
test edx, edx
jg 0x1002d985
sar ecx, 1
push ecx
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002dd10
add esp, 0xc
jmp 0x1002d9de
mov edx, dword [edi + 0x10088854]
test edx, edx
mov edx, dword [edi + 0x10088858]
je 0x1002d9b9
test edx, edx
push ecx
push esi
je 0x1002d9aa
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.10030030
jmp 0x1002d9db
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.10030820
jmp 0x1002d9db
test edx, edx
push ecx
push esi
je 0x1002d9ce
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002fcb0
jmp 0x1002d9db
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.10030490
add esp, 0x10
mov ecx, dword [0x10089350]
mov eax, dword [0x10089354]
inc ebx
add edi, 0x2c
cmp ebx, eax
jl 0x1002d948
jmp 0x1002dc51
test eax, eax
je 0x1002dac5
mov eax, dword [0x10089354]
xor ebx, ebx
test eax, eax
jle 0x1002dc51
xor edi, edi
mov edx, dword [edi + 0x10088850]
lea eax, [edi + 0x10088850]
test edx, edx
je 0x1002daaf
mov edx, dword [edi + 0x10097f48]
test edx, edx
jg 0x1002da50
mov edx, dword [edi + 0x10097f4c]
test edx, edx
jg 0x1002da50
sar ecx, 1
lea edx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push edx
push eax
call fcn.1002dd10
add esp, 0xc
jmp 0x1002daa9
mov edx, dword [edi + 0x10088854]
test edx, edx
mov edx, dword [edi + 0x10088858]
je 0x1002da84
test edx, edx
push ecx
push esi
je 0x1002da75
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002f590
jmp 0x1002daa6
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002fa50
jmp 0x1002daa6
test edx, edx
push ecx
push esi
je 0x1002da99
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002f330
jmp 0x1002daa6
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002f7f0
add esp, 0x10
mov ecx, dword [0x10089350]
mov eax, dword [0x10089354]
inc ebx
add edi, 0x2c
cmp ebx, eax
jl 0x1002da13
jmp 0x1002dc51
mov eax, dword [0x1008935c]
test eax, eax
je 0x1002db95
mov eax, dword [0x10089354]
xor ebx, ebx
test eax, eax
jle 0x1002dc51
xor edi, edi
mov edx, dword [edi + 0x10088850]
lea eax, [edi + 0x10088850]
test edx, edx
je 0x1002db7f
mov edx, dword [edi + 0x10097f48]
test edx, edx
jg 0x1002db20
mov edx, dword [edi + 0x10097f4c]
test edx, edx
jg 0x1002db20
sar ecx, 1
push ecx
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002dd10
add esp, 0xc
jmp 0x1002db79
mov edx, dword [edi + 0x10088854]
test edx, edx
mov edx, dword [edi + 0x10088858]
je 0x1002db54
test edx, edx
push ecx
push esi
je 0x1002db45
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002ec50
jmp 0x1002db76
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002f0e0
jmp 0x1002db76
test edx, edx
push ecx
push esi
je 0x1002db69
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002ea20
jmp 0x1002db76
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002ee90
add esp, 0x10
mov ecx, dword [0x10089350]
mov eax, dword [0x10089354]
inc ebx
add edi, 0x2c
cmp ebx, eax
jl 0x1002dae3
jmp 0x1002dc51
mov eax, dword [0x10089354]
xor ebx, ebx
test eax, eax
jle 0x1002dc51
xor edi, edi
mov edx, dword [edi + 0x10088850]
lea eax, [edi + 0x10088850]
test edx, edx
je 0x1002dc40
mov edx, dword [edi + 0x10097f48]
test edx, edx
jg 0x1002dbe1
mov edx, dword [edi + 0x10097f4c]
test edx, edx
jg 0x1002dbe1
lea edx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push edx
push eax
call fcn.1002dd10
add esp, 0xc
jmp 0x1002dc3a
mov edx, dword [edi + 0x10088854]
test edx, edx
mov edx, dword [edi + 0x10088858]
je 0x1002dc15
test edx, edx
push ecx
push esi
je 0x1002dc06
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002e380
jmp 0x1002dc37
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002e7b0
jmp 0x1002dc37
test edx, edx
push ecx
push esi
je 0x1002dc2a
lea ecx, [edi + sym.alleg40.dll__phys_voice]
push ecx
push eax
call fcn.1002df80
jmp 0x1002dc37
lea edx, [edi + sym.alleg40.dll__phys_voice]
push edx
push eax
call fcn.1002e5d0
add esp, 0x10
mov ecx, dword [0x10089350]
mov eax, dword [0x10089354]
inc ebx
add edi, 0x2c
cmp ebx, eax
jl 0x1002dba6
mov eax, dword [0x10088848]
test eax, eax
je 0x1002dcd5
mov eax, dword [esp + 0x18]
test eax, eax
je 0x1002dca0
xor eax, eax
test ecx, ecx
jle 0x1002dd02
mov ecx, dword [esp + 0x10]
mov edi, dword [0x10089368]
xor edx, edx
mov dx, word [esi]
add ecx, 2
shr edx, 2
add esi, 2
mov dx, word [edi + edx*2]
xor dx, 0x8000
inc eax
mov word [ecx - 2], dx
mov edx, dword [0x10089350]
cmp eax, edx
jl 0x1002dc70
pop edi
pop esi
pop ebx
ret
xor eax, eax
test ecx, ecx
jle 0x1002dd02
mov ecx, dword [esp + 0x10]
mov edi, dword [0x10089368]
xor edx, edx
mov dx, word [esi]
add ecx, 2
shr edx, 2
add esi, 2
inc eax
mov dx, word [edi + edx*2]
mov word [ecx - 2], dx
mov edx, dword [0x10089350]
cmp eax, edx
jl 0x1002dcaa
pop edi
pop esi
pop ebx
ret
xor eax, eax
test ecx, ecx
jle 0x1002dd02
mov ecx, dword [esp + 0x10]
mov edi, dword [0x10089368]
xor edx, edx
mov dx, word [esi]
add esi, 2
shr edx, 6
inc ecx
inc eax
mov dl, byte [edi + edx*2]
mov byte [ecx - 1], dl
mov edx, dword [0x10089350]
cmp eax, edx
jl 0x1002dcdf
pop edi
pop esi
pop ebx
ret