Function at 0x558ab0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0xc0
mov edi, ecx
mov ebx, dword [ebp + 0xc]
mov eax, dword [0x646040]
xor eax, ebp
mov dword [esp + 0xb8], eax
pcmpeqd xmm0, xmm0
lea esi, [esp + 0x70]
movdqa xmmword [esi + 0x20], xmm0
movdqa xmmword [esi + 0x10], xmm0
movdqa xmmword [esi], xmm0
lea eax, [esp + 0x50]
push 0x7f
push str.file_win.cc
push str.Write
push eax
call fcn.00509c60
add esp, 0x10
xor eax, eax
mov ecx, esi
push eax
push eax
call fcn.00520c00
mov dword [esp + 0xa4], 0xa
mov al, byte [0x64b456]
test al, al
jne 0x55906b
xor ecx, ecx
dec ecx
test ebx, ebx
js 0x558b78
mov eax, dword [ebp + 0x14]
test eax, eax
js 0x558b78
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
pxor xmm0, xmm0
movdqa xmmword [esp + 0x50], xmm0
mov dword [esp + 0x60], 0
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x58], ecx
lea esi, [esp + 0xa8]
mov dword [esi], 0xffffffff
lea ecx, [esp + 0x50]
push ecx
push esi
push eax
push edx
push dword [edi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor ecx, ecx
cmp eax, 1
sbb ecx, ecx
or ecx, dword [esi]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0xa8], 0xa
mov al, byte [0x64b456]
test al, al
jne 0x559043
call fcn.00564085
mov ebx, dword [eax]
call fcn.00564085
xor esi, esi
mov dword [eax], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, dword [esp + 0x70]
test esi, esi
je 0x558c26
cmp dword [esp + 0x74], 0
jne 0x558c26
cmp byte [esi + 0x11], 1
jne 0x558c26
mov eax, dword [esi + 0x20]
add eax, 0x50
mov dword [esp + 0xc], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x558dff
xor eax, eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x18], eax
cmp byte [esi + 0x2b], 0
jne 0x558c16
mov eax, dword [esi + 0x20]
cmp byte [esi + 0x29], 1
je 0x558dca
dec dword [eax + 0xb0]
cmp byte [esi + 0x11], 0
je 0x55909e
cmp byte [esi + 0x10], 0
je 0x558cc2
mov word [esi + 0x29], 0
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00564085
mov dword [eax], ebx
cmp byte [esp + 0x98], 1
jne 0x558c4d
mov eax, dword [esp + 0x90]
test eax, eax
jne 0x558cda
mov eax, dword [esp + 0x78]
test eax, eax
je 0x558c5b
mov ecx, dword [esp + 0x7c]
mov dword [eax], ecx
mov eax, dword [esp + 0x74]
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x64e810]
bt edx, ecx
jb 0x559001
mov dword [esp + 0x74], 0
mov eax, dword [esp + 0x70]
mov ecx, eax
shr ecx, 0xe
mov edx, eax
shr edx, 0x13
mov edx, dword [edx*4 + 0x64e810]
bt edx, ecx
jb 0x558cb7
mov ecx, dword [esp + 0xb8]
xor ecx, ebp
call fcn.00567335
mov eax, dword [esp + 0x1c]
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret 0x10
push eax
call fcn.004f4f20
add esp, 4
jmp 0x558c9b
mov eax, dword [esi + 0x20]
cmp byte [esi + 0x2a], 1
je 0x55900f
dec dword [eax + 0xb4]
jmp 0x558c16
mov dword [esp + 0xc], eax
mov ecx, dword [fcn.005608f0]
cmp ecx, 0x5531a0
jne 0x558db0
xor eax, eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x50], eax
lea eax, [esp + 0x50]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x54]
mov eax, 0x7bd05af6
cmp eax, edi
mov eax, 0x863
sbb eax, esi
jl 0x5590c2
mov ecx, 0xf4240
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add ecx, edx
push dword [0x64b6cc]
push dword [0x64b6c8]
push ecx
push eax
call fcn.005877d0
mov ecx, edx
mov dword [esp + 0xa8], eax
mov dword [esp + 0xac], ecx
mov edx, dword [esp + 0x88]
mov esi, dword [esp + 0x8c]
mov dword [esp + 4], eax
sub eax, edx
mov dword [esp + 8], ecx
sbb ecx, esi
seto bl
mov edi, ecx
sar edi, 0x1f
test bl, bl
cmovne eax, edi
add edi, 0x80000000
test bl, bl
cmove edi, ecx
cmp eax, 0xf4240
mov ecx, edi
sbb ecx, 0
jge 0x558e0e
mov edi, dword [esp + 0x90]
test edi, edi
je 0x558c4d
lock dec dword [edi]
jne 0x558c4d
jmp 0x5590ad
call dword [0x6401dc]
lea esi, [esp + 0xa8]
push esi
call ecx
add esp, 4
mov eax, dword [esi]
mov ecx, dword [esi + 4]
jmp 0x558d55
mov ecx, dword [eax + 0x5c]
mov edx, dword [eax + 0xa0]
dec edx
mov dword [eax + 0xa0], edx
cmp ecx, dword [eax + 0x60]
je 0x558de7
cmp dword [eax + 0xa8], edx
jae 0x558df2
mov word [eax + 0x78], 0
jmp 0x558c02
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x558c02
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x558be1
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], esi
xor eax, eax
dec eax
mov ebx, 0x3938700
mov esi, dword [esp + 0xc]
add ebx, dword [esi + 0xf8]
mov ecx, dword [esi + 0xfc]
adc ecx, 0
mov edx, 0x7fffffff
cmovno edx, ecx
cmovo ebx, eax
mov eax, dword [esp + 4]
cmp eax, ebx
mov ebx, dword [esp + 8]
mov ecx, ebx
sbb ecx, edx
jge 0x559191
mov ecx, dword [esi + 0xf8]
mov eax, dword [esi + 0xfc]
mov edx, dword [esp + 0x14]
mov dword [esp + 8], ecx
sub edx, ecx
mov ebx, dword [esp + 0x10]
mov dword [esp + 4], eax
sbb ebx, eax
seto cl
mov eax, ebx
sar eax, 0x1f
test cl, cl
cmovne edx, eax
add eax, 0x80000000
test cl, cl
cmove eax, ebx
mov ecx, edx
add ecx, 1
mov ebx, eax
adc ebx, 0x80000000
cmp ecx, 2
sbb ebx, 0
mov ebx, 0x80000000
mov esi, dword [esp + 0x18]
jb 0x55916d
movd xmm0, edx
movd xmm1, eax
punpckldq xmm0, xmm1
movq qword [esp + 0x48], xmm0
fild qword [esp + 0x48]
fstp qword [esp + 0x40]
movsd xmm0, qword [esp + 0x40]
divsd xmm0, qword [0x62fcc0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00590cb0
add esp, 8
fstp qword [esp + 0x20]
movsd xmm0, qword [esp + 0x20]
xor ecx, ecx
movsd xmm1, qword [0x6302f0]
ucomisd xmm0, xmm1
mov eax, 0x7fffffff
cmovb eax, ecx
movsd xmm2, qword [0x6302f8]
ucomisd xmm2, xmm0
maxsd xmm0, xmm1
cvttsd2si ecx, xmm0
cmovb ecx, eax
movd xmm0, esi
xor eax, eax
inc eax
add eax, esi
movd xmm1, edi
adc ebx, edi
cmp eax, 2
sbb ebx, 0
mov edi, 0x7fffffff
punpckldq xmm0, xmm1
movq qword [esp + 0x38], xmm0
fild qword [esp + 0x38]
fstp qword [esp + 0x30]
mov ebx, ecx
jae 0x558f56
movsd xmm0, qword [0x630300]
jmp 0x558f64
movsd xmm0, qword [esp + 0x30]
divsd xmm0, qword [0x62fcc0]
sub esp, 8
movsd qword [esp], xmm0
call fcn.00590dad
add esp, 8
fstp qword [esp + 0x28]
movsd xmm0, qword [esp + 0x28]
movsd xmm1, qword [0x6302f0]
ucomisd xmm0, xmm1
mov eax, 0
cmovb edi, eax
movsd xmm2, qword [0x6302f8]
ucomisd xmm2, xmm0
maxsd xmm0, xmm1
cvttsd2si esi, xmm0
cmovb esi, edi
add esi, ebx
cmp esi, 0x3c
mov edi, 0x3c
cmovl edi, esi
mov eax, dword [esp + 0xc]
add eax, 4
mov dword [esp + 4], eax
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x558ff5
cmp ebx, edi
mov eax, dword [esp + 0xc]
jge 0x558fdd
inc dword [eax + ebx*4 + 8]
inc ebx
cmp edi, ebx
jne 0x558fd4
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp esi, 0x3d
jl 0x558d93
jmp 0x55914e
push dword [esp + 4]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
jmp 0x558fcc
push eax
call fcn.004f4f20
add esp, 4
jmp 0x558c79
dec dword [eax + 0xa4]
mov ecx, dword [eax + 0x5c]
cmp ecx, dword [eax + 0x60]
je 0x55902b
mov edx, dword [eax + 0xa8]
cmp edx, dword [eax + 0xa0]
jae 0x559036
mov word [eax + 0x78], 0
jmp 0x558c16
movzx ecx, word [ecx + 8]
mov word [eax + 0x78], cx
jmp 0x558c16
movzx eax, al
mov dword [esp + 0x50], 0
lea ecx, [esp + 0xa8]
push 2
lea edx, [esp + 0x54]
push edx
push ecx
push eax
call fcn.00591070
add esp, 0x10
jmp 0x558b94
movzx ecx, al
lea eax, [esp + 0xa8]
lea edx, [esp + 0x50]
mov dword [eax], edx
lea esi, [esp + 0xb4]
mov dword [esi], str.ScopedBlockingCall
lea edx, [esp + 0xa4]
push eax
push esi
call fcn.005b7340
add esp, 8
jmp 0x558b24
push str....._third_partylibc_srcincludeoptional:795:_assertion_this__has_value___failed:_optional_operator_called_on_a_disengaged_value_n
push 0x624e92
call fcn.005912b0
mov ecx, edi
call fcn.004f2270
push edi
call fcn.00564050
add esp, 4
jmp 0x558c4d
mov ebx, dword [0x64b6c8]
mov dword [esp + 0x14], ebx
mov eax, dword [0x64b6cc]
mov dword [esp + 4], eax
push eax
push ebx
push esi
push edi
call fcn.005877d0
mov dword [esp + 8], eax
mov ecx, edx
mov eax, dword [esp + 8]
mul ebx
mov dword [esp + 0x18], eax
mov eax, dword [esp + 8]
mov ebx, eax
imul ebx, dword [esp + 4]
add edx, ebx
imul ebx, ecx, 0xf4240
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x14]
imul ecx, ebx
add ecx, edx
sub edi, dword [esp + 0x18]
sbb esi, ecx
mov ecx, 0xf4240
mul ecx
mov dword [esp + 8], eax
add edx, dword [esp + 0x10]
mov dword [esp + 0x10], edx
mov eax, edi
mul ecx
imul ecx, esi, 0xf4240
add edx, ecx
push dword [esp + 4]
push ebx
push edx
push eax
call fcn.005877d0
mov ecx, edx
add eax, dword [esp + 8]
adc ecx, dword [esp + 0x10]
jmp 0x558d47
mov eax, dword [esp + 0xc]
mov eax, dword [eax + 0x100]
sub esi, edi
xor ebx, ebx
mov dword [esp + 0xc], eax
test eax, eax
jne 0x558fa9
jmp 0x558d93
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 8]
mov eax, dword [esp + 0x10]
sbb eax, dword [esp + 4]
setl al
movzx eax, al
movsd xmm0, qword [eax*8 + 0x6302e0]
jmp 0x558ecd
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], ebx
sub esp, 0xc
movq xmm0, qword [esp + 0x5c]
movq qword [esp + 4], xmm0
lea ebx, [esp + 0xc0]
mov dword [esp], ebx
call fcn.004f2190
add esp, 0xc
mov ebx, dword [ebx]
test ebx, ebx
je 0x558e54
lock dec dword [ebx]
jne 0x558e54
mov ecx, ebx
call fcn.004f2270
push ebx
call fcn.00564050
add esp, 4
jmp 0x558e54