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

Disassembly:
sub esp, 0x44
mov eax, dword [0x41cef4]
push ebx
push ebp
push esi
xor esi, esi
xor ebp, ebp
xor ebx, ebx
cmp eax, esi
push edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x2c], ebx
jle 0x40a421
shl eax, 2
push eax
call fcn.0040db30
mov ebp, eax
add esp, 4
cmp ebp, esi
mov dword [esp + 0x28], ebp
je 0x40a421
mov eax, dword [0x41cef4]
xor ecx, ecx
cmp eax, esi
jle 0x40a421
mov eax, ebp
mov dword [eax], esi
mov edx, dword [0x41cef4]
inc ecx
add eax, 4
cmp ecx, edx
jl 0x40a411
mov eax, dword [0x41cf18]
cmp eax, esi
jle 0x40a45e
lea ecx, [eax*4]
push ecx
call fcn.0040db30
add esp, 4
cmp eax, esi
mov dword [esp + 0x18], eax
je 0x40a45e
mov edx, dword [0x41cf18]
xor ecx, ecx
cmp edx, esi
jle 0x40a45e
mov dword [eax], esi
mov edx, dword [0x41cf18]
inc ecx
add eax, 4
cmp ecx, edx
jl 0x40a44e
mov eax, dword [0x416044]
mov dword [esp + 0x20], esi
mov edx, dword [eax + 0x14]
and edx, 0xffffffef
mov dword [eax + 0x14], edx
mov eax, dword [0x416044]
mov ecx, dword [eax + 0x14]
and ecx, 0xfffffff7
mov dword [eax + 0x14], ecx
cmp word [0x41cf06], si
mov dword [0x424f24], 1
jbe 0x40af57
push 4
push 0x41cd38
call fcn.00406520
add esp, 8
test eax, eax
je 0x40af6a
push 4
push 0x424f80
push 0x41cd38
call fcn.0040dc90
add esp, 0xc
test eax, eax
jne 0x40af77
call fcn.00406ef0
test eax, eax
jne 0x40b16f
mov al, byte [0x424f64]
mov ecx, dword [0x416044]
test al, 8
je 0x40a501
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x40a4fa
cmp eax, 6
je 0x40a4fa
cmp eax, 0xb
je 0x40a4fa
cmp eax, 5
jne 0x40a501
mov eax, dword [ecx + 0x14]
or al, 0x20
jmp 0x40a506
mov eax, dword [ecx + 0x14]
and al, 0xdf
mov dword [ecx + 0x14], eax
mov edx, dword [0x424f58]
and edx, 0xffff
push 2
push edx
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40a531
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
mov eax, dword [0x41a8f0]
test eax, eax
jne 0x40a63d
mov esi, dword [0x41603c]
xor edi, edi
mov eax, dword [esi]
test eax, eax
je 0x40a5d9
push 0
push eax
push 0x41cde0
call fcn.00408e20
add esp, 0xc
test eax, eax
jne 0x40a570
mov eax, dword [esi + 4]
add esi, 4
test eax, eax
jne 0x40a550
jmp 0x40a5cc
test ebp, ebp
mov edi, 1
je 0x40a586
sub esi, dword [0x41603c]
sar esi, 2
mov dword [ebp + esi*4], edi
mov esi, dword [0x416040]
mov eax, dword [esi]
test eax, eax
je 0x40a5cc
push 0
push eax
push 0x41cde0
call fcn.00408e20
add esp, 0xc
test eax, eax
jne 0x40a5b2
mov eax, dword [esi + 4]
add esi, 4
test eax, eax
jne 0x40a592
jmp 0x40a5cc
mov eax, dword [esp + 0x18]
xor edi, edi
test eax, eax
je 0x40a5cc
sub esi, dword [0x416040]
sar esi, 2
mov dword [eax + esi*4], 1
mov eax, dword [0x41a8f0]
test eax, eax
jne 0x40a63d
test edi, edi
jne 0x40a63d
mov ax, word [0x424f5a]
test ax, ax
je 0x40a605
xor ecx, ecx
push 0
mov cx, ax
push ecx
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40a605
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
mov eax, dword [0x424f5c]
test ax, ax
je 0x40af39
and eax, 0xffff
push 0
push eax
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40af39
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
jmp 0x40af39
mov edx, dword [0x416030]
lea eax, [edx - 1]
cmp eax, 9
ja case.0x40a657.4
xor ecx, ecx
mov cl, byte [eax + 0x40b188]
jmp dword [ecx*4 + 0x40b178]
mov al, byte [0x41cde0]
mov ecx, 0x41cf20
test al, al
mov edx, 0x41cde0
je 0x40a686
cmp al, 0x20
jae 0x40a67b
mov byte [ecx], 0x5e
inc ecx
add al, 0x40
mov byte [ecx], al
mov al, byte [edx + 1]
inc ecx
inc edx
test al, al
jne 0x40a671
push 0x41cf20
push 0x419afc
mov byte [ecx], 0
call fcn.0040defd
mov ax, word [0x424f5a]
add esp, 8
test ax, ax
je 0x40a6c7
xor edx, edx
push 0
mov dx, ax
push edx
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40a6c7
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
mov eax, dword [0x424f5c]
test ax, ax
je 0x40aefa
and eax, 0xffff
push 0
push eax
call fcn.004071f0
add esp, 8
jmp 0x40ae90
mov dx, word [0x424f46]
mov dword [esp + 0x34], 0
cmp dx, 9
jae 0x40a709
mov ax, dx
mov word [esp + 0x24], ax
jmp 0x40a716
mov dword [esp + 0x24], 9
mov ax, word [esp + 0x24]
mov cl, byte [0x424f41]
cmp cl, 0xe
jae 0x40a727
movzx si, cl
jmp 0x40a72c
mov esi, 0xe
movzx bp, byte [0x424f40]
cmp ax, 6
jne 0x40a762
mov al, byte [0x424f44]
mov cl, al
and cl, 2
neg cl
sbb cl, cl
shr al, 2
and cl, 4
and al, 1
add cl, 0x34
or al, 0x32
mov byte [0x419839], cl
mov byte [0x41983b], al
jmp 0x40a79e
cmp ax, 8
jne 0x40a780
mov edx, dword [0x424f44]
shr edx, 1
and edx, 3
mov al, byte [edx + 0x419848]
mov byte [0x419843], al
jmp 0x40a79e
cmp ax, 9
jne 0x40a79e
xor ecx, ecx
mov cx, dx
push ecx
push 0x419a44
push 0x41c1c0
call fcn.0040e4ae
add esp, 0xc
mov ebx, dword [0x424f64]
mov edx, 0x20202020
mov dword [esp + 0x44], edx
mov eax, ebx
mov dword [esp + 0x48], edx
and esi, 0xffff
mov dword [esp + 0x4c], edx
mov byte [esp + 0x53], 0
mov word [esp + 0x50], dx
mov dword [esp + 0x30], esi
shr eax, 0x10
cmp esi, 0xd
mov byte [esp + 0x52], dl
ja case.0x40a7e3.3
xor ecx, ecx
mov cl, byte [esi + 0x40b1a4]
jmp dword [ecx*4 + 0x40b194]
xor edx, edx
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], edx
test ah, 1
mov dword [esp + 0x40], edx
je 0x40a802
mov byte [esp + 0x38], 0x52
test al, 0x80
je 0x40a810
mov byte [esp + 0x39], 0x57
mov byte [esp + 0x3b], 0x44
test al, 0x40
je 0x40a819
mov byte [esp + 0x3a], 0x45
test al, 0x20
je 0x40a822
mov byte [esp + 0x3c], 0x52
test al, 0x10
je 0x40a830
mov byte [esp + 0x3d], 0x57
mov byte [esp + 0x3f], 0x44
test al, 8
je 0x40a839
mov byte [esp + 0x3e], 0x45
test al, 4
je 0x40a842
mov byte [esp + 0x40], 0x52
test al, 2
je 0x40a850
mov byte [esp + 0x41], 0x57
mov byte [esp + 0x43], 0x44
test al, 1
je 0x40a859
mov byte [esp + 0x42], 0x45
lea eax, [esp + 0x44]
xor edx, edx
mov edi, 3
mov esi, 4
mov cl, byte [esp + edx + 0x38]
test cl, cl
je 0x40a874
mov byte [eax], cl
inc eax
inc edx
dec esi
jne 0x40a869
mov byte [eax], 0x2c
inc eax
dec edi
jne 0x40a864
dec eax
lea ecx, [esp + 0x44]
mov byte [eax], 0x20
sub eax, ecx
cmp eax, 0xc
jge 0x40ac91
mov ecx, ebp
mov esi, 0xa
and ecx, 0xffff
mov eax, ecx
cdq
idiv esi
mov eax, 0x66666667
push edx
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
push edx
push 0x419a4c
jmp 0x40ac84
mov ecx, ebp
mov esi, 0xa
and ecx, 0xffff
and ebx, 0xff
mov eax, ecx
cdq
idiv esi
mov eax, 0x66666667
push edx
imul ecx
sar edx, 2
mov eax, edx
lea ecx, [esp + 0x48]
shr eax, 0x1f
add edx, eax
push edx
push 0x419a54
push ecx
call fcn.0040e4ae
mov dl, bl
add esp, 0x10
and dl, 1
mov al, bl
neg dl
sbb dl, dl
and al, 2
and dl, 0xb6
mov cl, bl
add dl, 0x77
neg al
sbb al, al
and cl, 4
and al, 0x3b
mov byte [esp + 0x46], dl
add al, 0x2d
mov dl, bl
neg cl
sbb cl, cl
and dl, 0x20
and cl, 0x46
mov byte [esp + 0x49], al
add cl, 0x2d
neg dl
sbb dl, dl
mov byte [esp + 0x4a], cl
and dl, 0x34
add dl, 0x2d
test bl, 0x10
mov byte [esp + 0x48], dl
je 0x40a958
mov byte [esp + 0x44], 0x64
mov byte [esp + 0x47], 0x78
jmp 0x40a95d
mov byte [esp + 0x44], 0x2d
test bl, 8
je 0x40a96c
mov byte [esp + 0x44], 0x56
jmp 0x40ac91
push 0x2e
push 0x41cde0
call fcn.0040dcd0
mov esi, eax
add esp, 8
test esi, esi
je 0x40ac91
inc esi
push 3
push 0x419a68
push esi
call fcn.00407910
add esp, 0xc
test eax, eax
je 0x40a9ee
push 3
push 0x419a6c
push esi
call fcn.00407910
add esp, 0xc
test eax, eax
je 0x40a9ee
push 3
push 0x419a70
push esi
call fcn.00407910
add esp, 0xc
test eax, eax
je 0x40a9ee
push 3
push 0x419a74
push esi
call fcn.00407910
add esp, 0xc
test eax, eax
je 0x40a9ee
push 3
push 0x419a78
push esi
call fcn.00407910
add esp, 0xc
test eax, eax
jne 0x40ac91
mov byte [esp + 0x47], 0x78
jmp 0x40ac91
mov ecx, eax
and ecx, 0xc00
cmp ecx, 0x400
je 0x40aa1e
cmp ecx, 0x800
sete cl
dec ecx
and ecx, 0xffffffdb
add ecx, 0x64
mov byte [esp + 0x44], cl
jmp 0x40aa23
mov byte [esp + 0x44], 0x2d
mov dl, al
mov cl, al
and dl, 0x80
mov esi, 0xa
neg dl
sbb dl, dl
and cl, 0x40
and dl, 0x3b
add dl, 0x2d
neg cl
sbb cl, cl
mov byte [esp + 0x45], dl
mov dl, al
and cl, 0x46
and dl, 0x20
add cl, 0x2d
neg dl
sbb dl, dl
mov byte [esp + 0x46], cl
mov cl, al
and dl, 0x43
and cl, 0x10
add dl, 0x2d
neg cl
mov byte [esp + 0x47], dl
mov dl, al
sbb cl, cl
and dl, 8
and cl, 0x34
add cl, 0x2d
neg dl
mov byte [esp + 0x48], cl
mov cl, al
sbb dl, dl
and cl, 4
and dl, 0x45
add dl, 0x2d
neg cl
mov byte [esp + 0x49], dl
mov dl, al
sbb cl, cl
and dl, 2
and cl, 0x4a
add cl, 0x2d
neg dl
sbb dl, dl
and al, 1
and dl, 0x38
mov byte [esp + 0x4a], cl
add dl, 0x2d
mov ecx, ebp
neg al
sbb al, al
and ecx, 0xffff
and al, 0x37
mov byte [esp + 0x4b], dl
add al, 0x2d
mov byte [esp + 0x4c], al
mov eax, ecx
cdq
idiv esi
mov eax, 0x66666667
push edx
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
push edx
push 0x419a7c
jmp 0x40ac84
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x6000
jg 0x40ab2b
je 0x40ab24
cmp ecx, 0x1000
je 0x40ab1d
cmp ecx, 0x2000
je 0x40ab16
cmp ecx, 0x4000
jne 0x40ab43
mov byte [esp + 0x44], 0x64
jmp 0x40ab5d
mov byte [esp + 0x44], 0x63
jmp 0x40ab5d
mov byte [esp + 0x44], 0x70
jmp 0x40ab5d
mov byte [esp + 0x44], 0x62
jmp 0x40ab5d
cmp ecx, 0x8000
je 0x40ab58
cmp ecx, 0xa000
je 0x40ab51
cmp ecx, 0xc000
je 0x40ab4a
mov byte [esp + 0x44], 0x3f
jmp 0x40ab5d
mov byte [esp + 0x44], 0x73
jmp 0x40ab5d
mov byte [esp + 0x44], 0x6c
jmp 0x40ab5d
mov byte [esp + 0x44], 0x2d
mov edx, eax
mov cl, al
and edx, 0x100
neg edx
sbb dl, dl
and cl, 0x20
and dl, 0x45
add dl, 0x2d
neg cl
mov byte [esp + 0x45], dl
mov dl, al
sbb cl, cl
and dl, 4
and cl, 0x45
add cl, 0x2d
neg dl
mov byte [esp + 0x48], cl
mov cl, al
sbb dl, dl
and cl, 0x80
and dl, 0x45
add dl, 0x2d
neg cl
mov byte [esp + 0x4b], dl
mov dl, al
sbb cl, cl
and dl, 0x10
and cl, 0x4a
add cl, 0x2d
neg dl
mov byte [esp + 0x46], cl
mov cl, al
sbb dl, dl
and cl, 2
and dl, 0x4a
add dl, 0x2d
neg cl
sbb cl, cl
mov byte [esp + 0x49], dl
and cl, 0x4a
add cl, 0x2d
test al, 0x40
mov byte [esp + 0x4c], cl
je 0x40abee
mov edx, eax
and edx, 0x800
neg edx
sbb dl, dl
and dl, 0xfb
add dl, 0x78
mov byte [esp + 0x47], dl
jmp 0x40ac04
mov ecx, eax
and ecx, 0x800
neg ecx
sbb cl, cl
and cl, 0x26
add cl, 0x2d
mov byte [esp + 0x47], cl
test al, 8
je 0x40ac20
mov edx, eax
and edx, 0x400
neg edx
sbb dl, dl
and dl, 0xfb
add dl, 0x78
mov byte [esp + 0x4a], dl
jmp 0x40ac36
mov ecx, eax
and ecx, 0x400
neg ecx
sbb cl, cl
and cl, 0x26
add cl, 0x2d
mov byte [esp + 0x4a], cl
test al, 1
je 0x40ac49
and eax, 0x200
neg eax
sbb al, al
and al, 0xfc
add al, 0x78
jmp 0x40ac56
and eax, 0x200
neg eax
sbb al, al
and al, 0x27
add al, 0x2d
mov ecx, ebp
mov byte [esp + 0x4d], al
and ecx, 0xffff
mov esi, 0xa
mov eax, ecx
cdq
idiv esi
mov eax, 0x66666667
push edx
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
push edx
push 0x419a84
lea ecx, [esp + 0x5c]
push ecx
call fcn.0040e4ae
add esp, 0x10
mov cl, byte [0x424f44]
mov ax, word [0x424f5a]
test cl, 8
je 0x40acae
neg ax
sbb eax, eax
and al, 0xec
add eax, 0x6c
jmp 0x40acb9
neg ax
sbb eax, eax
and eax, 0x4b
add eax, 0x2d
test cl, 1
mov cl, byte [0x424f60]
je 0x40acd3
and cl, 1
neg cl
sbb ecx, ecx
and ecx, 0x12
add ecx, 0x42
jmp 0x40ace0
and cl, 1
neg cl
sbb ecx, ecx
and ecx, 0x12
add ecx, 0x62
mov edx, dword [0x424f54]
push eax
mov eax, dword [esp + 0x34]
push ecx
push edx
lea edx, [esp + 0x50]
mov ecx, dword [eax*4 + 0x419850]
push ecx
push edx
push 0x419a8c
call fcn.0040defd
mov eax, dword [0x416030]
add esp, 0x18
cmp eax, 4
jne 0x40adc9
mov al, byte [0x424f44]
mov esi, dword [0x424f50]
test al, 1
je 0x40ad27
sub esi, 0xc
mov ecx, dword [0x424f54]
test ecx, ecx
jne 0x40ad35
xor eax, eax
jmp 0x40adad
cmp ecx, 0x1e8480
jbe 0x40ad67
mov eax, 0x10624dd3
mul ecx
mov edi, edx
shr edi, 6
cmp ecx, esi
mov eax, edi
jb 0x40ad5b
shr eax, 1
sub eax, esi
xor edx, edx
add eax, ecx
div edi
jmp 0x40adad
shr eax, 1
sub eax, ecx
xor edx, edx
add eax, esi
div edi
jmp 0x40adab
lea eax, [esi + esi*4]
cmp ecx, esi
lea eax, [eax + eax*4]
jb 0x40ad8f
lea eax, [eax + eax*4]
mov edx, ecx
shl eax, 3
shr edx, 1
sub edx, eax
lea eax, [ecx + ecx*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [edx + eax*8]
xor edx, edx
div ecx
jmp 0x40adad
lea edx, [eax + eax*4]
mov eax, ecx
shr eax, 1
lea eax, [eax + edx*8]
lea edx, [ecx + ecx*4]
lea edx, [edx + edx*4]
lea edx, [edx + edx*4]
shl edx, 3
sub eax, edx
xor edx, edx
div ecx
neg eax
lea ecx, [eax + 5]
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
push edx
push 0x419a9c
jmp 0x40adda
cmp eax, 5
jne 0x40ade2
mov ecx, dword [0x424f50]
push ecx
push 0x419aa4
call fcn.0040defd
add esp, 8
push 0x424f48
push 0x424f4a
call fcn.0040bbf0
push eax
mov eax, dword [esp + 0x30]
and eax, 0xffff
mov edx, dword [eax*4 + 0x41988c]
push edx
push 0x419aac
call fcn.0040defd
add esp, 0x14
call fcn.0040c470
mov ax, word [0x424f5a]
test ax, ax
je 0x40ae3d
xor ecx, ecx
push 0
mov cx, ax
push ecx
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40ae3d
cmp eax, 1
mov esi, eax
jle 0x40ae41
jmp 0x40ae90
mov esi, dword [esp + 0x34]
mov eax, dword [0x424f5c]
test ax, ax
je 0x40ae66
and eax, 0xffff
push 0
push eax
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40ae66
cmp eax, 1
mov esi, eax
jg 0x40ae90
mov eax, esi
jmp 0x40ae90
mov edx, dword [esp + 0x20]
push edx
push 0x41994c
push 0x418cc0
call fcn.0040defd
push 0x418ce4
call fcn.0040defd
add esp, 0x10
call fcn.0040b1c0
test eax, eax
je 0x40aefa
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
jmp 0x40aefa
mov ax, word [0x424f5a]
test ax, ax
je 0x40aecf
xor ecx, ecx
push 0
mov cx, ax
push ecx
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40aecf
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
mov eax, dword [0x424f5c]
test ax, ax
je 0x40aefa
and eax, 0xffff
push 0
push eax
call fcn.004071f0
add esp, 8
test eax, eax
je 0x40aefa
cmp eax, 1
mov dword [esp + 0x10], eax
jg 0x40b16f
mov edx, dword [0x424f50]
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x2c]
mov ecx, dword [0x424f54]
mov al, byte [0x424f44]
add esi, edx
add ebx, ecx
mov dword [esp + 0x14], esi
test al, 1
mov dword [esp + 0x2c], ebx
je 0x40af2c
mov eax, esi
sub eax, 0xc
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x1c]
mov ebp, dword [esp + 0x28]
inc eax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x20]
xor ecx, ecx
mov cx, word [0x41cf06]
inc eax
cmp eax, ecx
mov dword [esp + 0x20], eax
jl 0x40a495
mov esi, dword [esp + 0x14]
push 4
push 0x41cd38
call fcn.00406520
add esp, 8
test eax, eax
jne 0x40af9b
pop edi
pop esi
pop ebp
mov eax, 0x33
pop ebx
add esp, 0x44
ret
mov edx, dword [esp + 0x20]
push edx
push 0x4160e8
push 0x419ea0
call fcn.0040dba4
add esp, 0xc
mov eax, 3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push 4
push 0x41cd28
push 0x41cd38
call fcn.0040dc90
add esp, 0xc
test eax, eax
je 0x40afcd
push 0x41609c
push 0x419ea0
call fcn.0040dba4
add esp, 8
mov dword [esp + 0x10], 1
mov eax, dword [0x41a8d8]
test eax, eax
je 0x40b0c9
test ebx, ebx
mov edi, 0x41c1d4
jne 0x40afea
xor ecx, ecx
jmp 0x40b076
cmp ebx, 0x1e8480
jbe 0x40b01e
mov eax, 0x10624dd3
mul ebx
mov ecx, edx
shr ecx, 6
cmp ebx, esi
mov eax, ecx
jb 0x40b012
shr eax, 1
sub eax, esi
xor edx, edx
add eax, ebx
div ecx
mov ecx, eax
jmp 0x40b06b
shr eax, 1
sub eax, ebx
xor edx, edx
add eax, esi
div ecx
jmp 0x40b067
lea eax, [ebx + ebx*4]
cmp ebx, esi
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
jb 0x40b04a
lea ecx, [esi + esi*4]
mov edx, ebx
shl eax, 3
lea ecx, [ecx + ecx*4]
shr edx, 1
lea ecx, [ecx + ecx*4]
shl ecx, 3
sub eax, ecx
add eax, edx
xor edx, edx
div ebx
mov ecx, eax
jmp 0x40b06b
shl eax, 3
mov ecx, eax
lea eax, [esi + esi*4]
mov edx, ebx
lea eax, [eax + eax*4]
shr edx, 1
lea eax, [eax + eax*4]
shl eax, 3
sub eax, ecx
add eax, edx
xor edx, edx
div ebx
mov ecx, eax
neg ecx
test ecx, ecx
jge 0x40b076
mov edi, 0x419950
neg ecx
cmp word [esp + 0x1c], 1
mov esi, 0x41c1d8
je 0x40b088
mov esi, 0x419954
mov eax, ecx
mov ebp, 0xa
cdq
idiv ebp
mov eax, 0x66666667
push edx
imul ecx
sar edx, 2
mov ecx, dword [esp + 0x18]
mov eax, edx
shr eax, 0x1f
add edx, eax
push edx
mov edx, dword [esp + 0x24]
push edi
push ecx
push ebx
and edx, 0xffff
push esi
push edx
push 0x418d04
call fcn.0040defd
mov ebp, dword [esp + 0x48]
add esp, 0x20
test ebp, ebp
je 0x40b10d
mov eax, dword [0x41cef4]
xor esi, esi
test eax, eax
jle 0x40b104
cmp dword [ebp + esi*4], 0
jne 0x40b0fa
mov eax, dword [0x41603c]
mov ecx, dword [eax + esi*4]
push ecx
push 0x41616c
push 0x419ea0
call fcn.0040dba4
add esp, 0xc
mov eax, dword [0x41cef4]
inc esi
cmp esi, eax
jl 0x40b0d8
push ebp
call fcn.0040df2e
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40b159
mov eax, dword [0x41cf18]
mov edi, dword [esp + 0x18]
xor esi, esi
test eax, eax
jle 0x40b150
cmp dword [edi + esi*4], 0
jne 0x40b146
mov edx, dword [0x416040]
mov eax, dword [edx + esi*4]
push eax
push 0x416190
push 0x419ea0
call fcn.0040dba4
add esp, 0xc
mov eax, dword [0x41cf18]
inc esi
cmp esi, eax
jl 0x40b124
push edi
call fcn.0040df2e
add esp, 4
cmp word [esp + 0x1c], 0
mov eax, dword [esp + 0x10]
jne 0x40b16f
cmp eax, 1
jg 0x40b16f
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret