Function at 0x582d38
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 0x583607
call fcn.005823cc
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 0x582e41
mov eax, dword [ebp + 0x30]
mov edi, dword [eax + 0x14]
test edi, edi
jne 0x582e41
cmp dword [ecx], 0xffffffff
je 0x582e41
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 0x582da9
jmp 0x582e10
test ebx, ebx
je 0x582e10
mov ecx, ebx
mov eax, dword [ebp + 0x30]
mov esi, dword [eax + 0x14]
test esi, esi
jne 0x582e10
mov ebx, dword [ecx + 0x10]
cmp dword [ecx], 0x6e
jne 0x582da0
mov edi, dword [ecx + 8]
mov esi, dword [ecx + 0xc]
cmp edi, esi
je 0x583433
mov eax, dword [esi + 8]
cmp dword [edi + 0x10], eax
jg 0x5830dc
je 0x5830cf
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.00581ff8
mov eax, dword [edi + 0x10]
test eax, eax
jne 0x5833fc
lea edx, [edi + 0xc]
mov ecx, esi
mov eax, ebp
call fcn.00582ad4
mov edx, edi
mov eax, ebp
call fcn.00581660
mov edx, 1
test ebx, ebx
jne 0x582da4
nop
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x582e2f
mov eax, dword [ebp + 0x30]
mov ecx, dword [eax + 0x14]
test ecx, ecx
jne 0x582e2f
mov ecx, dword [esp + 0x14]
cmp dword [ecx], 0xffffffff
jne 0x582d90
test edx, edx
je 0x582e41
mov eax, dword [ebp + 0x30]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x582d69
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x5835de
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 0x58313e
test ebx, ebx
jne 0x5831a4
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 0x582eaf
jmp 0x583573
mov edx, dword [eax + 0x14]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x583028
mov ebp, dword [esp + 0x14]
test edx, edx
jne 0x583120
mov ebx, dword [ebp + 0x10]
mov dword [esp + 0x14], ebx
mov edx, dword [ebp]
cmp edx, 0x5e
je 0x582ec3
cmp edx, 0x72
jne 0x582e94
mov edx, dword [ebp + 8]
mov dword [esp + 0x20], edx
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x2c], ecx
cmp edx, ecx
je 0x58310c
mov edx, dword [esp + 0x20]
cmp byte [edx + 4], 0
jne 0x582e94
mov eax, dword [edx + 8]
test eax, eax
je 0x58310c
mov edx, dword [esp + 0x20]
mov ecx, dword [edx + 0x14]
test ecx, ecx
je 0x582f3c
mov esi, dword [esp + 0x20]
jmp 0x582f12
cmp eax, 0x24
je 0x582f24
cmp eax, 0x5e
je 0x582f24
nop
mov ecx, ebx
test ebx, ebx
je 0x582f3c
mov ebx, dword [ecx + 0x10]
mov eax, dword [ecx]
cmp eax, 0x61
je 0x582f24
jle 0x582f00
cmp eax, 0x72
jne 0x582f0c
nop
cmp esi, dword [ecx + 0xc]
jne 0x582f0c
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
mov ecx, ebx
test ebx, ebx
jne 0x582f12
mov edx, dword [esp + 0x20]
cmp dword [edx + 0x10], 1
jle 0x582f9c
mov eax, edi
call fcn.00582460
mov ebx, eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582e97
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0xc]
mov ecx, ebx
mov eax, edi
call fcn.00582c28
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.00582580
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
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 0x582fbf
jmp 0x582ff0
cmp eax, 3
je 0x58305c
mov ebx, esi
test esi, esi
je 0x582ff0
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.0058222c
cmp eax, 1
jne 0x582fb0
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
mov ebx, esi
test esi, esi
jne 0x582fbf
mov edx, dword [esp + 0x20]
add edx, 0xc
mov ecx, dword [esp + 0x2c]
mov eax, edi
call fcn.00582ad4
mov edx, dword [esp + 0x20]
mov eax, edi
call fcn.00582118
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x582ea3
nop
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x58344a
mov ecx, dword [esp + 0x30]
test edx, edx
je 0x582e80
mov ebp, edi
nop
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x58313c
mov ebx, edx
mov edx, dword [ebp + 0x14]
jmp 0x5831a4
mov eax, edi
call fcn.00582460
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582e97
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.00582580
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.00582580
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582e97
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
jmp 0x582fea
mov edx, dword [esi + 0x10]
cmp dword [edi + 8], edx
jle 0x582dd8
nop
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.00581ff8
mov eax, dword [esi + 8]
test eax, eax
je 0x583414
mov edx, dword [esi + 0x14]
mov ecx, edi
mov eax, ebp
call fcn.00582c60
mov edx, 1
jmp 0x582da0
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
jmp 0x58300d
mov ebp, edi
mov ebx, dword [esp + 0x30]
test ebx, ebx
jne 0x583044
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
jne 0x58345a
mov ebx, edx
test ebx, ebx
jne 0x5831a1
mov edx, dword [ebp]
mov esi, dword [edx + 0x14]
test esi, esi
je 0x5831a1
lea edi, [ebp + 0x34]
lea ebx, [ebp + 0x20]
mov dword [esp + 0x14], ebx
jmp 0x58315e
mov esi, ebx
test ebx, ebx
je 0x58319b
mov ebx, dword [esi + 0x10]
cmp dword [esi], 0x5e
jne 0x583158
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.00582580
mov ecx, esi
mov edx, edi
mov eax, dword [esp + 0x14]
call fcn.00581ff8
mov esi, ebx
test ebx, ebx
jne 0x58315e
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 0x58350c
test ebx, ebx
jne 0x5833a0
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 0x5831ff
jmp 0x58357a
mov edx, dword [eax + 0x14]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x583378
mov ebp, dword [esp + 0x14]
test edx, edx
jne 0x5834f0
mov ebx, dword [ebp + 0x14]
mov dword [esp + 0x14], ebx
mov edx, dword [ebp]
cmp edx, 0x24
je 0x583213
cmp edx, 0x61
jne 0x5831e4
mov ecx, dword [ebp + 8]
mov dword [esp + 0x2c], ecx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x20], edx
cmp ecx, edx
je 0x5834dc
mov edx, dword [esp + 0x20]
cmp byte [edx + 4], 0
jne 0x5831e4
mov eax, dword [edx + 0x10]
test eax, eax
je 0x5834dc
mov edx, dword [esp + 0x20]
mov ecx, dword [edx + 0xc]
test ecx, ecx
je 0x58328c
mov esi, dword [esp + 0x20]
jmp 0x583262
cmp eax, 0x24
je 0x583274
cmp eax, 0x5e
je 0x583274
nop
mov ecx, ebx
test ebx, ebx
je 0x58328c
mov ebx, dword [ecx + 0x14]
mov eax, dword [ecx]
cmp eax, 0x61
je 0x583274
jle 0x583250
cmp eax, 0x72
jne 0x58325c
nop
cmp esi, dword [ecx + 8]
jne 0x58325c
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
mov ecx, ebx
test ebx, ebx
jne 0x583262
mov edx, dword [esp + 0x20]
cmp dword [edx + 8], 1
jle 0x5832ec
mov eax, edi
call fcn.00582460
mov ebx, eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x5831e7
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0x14]
mov ecx, ebx
mov eax, edi
call fcn.00582c60
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.00582580
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
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 0x58330f
jmp 0x583340
cmp eax, 3
je 0x583468
mov ebx, esi
test esi, esi
je 0x583340
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.0058222c
cmp eax, 1
jne 0x583300
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
mov ebx, esi
test esi, esi
jne 0x58330f
mov edx, dword [esp + 0x20]
add edx, 0x14
mov ecx, dword [esp + 0x2c]
mov eax, edi
call fcn.00582b2c
mov edx, dword [esp + 0x20]
mov eax, edi
call fcn.00582118
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x5831f3
nop
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x583588
mov ecx, dword [esp + 0x30]
test edx, edx
je 0x5831d0
mov ebp, edi
nop
mov esi, dword [esp + 0x34]
test esi, esi
je 0x583664
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x5835b5
mov eax, ebp
call fcn.005823cc
mov eax, dword [ebp]
mov ecx, dword [eax + 0x14]
test ecx, ecx
je 0x583657
mov eax, dword [ecx + 0xc]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x5833e8
mov edx, dword [ebp + 0xc]
cmp dword [eax + 0xc], edx
jne 0x5833e1
jmp 0x5835a8
cmp dword [eax + 0xc], edx
je 0x5835a8
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x5833d8
mov ecx, dword [ecx + 0x10]
test ecx, ecx
jne 0x5833c1
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.00582c28
mov edx, 1
jmp 0x582da0
lea edx, [esi + 0x14]
mov ecx, edi
mov eax, ebp
call fcn.00582b2c
mov edx, esi
mov eax, ebp
call fcn.00581660
mov edx, 1
jmp 0x582da0
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.00581ff8
mov edx, 1
jmp 0x582da0
mov ebp, edi
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x58313c
test edx, edx
je 0x582e61
jmp 0x5831a1
mov eax, edi
call fcn.00582460
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x5831e7
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.00582580
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.00582580
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x5831e7
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
jmp 0x58333a
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581ff8
jmp 0x58335d
mov ebp, edi
mov edi, dword [esp + 0x30]
test edi, edi
jne 0x583394
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
jne 0x583598
test ebx, ebx
jne 0x5833a0
mov eax, dword [ebp + 0xc]
mov ebx, dword [eax + 0xc]
test ebx, ebx
je 0x5833a0
lea edi, [ebp + 0x34]
lea ecx, [ebp + 0x20]
mov dword [esp + 0x14], ecx
jmp 0x58353a
mov ebx, esi
test esi, esi
je 0x5833a0
mov esi, dword [ebx + 0x14]
cmp dword [ebx], 0x24
jne 0x583530
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.00582580
mov ecx, ebx
mov edx, edi
mov eax, dword [esp + 0x14]
call fcn.00581ff8
jmp 0x583530
xor edx, edx
jmp 0x583028
xor edx, edx
mov ebx, dword [esp + 0x30]
test ebx, ebx
jne 0x583384
mov ebp, edi
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x58350c
test edx, edx
jne 0x5833a0
mov ecx, dword [ebp + 0x14]
jmp 0x5831b4
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 0x5833ac
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 0x582e4d
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.005823cc
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 0x582d5b
mov eax, 0x1000
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, edx
jmp 0x58350c