Function at 0x1004ae1b
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
push edi
xor edi, edi
push edi
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp + 0x10]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x2c], edi
call fcn.1004a9df
add esp, 0x28
test al, al
je 0x1004afd9
mov ecx, dword [ebp + 0x10]
test cl, 0x10
mov eax, dword [ebp - 8]
mov esi, eax
jne 0x1004ae75
test ecx, 0x400000
je 0x1004ae79
sar eax, 1
mov esi, eax
mov eax, ecx
and eax, 0x40
je 0x1004ae82
sar esi, 1
test ecx, 0x40000
je 0x1004ae97
cmp eax, edi
je 0x1004ae97
and ecx, 0xffffefff
mov dword [ebp + 0x10], ecx
mov edx, ecx
and dl, 0x40
neg dl
mov eax, 0xff
push eax
mov ebx, 0xffffff7f
sbb edx, edx
and edx, ebx
add edx, 0x80
push edx
push eax
push dword [ebp - 0x14]
push ecx
push esi
push dword [ebp + 8]
call fcn.100364d2
mov esi, eax
cmp esi, edi
je 0x1004afd9
mov eax, dword [esi + 0x10c]
dec eax
push eax
push edi
push esi
call fcn.1003736a
mov eax, dword [ebp - 0x18]
push edi
mov dword [esi + 0x168], eax
push dword [ebp - 0x1c]
push dword [ebp + 0xc]
call fcn.1004576d
mov edi, dword [esi + 0x168]
add esp, 0xc
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp + 8]
push eax
push dword [ebp - 8]
push 0
push esi
call fcn.10037119
test al, al
jne 0x1004af23
push esi
call fcn.10036562
jmp 0x1004afd9
xor eax, eax
cmp dword [edi + 4], eax
jne 0x1004af2e
cmp dword [edi], eax
je 0x1004af34
test byte [ebp + 0x12], 0x40
je 0x1004af59
test byte [ebp + 0x10], 0x10
push dword [ebp + 0xc]
je 0x1004af47
mov eax, dword [ebp - 4]
shr eax, 1
push eax
push 2
jmp 0x1004af4c
push dword [ebp - 4]
push 1
push dword [ebp + 8]
call fcn.100454ef
jmp 0x1004aff0
push 0x318
mov edi, str.F:dev_fmodsrc375win_src_format_wav.c
push edi
push dword [ebp - 4]
push eax
call fcn.1004417b
add esp, 0x10
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x1004af89
push esi
call fcn.10036562
mov dword [0x100befa8], 0xc
jmp 0x1004afd9
push dword [ebp + 0xc]
push dword [ebp - 4]
push 1
push eax
call fcn.100454ef
lea eax, [ebp - 8]
push eax
push dword [ebp + 8]
push dword [ebp - 4]
push dword [ebp - 0xc]
push dword [esi + 0x168]
call fcn.1004acdd
add esp, 0x24
test al, al
jne 0x1004afe0
push esi
call fcn.10036562
push 0x325
push edi
push dword [ebp - 0xc]
push 0
call fcn.10044124
add esp, 0x10
mov dword [0x100befa8], 0xb
xor eax, eax
jmp 0x1004b09b
push 0x32a
push edi
push dword [ebp - 0xc]
push 0
call fcn.10044124
mov eax, dword [ebp + 0x10]
add esp, 0x10
test al, 8
je 0x1004b02f
mov ecx, dword [ebp + 8]
xor edx, edx
cmp dword [ebp - 0x10], edx
jbe 0x1004b011
xor byte [ecx], 0x80
inc ecx
inc edx
cmp edx, dword [ebp - 0x10]
jb 0x1004b004
mov eax, dword [ebp + 0x10]
and eax, ebx
mov ecx, 0x100
or eax, ecx
mov dword [ebp + 0x10], eax
mov edx, dword [esi + 0x124]
lea eax, [esi + 0x124]
and edx, ebx
or edx, ecx
mov dword [eax], edx
push dword [ebp - 0x20]
push dword [ebp - 0x10]
push dword [ebp - 0x24]
push dword [ebp + 8]
push esi
call fcn.100371b6
test byte [ebp + 0x10], 0x10
mov eax, dword [ebp - 8]
je 0x1004b04c
sar eax, 1
test byte [ebp + 0x10], 0x40
je 0x1004b054
sar eax, 1
xor ecx, ecx
cmp dword [ebp - 0x30], ecx
jne 0x1004b06b
cmp dword [ebp - 0x2c], ecx
jne 0x1004b06b
dec eax
push eax
push ecx
push esi
call fcn.1003736a
jmp 0x1004b08e
push dword [ebp - 0x2c]
push dword [ebp - 0x30]
push esi
call fcn.1003736a
mov eax, dword [ebp + 0x10]
test al, 1
jne 0x1004b08e
and eax, 0xfffffffa
or eax, 2
push eax
push esi
mov dword [ebp + 0x10], eax
call fcn.100371ff
push dword [esi + 0x168]
call fcn.1004ac90
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret