Function at 0x5821b4
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 0x582a83
call fcn.00581848
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 0x5822bd
mov eax, dword [ebp + 0x30]
mov edi, dword [eax + 0x14]
test edi, edi
jne 0x5822bd
cmp dword [ecx], 0xffffffff
je 0x5822bd
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 0x582225
jmp 0x58228c
test ebx, ebx
je 0x58228c
mov ecx, ebx
mov eax, dword [ebp + 0x30]
mov esi, dword [eax + 0x14]
test esi, esi
jne 0x58228c
mov ebx, dword [ecx + 0x10]
cmp dword [ecx], 0x6e
jne 0x58221c
mov edi, dword [ecx + 8]
mov esi, dword [ecx + 0xc]
cmp edi, esi
je 0x5828af
mov eax, dword [esi + 8]
cmp dword [edi + 0x10], eax
jg 0x582558
je 0x58254b
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.00581474
mov eax, dword [edi + 0x10]
test eax, eax
jne 0x582878
lea edx, [edi + 0xc]
mov ecx, esi
mov eax, ebp
call fcn.00581f50
mov edx, edi
mov eax, ebp
call fcn.00580adc
mov edx, 1
test ebx, ebx
jne 0x582220
nop
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x5822ab
mov eax, dword [ebp + 0x30]
mov ecx, dword [eax + 0x14]
test ecx, ecx
jne 0x5822ab
mov ecx, dword [esp + 0x14]
cmp dword [ecx], 0xffffffff
jne 0x58220c
test edx, edx
je 0x5822bd
mov eax, dword [ebp + 0x30]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x5821e5
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x582a5a
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 0x5825ba
test ebx, ebx
jne 0x582620
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 0x58232b
jmp 0x5829ef
mov edx, dword [eax + 0x14]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x5824a4
mov ebp, dword [esp + 0x14]
test edx, edx
jne 0x58259c
mov ebx, dword [ebp + 0x10]
mov dword [esp + 0x14], ebx
mov edx, dword [ebp]
cmp edx, 0x5e
je 0x58233f
cmp edx, 0x72
jne 0x582310
mov edx, dword [ebp + 8]
mov dword [esp + 0x20], edx
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x2c], ecx
cmp edx, ecx
je 0x582588
mov edx, dword [esp + 0x20]
cmp byte [edx + 4], 0
jne 0x582310
mov eax, dword [edx + 8]
test eax, eax
je 0x582588
mov edx, dword [esp + 0x20]
mov ecx, dword [edx + 0x14]
test ecx, ecx
je 0x5823b8
mov esi, dword [esp + 0x20]
jmp 0x58238e
cmp eax, 0x24
je 0x5823a0
cmp eax, 0x5e
je 0x5823a0
nop
mov ecx, ebx
test ebx, ebx
je 0x5823b8
mov ebx, dword [ecx + 0x10]
mov eax, dword [ecx]
cmp eax, 0x61
je 0x5823a0
jle 0x58237c
cmp eax, 0x72
jne 0x582388
nop
cmp esi, dword [ecx + 0xc]
jne 0x582388
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
mov ecx, ebx
test ebx, ebx
jne 0x58238e
mov edx, dword [esp + 0x20]
cmp dword [edx + 0x10], 1
jle 0x582418
mov eax, edi
call fcn.005818dc
mov ebx, eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582313
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0xc]
mov ecx, ebx
mov eax, edi
call fcn.005820a4
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.005819fc
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
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 0x58243b
jmp 0x58246c
cmp eax, 3
je 0x5824d8
mov ebx, esi
test esi, esi
je 0x58246c
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.005816a8
cmp eax, 1
jne 0x58242c
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
mov ebx, esi
test esi, esi
jne 0x58243b
mov edx, dword [esp + 0x20]
add edx, 0xc
mov ecx, dword [esp + 0x2c]
mov eax, edi
call fcn.00581f50
mov edx, dword [esp + 0x20]
mov eax, edi
call fcn.00581594
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x58231f
nop
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x5828c6
mov ecx, dword [esp + 0x30]
test edx, edx
je 0x5822fc
mov ebp, edi
nop
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x5825b8
mov ebx, edx
mov edx, dword [ebp + 0x14]
jmp 0x582620
mov eax, edi
call fcn.005818dc
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582313
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.005819fc
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.005819fc
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582313
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
jmp 0x582466
mov edx, dword [esi + 0x10]
cmp dword [edi + 8], edx
jle 0x582254
nop
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.00581474
mov eax, dword [esi + 8]
test eax, eax
je 0x582890
mov edx, dword [esi + 0x14]
mov ecx, edi
mov eax, ebp
call fcn.005820dc
mov edx, 1
jmp 0x58221c
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
jmp 0x582489
mov ebp, edi
mov ebx, dword [esp + 0x30]
test ebx, ebx
jne 0x5824c0
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
jne 0x5828d6
mov ebx, edx
test ebx, ebx
jne 0x58261d
mov edx, dword [ebp]
mov esi, dword [edx + 0x14]
test esi, esi
je 0x58261d
lea edi, [ebp + 0x34]
lea ebx, [ebp + 0x20]
mov dword [esp + 0x14], ebx
jmp 0x5825da
mov esi, ebx
test ebx, ebx
je 0x582617
mov ebx, dword [esi + 0x10]
cmp dword [esi], 0x5e
jne 0x5825d4
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.005819fc
mov ecx, esi
mov edx, edi
mov eax, dword [esp + 0x14]
call fcn.00581474
mov esi, ebx
test ebx, ebx
jne 0x5825da
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 0x582988
test ebx, ebx
jne 0x58281c
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 0x58267b
jmp 0x5829f6
mov edx, dword [eax + 0x14]
mov esi, dword [esp + 0x14]
test esi, esi
je 0x5827f4
mov ebp, dword [esp + 0x14]
test edx, edx
jne 0x58296c
mov ebx, dword [ebp + 0x14]
mov dword [esp + 0x14], ebx
mov edx, dword [ebp]
cmp edx, 0x24
je 0x58268f
cmp edx, 0x61
jne 0x582660
mov ecx, dword [ebp + 8]
mov dword [esp + 0x2c], ecx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x20], edx
cmp ecx, edx
je 0x582958
mov edx, dword [esp + 0x20]
cmp byte [edx + 4], 0
jne 0x582660
mov eax, dword [edx + 0x10]
test eax, eax
je 0x582958
mov edx, dword [esp + 0x20]
mov ecx, dword [edx + 0xc]
test ecx, ecx
je 0x582708
mov esi, dword [esp + 0x20]
jmp 0x5826de
cmp eax, 0x24
je 0x5826f0
cmp eax, 0x5e
je 0x5826f0
nop
mov ecx, ebx
test ebx, ebx
je 0x582708
mov ebx, dword [ecx + 0x14]
mov eax, dword [ecx]
cmp eax, 0x61
je 0x5826f0
jle 0x5826cc
cmp eax, 0x72
jne 0x5826d8
nop
cmp esi, dword [ecx + 8]
jne 0x5826d8
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
mov ecx, ebx
test ebx, ebx
jne 0x5826de
mov edx, dword [esp + 0x20]
cmp dword [edx + 8], 1
jle 0x582768
mov eax, edi
call fcn.005818dc
mov ebx, eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582663
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0x14]
mov ecx, ebx
mov eax, edi
call fcn.005820dc
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.005819fc
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
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 0x58278b
jmp 0x5827bc
cmp eax, 3
je 0x5828e4
mov ebx, esi
test esi, esi
je 0x5827bc
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.005816a8
cmp eax, 1
jne 0x58277c
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
mov ebx, esi
test esi, esi
jne 0x58278b
mov edx, dword [esp + 0x20]
add edx, 0x14
mov ecx, dword [esp + 0x2c]
mov eax, edi
call fcn.00581fa8
mov edx, dword [esp + 0x20]
mov eax, edi
call fcn.00581594
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x14]
test esi, esi
jne 0x58266f
nop
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x582a04
mov ecx, dword [esp + 0x30]
test edx, edx
je 0x58264c
mov ebp, edi
nop
mov esi, dword [esp + 0x34]
test esi, esi
je 0x582ae0
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x582a31
mov eax, ebp
call fcn.00581848
mov eax, dword [ebp]
mov ecx, dword [eax + 0x14]
test ecx, ecx
je 0x582ad3
mov eax, dword [ecx + 0xc]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x582864
mov edx, dword [ebp + 0xc]
cmp dword [eax + 0xc], edx
jne 0x58285d
jmp 0x582a24
cmp dword [eax + 0xc], edx
je 0x582a24
mov eax, dword [eax + 0x10]
test eax, eax
jne 0x582854
mov ecx, dword [ecx + 0x10]
test ecx, ecx
jne 0x58283d
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.005820a4
mov edx, 1
jmp 0x58221c
lea edx, [esi + 0x14]
mov ecx, edi
mov eax, ebp
call fcn.00581fa8
mov edx, esi
mov eax, ebp
call fcn.00580adc
mov edx, 1
jmp 0x58221c
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
call fcn.00581474
mov edx, 1
jmp 0x58221c
mov ebp, edi
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x5825b8
test edx, edx
je 0x5822dd
jmp 0x58261d
mov eax, edi
call fcn.005818dc
mov dword [esp + 0x1c], eax
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582663
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.005819fc
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.005819fc
mov eax, dword [edi + 0x30]
mov edx, dword [eax + 0x14]
test edx, edx
jne 0x582663
mov ecx, ebx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
jmp 0x5827b6
mov ecx, ebp
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
call fcn.00581474
jmp 0x5827d9
mov ebp, edi
mov edi, dword [esp + 0x30]
test edi, edi
jne 0x582810
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
jne 0x582a14
test ebx, ebx
jne 0x58281c
mov eax, dword [ebp + 0xc]
mov ebx, dword [eax + 0xc]
test ebx, ebx
je 0x58281c
lea edi, [ebp + 0x34]
lea ecx, [ebp + 0x20]
mov dword [esp + 0x14], ecx
jmp 0x5829b6
mov ebx, esi
test esi, esi
je 0x58281c
mov esi, dword [ebx + 0x14]
cmp dword [ebx], 0x24
jne 0x5829ac
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.005819fc
mov ecx, ebx
mov edx, edi
mov eax, dword [esp + 0x14]
call fcn.00581474
jmp 0x5829ac
xor edx, edx
jmp 0x5824a4
xor edx, edx
mov ebx, dword [esp + 0x30]
test ebx, ebx
jne 0x582800
mov ebp, edi
mov ebx, edx
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x582988
test edx, edx
jne 0x58281c
mov ecx, dword [ebp + 0x14]
jmp 0x582630
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 0x582828
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 0x5822c9
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.00581848
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 0x5821d7
mov eax, 0x1000
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, edx
jmp 0x582988