Function at 0x645c93d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [esp + 0x60]
mov esi, dword [esp + 0x68]
mov eax, dword [ebx + 0x84]
mov dword [esp], eax
call sym.allegro_5.0.10_monolith_mt.dll_al_get_channel_count
mov ebp, eax
mov edi, dword [esi]
mov al, byte [ebx + 0x98]
test al, al
je 0x645c951e
mov edx, edi
imul edx, ebp
mov dword [esp + 0x34], edx
mov eax, dword [ebx + 0x8c]
imul eax, ebp
cmp eax, edx
jl 0x645c9528
mov eax, dword [ebx + 0x80]
mov dword [esp], eax
call sym.allegro_5.0.10_monolith_mt.dll_al_get_audio_depth_size
mov ecx, dword [esp + 0x34]
imul ecx, eax
xor eax, eax
mov edi, dword [ebx + 0x90]
rep stosb byte es:[edi], al
mov edi, dword [ebx + 0xf0]
dec edi
js 0x645c9490
lea ecx, [ebx + 0xe8]
mov dword [esp + 0x2c], ecx
lea edx, [ebx + 0x90]
mov dword [esp + 0x30], edx
lea esi, [esi]
mov dword [esp + 4], edi
mov ecx, dword [esp + 0x2c]
mov dword [esp], ecx
call sym.allegro_5.0.10_monolith_mt.dll__al_vector_ref
mov eax, dword [eax]
mov dword [esp + 0x10], ebp
mov ecx, dword [ebx + 0x80]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
mov edx, dword [esp + 0x30]
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [eax + 0xcc]
dec edi
jns 0x645c9458
mov eax, dword [ebx + 0xe0]
test eax, eax
je 0x645c94b5
mov edx, dword [ebx + 0xe4]
mov dword [esp + 8], edx
mov edx, dword [esi]
mov dword [esp + 4], edx
mov edx, dword [ebx + 0x90]
mov dword [esp], edx
call eax
fld dword [ebx + 0xa4]
fld1
fxch st(1)
fucom st(1)
fnstsw ax
fstp st(1)
and ah, 0x45
xor ah, 0x40
je 0x645c94ec
mov eax, dword [ebx + 0x80]
cmp eax, 1
je 0x645c9650
cmp eax, 3
je 0x645c9620
fstp st(0)
jmp 0x645c94f8
fstp st(0)
jmp 0x645c94f8
fstp st(0)
jmp 0x645c94f8
fstp st(0)
nop
mov ecx, dword [esp + 0x64]
mov edx, dword [ecx]
test edx, edx
je 0x645c9698
mov eax, dword [ebx + 0x80]
cmp eax, 1
je 0x645c959c
cmp eax, 3
je 0x645c95f0
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], str._al_kcm_mixer_read
mov dword [esp + 8], 0x647e4900
mov dword [esp + 4], 0x16e
mov eax, dword [ebx + 0x90]
mov dword [esp], eax
call sym.allegro_5.0.10_monolith_mt.dll_al_free_with_context
mov eax, dword [ebx + 0x80]
mov dword [esp], eax
call sym.allegro_5.0.10_monolith_mt.dll_al_get_audio_depth_size
mov dword [esp + 0xc], str._al_kcm_mixer_read
mov dword [esp + 8], 0x647e4900
mov dword [esp + 4], 0x16f
imul eax, dword [esp + 0x34]
mov dword [esp], eax
call sym.allegro_5.0.10_monolith_mt.dll_al_malloc_with_context
mov dword [ebx + 0x90], eax
test eax, eax
je 0x645c9898
mov dword [ebx + 0x8c], edi
jmp 0x645c9419
mov eax, dword [ebx + 0x90]
mov ecx, dword [esp + 0x34]
test ecx, ecx
jle 0x645c951e
mov ecx, dword [esp + 0x34]
lea ebx, [eax + ecx*2]
lea esi, [esi]
movsx esi, word [edx]
movsx ecx, word [eax]
add ecx, esi
cmp ecx, 0x7fff
jle 0x645c95cd
mov ecx, 0x7fff
cmp ecx, 0xffff8000
jge 0x645c95da
mov ecx, 0xffff8000
mov word [edx], cx
add edx, 2
add eax, 2
cmp eax, ebx
jne 0x645c95b8
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [ebx + 0x90]
mov ebx, dword [esp + 0x34]
test ebx, ebx
jle 0x645c951e
xor al, al
mov ebx, dword [esp + 0x34]
fld dword [edx + eax*4]
fadd dword [ecx + eax*4]
fstp dword [edx + eax*4]
inc eax
cmp eax, ebx
jne 0x645c9608
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebx + 0x90]
mov edx, dword [esp + 0x34]
dec edx
mov edi, dword [esp + 0x34]
test edi, edi
je 0x645c94f0
nop
fld dword [eax]
fmul st(1)
fstp dword [eax]
add eax, 4
dec edx
cmp edx, 0xffffffff
jne 0x645c9638
fstp st(0)
jmp 0x645c94f8
mov eax, dword [ebx + 0x90]
mov edx, dword [esp + 0x34]
dec edx
mov esi, dword [esp + 0x34]
test esi, esi
je 0x645c94f4
fnstcw word [esp + 0x3e]
mov cx, word [esp + 0x3e]
mov ch, 0xc
mov word [esp + 0x3c], cx
nop
fld st(0)
fimul word [eax]
fldcw word [esp + 0x3c]
fistp word [eax]
fldcw word [esp + 0x3e]
add eax, 2
dec edx
cmp edx, 0xffffffff
jne 0x645c9678
fstp st(0)
jmp 0x645c94f8
mov eax, dword [ebx + 0x90]
mov dword [ecx], eax
mov eax, dword [esp + 0x6c]
and eax, 0xfffffff7
cmp eax, 1
je 0x645c97e7
jb 0x645c974c
cmp eax, 2
jne 0x645c951e
cmp dword [ebx + 0x80], 3
jne 0x645c951e
mov esi, dword [esp + 0x6c]
shl esi, 0x14
and esi, 0x800000
mov eax, dword [ebx + 0x90]
mov ebp, dword [esp + 0x34]
test ebp, ebp
jle 0x645c951e
fld dword [0x647e4bd8]
fnstcw word [esp + 0x3e]
mov dx, word [esp + 0x3e]
mov dh, 0xc
mov word [esp + 0x3c], dx
mov ecx, dword [esp + 0x34]
mov edi, eax
nop
fld dword [edi]
fmul st(1)
fldcw word [esp + 0x3c]
fistp dword [esp + 0x38]
fldcw word [esp + 0x3e]
mov ebx, dword [esp + 0x38]
add ebx, 0x800000
mov edx, ebx
not edx
sar edx, 0x1f
and edx, ebx
lea ebx, [edx - 0xffffff]
mov eax, ebx
cdq
and edx, ebx
lea edx, [esi + edx + 0x7fffff]
mov dword [edi], edx
add edi, 4
dec ecx
jne 0x645c9708
fstp st(0)
jmp 0x645c951e
cmp dword [ebx + 0x80], 3
jne 0x645c951e
mov eax, dword [esp + 0x6c]
and eax, 8
cmp eax, 1
sbb esi, esi
not esi
and esi, 0xffffff80
mov ebx, dword [ebx + 0x90]
mov ecx, dword [esp + 0x34]
test ecx, ecx
jle 0x645c951e
xor eax, eax
fld dword [0x647e4be4]
fnstcw word [esp + 0x3e]
mov dx, word [esp + 0x3e]
mov dh, 0xc
mov word [esp + 0x3c], dx
mov edi, dword [esp + 0x34]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
fld dword [ebx + eax*4]
fmul st(1)
fldcw word [esp + 0x3c]
fistp dword [esp + 0x38]
fldcw word [esp + 0x3e]
mov ecx, dword [esp + 0x38]
sub ecx, 0xffffff80
mov edx, ecx
not edx
sar edx, 0x1f
and edx, ecx
lea ecx, [edx - 0xff]
mov eax, ecx
cdq
and edx, ecx
lea edx, [esi + edx + 0x7f]
mov ecx, dword [esp + 0x2c]
mov byte [ebx + ecx], dl
inc ecx
mov dword [esp + 0x2c], ecx
cmp ecx, edi
jne 0x645c979c
fstp st(0)
jmp 0x645c951e
mov eax, dword [ebx + 0x80]
cmp eax, 1
je 0x645c98bb
cmp eax, 3
jne 0x645c951e
test byte [esp + 0x6c], 8
je 0x645c995f
mov esi, 0xffff8000
mov ebx, dword [ebx + 0x90]
mov edi, dword [esp + 0x34]
test edi, edi
jle 0x645c951e
mov edi, dword [esp + 0x34]
shl edi, 1
xor eax, eax
fld dword [0x647e4be0]
fnstcw word [esp + 0x3e]
mov dx, word [esp + 0x3e]
mov dh, 0xc
mov word [esp + 0x3c], dx
mov dword [esp + 0x2c], eax
nop
mov edx, dword [esp + 0x2c]
fld dword [ebx + edx*2]
fmul st(1)
fldcw word [esp + 0x3c]
fistp dword [esp + 0x38]
fldcw word [esp + 0x3e]
mov ecx, dword [esp + 0x38]
add ecx, 0x8000
mov edx, ecx
not edx
sar edx, 0x1f
and edx, ecx
lea ecx, [edx - 0xffff]
mov eax, ecx
cdq
and edx, ecx
lea edx, [esi + edx + 0x7fff]
mov ecx, dword [esp + 0x2c]
mov word [ebx + ecx], dx
add ecx, 2
mov dword [esp + 0x2c], ecx
cmp ecx, edi
jne 0x645c9844
fstp st(0)
jmp 0x645c951e
mov dword [esp + 4], str.Out_of_memory_allocating_mixer_buffer
mov dword [esp], 0xff
call sym.allegro_5.0.10_monolith_mt.dll__al_set_error
mov dword [ebx + 0x8c], 0
jmp 0x645c951e
cmp dword [esp + 0x6c], 1
je 0x645c951e
mov edi, dword [ebx + 0x90]
mov ebx, dword [esp + 0x34]
test ebx, ebx
jle 0x645c951e
mov esi, dword [esp + 0x34]
mov eax, edi
shl eax, 0x1e
shr eax, 0x1f
mov edx, esi
cmp esi, eax
jbe 0x645c98ec
mov edx, eax
cmp dword [esp + 0x34], 3
ja 0x645c98f7
mov edx, dword [esp + 0x34]
mov eax, edi
test edx, edx
je 0x645c991d
xor ecx, ecx
mov ebx, dword [esp + 0x34]
add word [eax], 0x8000
add eax, 2
dec ebx
inc ecx
cmp edx, ecx
ja 0x645c9903
mov dword [esp + 0x34], ebx
cmp esi, edx
je 0x645c951e
sub esi, edx
mov ecx, esi
shr ecx, 1
mov ebx, ecx
shl ebx, 1
je 0x645c9949
lea edi, [edi + edx*2]
xor edx, edx
xor dword [edi + edx*4], 0x80008000
inc edx
cmp ecx, edx
ja 0x645c992e
sub dword [esp + 0x34], ebx
lea eax, [eax + ebx*2]
cmp esi, ebx
je 0x645c951e
mov edx, dword [esp + 0x34]
add word [eax], 0x8000
add eax, 2
dec edx
test edx, edx
jg 0x645c994d
jmp 0x645c951e
xor esi, esi
jmp 0x645c980f