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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x519486
mov eax, dword fs:[0]
push eax
sub esp, 0x60
push ebx
push esi
push edi
mov eax, dword [0x5750c8]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [edi]
mov edx, dword [eax + 0xc]
call edx
xor esi, esi
mov dword [edi + 0x9c], esi
mov dword [edi + 0xa0], esi
mov dword [edi + 0xa4], esi
mov dword [edi + 0xa8], esi
mov dword [edi + 0xac], esi
push 0x104
mov dword [edi + 0x88], 0x80
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [esp + 0x34], eax
mov dword [esp + 0x78], esi
cmp eax, esi
je 0x5047c1
push eax
call fcn.0049cf40
jmp 0x5047c3
xor eax, eax
mov dword [esp + 0x78], 0xffffffff
fld dword [0x5554ec]
mov dword [edi + 0x98], eax
mov edx, dword [eax]
push ecx
mov ecx, eax
fstp dword [esp]
mov eax, dword [edx + 0x4c]
call eax
fld dword [0x555128]
mov ecx, dword [edi + 0x98]
mov edx, dword [ecx]
mov eax, dword [edx + 0x48]
push ecx
fstp dword [esp]
call eax
mov ecx, dword [edi + 0x98]
fld dword [0x555128]
mov edx, dword [ecx]
mov eax, dword [edx + 0x50]
push ecx
fstp dword [esp]
call eax
mov ebx, dword [0x5b30b0]
mov esi, dword [ebx]
mov eax, dword [esi + 4]
mov ecx, dword [edi + 0x98]
lea edx, [esp + 0x20]
push edx
push eax
push esi
mov dword [esp + 0x2c], ecx
call fcn.0040f3e0
mov ecx, dword [ebx + 4]
mov edx, 0x3ffffffe
sub edx, ecx
cmp edx, 1
jae 0x50484d
push str.list_T__too_long
call dword [sym.imp.MSVCP100.dll_void___cdecl_std::_Xlength_error_char_const__]
inc ecx
test byte [0x5fc614], 1
mov dword [ebx + 4], ecx
mov dword [esi + 4], eax
mov ecx, dword [eax + 4]
mov dword [ecx], eax
jne 0x50488b
mov eax, 1
or dword [0x5fc614], eax
mov dword [esp + 0x78], eax
call fcn.00492cb0
push 0x52b3e0
call fcn.0045f177
add esp, 4
mov dword [esp + 0x78], 0xffffffff
test byte [0x5fc614], 1
mov byte [esp + 0x12], 1
mov byte [esp + 0x13], 1
mov dword [esp + 0x1c], 0
jne 0x5048cf
or dword [0x5fc614], 1
mov dword [esp + 0x78], 2
call fcn.00492cb0
push 0x52b3e0
call fcn.0045f177
add esp, 4
mov dword [esp + 0x78], 0xffffffff
lea eax, [esp + 0x5c]
push eax
mov ecx, 0x5bf928
call fcn.00404070
mov dword [esp + 0x78], 3
mov ebx, dword [esp + 0x5c]
mov esi, ebx
mov dword [esp + 0x18], ebx
cmp ebx, dword [esp + 0x60]
je 0x504ba5
mov edx, dword [0x5bf86c]
mov eax, dword [edx + 4]
cmp byte [eax + 0x15], 0
mov ecx, edx
jne 0x504924
mov ebx, dword [esi]
lea ecx, [ecx]
cmp dword [eax + 0xc], ebx
jae 0x50491a
mov eax, dword [eax + 8]
jmp 0x50491e
mov ecx, eax
mov eax, dword [eax]
cmp byte [eax + 0x15], 0
je 0x504910
mov dword [esp + 0x24], ecx
cmp ecx, edx
je 0x504939
mov eax, dword [esi]
cmp eax, dword [ecx + 0xc]
jb 0x504939
lea eax, [esp + 0x24]
jmp 0x504941
mov dword [esp + 0x28], edx
lea eax, [esp + 0x28]
mov eax, dword [eax]
mov dword [esp + 0x14], eax
cmp eax, edx
je 0x504b90
mov ebx, dword [eax + 0x10]
mov al, byte [ebx + 0x40]
mov dword [esp + 0x34], ebx
cmp al, 0x30
jl 0x504b90
cmp al, 0x39
jg 0x504b90
mov esi, dword [0x5b30c0]
mov ecx, dword [esi + 0x158]
mov eax, dword [ecx + 4]
cmp byte [eax + 0x95], 0
mov edx, dword [ebx + 0x80]
mov dword [esp + 0x30], edx
jne 0x5049a7
jmp 0x504990
cmp dword [eax + 0xc], edx
jae 0x50499a
mov eax, dword [eax + 8]
jmp 0x50499e
mov ecx, eax
mov eax, dword [eax]
cmp byte [eax + 0x95], 0
je 0x504990
mov eax, dword [esi + 0x158]
mov dword [esp + 0x1c], ecx
cmp ecx, eax
je 0x5049c0
cmp edx, dword [ecx + 0xc]
jb 0x5049c0
lea eax, [esp + 0x1c]
jmp 0x5049c8
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x2c]
mov eax, dword [eax]
cmp eax, dword [esi + 0x158]
jne 0x5049f3
lea ecx, [esi + 0x164]
lea ebx, [esp + 0x30]
lea eax, [esp + 0x38]
call fcn.00401a10
mov eax, dword [eax]
cmp eax, dword [esi + 0x168]
je 0x5049ff
mov ebx, dword [esp + 0x34]
mov ecx, dword [ebx + 0x90]
add dword [edi + 0x80], ecx
mov edx, dword [esp + 0x14]
mov eax, dword [edx + 0x10]
mov ecx, dword [eax + 0x90]
add dword [edi + 0x84], ecx
push 0x88
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_]
mov esi, eax
add esp, 4
mov dword [esp + 0x3c], esi
mov byte [esp + 0x78], 4
test esi, esi
je 0x504ada
push esi
call fcn.0049cdf0
lea eax, [esi + 0x78]
mov dword [esi], vtable.AchievementListItem.0
mov dword [eax], 0
mov byte [esp + 0x78], 6
fldz
push 0
fstp dword [esi + 0x68]
push eax
mov dword [esi + 0x7c], 0
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
je 0x504aba
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 4]
call eax
mov ebx, eax
lea eax, [ebx + 4]
push eax
mov dword [esp + 0x38], eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jne 0x504aba
mov ecx, dword [ebx + 8]
test ecx, ecx
je 0x504ab0
mov eax, dword [ebx + 8]
push 1
push 0
add eax, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, 1
je 0x504aa8
mov edx, dword [esp + 0x34]
mov eax, dword [edx]
jmp 0x504aba
mov ecx, dword [ebx + 8]
call fcn.004037e0
mov edx, dword [ebx]
mov eax, dword [edx]
push 1
mov ecx, ebx
call eax
fldz
mov word [esi + 0x80], 1
fst dword [esi + 0x84]
mov byte [esi + 0x82], 0
fst dword [esi + 0x60]
fstp dword [esi + 0x64]
jmp 0x504adc
xor esi, esi
mov byte [esp + 0x78], 3
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx + 0x10]
push edi
mov ecx, esi
call fcn.00502b50
mov al, byte [esp + 0x12]
test al, al
mov byte [esi + 0x80], al
mov eax, dword [edi + 0x98]
sete dl
push esi
mov byte [esp + 0x16], dl
call fcn.0049c370
mov ecx, edi
lea eax, [esp + 0x50]
call fcn.00404260
sub esp, 0x24
mov edx, esp
mov dword [esp + 0x60], esp
mov dword [esp + 0x60], edx
mov byte [edx + 0x20], 1
mov dword [edx], 0
mov byte [esp + 0x9c], 8
mov ebx, dword [eax]
mov ecx, eax
mov eax, dword [ebx + 4]
push edx
call eax
push esi
mov byte [esp + 0xa0], 7
call fcn.00403e10
cmp byte [esp + 0x13], 0
mov byte [esp + 0x78], 3
mov dword [esp + 0x50], vtable.Mortar::Delegate1_void__class_ScrollingMenuItem__::BaseDelegate.0
je 0x504b72
mov dword [edi + 0x9c], esi
mov byte [esi + 0x81], 1
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov ecx, esi
mov byte [esp + 0x13], 0
call eax
fstp st(0)
mov edx, dword [0x5bf86c]
mov dword [esp + 0x1c], esi
mov esi, dword [esp + 0x18]
add esi, 4
mov dword [esp + 0x18], esi
cmp esi, dword [esp + 0x60]
jne 0x504900
mov ebx, dword [esp + 0x5c]
fldz
fcomp dword [0x57691c]
fnstsw ax
test ah, 5
jp 0x504bc0
fld dword [0x5554e8]
fstp dword [0x57691c]
mov ecx, dword [esp + 0x1c]
mov byte [ecx + 0x82], 1
call fcn.0048fe70
fmul qword [0x554e48]
fmul qword [0x554b90]
fstp qword [esp + 0x3c]
call fcn.0048fe70
fmul qword [0x554b90]
fsubr qword [esp + 0x3c]
fstp qword [esp + 0x3c]
call fcn.0048fe70
fmul qword [0x554e48]
mov eax, dword [edi + 0x98]
fmul qword [0x554e40]
fsubr qword [esp + 0x3c]
fstp dword [esp + 0x3c]
mov edx, dword [esp + 0x3c]
fld dword [0x5554d8]
mov dword [eax + 8], edx
fstp dword [esp + 0x40]
mov ecx, dword [esp + 0x40]
fldz
mov dword [eax + 0xc], ecx
fstp dword [esp + 0x44]
mov edx, dword [esp + 0x44]
mov dword [eax + 0x10], edx
mov ecx, dword [edi + 0x98]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
call edx
fld dword [0x57691c]
mov eax, dword [edi + 0x98]
fstp dword [eax + 0xdc]
mov ecx, dword [edi + 0x98]
fldz
mov dword [ecx + 0x34], 0x80
mov edi, dword [edi + 0x98]
mov edx, dword [edi]
mov eax, dword [edx + 0x24]
push ecx
mov ecx, edi
fstp dword [esp]
call eax
test ebx, ebx
je 0x504c86
push ebx
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret