Function at 0x57e990
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
cmp byte [ebp + 8], 0
push esi
push edi
je 0x57e9af
mov edi, str.global_pgstat.tmp
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], str.global_pgstat.stat
jmp 0x57e9c2
mov eax, dword [sym.postgres.exe_pgstat_stat_tmpname]
mov ecx, dword [sym.postgres.exe_pgstat_stat_filename]
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], ecx
mov edi, eax
push 0x6bf728
push edi
call sym.postgres.exe_AllocateFile
mov esi, eax
add esp, 8
test esi, esi
jne 0x57ea1b
push eax
push str.pgstat_write_statsfile
push 0xd81
push str.src_backendpostmasterpgstat.c
push 0xf
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x57ed38
push edi
push str.could_not_open_temporary_statistics_file___s_:__m
call sym.postgres.exe_errmsg
add esp, 8
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push ebx
call sym.postgres.exe_GetCurrentTimestamp
mov edi, dword [sym.imp.MSVCR100.dll_fwrite]
push esi
push 1
mov dword [0x83630c], edx
lea edx, [ebp - 0x10]
push 4
push edx
mov dword [0x836308], eax
mov dword [ebp - 0x10], 0x1a5bc9a
call edi
push esi
push 1
push 0x60
push 0x836308
call edi
mov eax, dword [0x8363c0]
push eax
lea ecx, [ebp - 0x34]
push ecx
call sym.postgres.exe_hash_seq_init
lea edx, [ebp - 0x34]
push edx
call sym.postgres.exe_hash_seq_search
mov ebx, dword [sym.imp.MSVCR100.dll_fputc]
mov edi, eax
add esp, 0x2c
mov dword [ebp - 8], edi
test edi, edi
je 0x57eb4f
jmp 0x57ea83
mov edi, dword [ebp - 8]
push esi
push 0x44
call ebx
push esi
push 1
push 0xb0
push edi
call dword [sym.imp.MSVCR100.dll_fwrite]
mov eax, dword [edi + 0xb0]
push eax
lea ecx, [ebp - 0x1c]
push ecx
call sym.postgres.exe_hash_seq_init
lea edx, [ebp - 0x1c]
push edx
call sym.postgres.exe_hash_seq_search
mov edi, eax
add esp, 0x24
test edi, edi
je 0x57eae6
lea esp, [esp]
push esi
push 0x54
call ebx
push esi
push 1
push 0xa8
push edi
call dword [sym.imp.MSVCR100.dll_fwrite]
lea eax, [ebp - 0x1c]
push eax
call sym.postgres.exe_hash_seq_search
mov edi, eax
add esp, 0x1c
test edi, edi
jne 0x57eac0
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 0xb4]
push edx
lea eax, [ebp - 0x28]
push eax
call sym.postgres.exe_hash_seq_init
lea ecx, [ebp - 0x28]
push ecx
call sym.postgres.exe_hash_seq_search
mov edi, eax
add esp, 0xc
test edi, edi
je 0x57eb33
jmp 0x57eb10
push esi
push 0x46
call ebx
push esi
push 1
push 0x20
push edi
call dword [sym.imp.MSVCR100.dll_fwrite]
lea edx, [ebp - 0x28]
push edx
call sym.postgres.exe_hash_seq_search
mov edi, eax
add esp, 0x1c
test edi, edi
jne 0x57eb10
push esi
push 0x64
call ebx
lea eax, [ebp - 0x34]
push eax
call sym.postgres.exe_hash_seq_search
add esp, 0xc
mov dword [ebp - 8], eax
test eax, eax
jne 0x57ea80
push esi
push 0x45
call ebx
push esi
call dword [sym.imp.MSVCR100.dll_ferror]
add esp, 0xc
pop ebx
test eax, eax
je 0x57ebb9
push 0
push str.pgstat_write_statsfile
push 0xdce
push str.src_backendpostmasterpgstat.c
push 0xf
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x57eba2
mov ecx, dword [ebp - 4]
push ecx
push str.could_not_write_temporary_statistics_file___s_:__m
call sym.postgres.exe_errmsg
add esp, 8
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
push esi
call sym.postgres.exe_FreeFile
mov edx, dword [ebp - 4]
push edx
call sym.postgres.exe_pgunlink
add esp, 8
jmp 0x57ed23
push esi
call sym.postgres.exe_FreeFile
add esp, 4
test eax, eax
jns 0x57ec13
push 0
push str.pgstat_write_statsfile
push 0xdd7
push str.src_backendpostmasterpgstat.c
push 0xf
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x57ec05
mov eax, dword [ebp - 4]
push eax
push str.could_not_close_temporary_statistics_file___s_:__m
call sym.postgres.exe_errmsg
add esp, 8
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov ecx, dword [ebp - 4]
push ecx
call sym.postgres.exe_pgunlink
jmp 0x57ed20
mov edi, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
push edi
push esi
call sym.postgres.exe_pgrename
add esp, 8
test eax, eax
jns 0x57ec6f
push 0
push str.pgstat_write_statsfile
push 0xddf
push str.src_backendpostmasterpgstat.c
push 0xf
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x57ec64
push edi
push esi
push str.could_not_rename_temporary_statistics_file___s__to___s_:__m
call sym.postgres.exe_errmsg
add esp, 0xc
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 8
push esi
call sym.postgres.exe_pgunlink
jmp 0x57ed20
mov eax, dword [0x83630c]
mov ecx, dword [0x83636c]
mov edx, dword [0x836308]
mov dword [0x8362f8], edx
mov dword [0x8362fc], eax
cmp ecx, eax
jl 0x57ed23
mov eax, dword [0x836368]
jg 0x57eca2
cmp eax, edx
jbe 0x57ed23
push ecx
push eax
call sym.postgres.exe_timestamptz_to_str
mov edx, dword [sym.postgres.exe_CurrentMemoryContext]
push eax
push edx
call sym.postgres.exe_MemoryContextStrdup
mov ecx, dword [0x8362f8]
mov esi, eax
mov eax, dword [0x8362fc]
push eax
push ecx
call sym.postgres.exe_timestamptz_to_str
mov edx, dword [sym.postgres.exe_CurrentMemoryContext]
push eax
push edx
call sym.postgres.exe_MemoryContextStrdup
push str.pgstat_write_statsfile
push 0xdf7
push str.src_backendpostmasterpgstat.c
mov edi, eax
call sym.postgres.exe_elog_start
push edi
push esi
push str.last_statrequest__s_is_later_than_collectors_time__s
push 0xf
call sym.postgres.exe_elog_finish
push esi
call sym.postgres.exe_pfree
add esp, 0x40
push edi
call sym.postgres.exe_pfree
mov eax, dword [0x8362f8]
mov ecx, dword [0x8362fc]
mov dword [0x836368], eax
mov dword [0x83636c], ecx
add esp, 4
cmp byte [ebp + 8], 0
je 0x57ed38
mov edx, dword [sym.postgres.exe_pgstat_stat_filename]
push edx
call sym.postgres.exe_pgunlink
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret