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

Disassembly:
push 0xffffffffffffffff
push 0x462040
mov eax, dword fs:[0]
push eax
sub esp, 0x74
push ebx
push ebp
push esi
push edi
mov eax, dword [0x481e98]
xor eax, esp
push eax
lea eax, [esp + 0x88]
mov dword fs:[0], eax
mov esi, ecx
mov dword [esp + 0x24], esi
call fcn.0043239f
xor ecx, ecx
xor edi, edi
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x4165ec
push 0x80004005
call fcn.00401050
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
lea ecx, [esp + 0x18]
push str.select_planname_from_planhistory_order_by_querytime
push ecx
mov dword [esp + 0x98], edi
call fcn.00401ce0
add esp, 8
push edi
lea ecx, [esp + 0x30]
call fcn.00401d00
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x14], edi
mov eax, 1
sub eax, dword [ecx - 4]
mov ecx, dword [ecx - 8]
or ecx, eax
mov byte [esp + 0x90], 2
jge 0x416648
push edi
lea ecx, [esp + 0x1c]
call fcn.00401440
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x14]
push edx
push eax
lea ecx, [esp + 0x34]
call fcn.00401700
test eax, eax
mov ecx, esi
jne 0x416971
push 0x439
call fcn.0042fe70
mov ecx, dword [eax + 0x20]
mov ebp, dword [sym.imp.USER32.dll_SendMessageA]
push edi
push edi
push 0x303
push ecx
call ebp
mov eax, dword [esp + 0x14]
cmp eax, edi
jne 0x416698
push 0x80004003
call fcn.0045eff0
mov eax, dword [esp + 0x14]
mov edx, dword [eax]
mov edx, dword [edx + 0x50]
lea ecx, [esp + 0x1c]
push ecx
push eax
mov esi, eax
mov dword [esp + 0x24], edi
call edx
cmp eax, edi
jge 0x4166bb
push 0x467728
push esi
push eax
call fcn.0045f000
cmp word [esp + 0x1c], di
jne 0x41693c
push str.planname
mov word [esp + 0x4c], 8
call fcn.0045f080
mov dword [esp + 0x50], eax
cmp dword [esp + 0x14], edi
mov byte [esp + 0x90], 3
jne 0x4166f3
push 0x80004003
call fcn.0045eff0
lea eax, [esp + 0x48]
push eax
lea ecx, [esp + 0x7c]
push ecx
mov ecx, dword [esp + 0x1c]
call fcn.00402680
mov edx, dword [eax]
mov esi, dword [sym.imp.OLEAUT32.dll_VariantCopy]
mov dword [esp + 0x38], edx
mov ecx, dword [eax + 4]
mov dword [esp + 0x3c], ecx
mov edx, dword [eax + 8]
mov dword [esp + 0x40], edx
mov eax, dword [eax + 0xc]
lea ecx, [esp + 0x78]
push ecx
mov dword [esp + 0x48], eax
call esi
lea edx, [esp + 0x48]
push edx
mov byte [esp + 0x94], 2
call esi
cmp word [esp + 0x38], 1
je 0x416900
lea eax, [esp + 0x58]
push eax
call dword [sym.imp.OLEAUT32.dll_VariantClear]
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x5c]
push edx
call dword [sym.imp.OLEAUT32.dll_VariantCopyInd]
cmp eax, edi
jge 0x41676e
push eax
call fcn.0045eff0
lea eax, [esp + 0x58]
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x94], 4
call fcn.00402e50
mov esi, dword [eax]
cmp esi, edi
mov byte [esp + 0x90], 5
je 0x4167a7
cmp dword [esi + 4], edi
jne 0x4167a2
mov ecx, dword [esi]
push ecx
call fcn.0045f210
mov dword [esi + 4], eax
mov esi, dword [esi + 4]
jmp 0x4167a9
xor esi, esi
mov ecx, dword [esp + 0x24]
push 0x439
call fcn.0042fe70
mov edx, dword [eax + 0x20]
push esi
push 0xffffffffffffffff
push 0x158
push edx
call ebp
cmp eax, 0xffffffff
mov eax, dword [esp + 0x20]
sete bl
cmp eax, edi
je 0x416811
mov esi, eax
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
cmp eax, edi
jne 0x41680d
cmp esi, edi
je 0x41680d
mov eax, dword [esi]
cmp eax, edi
je 0x4167f4
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
cmp eax, edi
je 0x416804
push eax
call fcn.0042a3e5
add esp, 4
push esi
call fcn.0042a3e5
add esp, 4
mov dword [esp + 0x20], edi
lea eax, [esp + 0x58]
push eax
mov byte [esp + 0x94], 2
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
test bl, bl
je 0x416900
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.OLEAUT32.dll_VariantClear]
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x6c]
push eax
call dword [sym.imp.OLEAUT32.dll_VariantCopyInd]
cmp eax, edi
jge 0x416851
push eax
call fcn.0045eff0
lea ecx, [esp + 0x68]
push ecx
lea ecx, [esp + 0x2c]
mov byte [esp + 0x94], 6
call fcn.00402e50
mov esi, dword [eax]
cmp esi, edi
mov byte [esp + 0x90], 7
je 0x41688a
cmp dword [esi + 4], edi
jne 0x416885
mov edx, dword [esi]
push edx
call fcn.0045f210
mov dword [esi + 4], eax
mov esi, dword [esi + 4]
jmp 0x41688c
xor esi, esi
mov ecx, dword [esp + 0x24]
push 0x439
call fcn.0042fe70
mov eax, dword [eax + 0x20]
push esi
push edi
push 0x143
push eax
call ebp
mov eax, dword [esp + 0x28]
cmp eax, edi
je 0x4168ed
mov esi, eax
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
cmp eax, edi
jne 0x4168e9
cmp esi, edi
je 0x4168e9
mov eax, dword [esi]
cmp eax, edi
je 0x4168d0
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [esi + 4]
cmp eax, edi
je 0x4168e0
push eax
call fcn.0042a3e5
add esp, 4
push esi
call fcn.0042a3e5
add esp, 4
mov dword [esp + 0x28], edi
lea ecx, [esp + 0x68]
push ecx
mov byte [esp + 0x94], 2
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
mov eax, dword [esp + 0x14]
cmp eax, edi
jne 0x416916
push 0x80004003
call fcn.0045eff0
mov eax, dword [esp + 0x14]
mov edx, dword [eax]
mov esi, eax
push eax
mov eax, dword [edx + 0x90]
call eax
cmp eax, edi
jge 0x416682
push 0x467728
push esi
push eax
call fcn.0045f000
jmp 0x416682
mov eax, dword [esp + 0x14]
cmp eax, edi
jne 0x416952
push 0x80004003
call fcn.0045eff0
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x80]
push eax
mov esi, eax
call edx
cmp eax, edi
jge 0x416981
push 0x467728
push esi
push eax
call fcn.0045f000
jmp 0x416981
push edi
push 0x467ac4
push 0x46a910
call fcn.0042ba30
mov eax, dword [esp + 0x14]
cmp eax, edi
mov byte [esp + 0x90], 1
je 0x416999
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
lea ecx, [esp + 0x2c]
mov byte [esp + 0x90], 0
call fcn.00401490
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
mov dword [esp + 0x90], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4169d5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x88]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x80
ret