Function at 0x508cef
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
mov eax, dword [0x5c4e68]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push 6
mov esi, ecx
pop ecx
xor eax, eax
push 0x103
lea edi, [ebp - 0x3b]
push eax
mov byte [ebp - 0x3c], 0
rep stosd dword es:[edi], eax
mov byte [ebp - 0x148], al
lea eax, [ebp - 0x147]
push eax
mov dword [ebp - 0x150], esi
call fcn.005117f0
add esp, 0xc
xor eax, eax
and dword [ebp - 0x14c], eax
and dword [ebp - 0x15c], eax
push 6
pop ecx
lea edi, [ebp - 0x1f]
mov byte [ebp - 0x20], 0
mov edx, esi
rep stosd dword es:[edi], eax
call fcn.004c3b34
test eax, eax
je 0x508d61
xor eax, eax
jmp 0x5090ce
test ebx, ebx
je 0x508d5a
push esi
mov ecx, 0x104
lea eax, [ebp - 0x148]
call fcn.004c3b66
pop ecx
mov edx, eax
call fcn.004c470f
mov eax, edx
push eax
mov esi, 0x532eb0
call fcn.004c3c75
neg eax
sbb eax, eax
inc eax
xor edi, edi
cmp eax, edi
pop ecx
mov dword [ebp - 0x158], eax
mov dword [ebp - 0x154], edi
je 0x508de3
push edi
push edi
push edi
push edi
push edi
lea eax, [ebp - 0x3c]
push eax
push 0x19
pop eax
call fcn.004621ac
add esp, 0x18
lea edx, [ebp - 0x3c]
call fcn.004c3b34
test eax, eax
jne 0x508de3
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x148]
push eax
call fcn.004c48c1
test eax, eax
pop ecx
pop ecx
je 0x508de3
mov dword [ebp - 0x154], 1
push edi
mov esi, ebx
call fcn.0050b3ce
pop ecx
lea edx, [ebx + 0x6c]
call fcn.004c3b34
test eax, eax
jne 0x508dfd
cmp dword [ebx + 0x24], edi
je 0x508e08
push 0x19
lea ecx, [ebp - 0x20]
call fcn.00462751
pop ecx
cmp dword [ebx + 0x88], edi
je 0x508e15
cmp dword [ebx + 0x24], edi
je 0x508e27
call fcn.0046297d
mov ecx, eax
call fcn.00467c70
mov dword [ebp - 0x14c], eax
cmp dword [ebx + 0x2f8c], edi
jle 0x508e34
cmp dword [ebx + 0x24], edi
je 0x508e3d
call fcn.00462843
mov esi, eax
jmp 0x508e43
mov esi, dword [ebp - 0x15c]
lea edx, [ebp - 0x20]
call fcn.004c3b34
test eax, eax
jne 0x508e5f
lea eax, [ebp - 0x20]
push eax
push 0x19
pop ecx
lea eax, [ebx + 0x6c]
call fcn.004c3b66
pop ecx
mov eax, dword [ebp - 0x14c]
cmp eax, edi
je 0x508e6f
mov dword [ebx + 0x88], eax
cmp esi, edi
jle 0x508e79
mov dword [ebx + 0x2f8c], esi
call fcn.00415bfa
cmp dword [ebx + 0x90], 0
mov dword [ebx + 0x24], edi
mov edi, 0x300c
mov dword [ebx + 0x2f90], eax
mov dword [ebx], edi
jne 0x508e9e
and dword [ebx + 0x8c], 0
mov eax, dword [ebx + 0x8c]
mov esi, 0x1f4
cmp eax, esi
jle 0x508ec2
push esi
push eax
push str.:8:SaveSales___FAILED:_The_max_number_of_employees_has_been_exceeded___ld__ld
call fcn.004265da
add esp, 0xc
mov dword [ebx + 0x8c], esi
cmp dword [ebp - 0x158], 0
je 0x508ef1
call fcn.00512297
push eax
push 0
push 0
call fcn.0048a119
pop ecx
pop ecx
push eax
lea eax, [ebp - 0x148]
push str._stemp_d.sls
push eax
call fcn.00511173
add esp, 0x10
xor edx, edx
xor eax, eax
cmp eax, 4
jb 0x508eff
cmp eax, 8
jb 0x508f13
cmp eax, 0x90
jl 0x508f0d
cmp eax, 0x94
jl 0x508f13
movzx ecx, byte [ebx + eax]
add edx, ecx
inc eax
cmp eax, edi
jb 0x508ef5
mov eax, dword [ebx + 0x8c]
add edx, edi
test eax, eax
jle 0x508f4e
shl eax, 6
xor ecx, ecx
test eax, eax
jle 0x508f4c
mov esi, dword [ebx + 0x8c]
mov eax, dword [ebx + 0x90]
shl esi, 6
movzx edi, byte [eax + ecx]
add edx, edi
inc ecx
cmp ecx, esi
jl 0x508f3c
mov edi, 0x300c
add edx, ecx
mov dword [ebx + 4], edx
push 0x10c
push str..GetSalesSa7.c
mov edx, 0x530484
lea ecx, [ebp - 0x148]
call fcn.0042d2c6
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x508d5a
push esi
push 1
push edi
push ebx
call fcn.005110f1
add esp, 0x10
cmp eax, 1
je 0x508fc3
mov ecx, esi
call fcn.0042d70e
cmp dword [ebp - 0x158], 0
je 0x508fa4
lea eax, [ebp - 0x148]
call fcn.0042a76b
push dword [ebp - 0x150]
lea eax, [ebp - 0x148]
push eax
push str.:6:SaveSales___FAILED_to_fwrite_to___s__for___s_
call fcn.004265da
add esp, 0xc
jmp 0x508d5a
mov eax, dword [ebx + 0x8c]
xor edi, edi
cmp eax, edi
jle 0x509011
mov dword [ebp - 0x14c], edi
mov eax, dword [ebx + 0x90]
add eax, dword [ebp - 0x14c]
push esi
push 1
push 0x40
push eax
call fcn.005110f1
add esp, 0x10
cmp eax, 1
je 0x509001
push edi
push str.:7:SaveSales___FAILED:_fwrite___FAILED_to_write_cashier_index__d.
call fcn.004265da
pop ecx
pop ecx
add dword [ebp - 0x14c], 0x40
inc edi
cmp edi, dword [ebx + 0x8c]
jl 0x508fd5
mov ecx, esi
call fcn.0042d70e
xor edi, edi
cmp dword [ebp - 0x158], edi
je 0x5090cb
cmp dword [ebp - 0x154], edi
je 0x509047
cmp dword [ebp + 8], edi
je 0x509047
push 0x132
push str..GetSalesSa7.c
push 0x40
call fcn.0046c07a
add esp, 0xc
call fcn.004f16be
mov edx, dword [ebp - 0x150]
lea ecx, [ebp - 0x148]
mov esi, eax
call fcn.0042a80f
cmp eax, edi
jne 0x5090ab
call fcn.004f16be
sub eax, esi
cmp eax, 0x1388
jae 0x509091
push 0xfa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [ebp - 0x150]
lea ecx, [ebp - 0x148]
call fcn.0042a80f
cmp eax, edi
jne 0x5090ab
push dword [ebp - 0x150]
lea eax, [ebp - 0x148]
push eax
push str.:7:SaveSales___FAILED_to_CopyFileSafe___s_____s___0__
call fcn.00426c01
add esp, 0xc
cmp dword [ebp - 0x154], edi
je 0x5090c0
cmp dword [ebp + 8], edi
je 0x5090c0
push 0x40
call fcn.0046cf18
pop ecx
lea eax, [ebp - 0x148]
call fcn.0042a76b
xor eax, eax
inc eax
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0051291c
leave
ret