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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x455c20]
xor eax, ebp
mov dword [ebp - 4], eax
xor al, al
xorps xmm0, xmm0
cmp dword [0x456300], 0
push ebx
mov ebx, dword [ebp + 8]
push esi
movsd qword [ebp - 0x30], xmm0
mov byte [ebp - 0x25], al
mov byte [ebp - 0x26], al
jne 0x409483
push str.You_are_currently_not_connected_to_a_database._n
call fcn.00408fb0
mov bl, byte [ebp - 0x25]
add esp, 4
jmp 0x4099c9
push edi
mov edi, dword [sym.imp.MSVCR120.dll_fflush]
cmp byte [0x4563c0], al
je 0x4094d6
push ebx
push str._Single_step_mode:_verify_command__n_s_n_press_return_to_proceed_or_enter_x_and_return_to_cancel__n
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call fcn.004264b0
mov esi, dword [sym.imp.MSVCR120.dll___iob_func]
call esi
add eax, 0x20
push eax
call edi
call esi
push eax
lea eax, [ebp - 0x40]
push 3
push eax
call dword [sym.imp.MSVCR120.dll_fgets]
add esp, 0x18
test eax, eax
je 0x4094f5
cmp byte [ebp - 0x40], 0x78
je 0x4099c5
jmp 0x4094f5
cmp dword [0x4563c8], 1
jne 0x4094f5
push ebx
call dword [sym.imp.MSVCR120.dll_puts]
call dword [sym.imp.MSVCR120.dll___iob_func]
add eax, 0x20
push eax
call edi
add esp, 8
cmp dword [0x4563b4], 0
je 0x409523
push ebx
push str._QUERY__n_s_n_n_n
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
push dword [0x4563b4]
call fcn.00426490
push dword [0x4563b4]
call edi
add esp, 0x10
mov edi, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x455c50
call edi
mov eax, dword [0x455c4c]
mov dword [0x455c4c], 0
test eax, eax
je 0x40954c
push eax
call sub.LIBPQ.dll_Ordinal_121
add esp, 4
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_120
add esp, 4
mov dword [0x455c4c], eax
push 0x455c50
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_96
add esp, 4
test eax, eax
jne 0x4095f6
cmp byte [0x4563bc], al
jne 0x409681
push ebx
call fcn.0040a080
add esp, 4
test al, al
jne 0x409681
push str.BEGIN
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_21
mov esi, eax
push esi
call sub.LIBPQ.dll_Ordinal_33
add esp, 0xc
cmp eax, 1
je 0x4095e2
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_15
push eax
push 0x42b548
call fcn.00408fb0
push esi
call sub.LIBPQ.dll_Ordinal_48
add esp, 0x10
call fcn.004090c0
jmp 0x4099c5
push esi
call sub.LIBPQ.dll_Ordinal_48
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_96
add esp, 8
cmp eax, 2
jne 0x409681
mov eax, dword [0x4563d0]
test eax, eax
je 0x409681
cmp byte [0x456390], 0
jne 0x409616
cmp eax, 2
jne 0x409681
cmp byte [0x455c48], 0
jne 0x409650
mov eax, dword [0x456394]
cmp eax, 0x13880
jge 0x409650
push 0x20
lea ecx, [ebp - 0x24]
push ecx
push 0
push eax
call fcn.00401250
push eax
push str.The_server__version__s__does_not_support_savepoints_for_ON_ERROR_ROLLBACK._n
call fcn.00408fb0
add esp, 0x18
mov byte [0x455c48], 1
jmp 0x409681
push str.SAVEPOINT_pg_psql_temporary_savepoint
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_21
mov esi, eax
push esi
call sub.LIBPQ.dll_Ordinal_33
add esp, 0xc
cmp eax, 1
jne 0x4095b9
push esi
call sub.LIBPQ.dll_Ordinal_48
add esp, 4
mov byte [ebp - 0x26], 1
cmp dword [0x4563c4], 0
jle 0x4096c0
push ebx
call fcn.0040a590
add esp, 4
test al, al
je 0x4096c0
lea eax, [ebp - 0x30]
push eax
push ebx
call fcn.00409b80
add esp, 8
mov byte [ebp - 0x25], al
call fcn.004090c0
movsd xmm0, qword [ebp - 0x30]
xor edi, edi
mov al, byte [ebp - 0x25]
movsd qword [ebp - 0x30], xmm0
jmp 0x4097a0
cmp byte [0x4563b0], 0
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
je 0x4096d5
lea eax, [ebp - 0x50]
push eax
call esi
push ebx
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_21
add esp, 8
mov dword [ebp - 0x34], eax
push 0x455c50
call edi
mov eax, dword [0x455c4c]
mov dword [0x455c4c], 0
test eax, eax
je 0x40970a
push eax
call sub.LIBPQ.dll_Ordinal_121
add esp, 4
push 0x455c50
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebp - 0x34]
push eax
call fcn.0040ab80
add esp, 4
mov byte [ebp - 0x25], al
cmp byte [0x4563b0], 0
je 0x40977f
lea eax, [ebp - 0x3c]
push eax
call esi
mov eax, dword [ebp - 0x50]
sub dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x4c]
sbb dword [ebp - 0x38], eax
lea eax, [ebp - 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov edx, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x3c]
call fcn.0042a2ef
mulsd xmm0, qword [0x42edc8]
mov edx, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x48]
movsd qword [ebp - 0x30], xmm0
call fcn.0042a2ef
movsd xmm1, qword [ebp - 0x30]
divsd xmm1, xmm0
mov al, byte [ebp - 0x25]
movsd qword [ebp - 0x30], xmm1
jmp 0x409789
movsd xmm0, qword [ebp - 0x30]
movsd qword [ebp - 0x30], xmm0
mov edi, dword [ebp - 0x34]
test al, al
je 0x4097a4
test edi, edi
je 0x4097a0
push edi
call fcn.0040ae30
add esp, 4
mov byte [ebp - 0x25], al
test al, al
jne 0x4097bb
cmp dword [0x4563c8], 2
jne 0x4097bb
push ebx
push str.STATEMENT:___s_n
call fcn.00408fb0
add esp, 8
cmp byte [ebp - 0x26], 0
je 0x409934
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_96
mov esi, eax
add esp, 4
mov ecx, esi
sub ecx, 0
je 0x409934
sub ecx, 2
je 0x40981b
dec ecx
je 0x409811
mov byte [ebp - 0x25], 0
cmp esi, 4
jne 0x4097fe
call fcn.0040a7c0
test al, al
je 0x409934
push esi
push str.unexpected_transaction_status___d__n
call fcn.00408fb0
add esp, 8
jmp 0x409934
mov eax, str.ROLLBACK_TO_pg_psql_temporary_savepoint
jmp 0x4098de
test edi, edi
je 0x4098d9
push edi
mov esi, str.SAVEPOINT
call sub.LIBPQ.dll_Ordinal_42
add esp, 4
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x409851
test cl, cl
je 0x40984d
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x409851
add eax, 2
add esi, 2
test cl, cl
jne 0x409831
xor eax, eax
jmp 0x409856
sbb eax, eax
or eax, 1
test eax, eax
je 0x409934
push edi
mov esi, str.RELEASE
call sub.LIBPQ.dll_Ordinal_42
add esp, 4
lea esp, [esp]
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x409890
test cl, cl
je 0x40988c
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x409890
add eax, 2
add esi, 2
test cl, cl
jne 0x409870
xor eax, eax
jmp 0x409895
sbb eax, eax
or eax, 1
test eax, eax
je 0x409934
push edi
mov esi, str.ROLLBACK
call sub.LIBPQ.dll_Ordinal_42
add esp, 4
jmp 0x4098b0
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x4098d0
test cl, cl
je 0x4098cc
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x4098d0
add eax, 2
add esi, 2
test cl, cl
jne 0x4098b0
xor eax, eax
jmp 0x4098d5
sbb eax, eax
or eax, 1
test eax, eax
je 0x409934
mov eax, str.RELEASE_pg_psql_temporary_savepoint
push eax
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_21
mov esi, eax
push esi
call sub.LIBPQ.dll_Ordinal_33
add esp, 0xc
cmp eax, 1
je 0x40992b
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_15
push eax
push 0x42b548
call fcn.00408fb0
push esi
call sub.LIBPQ.dll_Ordinal_48
push edi
xor bl, bl
call sub.LIBPQ.dll_Ordinal_48
add esp, 0x14
call fcn.004090c0
jmp 0x4099c8
push esi
call sub.LIBPQ.dll_Ordinal_48
add esp, 4
push edi
call sub.LIBPQ.dll_Ordinal_48
add esp, 4
cmp byte [0x4563b0], 0
je 0x409969
movsd xmm0, qword [ebp - 0x30]
sub esp, 8
movsd qword [esp], xmm0
push str.Time:__.3f_ms_n
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call fcn.004264b0
add esp, 0xc
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_72
add esp, 4
cmp dword [0x456304], eax
je 0x4099c0
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_72
add esp, 4
test eax, eax
js 0x4099c0
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_72
push eax
mov dword [0x456304], eax
mov dword [0x456348], eax
call sub.LIBPQ.dll_Ordinal_92
push eax
push str.ENCODING
push dword [0x4563b8]
call fcn.00424ab0
add esp, 0x14
call fcn.0040a930
mov bl, byte [ebp - 0x25]
pop edi
mov eax, dword [0x45637c]
mov esi, dword [sym.imp.MSVCR120.dll_free]
test eax, eax
je 0x4099e8
push eax
call esi
add esp, 4
mov dword [0x45637c], 0
mov eax, dword [0x456380]
test eax, eax
je 0x409a01
push eax
call esi
add esp, 4
mov dword [0x456380], 0
mov ecx, dword [ebp - 4]
mov al, bl
pop esi
xor ecx, ebp
pop ebx
call fcn.00429e54
mov esp, ebp
pop ebp
ret