Function at 0x4a29b0
Capabilities:
Hash data using djb2

Disassembly:
sub esp, 0xd4
test byte [0x409384c], 1
push ebx
push ebp
push esi
push edi
jne 0x4a29e7
or dword [0x409384c], 1
push 0xfa0
push 0x4093834
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
push 0x553d80
call fcn.0051b51b
add esp, 4
push 0x4093834
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [esp + 0xe8]
sub esp, 0x10
mov eax, esp
mov ecx, 0x4c6060
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
xor esi, esi
mov dword [eax + 8], esi
xor ebx, ebx
mov dword [eax + 0xc], ebx
mov ecx, str.MoveRandom
lea eax, [esp + 0x60]
add edi, 0x190
call fcn.004a0770
call fcn.004a3550
sub esp, 0x10
mov eax, esp
mov ecx, 0x4c62c0
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
mov dword [eax + 8], esi
mov dword [eax + 0xc], ebx
mov ecx, str.MoveRandomRun
lea eax, [esp + 0x60]
call fcn.004a0770
call fcn.004a3550
sub esp, 0x10
mov eax, esp
mov ecx, 0x4c64f0
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
mov dword [eax + 8], esi
mov dword [eax + 0xc], ebx
mov ecx, str.MoveAtSelectedPosition
lea eax, [esp + 0x60]
call fcn.004a0770
call fcn.004a3550
sub esp, 0x10
mov eax, esp
mov ecx, 0x4c66d0
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
mov dword [eax + 8], esi
mov dword [eax + 0xc], ebx
mov ecx, str.MoveRunAway
lea eax, [esp + 0x60]
call fcn.004a0770
call fcn.004a3550
sub esp, 0x10
mov eax, esp
mov ecx, 0x4c6890
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
mov dword [eax + 8], esi
mov dword [eax + 0xc], ebx
mov ecx, str.Battle
lea eax, [esp + 0x60]
call fcn.004a0770
call fcn.004a3550
sub esp, 0x10
mov eax, esp
mov ecx, 0x4c6050
mov dword [eax], ecx
xor edx, edx
mov dword [eax + 4], edx
mov dword [eax + 8], esi
mov dword [eax + 0xc], ebx
mov ecx, str.Debug
lea eax, [esp + 0x60]
call fcn.004a0770
call fcn.004a3550
xor edx, edx
mov ecx, 0x4c6940
sub esp, 0x10
mov eax, esp
mov dword [eax], ecx
mov dword [eax + 4], edx
mov dword [eax + 8], esi
mov dword [eax + 0xc], ebx
mov ecx, str.ResetUser
lea eax, [esp + 0x60]
call fcn.004a0770
call fcn.004a3550
mov esi, dword [esp + 0xec]
mov eax, dword [esi + 0x26c]
sub eax, dword [esi + 0x268]
mov dword [esp + 0x14], ebx
sar eax, 9
mov dword [esp + 0x4c], eax
cmp eax, ebx
jbe 0x4a2f30
mov dword [esp + 0x18], ebx
jmp 0x4a2b67
mov esi, dword [esp + 0xec]
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
or eax, 0xffffffff
mov dword [esp + 0x28], eax
xor eax, eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
or eax, 0xffffffff
mov dword [esp + 0x48], eax
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
or eax, 0xffffffff
mov dword [esp + 0x38], eax
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov ebp, edx
shr ebp, 0x1f
add ebp, edx
xor ebx, ebx
cmp ebp, ebx
jle 0x4a2e4d
mov dword [esp + 0x10], ebx
jmp 0x4a2bd0
mov eax, dword [esi + 0x26c]
sub eax, dword [esi + 0x268]
sar eax, 9
cmp dword [esp + 0x14], eax
jb 0x4a2bea
call fcn.0051b1ad
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
mov esi, dword [esi + 0x268]
add esi, dword [esp + 0x18]
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
cmp ebx, ecx
jb 0x4a2c14
call fcn.0051b1ad
mov eax, dword [edi + 0xc]
lea ecx, [esi + 0x80]
mov esi, dword [esp + 0x10]
add eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4a2c43
test dl, dl
je 0x4a2c3f
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4a2c43
add eax, 2
add ecx, 2
test dl, dl
jne 0x4a2c23
xor eax, eax
jmp 0x4a2c48
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4a2c96
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x4a2c6c
call fcn.0051b1ad
mov ecx, dword [edi + 0xc]
mov edx, dword [esi + ecx + 0x80]
lea eax, [esi + ecx + 0x80]
mov ecx, dword [eax + 4]
mov dword [esp + 0x1c], edx
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], edx
mov dword [esp + 0x28], eax
mov esi, dword [esp + 0xec]
mov ecx, dword [esi + 0x26c]
sub ecx, dword [esi + 0x268]
sar ecx, 9
cmp dword [esp + 0x14], ecx
jb 0x4a2cb7
call fcn.0051b1ad
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
mov esi, dword [esi + 0x268]
add esi, dword [esp + 0x18]
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x4a2ce1
call fcn.0051b1ad
mov eax, dword [edi + 0xc]
lea ecx, [esi + 0x100]
mov esi, dword [esp + 0x10]
add eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4a2d10
test dl, dl
je 0x4a2d0c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4a2d10
add eax, 2
add ecx, 2
test dl, dl
jne 0x4a2cf0
xor eax, eax
jmp 0x4a2d15
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4a2d63
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
cmp ebx, ecx
jb 0x4a2d39
call fcn.0051b1ad
mov edx, dword [edi + 0xc]
mov ecx, dword [esi + edx + 0x80]
lea eax, [esi + edx + 0x80]
mov edx, dword [eax + 4]
mov dword [esp + 0x3c], ecx
mov ecx, dword [eax + 8]
mov dword [esp + 0x40], edx
mov edx, dword [eax + 0xc]
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], edx
mov esi, dword [esp + 0xec]
mov eax, dword [esi + 0x26c]
sub eax, dword [esi + 0x268]
sar eax, 9
cmp dword [esp + 0x14], eax
jb 0x4a2d84
call fcn.0051b1ad
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
mov esi, dword [esi + 0x268]
add esi, dword [esp + 0x18]
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
cmp ebx, ecx
jb 0x4a2dae
call fcn.0051b1ad
mov eax, dword [edi + 0xc]
lea ecx, [esi + 0x180]
mov esi, dword [esp + 0x10]
add eax, esi
lea ecx, [ecx]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4a2de0
test dl, dl
je 0x4a2ddc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4a2de0
add eax, 2
add ecx, 2
test dl, dl
jne 0x4a2dc0
xor eax, eax
jmp 0x4a2de5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4a2e33
mov ecx, dword [edi + 0x10]
sub ecx, dword [edi + 0xc]
mov eax, 0x38e38e39
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x4a2e09
call fcn.0051b1ad
mov ecx, dword [edi + 0xc]
mov edx, dword [esi + ecx + 0x80]
lea eax, [esi + ecx + 0x80]
mov ecx, dword [eax + 4]
mov dword [esp + 0x2c], edx
mov edx, dword [eax + 8]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], eax
add esi, 0x90
inc ebx
cmp ebx, ebp
mov dword [esp + 0x10], esi
mov esi, dword [esp + 0xec]
jl 0x4a2bd0
mov ecx, dword [esi + 0x26c]
sub ecx, dword [esi + 0x268]
sar ecx, 9
cmp dword [esp + 0x14], ecx
jb 0x4a2e67
call fcn.0051b1ad
mov edx, dword [esi + 0x268]
add edx, dword [esp + 0x18]
mov eax, edx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4a2e76
sub eax, esi
mov esi, eax
mov eax, 0x1505
mov ecx, 0
je 0x4a2ea4
lea ecx, [ecx]
movsx ebx, byte [ecx + edx]
mov ebp, eax
shl ebp, 5
add ebp, eax
add ebx, ebp
inc ecx
mov eax, ebx
cmp ecx, esi
jb 0x4a2e90
mov esi, dword [esp + 0xe8]
mov dword [esp + 0x10], eax
lea eax, [esi + 0x14c]
push eax
lea ecx, [esp + 0x14]
call fcn.004a8420
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
add dword [esp + 0x18], 0x200
mov dword [eax], edx
mov edx, dword [esp + 0x24]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x28]
mov dword [eax + 8], edx
mov edx, dword [esp + 0x3c]
mov dword [eax + 0xc], ecx
mov ecx, dword [esp + 0x40]
mov dword [eax + 0x10], edx
mov edx, dword [esp + 0x44]
mov dword [eax + 0x14], ecx
mov ecx, dword [esp + 0x48]
mov dword [eax + 0x18], edx
mov edx, dword [esp + 0x2c]
mov dword [eax + 0x1c], ecx
mov ecx, dword [esp + 0x30]
mov dword [eax + 0x20], edx
mov edx, dword [esp + 0x34]
mov dword [eax + 0x24], ecx
mov ecx, dword [esp + 0x38]
mov dword [eax + 0x28], edx
mov dword [eax + 0x30], esi
mov dword [eax + 0x2c], ecx
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cmp eax, dword [esp + 0x4c]
jb 0x4a2b60
push 0x4093834
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd4
ret 8