Function at 0x4a4680
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x3c]
mov dword [ebp - 0x60], eax
mov eax, dword [esi + 0x4c]
push edi
mov edi, dword [sym.postgres.exe_CurrentMemoryContext]
mov dword [sym.postgres.exe_CurrentMemoryContext], eax
mov ecx, dword [esi + 0x40]
push ecx
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x64], edi
call sym.postgres.exe_CreateTupleDescCopy
mov dword [esi + 0x40], eax
add esp, 4
mov dword [sym.postgres.exe_CurrentMemoryContext], edi
cmp dword [esi + 0x34], 2
je 0x4a4710
push 0
push 0x6c50d8
push 0x154
push str.src_backendcommandsportalcmds.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4a4710
mov edx, dword [esi]
push edx
push str.portal___s__cannot_be_run
call sym.postgres.exe_errmsg
add esp, 8
push eax
push 0x145
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov dword [esi + 0x34], 3
mov edx, dword [sym.postgres.exe_PortalContext]
mov eax, dword [sym.postgres.exe_ActivePortal]
mov ecx, dword [sym.postgres.exe_CurrentResourceOwner]
mov dword [ebp - 0x4c], edx
mov dword [ebp - 0x54], eax
mov eax, dword [sym.postgres.exe_PG_exception_stack]
mov dword [ebp - 0x48], ecx
mov ecx, dword [sym.postgres.exe_error_context_stack]
lea edx, [ebp - 0x44]
push 0
push edx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], ecx
call sub.MSVCR100.dll__setjmp3
add esp, 8
test eax, eax
jne 0x4a48fa
mov esi, dword [ebp - 0x50]
mov edi, dword [ebp - 0x60]
lea eax, [ebp - 0x44]
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_ActivePortal], esi
mov ecx, dword [esi + 0xc]
mov dword [sym.postgres.exe_CurrentResourceOwner], ecx
mov eax, dword [esi + 8]
mov dword [sym.postgres.exe_PortalContext], eax
mov dword [sym.postgres.exe_CurrentMemoryContext], eax
mov edx, dword [edi + 0x10]
push edx
call sym.postgres.exe_PushActiveSnapshot
push edi
call sym.postgres.exe_ExecutorRewind
push 5
call sym.postgres.exe_CreateDestReceiver
mov dword [edi + 0x18], eax
mov ecx, dword [esi + 0x4c]
mov edx, dword [esi + 0x48]
push 1
push ecx
push edx
push eax
call sym.postgres.exe_SetTuplestoreDestReceiverParams
push 0
push 1
push edi
call sym.postgres.exe_ExecutorRun
mov eax, dword [edi + 0x18]
push eax
mov eax, dword [eax + 0xc]
call eax
mov dword [edi + 0x18], 0
push edi
mov dword [esi + 0x3c], 0
call sym.postgres.exe_ExecutorFinish
push edi
call sym.postgres.exe_ExecutorEnd
push edi
call sym.postgres.exe_FreeQueryDesc
mov ecx, dword [esi + 0x4c]
add esp, 0x38
mov dword [sym.postgres.exe_CurrentMemoryContext], ecx
cmp byte [esi + 0x51], 0
je 0x4a4807
mov edx, dword [esi + 0x48]
push 1
push edx
call sym.postgres.exe_tuplestore_advance
add esp, 8
test al, al
jne 0x4a47f0
jmp 0x4a489e
cmp byte [esi + 0x52], 0
je 0x4a4850
push 0
push 0x6c50d8
push 0x19d
push str.src_backendcommandsportalcmds.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x4a4850
push str.could_not_reposition_held_cursor
call sym.postgres.exe_errmsg
add esp, 4
push eax
push 0x145
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [esi + 0x48]
push eax
call sym.postgres.exe_tuplestore_rescan
xor edi, edi
add esp, 4
cmp dword [esi + 0x54], edi
jle 0x4a489e
mov ecx, dword [esi + 0x48]
push 1
push ecx
call sym.postgres.exe_tuplestore_advance
add esp, 8
test al, al
jne 0x4a4898
push 0x6c50d8
push 0x1a4
push str.src_backendcommandsportalcmds.c
call sym.postgres.exe_elog_start
push str.unexpected_end_of_tuple_stream
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
inc edi
cmp edi, dword [esi + 0x54]
jl 0x4a4863
mov edx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x64]
mov dword [sym.postgres.exe_PG_exception_stack], edx
mov edx, dword [ebp - 0x54]
mov dword [sym.postgres.exe_error_context_stack], eax
mov eax, dword [ebp - 0x48]
mov dword [sym.postgres.exe_CurrentMemoryContext], ecx
mov ecx, dword [ebp - 0x4c]
mov dword [esi + 0x34], 2
mov dword [sym.postgres.exe_ActivePortal], edx
mov dword [sym.postgres.exe_CurrentResourceOwner], eax
mov dword [sym.postgres.exe_PortalContext], ecx
call sym.postgres.exe_PopActiveSnapshot
mov edx, dword [esi + 8]
push edx
call sym.postgres.exe_MemoryContextDeleteChildren
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
xor ecx, ebp
pop esi
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x5c]
mov ecx, dword [ebp - 0x58]
push edx
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
call sym.postgres.exe_MarkPortalFailed
mov eax, dword [ebp - 0x54]
mov ecx, dword [ebp - 0x48]
mov edx, dword [ebp - 0x4c]
add esp, 4
mov dword [sym.postgres.exe_ActivePortal], eax
mov dword [sym.postgres.exe_CurrentResourceOwner], ecx
mov dword [sym.postgres.exe_PortalContext], edx
call sym.postgres.exe_pg_re_throw
push 1
call dword [sym.imp.MSVCR100.dll_exit]
int3