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

Disassembly:
push 0xffffffffffffffff
push 0x59c4db
mov eax, dword fs:[0]
push eax
sub esp, 0xc0
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6a3b20]
xor eax, esp
push eax
lea eax, [esp + 0xd4]
mov dword fs:[0], eax
mov dword [esp + 0x28], 0
mov esi, dword [0x5a7c68]
mov eax, esi
mov dword [esp + 0x18], eax
mov ebp, dword [esp + 0xe8]
mov ebx, 1
mov dword [esp + 0xdc], ebx
test ebp, ebp
jne 0x509524
mov esi, dword [esp + 0xe4]
mov dword [esi], eax
mov eax, dword [0x5a7c68]
mov dword [esp + 0x18], eax
mov ecx, dword [eax]
mov dword [esp + 0x28], ebx
mov byte [esp + 0xdc], 0
test ecx, ecx
je 0x509513
cmp ecx, 0xffffffff
je 0x50951d
or ecx, 0xffffffff
lock xadd dword [eax], ecx
setne al
test al, al
jne 0x50951d
mov eax, dword [esp + 0x18]
push eax
lea ecx, [esp + 0x1c]
call fcn.00436e50
mov eax, esi
jmp 0x509b1a
mov dword [esp + 0x20], esi
mov eax, dword [esp + 0xec]
sub eax, 0
mov byte [esp + 0xdc], 2
je 0x509577
sub eax, ebx
jne 0x5095ba
lea edx, [esp + 0x1c]
push edx
mov ecx, ebp
call fcn.004f8750
mov ecx, dword [eax]
mov dword [eax], esi
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx]
test eax, eax
je 0x5095ac
cmp eax, 0xffffffff
je 0x5095b6
or edx, 0xffffffff
lock xadd dword [ecx], edx
setne al
test al, al
jne 0x5095b6
mov ecx, dword [esp + 0x1c]
jmp 0x5095ac
lea eax, [esp + 0x24]
push eax
mov ecx, ebp
call fcn.004f8720
mov ecx, dword [eax]
mov dword [eax], esi
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0x24]
mov eax, dword [ecx]
test eax, eax
je 0x5095ac
cmp eax, 0xffffffff
je 0x5095b6
or edx, 0xffffffff
lock xadd dword [ecx], edx
setne al
test al, al
jne 0x5095b6
mov ecx, dword [esp + 0x24]
push ecx
call dword [0x5a7d8c]
add esp, 4
mov esi, dword [esp + 0x20]
mov eax, dword [esi + 0xc]
cmp eax, dword [esi + 8]
jne 0x5095cb
mov dword [esp + 0x28], ebx
jmp 0x509aa1
lea ecx, [esp + 0x20]
push ecx
lea ecx, [esp + 0x30]
call fcn.004f8270
mov eax, dword [esp + 0x2c]
mov edx, dword [eax + 8]
lea ecx, [eax + edx*4 + 0x10]
mov dword [esp + 0x30], ecx
mov edx, dword [eax + 0xc]
lea eax, [eax + edx*4 + 0x10]
mov dword [esp + 0x34], eax
mov eax, ebx
mov dword [esp + 0x38], eax
mov edi, dword [0x5a7bec]
mov ebx, 4
cmp ecx, dword [esp + 0x34]
je 0x509a66
mov esi, dword [ecx]
test eax, eax
je 0x509a4f
mov ecx, dword [0x5a79dc]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx + 0xc]
sub eax, dword [ecx + 8]
lea ecx, [esp + 0x64]
push eax
mov byte [esp + 0xe0], bl
call dword [0x5a7868]
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x1b]
call fcn.00506c00
lea ecx, [esp + 0x64]
push ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 6
call fcn.004f9e90
mov ecx, eax
call dword [0x5a78d4]
lea ecx, [esp + 0x24]
mov byte [esp + 0xdc], 5
call dword [0x5a7d90]
lea ecx, [esp + 0x64]
mov byte [esp + 0xdc], bl
call edi
lea edx, [esp + 0x44]
push edx
mov ecx, ebp
call fcn.004f6ec0
push eax
lea ecx, [esp + 0xb8]
mov byte [esp + 0xe0], 7
call dword [0x5a7bf0]
lea eax, [esp + 0x5c]
push eax
lea ecx, [esp + 0x1b]
call fcn.00506c20
lea ecx, [esp + 0xb4]
push ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 9
call fcn.004f9e90
mov ecx, eax
call dword [0x5a78d4]
lea ecx, [esp + 0x5c]
mov byte [esp + 0xdc], 8
call dword [0x5a7d90]
lea ecx, [esp + 0xb4]
mov byte [esp + 0xdc], 7
call edi
lea ecx, [esp + 0x44]
mov byte [esp + 0xdc], bl
call dword [0x5a7d90]
mov ecx, ebp
call fcn.004f7050
mov edx, dword [eax + 0x1c]
mov ebp, dword [edx + esi*4]
mov esi, dword [ebp + 8]
test esi, esi
je 0x509849
mov eax, dword [esi + 0x30]
push 0xffffffffffffffff
push eax
call fcn.00563bd0
mov ecx, dword [eax + 8]
add esp, 4
push ecx
lea ecx, [esp + 0x50]
call dword [0x5a7728]
push eax
lea ecx, [esp + 0x98]
mov byte [esp + 0xe0], 0xa
call dword [0x5a7b10]
lea edx, [esp + 0x58]
push edx
lea ecx, [esp + 0x1b]
call fcn.00506c40
lea ecx, [esp + 0x94]
push ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 0xc
call fcn.004f9e90
mov ecx, eax
call dword [0x5a78d4]
lea ecx, [esp + 0x58]
mov byte [esp + 0xdc], 0xb
call dword [0x5a7d90]
lea ecx, [esp + 0x94]
mov byte [esp + 0xdc], 0xa
call edi
lea ecx, [esp + 0x48]
mov byte [esp + 0xdc], bl
call dword [0x5a7d74]
mov eax, dword [esi + 0x64]
test eax, eax
je 0x509849
mov edx, dword [esi + 0x68]
push edx
push eax
lea ecx, [esp + 0x44]
call dword [0x5a7728]
push eax
lea ecx, [esp + 0x78]
mov byte [esp + 0xe0], 0xd
call dword [0x5a7b10]
lea eax, [esp + 0x60]
push eax
lea ecx, [esp + 0x1b]
call fcn.00506c60
lea ecx, [esp + 0x74]
push ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 0xf
call fcn.004f9e90
mov ecx, eax
call dword [0x5a78d4]
lea ecx, [esp + 0x60]
mov byte [esp + 0xdc], 0xe
call dword [0x5a7d90]
lea ecx, [esp + 0x74]
mov byte [esp + 0xdc], 0xd
call edi
lea ecx, [esp + 0x3c]
mov byte [esp + 0xdc], bl
call dword [0x5a7d74]
mov edx, dword [ebp + 0x58]
push 0
push 0
push 0x5bdb90
push edx
call fcn.00563d26
add esp, 0x10
test eax, eax
jne 0x50987d
push eax
push eax
mov eax, dword [ebp + 0x58]
push str.lang
push eax
call fcn.00563d26
add esp, 0x10
test eax, eax
je 0x50990b
mov ecx, dword [eax + 4]
push 0xffffffffffffffff
push ecx
lea edx, [esp + 0x54]
push edx
call dword [0x5a7cb8]
add esp, 0xc
push eax
lea ecx, [esp + 0x88]
mov byte [esp + 0xe0], 0x10
call dword [0x5a7bf0]
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x1b]
call fcn.00506c80
lea ecx, [esp + 0x84]
push ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 0x12
call fcn.004f9e90
mov ecx, eax
call dword [0x5a78d4]
lea ecx, [esp + 0x54]
mov byte [esp + 0xdc], 0x11
call dword [0x5a7d90]
lea ecx, [esp + 0x84]
mov byte [esp + 0xdc], 0x10
call edi
lea ecx, [esp + 0x4c]
mov byte [esp + 0xdc], bl
call dword [0x5a7d90]
mov edx, dword [ebp + 0x58]
push 0
push 0
push str.title
push edx
call fcn.00563d26
add esp, 0x10
test eax, eax
je 0x5099b6
mov eax, dword [eax + 4]
push 0xffffffffffffffff
push eax
lea ecx, [esp + 0x48]
push ecx
call dword [0x5a7cb8]
add esp, 0xc
push eax
lea ecx, [esp + 0xa8]
mov byte [esp + 0xe0], 0x13
call dword [0x5a7bf0]
lea edx, [esp + 0x50]
push edx
lea ecx, [esp + 0x1b]
call fcn.00506ca0
lea ecx, [esp + 0xa4]
push ecx
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 0x15
call fcn.004f9e90
mov ecx, eax
call dword [0x5a78d4]
lea ecx, [esp + 0x50]
mov byte [esp + 0xdc], 0x14
call dword [0x5a7d90]
lea ecx, [esp + 0xa4]
mov byte [esp + 0xdc], 0x13
call edi
lea ecx, [esp + 0x40]
mov byte [esp + 0xdc], bl
call dword [0x5a7d90]
lea edx, [esp + 0x1c]
push edx
lea ecx, [esp + 0xc8]
call dword [0x5a74e4]
lea eax, [esp + 0xc4]
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0xe0], 0x16
call fcn.0045c850
lea ecx, [esp + 0xc4]
mov byte [esp + 0xdc], bl
call edi
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
mov byte [esp + 0xdc], 3
test ecx, ecx
je 0x509a1a
cmp ecx, 0xffffffff
je 0x509a42
or ecx, 0xffffffff
lock xadd dword [eax], ecx
setne al
test al, al
jne 0x509a42
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0xc]
lea esi, [eax + 0xc]
mov ebp, eax
test ecx, ecx
je 0x509a38
call fcn.004e4fe0
mov edx, dword [esi]
push 8
push edx
mov ecx, ebp
call dword [0x5a7b38]
push ebp
call dword [0x5a7b3c]
add esp, 4
mov ecx, dword [esp + 0x30]
mov ebp, dword [esp + 0xe8]
xor eax, eax
mov esi, dword [esp + 0x20]
add ecx, ebx
xor eax, 1
mov dword [esp + 0x30], ecx
mov dword [esp + 0x38], eax
jne 0x509604
mov ecx, dword [esp + 0x2c]
mov eax, dword [ecx]
mov byte [esp + 0xdc], 2
test eax, eax
je 0x509a8f
cmp eax, 0xffffffff
je 0x509a99
or eax, 0xffffffff
lock xadd dword [ecx], eax
setne al
test al, al
jne 0x509a99
mov ecx, dword [esp + 0x2c]
push ecx
call dword [0x5a7d8c]
add esp, 4
mov dword [esp + 0x28], 1
mov ecx, dword [esp + 0x18]
mov edi, dword [esp + 0xe4]
mov dword [edi], ecx
mov edx, dword [0x5a7c68]
mov dword [esp + 0x18], edx
mov eax, dword [esi]
mov byte [esp + 0xdc], 1
test eax, eax
je 0x509adb
cmp eax, 0xffffffff
je 0x509ae5
or ecx, 0xffffffff
mov eax, esi
lock xadd dword [eax], ecx
setne al
test al, al
jne 0x509ae5
push esi
call dword [0x5a7d8c]
add esp, 4
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
mov byte [esp + 0xdc], 0
test eax, eax
je 0x509b0a
cmp eax, 0xffffffff
je 0x509b18
or edx, 0xffffffff
lock xadd dword [ecx], edx
setne al
test al, al
jne 0x509b18
mov eax, dword [esp + 0x18]
push eax
lea ecx, [esp + 0x1c]
call fcn.00436e50
mov eax, edi
mov ecx, dword [esp + 0xd4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xcc
ret 0xc