Function at 0x577d40
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7c
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
xor eax, eax
push edi
or edi, 0xffffffff
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x40], eax
cmp dword [ebp + 0x10], edi
jne 0x577d75
and ebx, 0xfffffff9
mov dword [ebp + 0xc], ebx
mov eax, ebx
and eax, 1
mov dword [ebp - 0x54], eax
je 0x577daa
mov eax, dword [esi + 8]
cmp eax, dword [sym.postgres.exe_MyProcPid]
je 0x577daa
push 0x7330c4
push 0x7b
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
push str.cannot_wait_on_a_latch_owned_by_another_process
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
test bl, 8
je 0x577dbc
lea ecx, [ebp - 0x64]
push ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edi, dword [ebp + 0x14]
mov eax, dword [esi + 0xc]
mov edx, dword [0x869244]
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x70], eax
mov eax, ebx
and eax, 6
mov dword [ebp - 0x74], edx
mov dword [ebp - 0x38], 2
mov dword [ebp - 0x5c], eax
je 0x577e7d
xor esi, esi
test bl, 2
je 0x577def
mov esi, 0x21
test bl, 4
je 0x577df7
or esi, 2
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
mov ebx, eax
mov dword [ebp - 0x3c], ebx
test ebx, ebx
jne 0x577e33
push 0x7330c4
push 0xa3
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
add esp, 0xc
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.failed_to_create_event_for_socket:_error_code__u
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0xc
mov eax, dword [ebp + 0x10]
push esi
push ebx
push eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
test eax, eax
je 0x577e70
push 0x7330c4
push 0xa6
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
add esp, 0xc
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.failed_to_set_up_event_for_socket:_error_code__u
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0xc
mov dword [ebp - 0x6c], ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x38], 3
and ebx, 0x10
mov dword [ebp - 0x50], ebx
je 0x577e99
mov eax, dword [ebp - 0x38]
mov ecx, dword [0x869198]
mov dword [ebp - 0x40], eax
mov dword [ebp + eax*4 - 0x74], ecx
inc eax
mov dword [ebp - 0x38], eax
call sym.postgres.exe_pgwin32_dispatch_queued_signals
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp - 0x58]
push edx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
jne 0x577edb
push 0x7330c4
push 0xbd
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
add esp, 0xc
call ebx
push eax
push str.ResetEvent_failed:_error_code__lu
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0xc
cmp dword [ebp - 0x54], 0
je 0x577eee
mov eax, dword [ebp - 0x4c]
mov ecx, dword [eax]
test ecx, ecx
jne 0x578087
mov eax, dword [ebp - 0x38]
push edi
push 0
lea edx, [ebp - 0x74]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov esi, eax
cmp esi, 0xffffffff
jne 0x577f34
push 0x7330c4
push 0xcd
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
add esp, 0xc
call ebx
push eax
push str.WaitForMultipleObjects___failed:_error_code__lu
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0xc
jmp 0x577fea
cmp esi, 0x102
je 0x57807e
test esi, esi
jne 0x577f4e
call sym.postgres.exe_pgwin32_dispatch_queued_signals
jmp 0x577fea
cmp esi, 1
je 0x577ea4
cmp dword [ebp - 0x5c], 0
je 0x578038
cmp esi, 2
jne 0x578038
push 0x2c
lea ecx, [ebp - 0x30]
push 0
push ecx
call sub.MSVCR100.dll_memset
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp + 0x10]
add esp, 0xc
lea edx, [ebp - 0x30]
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSAEnumNetworkEvents]
test eax, eax
je 0x577fbd
push 0x7330c4
push 0xe7
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
add esp, 0xc
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
push eax
push str.failed_to_enumerate_network_events:_error_code__u
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0xc
mov cl, byte [ebp + 0xc]
mov al, byte [ebp - 0x30]
test cl, 2
je 0x577fd3
test al, 0x21
je 0x577fd3
mov dword [ebp - 0x34], 2
test cl, 4
je 0x577fe0
test al, 2
je 0x577fe0
or dword [ebp - 0x34], 4
cmp dword [ebp - 0x34], 0
jne 0x57808e
cmp edi, 0xffffffff
je 0x577ea4
lea edx, [ebp - 0x48]
push edx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [ebp - 0x64]
sub dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x60]
lea edx, [ebp - 0x7c]
sbb dword [ebp - 0x44], ecx
push edx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
fild qword [ebp - 0x48]
fmul qword [0x6c0e88]
fild qword [ebp - 0x7c]
fdivp st(1)
call fcn.006a8d10
mov edi, dword [ebp + 0x14]
sub edi, eax
jns 0x577ea4
xor edi, edi
jmp 0x577ea4
cmp dword [ebp - 0x50], 0
je 0x578055
cmp esi, dword [ebp - 0x40]
jne 0x578055
call sym.postgres.exe_PostmasterIsAlive
test al, al
jne 0x577fea
mov dword [ebp - 0x34], 0x10
jmp 0x57808e
push 0x7330c4
push 0x102
push str.src_backendportwin32_latch.c
call sym.postgres.exe_elog_start
push esi
push str.unexpected_return_code_from_WaitForMultipleObjects__:__lu
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
jmp 0x577fea
mov dword [ebp - 0x34], 8
jmp 0x57808e
mov dword [ebp - 0x34], 1
mov esi, dword [ebp - 0x3c]
test esi, esi
je 0x5780aa
mov eax, dword [ebp + 0x10]
push 0
push 0
push eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
push esi
call dword [sym.imp.WS2_32.dll_WSACloseEvent]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x34]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret