Function at 0x509830
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x7734e0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x180
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x40], esi
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 4], 7
mov dword [ebp - 4], 2
mov eax, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x1c]
mov byte [eax], 0
mov ebx, dword [edx + 0x78]
mov dword [ebp - 4], 2
mov eax, edi
cmp edi, ebx
jae 0x50989e
cmp byte [eax], 0xa
je 0x509c07
inc eax
cmp eax, ebx
jb 0x509890
mov dword [ebp - 0x18], ebx
cmp edi, ebx
jb 0x5098a9
mov esi, ebx
jmp 0x5098c2
mov eax, ebx
sub eax, edi
push eax
push 0x3d
push edi
call fcn.00744530
add esp, 0xc
lea esi, [eax + 1]
test eax, eax
jne 0x5098c2
mov esi, ebx
push 6
mov edx, dword [ebp + 0xc]
mov ecx, edi
push str.region
mov dword [ebp - 0x14], edx
call fcn.0051bfc0
mov edx, dword [ebp - 0x14]
movzx eax, al
test eax, eax
je 0x5098fe
lea edx, [edi + 6]
cmp edx, esi
jae 0x509af2
cmp byte [edx], 0x20
jne 0x509af2
inc edx
cmp edx, esi
jb 0x5098eb
jmp 0x509af2
push 0xa
mov ecx, edi
push str.countryidx
call fcn.0051bfc0
movzx eax, al
test eax, eax
jne 0x509947
mov dword [ebp - 4], 1
mov dword [ebp - 4], 1
mov edi, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov ebx, dword [eax + 0x78]
mov edx, edi
cmp edi, ebx
jae 0x509b88
cmp byte [edx], 0xa
je 0x509c04
inc edx
cmp edx, ebx
jb 0x509934
jmp 0x509b88
mov edx, dword [ebp - 0x18]
cmp esi, edx
jae 0x509958
cmp byte [esi], 0x20
jne 0x509958
inc esi
cmp esi, edx
jb 0x50994e
mov ebx, esi
mov eax, edx
sub eax, esi
mov dword [ebp - 0x38], eax
xor edi, edi
xor ecx, ecx
cmp esi, edx
jae 0x509991
xor edx, edx
movsx eax, byte [edx + ebx]
cmp eax, 0x30
jl 0x509991
cmp eax, 0x39
jg 0x509991
lea ecx, [edi + edi*4]
lea edi, [eax + ecx*2]
add edi, 0xffffffd0
lea esi, [edx + ebx + 1]
inc edx
mov ecx, 1
cmp edx, dword [ebp - 0x38]
jb 0x50996b
test ecx, ecx
add esp, 0xfffffff0
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x48]
mov dword [esp], str.INSERT_INTO_MP_REGIONS_OBS__id_region_country_id___VALUES___i___q___i__
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp + 0xc], edi
call fcn.0051fe70
add esp, 0x10
mov ebx, eax
add esp, 0xffffffec
mov edi, dword [ebp - 0x1c]
xor esi, esi
mov dword [esp + 0xc], esi
mov eax, dword [edi + 4]
mov edx, ebx
mov dword [esp + 0x10], esi
xor ecx, ecx
call fcn.005037fc
add esp, 0x14
test ebx, ebx
je 0x509a4e
cmp dword [0x830380], 0
je 0x509a43
mov eax, dword [0x84f788]
test eax, eax
je 0x5099f9
push eax
mov dword [esp], eax
call dword [0x8303c8]
pop ecx
push eax
mov dword [esp], ebx
call dword [0x8303a4]
pop ecx
mov edx, dword [0x84f3a0]
sub edx, eax
mov eax, dword [0x84f3c4]
mov dword [0x84f3a0], edx
cmp edx, eax
jge 0x509a1d
mov edx, eax
push eax
mov dword [0x84f3c4], edx
mov dword [esp], ebx
call dword [0x83039c]
pop ecx
mov eax, dword [0x84f788]
test eax, eax
je 0x509a4e
push eax
mov dword [esp], eax
call dword [0x8303d0]
jmp 0x509a4d
push eax
mov dword [esp], ebx
call dword [0x83039c]
pop ecx
mov esi, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
mov ebx, edx
cmp esi, edx
je 0x509913
mov eax, 1
push eax
push edx
push esi
call fcn.00743960
add esp, 0xc
mov edx, dword [ebp - 0x4c]
sub edx, ebx
add edx, esi
mov dword [ebp - 0x4c], edx
jmp 0x509913
mov dword [ebp - 0x24], edx
mov eax, esi
sub eax, edx
mov dword [ebp - 0x30], eax
xor ecx, ecx
cmp edx, esi
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x2c], ecx
jae 0x509b42
xor eax, eax
mov ecx, dword [ebp - 0x24]
movsx ecx, byte [eax + ecx]
cmp ecx, 0x30
mov dword [ebp - 0x20], ecx
jl 0x509b42
cmp dword [ebp - 0x20], 0x39
jg 0x509b42
mov dword [ebp - 0x2c], 1
mov edx, dword [ebp - 0x28]
lea edx, [edx + edx*4]
lea ecx, [ecx + edx*2]
add ecx, 0xffffffd0
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x24]
lea edx, [eax + edx + 1]
inc eax
cmp eax, dword [ebp - 0x30]
jb 0x509b0a
cmp dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0x28]
cmp ebx, esi
mov dword [ebp - 0x34], eax
jae 0x509b66
xor ebx, ebx
add ebx, esi
lea ecx, [ebp - 0x5c]
push ebx
push esi
call fcn.00583ef0
mov edx, dword [ebp + 0xc]
jmp 0x5098fe
sub ebx, esi
je 0x509b52
movsx eax, byte [ebx + esi - 1]
cmp eax, 0xd
je 0x509b83
cmp eax, 0xa
je 0x509b83
cmp eax, 0x20
je 0x509b83
cmp eax, 9
jne 0x509b52
dec ebx
jne 0x509b6a
jmp 0x509b52
mov edx, ebx
push 4
mov ecx, edi
push str._end
call fcn.0051bfc0
movzx eax, al
test eax, eax
je 0x509883
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0x48]
lea eax, [ebp - 0x5c]
cmp edx, eax
je 0x509bce
test edx, edx
je 0x509bce
mov eax, dword [ebp - 0x5c]
sub eax, edx
cmp eax, 0x80
jbe 0x509bf0
push edx
call fcn.007424fc
pop ecx
mov edi, dword [ebp - 0x18]
mov dword [ebp - 4], 0xffffffff
mov eax, edi
mov edi, dword [ebp - 0x44]
mov esi, dword [ebp - 0x40]
mov ebx, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 8
add esp, 0xfffffff8
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.005d3210
add esp, 8
jmp 0x509bcb
inc edx
jmp 0x509b8a
lea ebx, [eax + 1]
jmp 0x50989e