Function at 0x4066b0
Capabilities:
Encode data using xor
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x98
mov edx, dword [ecx + 0x58]
xor eax, eax
sub edx, dword [ecx + 0x50]
mov dword [ecx + 0xd4], eax
mov dword [ecx + 0xd8], eax
jne 0x4066d3
add esp, 0x98
ret
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebx
mov ebx, ecx
mov dword [esp + 0x38], ebp
xor eax, eax
mov dword [esp + 0x7c], eax
mov ebp, eax
mov edx, dword [ebx + 0x18]
add edx, 0xfffffff8
cmp edx, dword [ebx + 0x10]
ja 0x406704
mov ecx, ebx
mov edx, 2
call fcn.00402e90
lea edx, [esp + 0x90]
push edx
push ebp
mov ecx, ebx
call fcn.00407bc0
mov edx, dword [esp + 0x90]
mov ecx, ebp
and ecx, dword [ebx + 0xb4]
cmp eax, 1
jne 0x4068ff
cmp edx, 0xffffffff
jne 0x4068ff
mov edi, dword [ebx + 0x114]
mov dword [esp + 0x84], eax
lea eax, [ebx + ecx*2]
shl edi, 5
movzx edx, word [edi + eax + 0x120]
mov esi, edx
neg esi
add esi, 0x800
shr esi, 5
add edx, esi
mov word [edi + eax + 0x120], dx
mov esi, dword [ebx + 0x4c]
sub esi, dword [ebx + 0x100]
movzx eax, byte [esi]
mov ecx, dword [ebx + 0xa4]
movzx edi, byte [esi - 1]
mov dword [esp + 0x60], eax
mov edx, ebp
and edx, dword [ebx + 0xb0]
shl edx, cl
neg ecx
add ecx, 8
shr edi, cl
add edx, edi
lea edx, [edx + edx*2]
shl edx, 9
add edx, ebx
mov edi, eax
or edi, 0x100
cmp dword [ebx + 0x114], 7
mov eax, dword [esp + 0x84]
jb 0x40684c
mov ecx, dword [ebx + 0x104]
mov dword [esp + 0x54], 0x100
neg ecx
add ecx, esi
movzx ecx, byte [ecx - 1]
mov dword [esp + 0x50], esi
mov dword [esp + 0x84], eax
mov dword [esp + 0x70], ebp
mov ebp, dword [esp + 0x54]
mov dword [esp + 0x6c], ebx
add ecx, ecx
mov esi, edi
shr esi, 8
add esi, ebp
mov ebx, ebp
and ebx, ecx
add esi, ebx
mov ebx, edi
shr ebx, 7
test bl, 1
movzx ebx, word [edx + esi*2 + 0x784]
jne 0x406816
mov eax, ebx
neg eax
add eax, 0x800
shr eax, 5
add ebx, eax
jmp 0x40681d
mov eax, ebx
shr eax, 5
sub ebx, eax
mov word [edx + esi*2 + 0x784], bx
add edi, edi
mov ebx, ecx
xor ebx, edi
not ebx
and ebp, ebx
cmp edi, 0x10000
jb 0x4067e5
mov esi, dword [esp + 0x50]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
jmp 0x40689d
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
mov ebx, edi
shr ebx, 8
mov ecx, edi
shr ecx, 7
test cl, 1
movzx ecx, word [edx + ebx*2 + 0x784]
jne 0x40687c
mov ebp, ecx
neg ebp
add ebp, 0x800
shr ebp, 5
add ecx, ebp
jmp 0x406883
mov ebp, ecx
shr ebp, 5
sub ecx, ebp
mov word [edx + ebx*2 + 0x784], cx
add edi, edi
cmp edi, 0x10000
jb 0x406854
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
mov edx, dword [esp + 0x60]
mov edi, dword [ebx + 0x10]
mov byte [edi], 1
mov edi, dword [ebx + 0x10]
inc edi
mov dword [ebx + 0x10], edi
mov byte [edi], dl
mov edi, dword [ebx + 0x10]
mov edx, dword [ebx + 0x114]
inc edi
mov dword [ebx + 0x10], edi
cmp edx, 7
jb 0x4068ed
cmp esi, dword [ebx + 0x48]
jbe 0x4068cd
movzx edx, byte [esi - 1]
jmp 0x4068cf
xor edx, edx
mov byte [edi], dl
sub esi, dword [ebx + 0x104]
mov edi, dword [ebx + 0x10]
inc edi
mov dword [ebx + 0x10], edi
movzx edx, byte [esi - 1]
mov byte [edi], dl
mov edx, dword [ebx + 0x114]
inc dword [ebx + 0x10]
mov edx, dword [edx*4 + 0x4203c0]
mov dword [ebx + 0x114], edx
jmp 0x4076ec
mov dword [esp + 0x84], eax
mov eax, dword [ebx + 0x114]
mov dword [esp + 0x88], ecx
lea ecx, [ebx + ecx*2]
mov dword [esp + 0x8c], ecx
shl eax, 5
movzx edi, word [eax + ecx + 0x120]
mov esi, edi
shr esi, 5
sub edi, esi
mov word [eax + ecx + 0x120], di
mov ecx, dword [esp + 0x88]
cmp edx, 4
mov eax, dword [esp + 0x84]
jae 0x407022
mov dword [esp + 0x88], ecx
mov ecx, dword [ebx + 0x114]
movzx edi, word [ebx + ecx*2 + 0x2a0]
mov esi, edi
shr esi, 5
sub edi, esi
mov word [ebx + ecx*2 + 0x2a0], di
mov ecx, dword [esp + 0x88]
test edx, edx
jne 0x406a47
mov edi, dword [ebx + 0x114]
movzx esi, word [ebx + edi*2 + 0x2b8]
mov edx, esi
neg edx
add edx, 0x800
shr edx, 5
add esi, edx
mov word [ebx + edi*2 + 0x2b8], si
cmp eax, 1
jne 0x406a04
mov ecx, dword [esp + 0x8c]
mov edx, dword [ebx + 0x114]
shl edx, 5
movzx edi, word [edx + ecx + 0x300]
mov esi, edi
neg esi
add esi, 0x800
shr esi, 5
add edi, esi
mov word [edx + ecx + 0x300], di
mov esi, dword [ebx + 0x4c]
sub esi, dword [ebx + 0x100]
mov edx, dword [ebx + 0x10]
mov byte [edx], 3
sub esi, dword [ebx + 0x104]
mov edi, dword [ebx + 0x10]
inc edi
mov dword [ebx + 0x10], edi
movzx edx, byte [esi - 1]
mov byte [edi], dl
inc dword [ebx + 0x10]
jmp 0x406b7d
mov edi, dword [ebx + 0x114]
mov dword [esp + 0x88], ecx
mov ecx, dword [esp + 0x8c]
shl edi, 5
movzx esi, word [edi + ecx + 0x300]
mov edx, esi
shr edx, 5
sub esi, edx
mov word [edi + ecx + 0x300], si
mov edx, dword [ebx + 0x10]
mov ecx, dword [esp + 0x88]
mov byte [edx], 2
inc dword [ebx + 0x10]
jmp 0x406b95
mov esi, dword [ebx + edx*4 + 0x104]
mov dword [esp + 0x88], ecx
mov ecx, dword [ebx + 0x114]
mov dword [esp + 0x5c], esi
movzx esi, word [ebx + ecx*2 + 0x2b8]
mov edi, esi
shr edi, 5
sub esi, edi
cmp edx, 1
mov word [ebx + ecx*2 + 0x2b8], si
mov ecx, dword [esp + 0x88]
jne 0x406ab5
mov edi, dword [ebx + 0x114]
movzx esi, word [ebx + edi*2 + 0x2d0]
mov edx, esi
neg edx
add edx, 0x800
shr edx, 5
add esi, edx
mov word [ebx + edi*2 + 0x2d0], si
mov edx, dword [ebx + 0x10]
mov byte [edx], 4
inc dword [ebx + 0x10]
jmp 0x406b62
mov dword [esp + 0x88], ecx
mov ecx, dword [ebx + 0x114]
movzx edi, word [ebx + ecx*2 + 0x2d0]
mov esi, edi
shr esi, 5
sub edi, esi
mov word [ebx + ecx*2 + 0x2d0], di
mov ecx, dword [esp + 0x88]
cmp edx, 2
jne 0x406b16
mov edi, dword [ebx + 0x114]
movzx esi, word [ebx + edi*2 + 0x2e8]
mov edx, esi
neg edx
add edx, 0x800
shr edx, 5
add esi, edx
mov word [ebx + edi*2 + 0x2e8], si
mov edx, dword [ebx + 0x10]
mov byte [edx], 5
mov edx, dword [ebx + 0x10]
inc edx
jmp 0x406b3d
mov edi, dword [ebx + 0x114]
movzx esi, word [ebx + edi*2 + 0x2e8]
mov edx, esi
shr edx, 5
sub esi, edx
mov word [ebx + edi*2 + 0x2e8], si
mov edx, dword [ebx + 0x10]
mov byte [edx], 6
mov edx, dword [ebx + 0x10]
inc edx
cmp dword [esp + 0x90], 3
mov dword [ebx + 0x10], edx
jne 0x406b56
mov edx, dword [ebx + 0x10c]
mov dword [ebx + 0x110], edx
mov edx, dword [ebx + 0x108]
mov dword [ebx + 0x10c], edx
mov esi, dword [esp + 0x5c]
mov edx, dword [ebx + 0x104]
mov dword [ebx + 0x108], edx
mov dword [ebx + 0x104], esi
cmp eax, 1
jne 0x406b95
mov edx, dword [ebx + 0x114]
mov esi, dword [edx*4 + 0x420450]
mov dword [ebx + 0x114], esi
jmp 0x4076ec
lea edx, [eax - 2]
cmp edx, 8
jb 0x406d07
movzx edi, word [ebx + 0x604fd0]
mov esi, edi
shr esi, 5
sub edi, esi
cmp edx, 0x10
mov word [ebx + 0x604fd0], di
jb 0x406c55
movzx edi, word [ebx + 0x604fd2]
mov dword [esp + 0xc], edx
mov esi, edi
mov dword [esp + 0x88], ecx
shr esi, 5
sub edi, esi
mov dword [esp + 0x14], 1
mov word [ebx + 0x604fd2], di
lea esi, [eax - 0x12]
mov edi, 8
mov dword [esp + 0x84], eax
mov dword [esp + 0x70], ebp
mov ebp, dword [esp + 0x14]
dec edi
mov ecx, edi
mov edx, esi
shr edx, cl
add ebp, ebp
movzx eax, word [ebx + ebp + 0x6051d4]
and edx, 1
jne 0x406c25
mov ecx, eax
neg ecx
add ecx, 0x800
shr ecx, 5
add eax, ecx
jmp 0x406c2c
mov ecx, eax
shr ecx, 5
sub eax, ecx
mov word [ebx + ebp + 0x6051d4], ax
or ebp, edx
test edi, edi
jne 0x406bfe
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
jmp 0x406da3
movzx edi, word [ebx + 0x604fd2]
mov dword [esp + 0xc], edx
mov esi, edi
mov dword [esp + 0x88], ecx
neg esi
add esi, 0x800
mov dword [esp + 0x10], 3
mov dword [esp + 0x84], eax
shr esi, 5
mov dword [esp + 0x70], ebp
add edi, esi
mov word [ebx + 0x604fd2], di
mov dword [esp + 0x6c], ebx
mov esi, ecx
shl esi, 4
mov ecx, dword [esp + 0x10]
lea edi, [esi + ebx + 0x604fd0]
mov edx, edi
lea edi, [eax - 0xa]
mov esi, 1
dec ecx
mov ebx, edi
shr ebx, cl
add esi, esi
movzx eax, word [edx + esi + 0x104]
and ebx, 1
jne 0x406cd3
mov ebp, eax
neg ebp
add ebp, 0x800
shr ebp, 5
add eax, ebp
jmp 0x406cda
mov ebp, eax
shr ebp, 5
sub eax, ebp
mov word [edx + esi + 0x104], ax
or esi, ebx
test ecx, ecx
jne 0x406cae
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
jmp 0x406da3
movzx edi, word [ebx + 0x604fd0]
mov dword [esp + 0x88], ecx
mov esi, edi
mov dword [esp + 0x84], eax
neg esi
add esi, 0x800
mov dword [esp + 0x18], 1
mov dword [esp + 0x70], ebp
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x6c], ebx
shr esi, 5
add edi, esi
mov esi, ecx
mov word [ebx + 0x604fd0], di
shl esi, 4
lea esi, [esi + ebx + 0x604fd0]
mov edi, 3
dec edi
mov ecx, edi
mov ebx, edx
shr ebx, cl
add ebp, ebp
movzx eax, word [esi + ebp + 4]
and ebx, 1
jne 0x406d7b
mov ecx, eax
neg ecx
add ecx, 0x800
shr ecx, 5
add eax, ecx
jmp 0x406d82
mov ecx, eax
shr ecx, 5
sub eax, ecx
mov word [esi + ebp + 4], ax
or ebp, ebx
test edi, edi
jne 0x406d57
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
mov esi, dword [ebx + ecx*4 + 0x6097dc]
inc esi
mov dword [ebx + ecx*4 + 0x6097dc], esi
cmp esi, dword [ebx + 0x6097d8]
jb 0x406ffe
mov edi, dword [ebx + 0x6097d4]
movzx esi, word [ebx + 0x604fd2]
mov dword [esp + 0x84], eax
mov eax, ecx
shl eax, 4
mov dword [esp + 0x88], ecx
mov dword [esp + 0xc], edx
mov dword [esp + 0x1c], edi
movzx edi, word [ebx + 0x604fd0]
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
lea edx, [ecx + eax]
shl edx, 6
lea edx, [edx + ebx + 0x604fd0]
mov dword [esp + 0x58], edx
mov edx, edi
shr edx, 4
mov edx, dword [edx*4 + 0x445400]
mov dword [esp + 8], edx
xor edi, 0x7ff
shr edi, 4
mov edx, dword [edi*4 + 0x445400]
mov ecx, esi
shr ecx, 4
mov ecx, dword [ecx*4 + 0x445400]
xor esi, 0x7ff
shr esi, 4
add ecx, dword [edi*4 + 0x445400]
add edx, dword [esi*4 + 0x445400]
mov dword [esp + 4], ecx
xor esi, esi
xor ebp, ebp
mov dword [esp], edx
lea edi, [eax + ebx + 0x604fd0]
mov eax, dword [esp + 8]
mov ebx, dword [esp + 0x58]
mov edx, esi
or edx, 8
mov ecx, ebp
mov ebx, edx
and ebx, 0xfffffffe
movzx ebx, word [ebx + edi + 4]
mov ebp, edx
and ebp, 1
neg ebp
and ebp, 0x7ff
xor ebx, ebp
shr ebx, 4
shr edx, 1
add ecx, dword [ebx*4 + 0x445400]
cmp edx, 1
jne 0x406e6a
mov ebx, dword [esp + 0x58]
xor ebp, ebp
add ecx, eax
mov dword [ebx + esi*4 + 0x404], ecx
inc esi
cmp esi, 8
jb 0x406e63
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
cmp esi, 0x10
mov ebx, dword [esp + 0x6c]
jae 0x406f54
mov dword [esp + 0xc], edx
mov dword [esp + 0x88], ecx
mov dword [esp + 0x84], eax
mov eax, dword [esp + 4]
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
mov ebx, dword [esp + 0x58]
xor ebp, ebp
lea edx, [esi - 8]
or edx, 8
mov ecx, ebp
mov ebx, edx
and ebx, 0xfffffffe
movzx ebx, word [ebx + edi + 0x104]
mov ebp, edx
and ebp, 1
neg ebp
and ebp, 0x7ff
xor ebx, ebp
shr ebx, 4
shr edx, 1
add ecx, dword [ebx*4 + 0x445400]
cmp edx, 1
jne 0x406ef8
mov ebx, dword [esp + 0x58]
xor ebp, ebp
add ecx, eax
mov dword [ebx + esi*4 + 0x404], ecx
inc esi
cmp esi, 0x10
jb 0x406ef0
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
cmp esi, dword [esp + 0x1c]
jae 0x406ff3
mov dword [esp + 0xc], edx
mov edx, dword [esp]
mov dword [esp + 0x88], ecx
xor edi, edi
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 0x70], ebp
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x6c], ebx
lea ebx, [esi - 0x10]
or ebx, 0x100
mov ecx, edi
mov eax, dword [esp + 0x6c]
mov ebp, ebx
and ebp, 0xfffffffe
movzx ebp, word [ebp + eax + 0x6051d4]
mov edi, ebx
and edi, 1
neg edi
and edi, 0x7ff
xor ebp, edi
shr ebp, 4
shr ebx, 1
add ecx, dword [ebp*4 + 0x445400]
cmp ebx, 1
jne 0x406f94
mov eax, dword [esp + 0x58]
mov ebp, dword [esp + 0x1c]
xor edi, edi
add ecx, edx
mov dword [eax + esi*4 + 0x404], ecx
inc esi
cmp esi, ebp
jb 0x406f85
mov edx, dword [esp + 0xc]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
mov dword [ebx + ecx*4 + 0x6097dc], 0
mov esi, dword [ebx + 0x10]
mov word [esi], dx
mov edx, dword [ebx + 0x114]
mov edi, dword [edx*4 + 0x420420]
add esi, 2
mov dword [ebx + 0x10], esi
mov dword [ebx + 0x114], edi
jmp 0x4076ec
mov edx, dword [ebx + 0x10]
mov byte [edx], 0
mov edx, dword [ebx + 0x114]
inc dword [ebx + 0x10]
movzx edi, word [ebx + edx*2 + 0x2a0]
mov esi, edi
neg esi
add esi, 0x800
shr esi, 5
add edi, esi
mov word [ebx + edx*2 + 0x2a0], di
mov esi, dword [ebx + 0x114]
mov edi, dword [esi*4 + str._a_a_a_a_a_a_a_n_n_n_n_n_b_b_b_b_b_b_b_v_v_v_v_v_t_t_t_t_t_t_t_v_v_v_v_v]
mov dword [ebx + 0x114], edi
lea edi, [eax - 2]
cmp edi, 8
jb 0x4071da
movzx esi, word [ebx + 0x600784]
mov edx, esi
shr edx, 5
sub esi, edx
cmp edi, 0x10
mov word [ebx + 0x600784], si
jb 0x407123
movzx esi, word [ebx + 0x600786]
mov dword [esp + 0x3c], edi
mov edx, esi
mov dword [esp + 0x88], ecx
shr edx, 5
sub esi, edx
mov dword [esp + 0x48], 1
mov edi, dword [esp + 0x48]
lea edx, [eax - 0x12]
mov word [ebx + 0x600786], si
mov dword [esp + 0x84], eax
mov dword [esp + 0x70], ebp
mov esi, 8
dec esi
mov ecx, esi
mov ebp, edx
shr ebp, cl
add edi, edi
movzx eax, word [ebx + edi + 0x600988]
and ebp, 1
jne 0x4070f3
mov ecx, eax
neg ecx
add ecx, 0x800
shr ecx, 5
add eax, ecx
jmp 0x4070fa
mov ecx, eax
shr ecx, 5
sub eax, ecx
mov word [ebx + edi + 0x600988], ax
or edi, ebp
test esi, esi
jne 0x4070cc
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
jmp 0x407271
movzx esi, word [ebx + 0x600786]
mov dword [esp + 0x3c], edi
mov edx, esi
mov dword [esp + 0x88], ecx
neg edx
add edx, 0x800
mov dword [esp + 0x40], 1
mov dword [esp + 0x84], eax
shr edx, 5
mov dword [esp + 0x70], ebp
mov ebp, dword [esp + 0x40]
mov dword [esp + 0x6c], ebx
add esi, edx
mov edx, ecx
mov dword [esp + 0x4c], 3
mov ecx, dword [esp + 0x4c]
shl edx, 4
mov word [ebx + 0x600786], si
lea esi, [edx + ebx + 0x600784]
lea edx, [eax - 0xa]
dec ecx
mov ebx, edx
shr ebx, cl
add ebp, ebp
movzx eax, word [esi + ebp + 0x104]
and ebx, 1
jne 0x4071a6
mov edi, eax
neg edi
add edi, 0x800
shr edi, 5
add eax, edi
jmp 0x4071ad
mov edi, eax
shr edi, 5
sub eax, edi
mov word [esi + ebp + 0x104], ax
or ebp, ebx
test ecx, ecx
jne 0x407181
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
jmp 0x407271
movzx esi, word [ebx + 0x600784]
mov dword [esp + 0x88], ecx
mov edx, esi
mov dword [esp + 0x84], eax
neg edx
add edx, 0x800
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
shr edx, 5
add esi, edx
mov word [ebx + 0x600784], si
mov edx, ecx
shl edx, 4
lea esi, [edx + ebx + 0x600784]
mov edx, 1
mov ebx, esi
mov esi, 3
dec esi
mov ecx, esi
mov ebp, edi
shr ebp, cl
add edx, edx
movzx eax, word [ebx + edx + 4]
and ebp, 1
jne 0x407249
mov ecx, eax
neg ecx
add ecx, 0x800
shr ecx, 5
add eax, ecx
jmp 0x407250
mov ecx, eax
shr ecx, 5
sub eax, ecx
mov word [ebx + edx + 4], ax
or edx, ebp
test esi, esi
jne 0x407225
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
mov edx, dword [ebx + ecx*4 + 0x604f90]
inc edx
mov dword [ebx + ecx*4 + 0x604f90], edx
cmp edx, dword [ebx + 0x604f8c]
jb 0x4074de
movzx esi, word [ebx + 0x600786]
mov dword [esp + 0x84], eax
mov eax, ecx
mov dword [esp + 0x88], ecx
shl eax, 4
lea edx, [ecx + eax]
mov dword [esp + 0x3c], edi
mov edi, dword [ebx + 0x604f88]
mov dword [esp + 0x68], edi
movzx edi, word [ebx + 0x600784]
mov dword [esp + 0x70], ebp
mov ecx, esi
mov dword [esp + 0x6c], ebx
shl edx, 6
shr ecx, 4
mov ecx, dword [ecx*4 + 0x445400]
lea edx, [edx + ebx + 0x600784]
mov dword [esp + 0x80], edx
mov ebp, edx
mov edx, edi
shr edx, 4
mov edx, dword [edx*4 + 0x445400]
mov dword [esp + 0x28], edx
xor edi, 0x7ff
shr edi, 4
add ecx, dword [edi*4 + 0x445400]
mov edx, dword [edi*4 + 0x445400]
mov dword [esp + 0x24], ecx
xor esi, 0x7ff
shr esi, 4
add edx, dword [esi*4 + 0x445400]
mov dword [esp + 0x20], edx
xor edx, edx
lea esi, [eax + ebx + 0x600784]
mov eax, dword [esp + 0x28]
xor edi, edi
mov ecx, edx
or ecx, 8
mov ebx, edi
mov ebp, ecx
and ebp, 0xfffffffe
movzx ebp, word [ebp + esi + 4]
mov edi, ecx
and edi, 1
neg edi
and edi, 0x7ff
xor ebp, edi
shr ebp, 4
shr ecx, 1
add ebx, dword [ebp*4 + 0x445400]
cmp ecx, 1
jne 0x40733a
mov ebp, dword [esp + 0x80]
xor edi, edi
add ebx, eax
mov dword [ebp + edx*4 + 0x404], ebx
inc edx
cmp edx, 8
jb 0x407333
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
cmp edx, 0x10
mov ebx, dword [esp + 0x6c]
jae 0x40742d
mov dword [esp + 0x3c], edi
mov dword [esp + 0x88], ecx
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x70], ebp
mov ebp, dword [esp + 0x80]
mov dword [esp + 0x6c], ebx
xor edi, edi
lea ecx, [edx - 8]
or ecx, 8
mov ebx, edi
mov ebp, ecx
and ebp, 0xfffffffe
movzx ebp, word [ebp + esi + 0x104]
mov edi, ecx
and edi, 1
neg edi
and edi, 0x7ff
xor ebp, edi
shr ebp, 4
shr ecx, 1
add ebx, dword [ebp*4 + 0x445400]
cmp ecx, 1
jne 0x4073ce
mov ebp, dword [esp + 0x80]
xor edi, edi
add ebx, eax
mov dword [ebp + edx*4 + 0x404], ebx
inc edx
cmp edx, 0x10
jb 0x4073c6
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
cmp edx, dword [esp + 0x68]
jae 0x4074d3
mov esi, dword [esp + 0x68]
mov dword [esp + 0x3c], edi
mov dword [esp + 0x88], ecx
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x80]
xor edi, edi
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
lea ebx, [edx - 0x10]
or ebx, 0x100
mov ebp, edi
mov eax, dword [esp + 0x6c]
mov esi, ebx
and esi, 0xfffffffe
movzx esi, word [esi + eax + 0x600988]
mov edi, ebx
and edi, 1
neg edi
and edi, 0x7ff
xor esi, edi
shr esi, 4
shr ebx, 1
add ebp, dword [esi*4 + 0x445400]
cmp ebx, 1
jne 0x407471
mov eax, dword [esp + 0x80]
mov esi, dword [esp + 0x68]
xor edi, edi
add ebp, ecx
mov dword [eax + edx*4 + 0x404], ebp
inc edx
cmp edx, esi
jb 0x407462
mov edi, dword [esp + 0x3c]
mov ecx, dword [esp + 0x88]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
mov dword [ebx + ecx*4 + 0x604f90], 0
mov esi, dword [esp + 0x90]
mov edx, dword [ebx + 0x10]
mov word [edx], di
add esi, 0xfffffffc
mov dword [edx + 2], esi
add edx, 6
mov dword [esp + 0x90], esi
mov dword [ebx + 0x10], edx
cmp esi, 2
jae 0x407507
mov edx, esi
jmp 0x407517
bsr edx, esi
mov edi, esi
lea ecx, [edx + 0x1f]
shr edi, cl
and edi, 1
lea edx, [edi + edx*2]
mov dword [esp + 0x74], esi
mov ecx, eax
mov dword [esp + 0x64], 6
cmp eax, 5
mov dword [esp + 0x84], eax
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
jb 0x40753e
mov ecx, 5
mov edi, 1
add ecx, 0xfffffffe
shl ecx, 7
add ecx, ebx
mov ebx, ecx
mov ecx, dword [esp + 0x64]
dec ecx
mov ebp, edx
shr ebp, cl
add edi, edi
movzx eax, word [ebx + edi + 0x480]
and ebp, 1
jne 0x407576
mov esi, eax
neg esi
add esi, 0x800
shr esi, 5
add eax, esi
jmp 0x40757d
mov esi, eax
shr esi, 5
sub eax, esi
mov word [ebx + edi + 0x480], ax
or edi, ebp
test ecx, ecx
jne 0x407551
mov esi, dword [esp + 0x74]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
cmp edx, 4
jb 0x4076bc
mov ecx, edx
shr ecx, 1
dec ecx
mov dword [esp + 0x78], ecx
mov edi, edx
and edi, 1
or edi, 2
shl edi, cl
mov ecx, esi
sub ecx, edi
cmp edx, 0xe
jae 0x407651
add edx, edx
neg edx
add edx, ebx
lea edx, [edx + edi*2]
cmp dword [esp + 0x78], 0
je 0x4076bc
mov dword [esp + 0x44], 1
mov dword [esp + 0x74], esi
xor edi, edi
mov dword [esp + 0x84], eax
mov eax, edi
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
mov ebx, dword [esp + 0x44]
mov esi, ecx
and esi, 1
add ebx, ebx
movzx ebp, word [edx + ebx + 0x67e]
test esi, esi
jne 0x407622
mov edi, ebp
neg edi
add edi, 0x800
shr edi, 5
add ebp, edi
jmp 0x407629
mov edi, ebp
shr edi, 5
sub ebp, edi
mov word [edx + ebx + 0x67e], bp
or ebx, esi
shr ecx, 1
inc eax
cmp eax, dword [esp + 0x78]
jb 0x4075fe
mov esi, dword [esp + 0x74]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
mov ebx, dword [esp + 0x6c]
jmp 0x4076bc
mov dword [esp + 0x74], esi
mov dword [esp + 0x84], eax
mov dword [esp + 0x70], ebp
and ecx, 0xf
mov edx, 1
xor edi, edi
mov eax, ecx
and eax, 1
add edx, edx
movzx ebp, word [ebx + edx + 0x764]
test eax, eax
jne 0x40768e
mov esi, ebp
neg esi
add esi, 0x800
shr esi, 5
add ebp, esi
jmp 0x407695
mov esi, ebp
shr esi, 5
sub ebp, esi
mov word [ebx + edx + 0x764], bp
or edx, eax
shr ecx, 1
inc edi
cmp edi, 4
jb 0x40766a
mov esi, dword [esp + 0x74]
mov eax, dword [esp + 0x84]
mov ebp, dword [esp + 0x70]
inc dword [ebx + 0x118]
mov edx, dword [ebx + 0x10c]
mov edi, dword [ebx + 0x108]
inc dword [ebx + 0xf0]
mov dword [ebx + 0x110], edx
mov edx, dword [ebx + 0x104]
mov dword [ebx + 0x10c], edi
mov dword [ebx + 0x108], edx
mov dword [ebx + 0x104], esi
mov edx, dword [ebx + 0x100]
sub edx, eax
mov dword [ebx + 0x100], edx
add ebp, eax
test edx, edx
jne 0x4066ed
mov edx, dword [ebx + 0xf0]
cmp edx, dword [ebx + 0xc4]
jb 0x407719
mov ecx, ebx
call fcn.004079f0
mov edx, dword [ebx + 0x118]
cmp edx, dword [ebx + 0xc8]
jb 0x4077f5
mov dword [ebx + 0x118], 0
mov dword [esp + 0x70], ebp
xor esi, esi
movzx ebp, word [ebx + 0x766]
mov dword [esp + 0x94], esi
mov edi, esi
and edi, 1
movzx ecx, word [ebx + edi*2 + 0x768]
mov eax, esi
shr eax, 1
mov edx, edi
neg edx
and edx, 0x7ff
xor ebp, edx
shr ebp, 4
and eax, 1
mov edx, esi
shr edx, 2
mov esi, eax
neg esi
and esi, 0x7ff
xor ecx, esi
mov esi, dword [esp + 0x94]
shr ecx, 4
mov ecx, dword [ecx*4 + 0x445400]
lea edi, [edi + edi + 4]
add edi, eax
add ecx, dword [ebp*4 + 0x445400]
and edx, 1
lea ebp, [edx + edi*2]
movzx ebp, word [ebx + ebp*2 + 0x764]
movzx edi, word [ebx + edi*2 + 0x764]
mov eax, esi
shr eax, 3
and eax, 1
neg eax
and eax, 0x7ff
xor ebp, eax
shr ebp, 4
neg edx
and edx, 0x7ff
xor edi, edx
shr edi, 4
add ecx, dword [edi*4 + 0x445400]
add ecx, dword [ebp*4 + 0x445400]
mov dword [ebx + esi*4 + 0x78acb0], ecx
inc esi
cmp esi, 0x10
jb 0x40773b
mov ebp, dword [esp + 0x70]
mov edx, dword [esp + 0x7c]
mov esi, dword [ebx + 0x50]
mov dword [esp + 0x7c], ebp
neg edx
add edx, ebp
add dword [ebx + 0xd4], edx
adc dword [ebx + 0xd8], 0
cmp esi, dword [ebx + 0x58]
jne 0x4066ed
mov edx, dword [ebx + 0x1c]
test edx, edx
jne 0x407837
push 1
mov ecx, ebx
call fcn.00407850
mov edx, dword [ebx + 0x50]
cmp edx, dword [ebx + 0x58]
je 0x40781a
jmp 0x4066ed
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x30]
mov ebx, dword [esp + 0x34]
mov ebp, dword [esp + 0x38]
jmp 0x4066cc