Function at 0x40e7c0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ecx
mov ecx, dword [0x5040e8]
push ebx
push ebp
mov ebx, eax
mov eax, dword [ebx]
push esi
push edi
mov dword [ecx + 0x509c], eax
call fcn.0040e110
xor ebp, ebp
cmp dword [ebx + 0x20], ebp
jne 0x40e7ea
push ebx
call fcn.0040c7d0
add esp, 4
mov eax, dword [ebx + 0x90]
cmp eax, ebp
je 0x40e806
mov edx, dword [ebx + 4]
push edx
push ebx
call eax
add esp, 8
test eax, eax
je 0x40eb5a
mov eax, ebx
call fcn.0040e280
call fcn.00476d70
mov dword [ebx + 0x74], eax
mov eax, dword [ebx + 0x3c]
cmp eax, ebp
je 0x40e83a
push eax
call fcn.00470c10
add esp, 4
test eax, eax
jne 0x40e83a
mov eax, dword [ebx + 0x3c]
push eax
push str.Could_not_load_BGM__s_n
call fcn.0040c4a0
add esp, 8
mov eax, dword [0x5040e8]
nop
cmp dword [eax + 0x130f4], ebp
je 0x40e86e
cmp dword [eax + 0x11e98], 0x7530
mov dword [eax + 0x11e9c], 0x7d0
mov dword [eax + 0x130f0], 1
jge 0x40eb1f
jmp 0x40e892
mov ecx, dword [eax + 0x13100]
cmp ecx, ebp
je 0x40e892
cmp dword [ebx], 4
jne 0x40e892
cmp ecx, 0xffffffff
je 0x40e892
mov dword [eax + 0x11e9c], ecx
mov dword [eax + 0x130f0], 1
cmp dword [eax + 0x130f8], ebp
je 0x40e8d8
lea esi, [eax + 0x21b0]
lea edi, [esi + 4]
push edi
call dword [sym.imp.pthreadVC2.dll_pthread_mutex_lock]
add esp, 4
cmp dword [esi + 8], ebp
je 0x40e8b9
mov dword [esi + 0x14], 1
push edi
call dword [sym.imp.pthreadVC2.dll_pthread_mutex_unlock]
add esp, 4
call fcn.004433a0
call fcn.00424bf0
mov eax, dword [0x5040e8]
mov dword [eax + 0x130f8], ebp
mov ecx, dword [eax + 0x8748]
mov esi, dword [ecx]
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 0x1c]
shl edx, 4
push edx
push ebp
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
mov dword [esi + 8], ebp
mov dword [esi + 0x28], ebp
mov dword [esi + 0x24], ebp
mov dword [esi + 0x20], ebp
xor ecx, ecx
cmp dword [esi + 0xec], ebp
jle 0x40e930
lea eax, [esi + 0x34]
lea ecx, [ecx]
mov dword [eax - 8], 0x7fffffff
mov dword [eax - 4], 0x80000000
mov dword [eax], 0xffffffff
inc ecx
add eax, 0xc
cmp ecx, dword [esi + 0xec]
jl 0x40e910
push ebx
mov dword [esi + 0xf0], ebp
call fcn.0040e420
add esp, 4
cmp dword [ebx + 0x20], ebp
jne 0x40e94b
mov edx, ebx
call fcn.0040c950
mov eax, dword [ebx + 0x98]
cmp eax, ebp
je 0x40e96d
mov ecx, dword [0x5040e8]
cmp dword [ecx + 0x12128], ebp
jne 0x40e96d
mov edx, dword [ebx + 4]
push edx
push ebx
call eax
add esp, 8
push ebx
call fcn.0040e5d0
add esp, 4
cmp dword [ebx + 0x20], ebp
jne 0x40e984
push ebx
call fcn.0040cbf0
add esp, 4
mov eax, dword [ebx + 0x9c]
cmp eax, ebp
je 0x40e9a0
mov ecx, dword [ebx + 4]
push ecx
push ebx
call eax
add esp, 8
test eax, eax
je 0x40eb08
mov eax, dword [0x5040e8]
cmp dword [eax + 0x11eb0], ebp
jne 0x40e9d1
mov edi, dword [eax + 0x10c24]
xor esi, esi
cmp dword [edi + 4], ebp
jle 0x40e9d1
lea ebx, [ebx]
push esi
mov eax, edi
call fcn.0040fdb0
inc esi
add esp, 4
cmp esi, dword [edi + 4]
jl 0x40e9c0
mov edx, dword [0x5040e8]
cmp dword [edx + 0x11ea4], ebp
jne 0x40ea1f
mov eax, dword [ebx + 0x34]
cmp eax, ebp
je 0x40ea08
fld dword [ebx + 0x38]
sub esp, 8
fstp dword [esp + 4]
fld dword [ebx + 0x38]
fstp dword [esp]
call fcn.004724e0
mov eax, dword [ebx + 0x34]
push ebp
push eax
call fcn.004728a0
add esp, 0x10
mov eax, dword [ebx + 0x40]
cmp eax, ebp
je 0x40ea1f
cmp dword [eax], ebp
jne 0x40ea1f
mov ecx, dword [eax + 4]
push ecx
call fcn.00476570
add esp, 4
cmp dword [ebx + 0x20], ebp
jne 0x40ea2d
push ebx
call fcn.0040d1c0
add esp, 4
mov eax, dword [ebx + 0xa0]
cmp eax, ebp
je 0x40ea41
mov edx, dword [ebx + 4]
push edx
push ebx
call eax
add esp, 8
mov eax, dword [0x5040e8]
cmp dword [eax + 0x11ea4], ebp
jne 0x40ea7e
mov eax, dword [ebx + 0x34]
cmp eax, ebp
je 0x40ea7e
fld dword [ebx + 0x38]
sub esp, 8
fstp dword [esp + 4]
fld dword [ebx + 0x38]
fstp dword [esp]
call fcn.004724e0
mov ecx, dword [ebx + 0x34]
mov esi, 1
push esi
push ecx
call fcn.004728a0
add esp, 0x10
jmp 0x40ea83
mov esi, 1
mov ecx, dword [0x5040e8]
cmp dword [ecx + 0x11ea4], ebp
jne 0x40eaa7
mov eax, dword [ecx + 0x11ee4]
add ecx, 0x11ee4
sub eax, 2
jne 0x40eaa7
call fcn.0046b830
mov eax, dword [ebx + 0xa4]
cmp eax, ebp
je 0x40eabb
mov edx, dword [ebx + 4]
push edx
push ebx
call eax
add esp, 8
mov eax, dword [0x5040e8]
cmp dword [eax + 0x11ea4], ebp
je 0x40eace
add dword [ebx + 0x84], esi
call fcn.0040f700
mov eax, dword [0x5040e8]
mov dword [eax + 0x11ea8], ebp
cmp dword [eax + 0x11eb0], ebp
jne 0x40eaf2
add dword [eax + 0x11e98], esi
add dword [ebx + 0x6c], esi
add dword [ebx + 0x70], esi
cmp dword [eax + 0x11eac], ebp
je 0x40eb0d
mov dword [eax + 0x11eac], ebp
mov dword [eax + 0x11eb0], esi
jmp 0x40eb0d
mov eax, dword [0x5040e8]
cmp dword [ebx + 0x44], ebp
je 0x40e840
cmp dword [ebx + 0x48], ebp
jg 0x40e840
cmp dword [eax + 0x21b0], ebp
lea edi, [eax + 0x21b0]
je 0x40eb5a
lea esi, [edi + 4]
push esi
call dword [sym.imp.pthreadVC2.dll_pthread_mutex_lock]
mov edi, dword [edi + 8]
add esp, 4
push esi
call dword [sym.imp.pthreadVC2.dll_pthread_mutex_unlock]
add esp, 4
cmp edi, ebp
je 0x40eb5a
cmp dword [ebx + 0x68], ebp
je 0x40eb5a
call fcn.00443360
call fcn.004433a0
call fcn.00476d70
mov ecx, dword [0x5040e8]
mov dword [ebx + 0x78], eax
mov eax, dword [ebx + 0x94]
mov edx, dword [ecx + 0x11e98]
mov dword [ebx + 0x80], edx
cmp eax, ebp
je 0x40eb99
mov ecx, dword [ebx + 4]
push ecx
push ebx
call eax
add esp, 8
test eax, eax
jne 0x40eb99
push str.Common_loop_deinit_failed_n
call fcn.0040c4a0
add esp, 4
cmp dword [ebx + 0x20], ebp
jne 0x40eba7
push ebx
call fcn.0040c8e0
add esp, 4
mov eax, ebx
call fcn.0040e330
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
pop ecx
ret