Function at 0x4c9e10
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x70
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x64], eax
mov eax, dword [esi + 4]
and eax, 1
push edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x60], edi
mov ecx, str.VACUUM
jne 0x4c9e47
mov ecx, str.ANALYZE
xor ebx, ebx
mov dword [ebp - 0x5c], ecx
cmp eax, ebx
je 0x4c9e62
push ecx
mov ecx, dword [ebp + 0x1c]
push ecx
call sym.postgres.exe_PreventTransactionChain
add esp, 8
mov byte [ebp - 0x46], bl
jmp 0x4c9e71
mov edx, dword [ebp + 0x1c]
push edx
call sym.postgres.exe_IsInTransactionChain
add esp, 4
mov byte [ebp - 0x46], al
test byte [esi + 4], 1
je 0x4c9e85
call sym.postgres.exe_IsAutoVacuumWorkerProcess
test al, al
jne 0x4c9e85
call sym.postgres.exe_pgstat_vacuum_stat
mov eax, dword [sym.postgres.exe_PortalContext]
push 0x800000
push 0x2000
push ebx
push str.Vacuum
push eax
call sym.postgres.exe_AllocSetContextCreate
add esp, 0x14
mov dword [0x833804], eax
cmp edi, ebx
jne 0x4c9edd
mov ebx, dword [sym.postgres.exe_CurrentMemoryContext]
push 3
mov dword [ebp - 0x70], ebx
mov dword [sym.postgres.exe_CurrentMemoryContext], eax
mov dword [ebp - 0x68], ebx
call sym.postgres.exe_GetAccessStrategy
mov ecx, dword [sym.postgres.exe_CurrentMemoryContext]
mov edi, eax
add esp, 4
mov dword [sym.postgres.exe_CurrentMemoryContext], ebx
mov dword [ebp - 0x60], edi
mov dword [ebp - 0x6c], ecx
xor ebx, ebx
mov ecx, dword [esi + 0x10]
mov eax, dword [ebp - 0x64]
mov dword [0x833800], edi
call fcn.004c9200
test byte [esi + 4], 1
mov dword [ebp - 0x50], eax
je 0x4c9efd
mov byte [ebp - 0x45], 1
jmp 0x4c9f2a
call sym.postgres.exe_IsAutoVacuumWorkerProcess
test al, al
je 0x4c9f0c
mov byte [ebp - 0x45], 1
jmp 0x4c9f2a
mov dl, byte [ebp - 0x46]
test dl, dl
jne 0x4c9f26
mov eax, dword [ebp - 0x50]
cmp eax, ebx
je 0x4c9f26
cmp dword [eax + 4], 1
jle 0x4c9f26
mov byte [ebp - 0x45], 1
jmp 0x4c9f2a
mov byte [ebp - 0x45], 0
mov al, byte [ebp - 0x45]
test al, al
je 0x4c9f44
call sym.postgres.exe_ActiveSnapshotSet
test al, al
je 0x4c9f3f
call sym.postgres.exe_PopActiveSnapshot
call sym.postgres.exe_CommitTransactionCommand
mov ecx, dword [sym.postgres.exe_PG_exception_stack]
mov edx, dword [sym.postgres.exe_error_context_stack]
lea eax, [ebp - 0x44]
push ebx
push eax
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x54], edx
call sub.MSVCR100.dll__setjmp3
add esp, 8
test eax, eax
jne 0x4ca07d
cmp dword [sym.postgres.exe_VacuumCostDelay], ebx
mov eax, dword [ebp - 0x50]
setg dl
lea ecx, [ebp - 0x44]
mov dword [sym.postgres.exe_PG_exception_stack], ecx
mov byte [sym.postgres.exe_VacuumCostActive], dl
mov dword [sym.postgres.exe_VacuumCostBalance], ebx
mov dword [sym.postgres.exe_VacuumPageHit], ebx
mov dword [sym.postgres.exe_VacuumPageMiss], ebx
mov dword [sym.postgres.exe_VacuumPageDirty], ebx
call fcn.004c91e0
mov edi, eax
cmp edi, ebx
je 0x4ca01b
mov ebx, dword [ebp - 0x4c]
test byte [ebx + 4], 1
mov esi, dword [edi]
je 0x4c9fcd
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x4c]
push eax
push ecx
push edx
push esi
call fcn.004c9790
add esp, 0x10
test al, al
je 0x4ca012
test byte [ebx + 4], 2
je 0x4ca012
mov al, byte [ebp - 0x45]
test al, al
je 0x4c9fed
call sym.postgres.exe_StartTransactionCommand
call sym.postgres.exe_GetTransactionSnapshot
push eax
call sym.postgres.exe_PushActiveSnapshot
add esp, 4
mov ecx, dword [0x833800]
mov edx, dword [ebp - 0x4c]
push ecx
push edx
push esi
call sym.postgres.exe_analyze_rel
mov al, byte [ebp - 0x45]
add esp, 0xc
test al, al
je 0x4ca012
call sym.postgres.exe_PopActiveSnapshot
call sym.postgres.exe_CommitTransactionCommand
mov edi, dword [edi + 4]
test edi, edi
jne 0x4c9fac
xor ebx, ebx
mov al, byte [ebp - 0x45]
mov ecx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x54]
mov dword [sym.postgres.exe_PG_exception_stack], ecx
mov dword [sym.postgres.exe_error_context_stack], edx
mov byte [sym.postgres.exe_VacuumCostActive], 0
test al, al
je 0x4ca040
call sym.postgres.exe_StartTransactionCommand
mov ecx, dword [ebp - 0x4c]
test byte [ecx + 4], 1
je 0x4ca057
call sym.postgres.exe_IsAutoVacuumWorkerProcess
test al, al
jne 0x4ca057
call sym.postgres.exe_vac_update_datfrozenxid
mov edx, dword [0x833804]
push edx
call sym.postgres.exe_MemoryContextDelete
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
pop esi
mov dword [0x833804], ebx
xor ecx, ebp
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x54]
mov dword [sym.postgres.exe_PG_exception_stack], eax
mov dword [sym.postgres.exe_error_context_stack], ecx
mov byte [sym.postgres.exe_VacuumCostActive], 0
call sym.postgres.exe_pg_re_throw
push 1
call dword [sym.imp.MSVCR100.dll_exit]
int3