Function at 0x580638
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebp, eax
mov dword [esp + 0x38], edx
xor ebx, ebx
test edx, edx
setne bl
mov dword [esp + 0x3c], ebx
jne 0x580f07
call fcn.0057fccc
lea ebx, [ebp + 0x34]
mov dword [esp + 0x18], ebx
lea ebx, [ebp + 0x20]
mov dword [esp + 0x1c], ebx
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x580741
mov eax, dword [ebp + 0x30]
mov edi, dword [eax + 0x14]
test edi, edi
jne 0x580741
cmp dword [ecx], 0xffffffff
je 0x580741
xor edx, edx
lea esi, [esi]
mov ebx, dword [ecx + 0x20]
mov dword [esp + 0x14], ebx
mov ecx, dword [ecx + 0x14]
test ecx, ecx
jne 0x5806a9
jmp 0x580710
test ebx, ebx
je 0x580710
mov ecx, ebx
mov eax, dword [ebp + 0x30]
mov esi, dword [eax + 0x14]
test esi, esi
jne 0x580710
mov ebx, dword [ecx + 0x10]
cmp dword [ecx], 0x6e
jne 0x5806a0
mov edi, dword [ecx + 8]
mov esi, dword [ecx + 0xc]
cmp edi, esi
je 0x580d33
mov eax, dword [esi + 8]
cmp dword [edi + 0x10], eax
jg 0x5809dc
je 0x5809cf
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.0057f8f8
mov eax, dword [edi + 0x10]
test eax, eax
jne 0x580cfc
lea edx, [edi + 0xc]
mov ecx, esi
mov eax, ebp
call fcn.005803d4
mov edx, edi
mov eax, ebp
call fcn.0057ef60
mov edx, 1
test ebx, ebx
jne 0x5806a4
nop
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x58072f
mov eax, dword [ebp + 0x30]
mov ecx, dword [eax + 0x14]
test ecx, ecx
jne 0x58072f
mov ecx, dword [esp + 0x14]
cmp dword [ecx], 0xffffffff
jne 0x580690
test edx, edx
je 0x580741
mov eax, dword [ebp + 0x30]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x580669
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x580ede
mov eax, dword [ebp + 0x30]
mov ebx, dword [eax + 0x14]
lea ecx, [ebp + 0x34]
mov dword [esp + 0x24], ecx
lea edx, [ebp + 0x20]
mov dword [esp + 0x28], edx
mov ecx, dword [ebp + 0x14]
mov edx, ecx
test ecx, ecx
je 0x580a3e
test ebx, ebx
jne 0x580aa4
mov dword [esp + 0x34], 0
mov edi, ebp
mov ebx, dword [ecx + 0x20]
mov dword [esp + 0x30], ebx
mov ebp, dword [ecx + 0x14]
test ebp, ebp
jne 0x5807af
jmp 0x580e73
mov edx, dword [eax + 0x14]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x580928
mov ebp, dword [esp + 0x14]
test edx, edx
jne 0x580a20
mov ebx, dword [ebp + 0x10]
mov dword [esp + 0x14], ebx
mov edx, dword [ebp]
cmp edx, 0x5e
je 0x5807c3
cmp edx, 0x72
jne 0x580794
mov edx, dword [ebp + 8]
mov dword [esp + 0x20], edx
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x2c], ecx
cmp edx, ecx
je 0x580a0c
mov edx, dword [esp + 0x20]
cmp byte [edx + 4], 0
jne 0x580794
mov eax, dword [edx + 8]
test eax, eax
je 0x580a0c
mov edx, dword [esp + 0x20]
mov ecx, dword [edx + 0x14]
test ecx, ecx
je 0x58083c
mov esi, dword [esp + 0x20]
jmp 0x580812
cmp eax, 0x24
je 0x580824
cmp eax, 0x5e
je 0x580824
nop
mov ecx, ebx
test ebx, ebx
je 0x58083c
mov ebx, dword [ecx + 0x10]
mov eax, dword [ecx]
cmp eax, 0x61
je 0x580824
jle 0x580800
cmp eax, 0x72
jne 0x58080c
nop
cmp esi, dword [ecx + 0xc]
jne 0x58080c
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
mov ecx, ebx
test ebx, ebx
jne 0x580812
mov edx, dword [esp + 0x20]
cmp dword [edx + 0x10], 1
jle 0x58089c
mov eax, edi
call fcn.0057fd60
mov ebx, eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x580797
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0xc]
mov ecx, ebx
mov eax, edi
call fcn.00580528
movsx ecx, word [ebp + 4]
mov eax, dword [esp + 0x2c]
mov dword [esp + 4], eax
mov dword [esp], ebx
mov edx, dword [ebp]
mov eax, edi
call fcn.0057fe80
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
mov ebp, dword [ebx + 0x14]
mov dword [esp + 0x20], ebx
mov edx, dword [esp + 0x20]
mov ebx, dword [edx + 0xc]
lea ecx, [ebp + 4]
mov dword [esp + 0x18], ecx
test ebx, ebx
jne 0x5808bf
jmp 0x5808f0
cmp eax, 3
je 0x58095c
mov ebx, esi
test esi, esi
je 0x5808f0
mov esi, dword [ebx + 0x14]
lea eax, [ebx + 4]
mov dword [esp], eax
mov ecx, dword [ebx]
mov edx, dword [esp + 0x18]
mov eax, dword [ebp]
call fcn.0057fb2c
cmp eax, 1
jne 0x5808b0
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
mov ebx, esi
test esi, esi
jne 0x5808bf
mov edx, dword [esp + 0x20]
add edx, 0xc
mov ecx, dword [esp + 0x2c]
mov eax, edi
call fcn.005803d4
mov edx, dword [esp + 0x20]
mov eax, edi
call fcn.0057fa18
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x5807a3
nop
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x580d4a
mov ecx, dword [esp + 0x30]
test edx, edx
je 0x580780
mov ebp, edi
nop
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x580a3c
mov ebx, edx
mov edx, dword [ebp + 0x14]
jmp 0x580aa4
mov eax, edi
call fcn.0057fd60
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x580797
movsx ecx, word [ebx + 4]
mov eax, dword [esp + 0x2c]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
mov edx, dword [ebx]
mov eax, edi
call fcn.0057fe80
movsx ecx, word [ebp + 4]
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
mov edx, dword [ebp]
mov eax, edi
call fcn.0057fe80
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x580797
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
jmp 0x5808ea
mov edx, dword [esi + 0x10]
cmp dword [edi + 8], edx
jle 0x5806d8
nop
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.0057f8f8
mov eax, dword [esi + 8]
test eax, eax
je 0x580d14
mov edx, dword [esi + 0x14]
mov ecx, edi
mov eax, ebp
call fcn.00580560
mov edx, 1
jmp 0x5806a0
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
jmp 0x58090d
mov ebp, edi
mov ebx, dword [esp + 0x30]
test ebx, ebx
jne 0x580944
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
jne 0x580d5a
mov ebx, edx
test ebx, ebx
jne 0x580aa1
mov edx, dword [ebp]
mov esi, dword [edx + 0x14]
test esi, esi
je 0x580aa1
lea edi, [ebp + 0x34]
lea ebx, [ebp + 0x20]
mov dword [esp + 0x14], ebx
jmp 0x580a5e
mov esi, ebx
test ebx, ebx
je 0x580a9b
mov ebx, dword [esi + 0x10]
cmp dword [esi], 0x5e
jne 0x580a58
movsx eax, word [esi + 4]
movsx ecx, word [ebp + eax*2 + 0x24]
mov eax, dword [esi + 0xc]
mov dword [esp + 4], eax
mov eax, dword [esi + 8]
mov dword [esp], eax
mov edx, 0x70
mov eax, ebp
call fcn.0057fe80
mov ecx, esi
mov edx, edi
mov eax, dword [esp + 0x14]
call fcn.0057f8f8
mov esi, ebx
test ebx, ebx
jne 0x580a5e
mov eax, dword [ebp + 0x30]
mov ebx, dword [eax + 0x14]
mov edx, dword [ebp + 0x14]
lea ecx, [ebp + 0x34]
mov dword [esp + 0x24], ecx
lea ecx, [ebp + 0x20]
mov dword [esp + 0x28], ecx
mov ecx, edx
test ecx, ecx
je 0x580e0c
test ebx, ebx
jne 0x580ca0
mov dword [esp + 0x34], 0
mov edi, ebp
nop
mov ebx, dword [ecx + 0x20]
mov dword [esp + 0x30], ebx
mov ebp, dword [ecx + 0xc]
test ebp, ebp
jne 0x580aff
jmp 0x580e7a
mov edx, dword [eax + 0x14]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x580c78
mov ebp, dword [esp + 0x14]
test edx, edx
jne 0x580df0
mov ebx, dword [ebp + 0x14]
mov dword [esp + 0x14], ebx
mov edx, dword [ebp]
cmp edx, 0x24
je 0x580b13
cmp edx, 0x61
jne 0x580ae4
mov ecx, dword [ebp + 8]
mov dword [esp + 0x2c], ecx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x20], edx
cmp ecx, edx
je 0x580ddc
mov edx, dword [esp + 0x20]
cmp byte [edx + 4], 0
jne 0x580ae4
mov eax, dword [edx + 0x10]
test eax, eax
je 0x580ddc
mov edx, dword [esp + 0x20]
mov ecx, dword [edx + 0xc]
test ecx, ecx
je 0x580b8c
mov esi, dword [esp + 0x20]
jmp 0x580b62
cmp eax, 0x24
je 0x580b74
cmp eax, 0x5e
je 0x580b74
nop
mov ecx, ebx
test ebx, ebx
je 0x580b8c
mov ebx, dword [ecx + 0x14]
mov eax, dword [ecx]
cmp eax, 0x61
je 0x580b74
jle 0x580b50
cmp eax, 0x72
jne 0x580b5c
nop
cmp esi, dword [ecx + 8]
jne 0x580b5c
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
mov ecx, ebx
test ebx, ebx
jne 0x580b62
mov edx, dword [esp + 0x20]
cmp dword [edx + 8], 1
jle 0x580bec
mov eax, edi
call fcn.0057fd60
mov ebx, eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x580ae7
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0x14]
mov ecx, ebx
mov eax, edi
call fcn.00580560
movsx ecx, word [ebp + 4]
mov dword [esp + 4], ebx
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
mov edx, dword [ebp]
mov eax, edi
call fcn.0057fe80
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
mov ebp, dword [ebx + 0xc]
mov dword [esp + 0x20], ebx
mov edx, dword [esp + 0x20]
mov ebx, dword [edx + 0x14]
lea ecx, [ebp + 4]
mov dword [esp + 0x18], ecx
test ebx, ebx
jne 0x580c0f
jmp 0x580c40
cmp eax, 3
je 0x580d68
mov ebx, esi
test esi, esi
je 0x580c40
mov esi, dword [ebx + 0x10]
lea eax, [ebx + 4]
mov dword [esp], eax
mov ecx, dword [ebx]
mov edx, dword [esp + 0x18]
mov eax, dword [ebp]
call fcn.0057fb2c
cmp eax, 1
jne 0x580c00
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
mov ebx, esi
test esi, esi
jne 0x580c0f
mov edx, dword [esp + 0x20]
add edx, 0x14
mov ecx, dword [esp + 0x2c]
mov eax, edi
call fcn.0058042c
mov edx, dword [esp + 0x20]
mov eax, edi
call fcn.0057fa18
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x580af3
nop
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x580e88
mov ecx, dword [esp + 0x30]
test edx, edx
je 0x580ad0
mov ebp, edi
nop
mov esi, dword [esp + 0x34]
test esi, esi
je 0x580f64
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x580eb5
mov eax, ebp
call fcn.0057fccc
mov eax, dword [ebp]
mov ecx, dword [eax + 0x14]
test ecx, ecx
je 0x580f57
mov eax, dword [ecx + 0xc]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x580ce8
mov edx, dword [ebp + 0xc]
cmp dword [eax + 0xc], edx
jne 0x580ce1
jmp 0x580ea8
cmp dword [eax + 0xc], edx
je 0x580ea8
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x580cd8
mov ecx, dword [ecx + 0x10]
test ecx, ecx
jne 0x580cc1
xor eax, eax
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [edi + 0xc]
mov ecx, esi
mov eax, ebp
call fcn.00580528
mov edx, 1
jmp 0x5806a0
lea edx, [esi + 0x14]
mov ecx, edi
mov eax, ebp
call fcn.0058042c
mov edx, esi
mov eax, ebp
call fcn.0057ef60
mov edx, 1
jmp 0x5806a0
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.0057f8f8
mov edx, 1
jmp 0x5806a0
mov ebp, edi
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x580a3c
test edx, edx
je 0x580761
jmp 0x580aa1
mov eax, edi
call fcn.0057fd60
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x580ae7
movsx ecx, word [ebp + 4]
mov eax, dword [ebx + 0xc]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
mov edx, dword [ebp]
mov eax, edi
call fcn.0057fe80
movsx ecx, word [ebx + 4]
mov eax, dword [esp + 0x1c]
mov dword [esp + 4], eax
mov edx, dword [esp + 0x2c]
mov dword [esp], edx
mov edx, dword [ebx]
mov eax, edi
call fcn.0057fe80
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x580ae7
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
jmp 0x580c3a
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.0057f8f8
jmp 0x580c5d
mov ebp, edi
mov edi, dword [esp + 0x30]
test edi, edi
jne 0x580c94
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
jne 0x580e98
test ebx, ebx
jne 0x580ca0
mov eax, dword [ebp + 0xc]
mov ebx, dword [eax + 0xc]
test ebx, ebx
je 0x580ca0
lea edi, [ebp + 0x34]
lea ecx, [ebp + 0x20]
mov dword [esp + 0x14], ecx
jmp 0x580e3a
mov ebx, esi
test esi, esi
je 0x580ca0
mov esi, dword [ebx + 0x14]
cmp dword [ebx], 0x24
jne 0x580e30
movsx eax, word [ebx + 4]
movsx ecx, word [ebp + eax*2 + 0x28]
mov eax, dword [ebx + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
mov edx, 0x70
mov eax, ebp
call fcn.0057fe80
mov ecx, ebx
mov edx, edi
mov eax, dword [esp + 0x14]
call fcn.0057f8f8
jmp 0x580e30
xor edx, edx
jmp 0x580928
xor edx, edx
mov ebx, dword [esp + 0x30]
test ebx, ebx
jne 0x580c84
mov ebp, edi
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x580e0c
test edx, edx
jne 0x580ca0
mov ecx, dword [ebp + 0x14]
jmp 0x580ab4
mov eax, 0x800
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x38]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x10
mov dword [esp + 4], 1
mov dword [esp], str._nfinal_cleanup:_n
call sub.msvcrt.dll_fwrite
jmp 0x580cac
mov edx, dword [esp + 0x38]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0xe
mov dword [esp + 4], 1
mov dword [esp], str._nconstraints:_n
call sub.msvcrt.dll_fwrite
jmp 0x58074d
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x12
mov dword [esp + 4], 1
mov dword [esp], str._ninitial_cleanup:_n
call sub.msvcrt.dll_fwrite
mov eax, ebp
call fcn.0057fccc
mov edx, dword [esp + 0x38]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0xa
mov dword [esp + 4], 1
mov dword [esp], str._nempties:_n
call sub.msvcrt.dll_fwrite
jmp 0x58065b
mov eax, 0x1000
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, edx
jmp 0x580e0c