Function at 0x40d840
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x56e155
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xe4
push ebx
push ebp
push esi
mov ebp, ecx
xor ebx, ebx
mov dword [esp + 0xc], ebx
mov eax, dword [ebp]
push edi
xor esi, esi
call dword [eax + 0xc]
lea ecx, [esp + 0x54]
mov dword [ebp + 0x70], esi
mov dword [ebp + 0x5c], esi
mov dword [ebp + 0x68], esi
mov byte [ebp + 0x60], bl
mov byte [ebp + 0x6c], bl
call fcn.004a4fb0
mov edi, dword [esp + 0x104]
push edi
lea ecx, [esp + 0x58]
mov dword [esp + 0x100], esi
call fcn.004a6aa0
test eax, eax
je 0x40d8c1
lea ecx, [esp + 0x54]
mov dword [esp + 0xfc], 0xffffffff
call fcn.004a4fe0
mov eax, 1
jmp 0x40e379
lea ecx, [esp + 0x48]
push edi
push ecx
call fcn.004accf0
add esp, 8
mov eax, 1
lea edx, [esp + 0x18]
xor edi, edi
push edx
lea ecx, [esp + 0x58]
mov byte [esp + 0x100], al
mov dword [esp + 0x74], esi
mov dword [esp + 0x78], esi
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], esi
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov byte [esp + 0x2f], 0
mov byte [esp + 0x1b], 0
mov dword [esp + 0x48], edi
mov dword [esp + 0x44], esi
mov byte [ebp + 0x6d], 0
call fcn.004a4e30
mov ecx, dword [esp + 0x18]
cmp ecx, esi
mov byte [esp + 0xfc], 2
je 0x40e1d8
call fcn.0040e3a0
mov edx, dword [eax]
mov dword [esp + 0x2c], eax
mov eax, dword [eax + 4]
sub eax, edx
cmp eax, 8
mov dword [esp + 0x10], eax
jne 0x40dcb1
mov ecx, 2
mov edi, str.filename
mov esi, edx
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
jne 0x40dcad
mov ecx, dword [esp + 0x48]
cmp ecx, dword [esp + 0x4c]
lea edx, [esp + 0x17]
push edx
push 0x57e638
jne 0x40d9cb
lea ecx, [esp + 0xb0]
or ebx, 1
call fcn.00402250
lea eax, [esp + 0xa8]
push eax
push 0
lea ecx, [esp + 0xcc]
push ecx
mov ecx, dword [esp + 0x24]
or ebx, 2
mov byte [esp + 0x108], 3
mov dword [esp + 0x1c], ebx
call fcn.004a59e0
mov dword [esp + 0xfc], 4
or ebx, 4
jmp 0x40da6b
or ebx, 8
lea ecx, [esp + 0xa4]
mov dword [esp + 0x18], ebx
call fcn.00402250
lea eax, [esp + 0x9c]
push eax
push 0
lea ecx, [esp + 0xe4]
push ecx
mov ecx, dword [esp + 0x24]
or ebx, 0x10
mov dword [esp + 0x108], 5
mov dword [esp + 0x1c], ebx
call fcn.004a59e0
mov esi, eax
push 0x57ed04
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0xf0]
or ebx, 0x20
push eax
mov dword [esp + 0x108], 6
mov dword [esp + 0x1c], ebx
call fcn.0040c800
push esi
push eax
lea ecx, [esp + 0xe4]
or ebx, 0x40
push ecx
mov dword [esp + 0x114], 7
mov dword [esp + 0x28], ebx
call fcn.0040c910
add esp, 0x18
mov dword [esp + 0xfc], 8
or ebx, 0x80
push eax
lea ecx, [esp + 0x84]
mov dword [esp + 0x14], ebx
call fcn.00404140
test bl, bl
mov dword [esp + 0xfc], 0xd
jns 0x40dac5
mov ecx, dword [esp + 0xd0]
mov eax, dword [esp + 0xd8]
and ebx, 0xffffff7f
sub eax, ecx
test ecx, ecx
mov dword [esp + 0x10], ebx
je 0x40dac5
cmp eax, 0x80
jbe 0x40dabb
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40dac5
push eax
push ecx
call fcn.0050e390
add esp, 8
test bl, 0x40
mov dword [esp + 0xfc], 0xc
je 0x40db0c
mov ecx, dword [esp + 0xe8]
mov eax, dword [esp + 0xf0]
and ebx, 0xffffffbf
sub eax, ecx
test ecx, ecx
mov dword [esp + 0x10], ebx
je 0x40db0c
cmp eax, 0x80
jbe 0x40db02
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40db0c
push eax
push ecx
call fcn.0050e390
add esp, 8
test bl, 0x20
mov dword [esp + 0xfc], 0xb
je 0x40db53
mov ecx, dword [esp + 0xdc]
mov eax, dword [esp + 0xe4]
and ebx, 0xffffffdf
sub eax, ecx
test ecx, ecx
mov dword [esp + 0x10], ebx
je 0x40db53
cmp eax, 0x80
jbe 0x40db49
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40db53
push eax
push ecx
call fcn.0050e390
add esp, 8
test bl, 0x10
mov dword [esp + 0xfc], 0xa
je 0x40db9a
mov ecx, dword [esp + 0x9c]
mov eax, dword [esp + 0xa4]
and ebx, 0xffffffef
sub eax, ecx
test ecx, ecx
mov dword [esp + 0x10], ebx
je 0x40db9a
cmp eax, 0x80
jbe 0x40db90
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40db9a
push eax
push ecx
call fcn.0050e390
add esp, 8
test bl, 8
je 0x40dba2
and ebx, 0xfffffff7
test bl, 4
mov byte [esp + 0xfc], 0xf
je 0x40dbe6
mov ecx, dword [esp + 0xc4]
mov eax, dword [esp + 0xcc]
and ebx, 0xfffffffb
sub eax, ecx
test ecx, ecx
mov dword [esp + 0x10], ebx
je 0x40dbe6
cmp eax, 0x80
jbe 0x40dbdc
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40dbe6
push eax
push ecx
call fcn.0050e390
add esp, 8
test bl, 2
mov dword [esp + 0xfc], 0xe
je 0x40dc29
mov ecx, dword [esp + 0xa8]
mov eax, dword [esp + 0xb0]
and ebx, 0xfffffffd
sub eax, ecx
test ecx, ecx
je 0x40dc29
cmp eax, 0x80
jbe 0x40dc1f
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40dc29
push eax
push ecx
call fcn.0050e390
add esp, 8
test bl, 1
je 0x40dc31
and ebx, 0xfffffffe
lea edx, [esp + 0x80]
push edx
mov ecx, ebp
call fcn.004a77e0
test eax, eax
jne 0x40e2e1
mov esi, dword [ebp + 4]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 8]
mov edx, dword [esi]
mov ecx, esi
mov edi, eax
call dword [edx + 4]
mov ecx, dword [esp + 0x80]
mov dword [esp + 0x94], eax
mov eax, dword [esp + 0x88]
sub eax, ecx
test ecx, ecx
mov dword [esp + 0x98], edi
mov byte [esp + 0xfc], 2
je 0x40e19b
cmp eax, 0x80
jbe 0x40dc9e
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40e19b
push eax
push ecx
call fcn.0050e390
add esp, 8
jmp 0x40e19b
mov eax, dword [esp + 0x10]
cmp eax, 3
jne 0x40dead
mov ecx, eax
mov edi, 0x57ed00
mov esi, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40dd2d
mov ecx, dword [esp + 0x18]
push eax
push 3
mov esi, ecx
mov edi, ecx
mov dword [esp + 0x18], ecx
call fcn.004a4da0
push 0
push 2
mov ecx, esi
mov dword [esp + 0x28], eax
call fcn.004a4da0
push 0
push 1
mov ecx, edi
mov esi, eax
call fcn.004a4da0
mov ecx, dword [esp + 0x10]
push 0
push 0
mov edi, eax
call fcn.004a4da0
mov ecx, dword [esp + 0x20]
mov dword [esp + 0xb4], eax
mov dword [esp + 0xb8], edi
mov dword [esp + 0xbc], esi
mov dword [esp + 0xc0], ecx
jmp 0x40e19b
mov eax, dword [esp + 0x10]
cmp eax, 3
jne 0x40dead
mov ecx, eax
mov edi, 0x57ecfc
mov esi, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40dea9
mov ecx, dword [esp + 0x18]
push eax
push eax
call fcn.004a4da0
mov ecx, dword [ebp + 0x30]
lea esi, [ebp + 0x2c]
mov edi, eax
sub ecx, dword [esi]
sar ecx, 4
cmp edi, ecx
jb 0x40dd74
lea edx, [edi + 1]
push edx
mov ecx, esi
call fcn.0040ca10
mov ecx, dword [esp + 0x18]
push 0
push 1
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
push 0
push 2
fstp dword [esp + 0x18]
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
push 0
push 3
fstp dword [esp + 0x38]
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
push 0
push 4
fstp dword [esp + 0x3c]
call fcn.004a4da0
mov ecx, dword [ebp + 4]
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
mov eax, dword [ecx]
fstp dword [esp + 0x24]
call dword [eax + 4]
test eax, eax
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
jge 0x40ddf2
fadd dword [0x57ecf8]
mov ecx, dword [ebp + 4]
fstp dword [esp + 0x20]
mov edx, dword [ecx]
call dword [edx + 8]
test eax, eax
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
jge 0x40de10
fadd dword [0x57ecf8]
fld dword [0x57e6a0]
mov ecx, dword [esi]
fdiv dword [esp + 0x20]
shl edi, 4
mov eax, edi
push 0
push 3
fld dword [esp + 0x18]
fmul st(1)
fstp dword [ecx + eax]
mov ecx, dword [esi]
fld dword [0x57e6a0]
fdiv st(2)
fst dword [esp + 0x18]
fmul dword [esp + 0x38]
fstp dword [ecx + eax + 4]
mov ecx, dword [esi]
fmul dword [esp + 0x3c]
fstp dword [ecx + eax + 8]
mov esi, dword [esi]
fstp st(0)
fld dword [esp + 0x18]
fmul dword [esp + 0x2c]
fstp dword [esi + eax + 0xc]
mov ecx, dword [esp + 0x20]
mov edi, ecx
call fcn.004a4da0
push 0
push 1
mov ecx, edi
mov esi, eax
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
push 0
sub esi, eax
push 4
mov dword [esp + 0x94], esi
mov edi, ecx
call fcn.004a4da0
push 0
push 2
mov ecx, edi
mov esi, eax
call fcn.004a4da0
sub esi, eax
mov dword [esp + 0x90], esi
jmp 0x40e19b
mov eax, dword [esp + 0x10]
cmp eax, 5
jne 0x40e023
mov ecx, eax
mov edi, str.voice
mov esi, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x40e01f
mov ecx, dword [esp + 0x18]
push eax
push eax
call fcn.004a4da0
mov ecx, dword [ebp + 0x3c]
lea esi, [ebp + 0x38]
mov edi, eax
sub ecx, dword [esi]
sar ecx, 4
cmp edi, ecx
jb 0x40def0
lea edx, [edi + 1]
push edx
mov ecx, esi
call fcn.0040ca10
mov ecx, dword [esp + 0x18]
push 0
push 1
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
push 0
push 2
fstp dword [esp + 0x3c]
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
push 0
push 3
fstp dword [esp + 0x38]
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
push 0
push 4
fstp dword [esp + 0x28]
call fcn.004a4da0
mov ecx, dword [ebp + 4]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
mov eax, dword [ecx]
fstp dword [esp + 0x2c]
call dword [eax + 4]
test eax, eax
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
jge 0x40df6e
fadd dword [0x57ecf8]
mov ecx, dword [ebp + 4]
fstp dword [esp + 0x24]
mov edx, dword [ecx]
call dword [edx + 8]
test eax, eax
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
jge 0x40df8c
fadd dword [0x57ecf8]
fld dword [0x57e6a0]
mov ecx, dword [esi]
fdiv dword [esp + 0x24]
shl edi, 4
mov eax, edi
push 0
push 3
fld dword [esp + 0x3c]
fmul st(1)
fstp dword [ecx + eax]
mov ecx, dword [esi]
fld dword [0x57e6a0]
fdiv st(2)
fst dword [esp + 0x18]
fmul dword [esp + 0x38]
fstp dword [ecx + eax + 4]
mov ecx, dword [esi]
fmul dword [esp + 0x28]
fstp dword [ecx + eax + 8]
mov esi, dword [esi]
fstp st(0)
fld dword [esp + 0x18]
fmul dword [esp + 0x34]
fstp dword [esi + eax + 0xc]
mov ecx, dword [esp + 0x20]
mov edi, ecx
call fcn.004a4da0
push 0
push 1
mov ecx, edi
mov esi, eax
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
push 0
sub esi, eax
push 4
mov dword [esp + 0x40], esi
mov edi, ecx
call fcn.004a4da0
push 0
push 2
mov ecx, edi
mov esi, eax
call fcn.004a4da0
sub esi, eax
mov dword [esp + 0x3c], esi
jmp 0x40e19b
mov eax, dword [esp + 0x10]
cmp eax, 6
jne 0x40e081
mov ecx, 3
mov edi, str.eyepos
mov esi, edx
xor eax, eax
repe cmpsw word [esi], word es:[edi]
jne 0x40e081
mov ecx, dword [esp + 0x18]
push eax
push eax
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
push 0
push 1
mov esi, eax
call fcn.004a4da0
mov ecx, dword [esp + 0x8c]
mov edx, dword [esp + 0x90]
mov dword [esp + 0x70], esi
add esi, ecx
mov dword [esp + 0x74], eax
add eax, edx
mov dword [esp + 0x78], esi
mov dword [esp + 0x7c], eax
mov byte [esp + 0x2b], 1
jmp 0x40e19b
mov esi, dword [esp + 0x2c]
push str.voicepos
push esi
call fcn.00407070
add esp, 8
test al, al
je 0x40e0d9
mov ecx, dword [esp + 0x18]
push 0
push 0
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
push 0
push 1
mov esi, eax
call fcn.004a4da0
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x60], esi
add esi, ecx
mov dword [esp + 0x64], eax
add eax, edx
mov dword [esp + 0x68], esi
mov dword [esp + 0x6c], eax
mov byte [esp + 0x17], 1
jmp 0x40e19b
push str.eyepattern
push esi
call fcn.00407070
add esp, 8
test al, al
je 0x40e101
mov ecx, dword [esp + 0x18]
push 0
push 0
call fcn.004a4da0
mov dword [esp + 0x44], eax
jmp 0x40e19b
push str.voicepattern
push esi
call fcn.00407070
add esp, 8
test al, al
je 0x40e126
mov ecx, dword [esp + 0x18]
push 0
push 0
call fcn.004a4da0
mov dword [esp + 0x40], eax
jmp 0x40e19b
push str.offset
push esi
call fcn.00407070
add esp, 8
test al, al
je 0x40e16a
mov ecx, dword [esp + 0x18]
push 0
push 0
call fcn.004a4da0
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
push 0
push 1
fstp dword [ebp + 0x4c]
call fcn.004a4da0
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
fstp dword [ebp + 0x50]
jmp 0x40e19b
push str.drawmode
push esi
call fcn.00407070
add esp, 8
test al, al
je 0x40e19b
mov ecx, dword [esp + 0x18]
push 0
push 0
call fcn.004a4da0
sub eax, 0
je 0x40e197
dec eax
jne 0x40e19b
mov byte [ebp + 0x6d], 1
jmp 0x40e19b
mov byte [ebp + 0x6d], 0
mov ecx, dword [esp + 0x1c]
xor esi, esi
cmp ecx, esi
mov byte [esp + 0xfc], 1
je 0x40e1b2
call fcn.004016a0
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x58]
call fcn.004a4e30
mov ecx, dword [esp + 0x18]
cmp ecx, esi
mov byte [esp + 0xfc], 2
jne 0x40d938
mov edi, dword [esp + 0x44]
mov ecx, dword [esp + 0x1c]
cmp ecx, esi
mov byte [esp + 0xfc], 1
je 0x40e1ed
call fcn.004016a0
mov cl, byte [esp + 0x2b]
mov dl, byte [esp + 0x17]
mov byte [ebp + 0x60], cl
mov byte [ebp + 0x6c], dl
mov byte [ebp + 0x61], 1
fld dword [ebp + 0x4c]
call fcn.0052c1a8
fld dword [ebp + 0x50]
mov dword [esp + 0x38], eax
call fcn.0052c1a8
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x98]
push ecx
lea edx, [esp + 0x68]
push edx
lea eax, [esp + 0x7c]
push eax
lea ecx, [esp + 0xc4]
push ecx
mov ecx, ebp
call fcn.0040ca90
cmp edi, esi
jne 0x40e267
push 0x168
push 0xb4
mov word [ebp + 0x54], si
mov dword [ebp + 0x5c], 0x57ec30
mov word [ebp + 0x56], 2
call fcn.004956f0
add esp, 8
mov dword [ebp + 0x58], eax
mov ecx, dword [esp + 0x40]
mov eax, ecx
sub eax, esi
mov dword [ebp + 0x44], edi
je 0x40e280
dec eax
jne 0x40e291
mov dword [ebp + 0x68], 0x57ec7c
jmp 0x40e287
mov dword [ebp + 0x68], 0x57ec5c
mov word [ebp + 0x62], si
mov word [ebp + 0x64], 3
mov eax, dword [esp + 0x50]
mov dword [ebp + 0x48], ecx
mov ecx, dword [esp + 0x48]
sub eax, ecx
cmp ecx, esi
mov byte [esp + 0xfc], 0
je 0x40e2c6
cmp eax, 0x80
jbe 0x40e2bc
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40e2c6
push eax
push ecx
call fcn.0050e390
add esp, 8
lea ecx, [esp + 0x54]
mov dword [esp + 0xfc], 0xffffffff
call fcn.004a4fe0
xor eax, eax
jmp 0x40e379
mov ecx, dword [esp + 0x80]
mov eax, dword [esp + 0x88]
sub eax, ecx
test ecx, ecx
mov byte [esp + 0xfc], 2
je 0x40e319
cmp eax, 0x80
jbe 0x40e30f
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40e319
push eax
push ecx
call fcn.0050e390
add esp, 8
mov ecx, dword [esp + 0x1c]
test ecx, ecx
mov byte [esp + 0xfc], 1
je 0x40e32e
call fcn.004016a0
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x50]
sub eax, ecx
test ecx, ecx
mov byte [esp + 0xfc], 0
je 0x40e360
cmp eax, 0x80
jbe 0x40e356
push ecx
call fcn.0052b8dd
add esp, 4
jmp 0x40e360
push eax
push ecx
call fcn.0050e390
add esp, 8
lea ecx, [esp + 0x54]
mov dword [esp + 0xfc], 0xffffffff
call fcn.004a4fe0
mov eax, 2
mov ecx, dword [esp + 0xf4]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xf0
ret 4