Function at 0x401940
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov edx, dword [eax]
mov dword [ebp - 0x1c], eax
mov eax, 0xf8
cmp edx, 1
je 0x401963
xor eax, eax
cmp edx, 2
sete al
shl eax, 2
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], 0
mov ebx, dword [edx + 8]
test ebx, ebx
jle 0x401b46
not eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x20], eax
nop
lea esi, [esi]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov eax, dword [ecx + 4]
mov eax, dword [eax + edx*4]
mov ecx, dword [eax + 0x28]
mov dword [ebp - 0x10], eax
test ecx, ecx
je 0x401b75
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x10]
mov eax, dword [edx + 0xc]
mov edx, dword [ecx + 0x14]
test edx, eax
je 0x401a17
xor esi, esi
jmp 0x4019ce
add esi, 1
cmp esi, 8
je 0x401a10
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ecx + 0xc]
and eax, edx
mov ecx, esi
sar eax, cl
test al, 1
je 0x4019c0
mov ebx, dword [esi*4 + 0x417020]
add esi, 1
call sub.cygwin1.dll___getreent
mov edx, dword [ebp - 0x18]
mov dword [esp + 4], str.ERR:__Multiple_definitions_for_entry__s__2nd_occurance_in_PGC__d_n
mov dword [esp + 8], ebx
mov dword [esp + 0xc], edx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ecx, dword [ebp - 0x10]
cmp esi, 8
mov edx, dword [ecx + 0x14]
jne 0x4019c8
mov dword [ebp - 0x14], 1
test dword [ebp - 0x20], edx
je 0x401a7d
xor edi, edi
jmp 0x401a28
add edi, 1
cmp edi, 8
je 0x401a76
mov eax, dword [ebp - 0x20]
mov ecx, edi
and eax, edx
sar eax, cl
test al, 1
je 0x401a20
mov edx, dword [ebp - 0x1c]
mov esi, dword [edi*4 + 0x417020]
add edi, 1
mov eax, dword [edx]
mov ebx, dword [eax*4 + 0x417044]
call sub.cygwin1.dll___getreent
mov dword [esp + 8], esi
mov dword [esp + 4], str.ERR:__Entry__s_is_not_allowed_for_menu_type__s_n
mov dword [esp + 0xc], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ecx, dword [ebp - 0x10]
cmp edi, 8
mov edx, dword [ecx + 0x14]
jne 0x401a28
mov dword [ebp - 0x14], 1
mov eax, dword [ebp - 0x1c]
or dword [eax + 0xc], edx
mov edx, dword [ebp - 0x10]
cmp dword [edx], 0
je 0x401b33
jle 0x401b33
xor esi, esi
mov edi, 1
jmp 0x401aed
test edi, edi
je 0x401ae3
mov eax, dword [eax + 8]
xor edi, edi
cmp dword [eax + 0x10], 1
je 0x401ae3
call sub.cygwin1.dll___getreent
mov ecx, dword [ebp - 0x18]
xor edi, edi
mov dword [esp + 4], str.WARN:_First_cell_is_not_marked_as_a_chapter_in_PGC__d__setting_chapter_flag_n
mov dword [esp + 8], ecx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x1c]
mov eax, dword [eax + ebx]
mov eax, dword [eax + 8]
mov dword [eax + 0x10], 1
mov ecx, dword [ebp - 0x10]
add esi, 1
cmp dword [ecx], esi
jle 0x401b33
mov ecx, dword [ebp - 0x10]
lea ebx, [esi*4]
mov eax, dword [ecx + 0x1c]
mov eax, dword [eax + esi*4]
mov edx, dword [eax + 4]
test edx, edx
jne 0x401aa0
mov ebx, dword [eax]
add esi, 1
call sub.cygwin1.dll___getreent
mov edx, dword [ebp - 0x18]
mov dword [esp + 4], str.WARN:_Source_has_no_cells___s__in_PGC__d_n
mov dword [esp + 8], ebx
mov dword [esp + 0xc], edx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov ecx, dword [ebp - 0x10]
cmp dword [ecx], esi
jg 0x401aed
mov edx, dword [ebp - 0x1c]
add dword [ebp - 0x18], 1
mov eax, dword [ebp - 0x18]
cmp dword [edx + 8], eax
jg 0x401990
mov edx, 1
xor eax, eax
lea esi, [esi]
mov ecx, dword [ebp - 0x1c]
test dword [ecx + 0xc], edx
je 0x401b5c
add dword [ecx + 0x10], 1
add eax, 1
add edx, edx
cmp eax, 8
jne 0x401b50
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x401b9d
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [eax]
test edx, edx
je 0x4019aa
mov eax, dword [eax + 0x1c]
mov edx, dword [eax + edx*4 - 4]
mov eax, dword [edx + 4]
mov edx, dword [edx + 8]
lea eax, [eax + eax*4 - 5]
mov dword [edx + eax*8 + 0x14], 0xff
jmp 0x4019aa
mov dword [esp], 1
call sub.cygwin1.dll_exit
lea esi, [esi]