Function at 0x509c10
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x773500
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x16c
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], esi
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x44]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 4], 7
mov dword [ebp - 4], 2
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x18]
mov byte [eax], 0
mov edi, dword [edx + 0x78]
mov dword [ebp - 4], 2
mov eax, ebx
cmp ebx, edi
jae 0x509c7e
cmp byte [eax], 0xa
je 0x509f68
inc eax
cmp eax, edi
jb 0x509c70
mov dword [ebp - 0x14], edi
cmp ebx, edi
jae 0x509c9e
mov eax, edi
sub eax, ebx
push eax
push 0x3d
push ebx
call fcn.00744530
add esp, 0xc
lea edx, [eax + 1]
test eax, eax
je 0x509c9e
mov edi, edx
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x30]
mov esi, ecx
cmp edx, ecx
je 0x509cca
mov dword [ebp - 0x48], edx
mov eax, 1
push eax
push ecx
push edx
call fcn.00743960
mov edx, dword [ebp - 0x48]
add esp, 0xc
mov ecx, dword [ebp - 0x34]
sub ecx, esi
add ecx, edx
mov dword [ebp - 0x34], ecx
push 7
mov ecx, ebx
mov edx, dword [ebp + 0xc]
push str.country
call fcn.0051bfc0
movzx eax, al
test eax, eax
jne 0x509d16
mov dword [ebp - 4], 1
mov dword [ebp - 4], 1
mov ebx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
mov edi, dword [eax + 0x78]
mov edx, ebx
cmp ebx, edi
jae 0x509ee9
cmp byte [edx], 0xa
je 0x509f65
inc edx
cmp edx, edi
jb 0x509d03
jmp 0x509ee9
add ebx, 7
cmp ebx, edi
jae 0x509d27
cmp byte [ebx], 0x20
jne 0x509d27
inc ebx
cmp ebx, edi
jb 0x509d1d
mov dword [ebp - 0x1c], ebx
mov eax, edi
sub eax, ebx
mov dword [ebp - 0x20], eax
xor esi, esi
xor ecx, ecx
cmp ebx, edi
jae 0x509d67
xor edx, edx
mov eax, dword [ebp - 0x1c]
movsx eax, byte [edx + eax]
cmp eax, 0x30
jl 0x509d67
cmp eax, 0x39
jg 0x509d67
lea esi, [esi + esi*4]
lea esi, [eax + esi*2]
add esi, 0xffffffd0
mov eax, dword [ebp - 0x1c]
lea ebx, [edx + eax + 1]
inc edx
mov ecx, 1
cmp edx, dword [ebp - 0x20]
jb 0x509d3b
test ecx, ecx
mov eax, dword [ebp - 0x14]
cmp eax, edi
jae 0x509e47
xor eax, eax
add eax, edi
lea ecx, [ebp - 0x44]
push eax
push edi
call fcn.00583ef0
add esp, 0xfffffff4
mov eax, dword [ebp - 0x30]
mov dword [esp], str.INSERT_INTO_MP_COUNTRIES_OBS__id_country___VALUES___i___q__
mov dword [esp + 4], esi
mov dword [esp + 8], eax
call fcn.0051fe70
add esp, 0xc
mov ebx, eax
add esp, 0xffffffec
mov edi, dword [ebp - 0x18]
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 0x509ce2
cmp dword [0x830380], 0
je 0x509e37
mov eax, dword [0x84f788]
test eax, eax
je 0x509de5
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 0x509e09
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 0x509ce2
push eax
mov dword [esp], eax
call dword [0x8303d0]
pop ecx
jmp 0x509ce2
push eax
mov dword [esp], ebx
call dword [0x83039c]
pop ecx
jmp 0x509ce2
sub eax, edi
je 0x509d76
movsx edx, byte [eax + edi - 1]
cmp edx, 0xd
je 0x509e6c
cmp edx, 0xa
je 0x509e6c
cmp edx, 0x20
je 0x509e6c
cmp edx, 9
jne 0x509d76
dec eax
jne 0x509e4f
jmp 0x509d76
mov edx, edi
push 4
mov ecx, ebx
push str._end
call fcn.0051bfc0
movzx eax, al
test eax, eax
je 0x509c63
mov dword [ebp - 4], 0
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 0x44]
cmp edx, eax
je 0x509f2f
test edx, edx
je 0x509f2f
mov eax, dword [ebp - 0x44]
sub eax, edx
cmp eax, 0x80
jbe 0x509f51
push edx
call fcn.007424fc
pop ecx
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 4], 0xffffffff
mov eax, ebx
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x24]
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 0x509f2c
inc edx
jmp 0x509eeb
lea edi, [eax + 1]
jmp 0x509c7e