Function at 0x46c462
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push 0x60
mov eax, 0x49f34b
call fcn.00497b04
mov edi, ecx
mov dword [ebp - 0x40], edi
call fcn.0046c41c
mov edx, dword [ebp + 8]
mov eax, dword [edi + 0xb4]
add edx, 0x1f
mov ecx, dword [edi + 0xb0]
and edx, 0xffffffe0
add eax, edx
mov dword [ebp - 0x18], edx
mov dword [edi + 0xb4], eax
test ecx, ecx
je 0x46c4b3
cmp eax, ecx
jle 0x46c4b3
cmp byte [edi + 0xb8], 0
jne 0x46c4b3
mov ecx, edi
call fcn.0046d1c2
mov edx, dword [ebp - 0x18]
mov eax, edx
mov esi, edx
shr eax, 5
and esi, 0xfff
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 4], eax
push 2
pop eax
sub eax, dword [edi + 0x18]
imul ecx, eax, 0x28
mov eax, dword [edi + 0xc]
mov edx, dword [ecx + eax]
mov dword [ebp - 0x30], edx
test esi, esi
jne 0x46c4fb
mov ebx, dword [edi + 0x30]
mov eax, dword [edi + 0x2c]
add ebx, 0xf
and ebx, 0xfffffff0
jmp 0x46c501
mov eax, dword [edi + 0x24]
mov ebx, dword [edi + 0x28]
mov dword [ebp - 0x28], eax
mov ecx, eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp + 8], ecx
test esi, esi
jne 0x46c619
mov dword [ebp - 0x10], esi
cmp eax, edx
jae 0x46c831
mov edx, eax
mov dword [ebp - 0x10], esi
shl edx, 0xc
sub edx, 0x3000
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x14]
mov edx, 0x8000
sub eax, esi
cmp eax, edx
cmovl edx, eax
mov eax, dword [edi + 0x98]
mov dword [ebp - 0x34], edx
cmp dword [eax + ecx*4], edx
mov edx, dword [ebp - 0x20]
jg 0x46c55c
xor esi, esi
xor ebx, ebx
mov dword [ebp - 0x10], esi
jmp 0x46c5fe
push ecx
mov ecx, edi
call fcn.004656cd
mov dword [ebp - 0x2c], eax
jmp 0x46c5c5
mov cl, byte [eax + ebx]
inc ebx
mov dword [ebp - 0x1c], ebx
test cl, cl
je 0x46c581
add ebx, 0xf
and ebx, 0xfffffff0
xor esi, esi
mov dword [ebp - 0x10], esi
jmp 0x46c5c7
add esi, 8
mov dword [ebp - 0x10], esi
cmp esi, dword [ebp - 0x14]
jne 0x46c5c7
mov eax, dword [ebp - 0x20]
mov ecx, edi
push dword [ebp - 0x18]
add eax, ebx
shl eax, 3
sub eax, esi
shl eax, 5
push eax
mov dword [ebp - 0x24], eax
call fcn.0046c3ef
test al, al
je 0x46c869
mov eax, dword [ebp - 0x14]
sar eax, 3
add eax, 0xf
add ebx, eax
mov eax, dword [ebp - 0x2c]
and ebx, 0xfffffff0
xor esi, esi
mov dword [ebp - 0x10], esi
mov edx, ebx
cmp ebx, 0x1000
jb 0x46c569
test edx, edx
jne 0x46c5eb
test esi, esi
jne 0x46c5eb
mov edx, dword [edi + 0x98]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x34]
cmp ecx, dword [edx + eax*4]
jge 0x46c5eb
mov dword [edx + eax*4], ecx
push dword [ebp - 0x2c]
lea ecx, [edi + 0x60]
xor ebx, ebx
call fcn.0046f51b
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x20]
inc ecx
add edx, 0x1000
mov dword [ebp + 8], ecx
mov dword [ebp - 0x20], edx
cmp ecx, dword [ebp - 0x30]
jb 0x46c530
jmp 0x46c82e
xor esi, esi
mov dword [ebp - 0x10], esi
cmp eax, edx
jae 0x46c831
mov edx, eax
mov dword [ebp - 0x10], esi
shl edx, 0xc
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x14]
mov edx, 0x8000
sub eax, esi
cmp eax, edx
cmovl edx, eax
mov eax, dword [edi + 0x98]
mov dword [ebp - 0x48], edx
cmp dword [eax + ecx*4], edx
mov edx, dword [ebp - 0x20]
jg 0x46c660
xor esi, esi
xor ebx, ebx
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x1c], ebx
jmp 0x46c818
push ecx
mov ecx, edi
call fcn.004656cd
mov ecx, eax
mov eax, ebx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x24], eax
cmp ebx, 0x1000
jae 0x46c7e6
mov edx, dword [ebp - 0x14]
movzx eax, byte [ecx + ebx]
mov dword [ebp - 0x34], eax
movzx ecx, byte [eax + 0x4b9f38]
add ecx, esi
cmp ecx, edx
jl 0x46c6d7
mov eax, dword [ebp - 0x20]
mov ecx, edi
push dword [ebp - 0x18]
add eax, ebx
shl eax, 3
sub eax, esi
sub eax, 0x18000
shl eax, 5
push eax
mov dword [ebp - 0x24], eax
call fcn.0046c3ef
test al, al
je 0x46c9b4
mov edx, dword [ebp - 0x14]
lea eax, [edx + 7]
shr eax, 3
add ebx, eax
xor esi, esi
mov eax, ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x24], eax
jmp 0x46c7d4
movzx eax, byte [eax + 0x4b9e38]
cmp eax, edx
mov eax, dword [ebp - 0x34]
jb 0x46c7bb
movzx ecx, byte [eax + 0x4b9d18]
mov eax, dword [ebp - 0x20]
mov esi, dword [ebp - 0x18]
add eax, ebx
mov dword [ebp - 0x34], ecx
add ecx, 0xfffe8000
push esi
lea eax, [ecx + eax*8]
mov ecx, edi
shl eax, 5
push eax
mov dword [ebp - 0x24], eax
call fcn.0046c3ef
test al, al
jne 0x46c6bd
mov eax, dword [edi + 0x34]
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x54]
mov dword [edi + 0x34], eax
mov eax, dword [ebp + 8]
mov dword [edi + 0x24], eax
lea eax, [ecx + esi]
mov dword [ebp - 0x54], ecx
mov ecx, edi
push eax
mov dword [ebp - 0x50], esi
mov dword [edi + 0x28], ebx
call fcn.0046c39c
cmp dword [ebp + 0xc], 0
lea eax, [edi + 0x60]
je 0x46c77d
push dword [ebp + 0xc]
mov ecx, edi
call fcn.00465563
push dword [ebp - 0x18]
mov esi, eax
lea ecx, [edi + 0x60]
and esi, 7
sub eax, esi
push eax
push dword [ebp - 0x24]
call fcn.0046f323
or esi, dword [ebp - 0x24]
mov ecx, edi
or esi, 2
push esi
push dword [ebp + 0xc]
call fcn.00465633
lea eax, [edi + 0x60]
push dword [ebp - 0x2c]
mov ecx, eax
call fcn.0046f51b
push dword [ebp + 8]
lea eax, [ebp - 0x6c]
mov ecx, edi
push eax
call fcn.0046bfa1
mov ecx, dword [ebp - 0x14]
mov dl, 1
shl dl, cl
mov ecx, dword [ebp - 0x34]
dec dl
shl dl, cl
or byte [eax + ebx], dl
mov ecx, dword [edi + 0x34]
mov ecx, dword [ecx + 8]
mov dword [edi + 0x34], ecx
mov dword [ebp - 4], 3
jmp 0x46c9a1
mov al, byte [eax + 0x4ba058]
inc ebx
mov dword [ebp - 0x1c], ebx
cmp al, 8
jne 0x46c7ce
add esi, 8
jmp 0x46c7d1
movzx esi, al
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x10], esi
cmp ebx, 0x1000
jb 0x46c681
test eax, eax
jne 0x46c802
test esi, esi
jne 0x46c802
mov ecx, dword [edi + 0x98]
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x48]
cmp edx, dword [ecx + eax*4]
jge 0x46c802
mov dword [ecx + eax*4], edx
push dword [ebp - 0x2c]
xor ebx, ebx
lea ecx, [edi + 0x60]
mov dword [ebp - 0x1c], ebx
call fcn.0046f51b
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x20]
inc ecx
add edx, 0x1000
mov dword [ebp + 8], ecx
mov dword [ebp - 0x20], edx
cmp ecx, dword [ebp - 0x30]
jb 0x46c631
mov eax, dword [ebp - 0x28]
cmp eax, 3
je 0x46cb85
cmp dword [edi + 0xb0], 0
je 0x46c850
cmp byte [edi + 0xb8], 0
je 0x46cb41
lea edx, [eax + 1]
mov dword [ebp - 0x3c], esi
mov esi, dword [ebp - 0x44]
xor ebx, ebx
push 3
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x30], edx
pop eax
jmp 0x46c501
mov eax, dword [edi + 0x34]
mov edx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x54]
mov dword [edi + 0x34], eax
mov eax, dword [ebp + 8]
mov dword [edi + 0x2c], eax
lea eax, [edx + ecx]
mov dword [ebp - 0x50], ecx
mov ecx, edi
push eax
mov dword [ebp - 0x54], edx
mov dword [edi + 0x30], ebx
call fcn.0046c39c
cmp dword [ebp + 0xc], 0
lea eax, [edi + 0x60]
je 0x46c8d5
push dword [ebp + 0xc]
mov ecx, edi
call fcn.00465563
push dword [ebp - 0x18]
mov esi, eax
lea ecx, [edi + 0x60]
and esi, 7
sub eax, esi
push eax
push dword [ebp - 0x24]
call fcn.0046f323
or esi, dword [ebp - 0x24]
mov ecx, edi
or esi, 2
push esi
push dword [ebp + 0xc]
call fcn.00465633
mov esi, dword [ebp - 0x10]
lea eax, [edi + 0x60]
push dword [ebp - 0x2c]
mov ecx, eax
call fcn.0046f51b
push dword [ebp + 8]
lea eax, [ebp - 0x6c]
mov ecx, edi
push eax
call fcn.0046bfa1
sar esi, 3
mov ecx, eax
mov eax, 0xff
cmp esi, ebx
jbe 0x46c92a
push ebx
push eax
push ecx
call fcn.00473170
mov eax, dword [ebp + 8]
add esp, 0xc
sub esi, ebx
mov ecx, edi
dec eax
mov dword [ebp + 8], eax
push eax
lea eax, [ebp - 0x6c]
push eax
call fcn.0046bfa1
mov ebx, 0x1000
mov ecx, eax
mov dword [ebp - 0x1c], ebx
mov eax, 0xff
cmp esi, 0x1000
jbe 0x46c97e
mov ebx, dword [ebp + 8]
lea edx, [esi - 0x1001]
shr edx, 0xc
inc edx
mov dword [ebp + 0xc], edx
push 0x1000
push eax
push ecx
call fcn.00473170
mov eax, dword [edi + 0x98]
add esp, 0xc
sub esi, 0x1000
mov ecx, edi
and dword [eax + ebx*4], 0
dec ebx
push ebx
lea eax, [ebp - 0x6c]
push eax
call fcn.0046bfa1
sub dword [ebp + 0xc], 1
mov ecx, eax
mov eax, 0xff
jne 0x46c942
mov ebx, dword [ebp - 0x1c]
push esi
sub ecx, esi
add ecx, ebx
push 0xff
push ecx
call fcn.00473170
mov ecx, dword [edi + 0x34]
add esp, 0xc
mov ecx, dword [ecx + 8]
mov dword [edi + 0x34], ecx
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x6c]
call fcn.0046f9e1
mov eax, dword [ebp - 0x24]
call fcn.00497ae1
ret 8
mov eax, dword [edi + 0x34]
mov edx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x54]
mov dword [edi + 0x34], eax
mov eax, dword [ebp + 8]
mov dword [edi + 0x24], eax
lea eax, [edx + ecx]
mov dword [ebp - 0x50], ecx
mov ecx, edi
push eax
mov dword [ebp - 0x54], edx
mov dword [edi + 0x28], ebx
call fcn.0046c39c
cmp dword [ebp + 0xc], 0
lea eax, [edi + 0x60]
je 0x46ca20
push dword [ebp + 0xc]
mov ecx, edi
call fcn.00465563
push dword [ebp - 0x18]
mov esi, eax
lea ecx, [edi + 0x60]
and esi, 7
sub eax, esi
push eax
push dword [ebp - 0x24]
call fcn.0046f323
or esi, dword [ebp - 0x24]
mov ecx, edi
or esi, 2
push esi
push dword [ebp + 0xc]
call fcn.00465633
mov esi, dword [ebp - 0x10]
lea eax, [edi + 0x60]
push dword [ebp - 0x2c]
mov ecx, eax
call fcn.0046f51b
push dword [ebp + 8]
lea eax, [ebp - 0x6c]
mov ecx, edi
push eax
call fcn.0046bfa1
mov ecx, dword [ebp - 0x14]
mov dl, 1
sub ecx, esi
mov dword [ebp + 0xc], eax
shl dl, cl
dec dl
or byte [eax + ebx], dl
test esi, esi
je 0x46cb2c
mov ecx, ebx
shl ecx, 3
cmp esi, ecx
jbe 0x46ca92
push ebx
push 0xff
push eax
call fcn.00473170
mov eax, ebx
add esp, 0xc
shl eax, 3
mov ecx, edi
sub esi, eax
mov eax, dword [ebp + 8]
dec eax
push eax
mov dword [ebp + 8], eax
lea eax, [ebp - 0x6c]
push eax
call fcn.0046bfa1
mov edx, eax
mov ebx, 0x1000
mov dword [ebp + 0xc], edx
mov dword [ebp - 0x1c], ebx
jmp 0x46ca95
mov edx, dword [ebp + 0xc]
cmp esi, 0x8000
jle 0x46caf2
lea ebx, [esi - 0x8001]
shr ebx, 0xf
inc ebx
imul eax, ebx, 0xffff8000
add esi, eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x10], esi
mov esi, dword [ebp + 8]
push 0x1000
push 0xff
push eax
call fcn.00473170
mov eax, dword [edi + 0x98]
add esp, 0xc
mov ecx, edi
and dword [eax + esi*4], 0
dec esi
push esi
lea eax, [ebp - 0x6c]
push eax
call fcn.0046bfa1
sub ebx, 1
jne 0x46cab8
mov ebx, dword [ebp - 0x1c]
mov edx, eax
mov esi, dword [ebp - 0x10]
mov dword [ebp + 0xc], eax
push 8
pop eax
sub eax, esi
lea ecx, [esi - 8]
mov dword [ebp + 8], eax
mov eax, 0xff
mov dword [ebp + 0xc], ecx
test ecx, ecx
jle 0x46cb21
dec ecx
shr ecx, 3
inc ecx
mov esi, ecx
shl esi, 3
dec ebx
mov byte [edx + ebx], al
sub ecx, 1
jne 0x46cb13
sub esi, dword [ebp + 0xc]
jmp 0x46cb24
mov esi, dword [ebp + 8]
mov ecx, esi
shl al, cl
or byte [edx + ebx - 1], al
mov ecx, dword [edi + 0x34]
mov ecx, dword [ecx + 8]
mov dword [edi + 0x34], ecx
mov dword [ebp - 4], 2
jmp 0x46c9a1
mov ebx, dword [ebp - 0x18]
mov ecx, edi
sub dword [edi + 0xb4], ebx
call fcn.0046d1c2
and dword [edi + 0x30], 0
mov ecx, edi
and dword [edi + 0x28], 0
push 3
pop eax
push dword [ebp + 0xc]
mov dword [edi + 0x2c], eax
push ebx
mov dword [edi + 0x24], eax
call fcn.0046c462
mov esi, eax
lea ecx, [ebp - 0x6c]
mov dword [ebp - 4], 5
call fcn.0046f9e1
mov eax, esi
jmp 0x46c9ac
mov eax, dword [ebp - 0x38]
cmp eax, ecx
jbe 0x46cb97
mov esi, dword [ebp - 0x3c]
mov ecx, eax
mov dword [ebp + 8], ecx
mov dword [ebp - 0x10], esi
cmp ecx, 0x1003
je 0x46cf41
mov eax, dword [edi + 4]
mov ebx, dword [ebp - 0x18]
cmp ebx, eax
mov dword [ebp - 0x3c], 0xff000
cmova eax, ebx
xor edx, edx
add eax, 0xfefff
div dword [ebp - 0x3c]
mov edx, eax
add ecx, edx
mov dword [ebp - 0x1c], edx
cmp ecx, 0x1003
jbe 0x46cbee
xor edx, edx
lea eax, [ebx + 0xfefff]
div dword [ebp - 0x3c]
mov edx, eax
mov eax, dword [ebp + 8]
add eax, edx
mov dword [ebp - 0x1c], edx
cmp eax, 0x1003
ja 0x46cf41
mov ebx, dword [ebp - 0x14]
mov eax, edx
sub ebx, esi
shl eax, 0xc
mov esi, dword [ebp + 8]
mov dword [ebp - 0x14], ebx
lea ecx, [ebx + 0x7f]
lea esi, [esi + 0xffd]
and ecx, 0xffffff80
shl esi, 0xf
add esi, ecx
mov dword [ebp - 0x30], ecx
shl esi, 5
mov ecx, edi
add eax, esi
mov dword [ebp - 0x34], esi
push eax
call fcn.0046c39c
mov eax, ebx
lea ecx, [edi + 0x60]
sar eax, 3
mov edx, esi
mov dword [ebp - 0x2c], eax
mov ebx, 0xff
mov dword [ebp - 0x3c], edx
cmp eax, 0x1000
jb 0x46cc85
shr eax, 0xc
mov edi, ecx
mov dword [ebp - 0x38], eax
push 1
push edx
mov ecx, edi
call fcn.0046f107
push 0x1000
mov esi, eax
push ebx
push esi
call fcn.00473170
add esp, 0xc
mov ecx, edi
push esi
call fcn.0046f51b
mov edx, dword [ebp - 0x3c]
mov eax, 0x1000
sub dword [ebp - 0x2c], eax
add edx, eax
sub dword [ebp - 0x38], 1
mov dword [ebp - 0x3c], edx
jne 0x46cc46
mov edi, dword [ebp - 0x40]
lea ecx, [edi + 0x60]
push 1
push edx
call fcn.0046f107
push dword [ebp - 0x2c]
mov esi, eax
push ebx
push esi
call fcn.00473170
mov ecx, dword [ebp - 0x14]
add esp, 0xc
mov eax, dword [ebp - 0x2c]
and ecx, 7
mov dl, 1
shl dl, cl
dec dl
mov byte [esi + eax], dl
push esi
lea esi, [edi + 0x60]
mov ecx, esi
call fcn.0046f51b
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x1c]
shl ecx, 4
sar eax, 3
add eax, dword [ebp - 0x34]
mov dword [ebp - 0x20], ecx
mov ecx, eax
and ecx, 0xfff
sub eax, ecx
mov dword [ebp - 0x2c], ecx
push 1
push eax
mov ecx, esi
mov dword [ebp - 0x30], eax
call fcn.0046f107
mov ecx, eax
mov edx, 0x1000
mov eax, dword [ebp - 0x2c]
sub edx, eax
mov dword [ebp - 0x28], ecx
cmp edx, dword [ebp - 0x20]
jae 0x46cd58
mov edi, dword [ebp - 0x30]
push edx
add eax, ecx
push ebx
push eax
call fcn.00473170
add esp, 0xc
mov ecx, esi
push dword [ebp - 0x28]
call fcn.0046f51b
mov ecx, dword [ebp - 0x2c]
lea eax, [edi + 0x1000]
add ecx, 0xfffff000
mov edi, eax
add dword [ebp - 0x20], ecx
mov ecx, eax
and ecx, 0xfff
sub edi, ecx
mov dword [ebp - 0x2c], ecx
push 1
push edi
mov ecx, esi
call fcn.0046f107
mov ecx, eax
mov edx, 0x1000
mov eax, dword [ebp - 0x2c]
sub edx, eax
mov dword [ebp - 0x28], ecx
cmp edx, dword [ebp - 0x20]
jb 0x46ccfc
mov edi, dword [ebp - 0x40]
lea esi, [edi + 0x60]
push dword [ebp - 0x20]
add eax, ecx
push ebx
push eax
call fcn.00473170
add esp, 0xc
mov ecx, esi
push dword [ebp - 0x28]
call fcn.0046f51b
sub dword [ebp - 0x1c], 1
mov esi, dword [ebp + 8]
mov eax, esi
mov dword [ebp - 0x2c], eax
js 0x46cdc6
mov ebx, dword [ebp - 0x34]
jmp 0x46cd87
mov eax, dword [ebp - 0x2c]
mov edx, dword [edi + 0x10]
mov esi, eax
mov ecx, eax
shr esi, 0xf
shr ecx, 0xa
and ecx, 0x1f
mov eax, dword [edx + esi*4]
bts eax, ecx
mov dword [edx + esi*4], eax
mov eax, dword [ebp - 0x2c]
mov ecx, eax
inc eax
mov dword [ebp - 0x2c], eax
mov eax, ebx
or eax, 3
push eax
push ecx
mov ecx, edi
call fcn.00465633
add ebx, 0x1000
sub dword [ebp - 0x1c], 1
jns 0x46cd84
mov esi, dword [ebp + 8]
mov edx, dword [ebp - 0x2c]
push 2
pop eax
sub eax, dword [edi + 0x18]
imul ecx, eax, 0x28
mov eax, dword [edi + 0xc]
mov dword [ecx + eax], edx
mov eax, dword [ebp - 0x14]
cdq
and edx, 0x7fff
lea ecx, [edx + eax]
sar ecx, 0xf
add ecx, esi
cmp dword [ebp - 0x44], 0
je 0x46cdf9
and dword [edi + 0x28], 0
mov dword [edi + 0x24], ecx
jmp 0x46ce0d
and dword [edi + 0x30], 0
mov dword [edi + 0x2c], ecx
jmp 0x46ce0d
mov eax, dword [edi + 0x98]
dec ecx
and dword [eax + ecx*4], 0
cmp ecx, esi
ja 0x46ce02
mov ebx, dword [ebp - 0x10]
mov eax, esi
shl eax, 0xf
sub eax, ebx
sub eax, 0x18000
shl eax, 5
cmp dword [ebp + 0xc], 0
mov dword [ebp - 0x2c], eax
je 0x46ce63
push dword [ebp + 0xc]
mov ecx, edi
call fcn.00465563
push dword [ebp - 0x18]
mov esi, eax
lea ecx, [edi + 0x60]
and esi, 7
sub eax, esi
push eax
push dword [ebp - 0x2c]
call fcn.0046f323
or esi, dword [ebp - 0x2c]
mov ecx, edi
or esi, 2
push esi
push dword [ebp + 0xc]
call fcn.00465633
mov esi, dword [ebp + 8]
mov eax, dword [ebp - 0x2c]
test ebx, ebx
je 0x46cf2a
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x50], eax
mov eax, dword [edi + 0x34]
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x54]
mov dword [edi + 0x34], eax
cmp ebx, 0x8000
jle 0x46ced5
lea eax, [ebx - 0x8001]
shr eax, 0xf
inc eax
mov dword [ebp + 0xc], eax
imul eax, eax, 0xffff8000
add ebx, eax
mov dword [ebp - 0x10], ebx
mov ebx, dword [ebp + 0xc]
dec esi
lea eax, [ebp - 0x6c]
push esi
push eax
mov ecx, edi
call fcn.0046bfa1
push 0x1000
push 0xff
push eax
call fcn.00473170
mov eax, dword [edi + 0x98]
add esp, 0xc
and dword [eax + esi*4], 0
sub ebx, 1
jne 0x46cea3
mov ebx, dword [ebp - 0x10]
dec esi
lea eax, [ebp - 0x6c]
push esi
push eax
mov ecx, edi
call fcn.0046bfa1
push 8
pop esi
sub esi, ebx
lea edx, [eax + 0x1000]
lea eax, [ebx - 8]
mov dword [ebp + 0xc], eax
test eax, eax
jle 0x46cf15
lea ecx, [eax - 1]
mov eax, 0xff
shr ecx, 3
inc ecx
mov esi, ecx
shl esi, 3
dec edx
mov byte [edx], al
sub ecx, 1
jne 0x46cf08
sub esi, dword [ebp + 0xc]
jmp 0x46cf1a
mov eax, 0xff
mov ecx, esi
shl al, cl
or byte [edx - 1], al
mov ecx, dword [edi + 0x34]
mov ecx, dword [ecx + 8]
mov dword [edi + 0x34], ecx
lea ecx, [ebp - 0x6c]
mov dword [ebp - 4], 4
call fcn.0046f9e1
mov eax, dword [ebp - 0x2c]
jmp 0x46c9ac
push str.Out_of_memory
push 5
mov ecx, edi
call fcn.0046b11b
int3