Function at 0x59d810
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4b8
mov eax, dword [0x64e2c0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x48c], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x490], eax
mov eax, dword [ebp + 0x14]
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x494], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x46c], eax
lea eax, [ebp - 0x4b8]
push edi
push eax
push esi
mov dword [ebp - 0x414], 0
mov dword [ebp - 0x49c], 0xff
call fcn.0059e7c0
add esp, 8
test eax, eax
je 0x59e7a5
mov ecx, dword [ebp - 0x4ac]
mov eax, dword [esi + 4]
mov ebx, dword [ebp - 0x4b4]
mov edi, dword [ebp - 0x4b8]
mov dword [ebp - 0x438], ecx
mov ecx, dword [ebp - 0x4a8]
mov dword [ebp - 0x43c], ecx
mov ecx, dword [ebp - 0x4a4]
mov dword [ebp - 0x460], eax
mov dword [ebp - 0x418], ecx
mov ecx, dword [ebp - 0x4a0]
cdq
xor eax, edx
mov dword [ebp - 0x420], ecx
mov ecx, dword [ebp - 0x49c]
sub eax, edx
mov edx, dword [ebp - 0x498]
mov dword [ebp - 0x444], ecx
mov ecx, dword [ebp - 0x4b0]
mov dword [ebp - 0x40c], eax
mov dword [esi + 4], eax
mov dword [ebp - 0x430], ecx
mov dword [ebp - 0x42c], edx
mov dword [ebp - 0x448], ebx
mov dword [ebp - 0x424], edi
cmp ecx, 0xc
jne 0x59d923
cmp edi, 0x18
jge 0x59d938
mov ecx, ebx
mov eax, 0x55555556
sub ecx, edx
sub ecx, 0x18
imul ecx
mov eax, dword [ebp - 0x40c]
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
jmp 0x59d92f
cmp edi, 0x10
jge 0x59d935
sub ebx, edx
sub ebx, ecx
sar ebx, 2
mov dword [ebp - 0x414], ebx
cmp edi, 0x18
mov edx, dword [ebp - 0x420]
jne 0x59d94f
cmp edx, 0xff000000
jne 0x59d94f
mov ecx, 3
jmp 0x59d959
xor ecx, ecx
test edx, edx
setne cl
add ecx, 3
mov edx, dword [ebp - 0x46c]
mov dword [ebp - 0x440], ecx
mov dword [esi + 8], ecx
test edx, edx
je 0x59d979
cmp edx, 3
jl 0x59d979
mov ecx, edx
mov dword [ebp - 0x440], ecx
mov ebx, dword [esi]
mov edi, ebx
mov dword [ebp - 0x410], eax
test edi, edi
js 0x59e78c
je 0x59d99d
mov eax, Ordinal_1
cdq
idiv edi
cmp ecx, eax
jg 0x59e78c
imul edi, ecx
test edi, edi
js 0x59e78c
mov eax, dword [ebp - 0x410]
test eax, eax
js 0x59e78c
je 0x59d9cc
mov eax, Ordinal_1
cdq
idiv dword [ebp - 0x410]
cmp edi, eax
jg 0x59e78c
test ebx, ebx
je 0x59d9e1
xor edx, edx
mov eax, Ordinal_1
div ebx
cmp ecx, eax
jg 0x59e760
mov eax, dword [ebp - 0x40c]
test eax, eax
je 0x59da06
xor edx, edx
mov eax, Ordinal_1
div dword [ebp - 0x40c]
cmp edi, eax
jg 0x59e760
mov eax, dword [ebp - 0x40c]
imul ebx, ecx
imul ebx, eax
push ebx
call fcn.005b7d4f
mov ebx, eax
add esp, 4
mov dword [ebp - 0x468], ebx
test ebx, ebx
je 0x59e760
xor edi, edi
cmp dword [ebp - 0x424], 0x10
jge 0x59e047
mov eax, dword [ebp - 0x414]
test eax, eax
je 0x59e012
cmp eax, 0x100
jg 0x59e012
mov edx, dword [ebp - 0x440]
mov dword [ebp - 0x40c], edx
test eax, eax
jle 0x59dbd6
mov eax, dword [esi + 0xa8]
xor ebx, ebx
mov edi, dword [ebp - 0x430]
mov dword [ebp - 0x40c], edx
mov edx, dword [esi + 0xac]
cmp eax, edx
jb 0x59da94
cmp dword [esi + 0x20], 0
je 0x59dade
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov byte [ebp - 0x405], cl
lea ecx, [ebx*4]
mov dl, byte [ebp - 0x405]
mov byte [ebp + ecx - 0x402], dl
mov edx, dword [esi + 0xac]
mov dword [esi + 0xa8], eax
mov dword [ebp - 0x418], ecx
mov dword [ebp - 0x434], ecx
cmp eax, edx
jae 0x59daf5
mov cl, byte [eax]
mov byte [ebp - 0x405], cl
lea ecx, [ebx*4]
jmp 0x59db1e
lea ecx, [ebx*4]
mov dword [ebp - 0x418], ecx
mov byte [ebp + ecx - 0x402], 0
jmp 0x59dafb
mov ecx, dword [ebp - 0x434]
cmp dword [esi + 0x20], 0
je 0x59db47
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
mov byte [ebp - 0x405], cl
mov ecx, dword [ebp - 0x418]
mov dl, byte [ebp - 0x405]
inc eax
mov byte [ebp + ecx - 0x403], dl
mov edx, dword [esi + 0xac]
mov dword [esi + 0xa8], eax
cmp eax, edx
jae 0x59db4f
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59db71
mov byte [ebp + ecx - 0x403], 0
cmp dword [esi + 0x20], 0
je 0x59db6f
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59db71
xor dl, dl
mov ecx, dword [ebp - 0x418]
mov byte [ebp + ecx - 0x404], dl
cmp edi, 0xc
je 0x59dbb5
cmp eax, dword [esi + 0xac]
jae 0x59db94
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59dbb5
cmp dword [esi + 0x20], 0
je 0x59dbb5
push esi
call fcn.005aad30
mov ecx, dword [ebp - 0x418]
add esp, 4
inc dword [esi + 0xa8]
mov eax, dword [esi + 0xa8]
mov byte [ebp + ecx - 0x401], 0xff
inc ebx
mov ecx, dword [ebp - 0x414]
cmp ebx, ecx
jl 0x59da75
mov ebx, dword [ebp - 0x468]
xor edi, edi
jmp 0x59dbdc
mov ecx, dword [ebp - 0x414]
xor eax, eax
cmp dword [ebp - 0x430], 0xc
setne al
add eax, 3
imul eax, ecx
mov ecx, dword [ebp - 0x448]
sub ecx, eax
sub ecx, dword [ebp - 0x42c]
sub ecx, dword [ebp - 0x430]
push ecx
push esi
call fcn.005ab390
mov eax, dword [ebp - 0x424]
add esp, 8
cmp eax, 1
jne 0x59dc21
mov edx, dword [esi]
add edx, 7
shr edx, 3
jmp 0x59dc38
cmp eax, 4
jne 0x59dc2d
mov edx, dword [esi]
inc edx
shr edx, 1
jmp 0x59dc38
cmp eax, 8
jne 0x59dfdd
mov edx, dword [esi]
mov ecx, dword [esi + 4]
neg edx
and edx, 3
mov dword [ebp - 0x428], 0
mov dword [ebp - 0x418], edx
cmp eax, 1
jne 0x59ddf3
test ecx, ecx
jle 0x59e5ec
mov eax, dword [esi + 0xa8]
mov ecx, 7
mov dword [ebp - 0x420], ecx
cmp eax, dword [esi + 0xac]
jae 0x59dc85
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59dcad
cmp dword [esi + 0x20], 0
je 0x59dcab
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov ecx, dword [ebp - 0x420]
mov dl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59dcad
xor dl, dl
movzx eax, dl
mov edx, dword [esi]
mov dword [ebp - 0x41c], eax
mov dword [ebp - 0x410], 0
test edx, edx
jle 0x59dd9c
nop word [eax + eax]
sar eax, cl
and eax, 1
lea ecx, [eax*4]
movzx eax, byte [ebp + ecx - 0x404]
mov byte [edi + ebx], al
movzx eax, byte [ebp + ecx - 0x403]
mov byte [edi + ebx + 1], al
movzx eax, byte [ebp + ecx - 0x402]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [ebp - 0x40c], 4
jne 0x59dd10
mov byte [edi + ebx], 0xff
inc edi
mov eax, dword [ebp - 0x410]
inc eax
mov dword [ebp - 0x410], eax
cmp eax, edx
je 0x59dd9c
mov ecx, dword [ebp - 0x420]
sub ecx, 1
mov dword [ebp - 0x420], ecx
jns 0x59dd8e
mov eax, dword [esi + 0xa8]
mov dword [ebp - 0x420], 7
cmp eax, dword [esi + 0xac]
jae 0x59dd55
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59dd77
cmp dword [esi + 0x20], 0
je 0x59dd75
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
jmp 0x59dd77
xor cl, cl
mov edx, dword [esi]
movzx eax, cl
mov ecx, dword [ebp - 0x420]
mov dword [ebp - 0x41c], eax
mov eax, dword [ebp - 0x410]
cmp eax, edx
mov eax, dword [ebp - 0x41c]
jl 0x59dcd0
cmp dword [esi + 0x10], 0
mov edx, dword [ebp - 0x418]
je 0x59ddd0
mov eax, dword [esi + 0xac]
mov ecx, eax
sub ecx, dword [esi + 0xa8]
cmp ecx, edx
jge 0x59ddd0
sub edx, ecx
mov dword [esi + 0xa8], eax
mov eax, dword [esi + 0x14]
push edx
push dword [esi + 0x1c]
call eax
add esp, 8
jmp 0x59ddd6
add dword [esi + 0xa8], edx
mov edx, dword [ebp - 0x428]
mov ecx, dword [esi + 4]
inc edx
mov dword [ebp - 0x428], edx
cmp edx, ecx
jl 0x59dc61
jmp 0x59e5ec
test ecx, ecx
jle 0x59e5ec
nop dword [eax + eax]
cmp dword [esi], 0
mov dword [ebp - 0x410], 0
jle 0x59df7e
nop dword [eax]
nop word [eax + eax]
mov ecx, dword [esi + 0xa8]
cmp ecx, dword [esi + 0xac]
jae 0x59de39
mov dl, byte [ecx]
inc ecx
mov dword [esi + 0xa8], ecx
jmp 0x59de63
cmp dword [esi + 0x20], 0
je 0x59de61
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov dl, byte [eax]
lea ecx, [eax + 1]
mov eax, dword [ebp - 0x424]
mov dword [esi + 0xa8], ecx
jmp 0x59de63
xor dl, dl
movzx edx, dl
mov dword [ebp - 0x41c], 0
cmp eax, 4
jne 0x59de83
mov eax, edx
and eax, 0xf
shr edx, 4
mov dword [ebp - 0x41c], eax
movzx eax, byte [ebp + edx*4 - 0x404]
mov byte [edi + ebx], al
movzx eax, byte [ebp + edx*4 - 0x403]
mov byte [edi + ebx + 1], al
movzx eax, byte [ebp + edx*4 - 0x402]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [ebp - 0x40c], 4
jne 0x59deb7
mov byte [edi + ebx], 0xff
inc edi
mov eax, dword [ebp - 0x410]
mov edx, dword [esi]
inc eax
cmp eax, edx
je 0x59df78
cmp dword [ebp - 0x424], 8
jne 0x59df21
cmp ecx, dword [esi + 0xac]
jae 0x59def5
mov al, byte [ecx]
mov byte [ebp - 0x405], al
lea eax, [ecx + 1]
mov cl, byte [ebp - 0x405]
mov dword [esi + 0xa8], eax
movzx ecx, cl
jmp 0x59df27
cmp dword [esi + 0x20], 0
je 0x59df1a
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov cl, byte [eax]
inc eax
mov dword [esi + 0xa8], eax
mov edx, dword [esi]
movzx ecx, cl
jmp 0x59df27
xor cl, cl
movzx ecx, cl
jmp 0x59df27
mov ecx, dword [ebp - 0x41c]
movzx eax, byte [ebp + ecx*4 - 0x404]
mov byte [edi + ebx], al
movzx eax, byte [ebp + ecx*4 - 0x403]
mov byte [edi + ebx + 1], al
movzx eax, byte [ebp + ecx*4 - 0x402]
mov byte [edi + ebx + 2], al
add edi, 3
cmp dword [ebp - 0x40c], 4
jne 0x59df5b
mov byte [edi + ebx], 0xff
inc edi
mov eax, dword [ebp - 0x410]
add eax, 2
mov dword [ebp - 0x410], eax
cmp eax, edx
mov eax, dword [ebp - 0x424]
jl 0x59de20
mov edx, dword [ebp - 0x418]
cmp dword [esi + 0x10], 0
je 0x59dfb4
mov eax, dword [esi + 0xac]
mov ecx, eax
sub ecx, dword [esi + 0xa8]
cmp ecx, edx
jge 0x59dfb4
mov dword [esi + 0xa8], eax
mov eax, edx
sub eax, ecx
push eax
push dword [esi + 0x1c]
mov eax, dword [esi + 0x14]
call eax
mov edx, dword [ebp - 0x418]
add esp, 8
jmp 0x59dfba
add dword [esi + 0xa8], edx
mov eax, dword [ebp - 0x428]
mov ecx, dword [esi + 4]
inc eax
mov dword [ebp - 0x428], eax
cmp eax, ecx
mov eax, dword [ebp - 0x424]
jl 0x59de00
jmp 0x59e5ec
push ebx
call fcn.005b7d34
mov ecx, dword [0x655918]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop esi
pop ebx
mov dword [eax + 0xc], str.bad_bpp
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b26e6
mov esp, ebp
pop ebp
ret
push ebx
call fcn.005b7d34
mov ecx, dword [0x655918]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop esi
pop ebx
mov dword [eax + 0xc], str.invalid
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b26e6
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x448]
sub eax, dword [ebp - 0x42c]
sub eax, dword [ebp - 0x430]
push eax
push esi
mov dword [ebp - 0x450], 0
mov dword [ebp - 0x454], 0
mov dword [ebp - 0x428], 0
mov dword [ebp - 0x410], 0
mov dword [ebp - 0x458], 0
mov dword [ebp - 0x45c], 0
mov dword [ebp - 0x41c], 0
mov dword [ebp - 0x464], 0
mov dword [ebp - 0x414], edi
mov dword [ebp - 0x44c], edi
call fcn.005ab390
mov ecx, dword [ebp - 0x424]
add esp, 8
cmp ecx, 0x18
jne 0x59e0d1
mov eax, dword [esi]
lea eax, [eax + eax*2]
jmp 0x59e0de
cmp ecx, 0x10
jne 0x59e0dc
mov eax, dword [esi]
add eax, eax
jmp 0x59e0de
xor eax, eax
neg eax
and eax, 3
mov dword [ebp - 0x448], eax
cmp ecx, 0x18
jne 0x59e0ff
mov dword [ebp - 0x44c], 1
xor eax, eax
jmp 0x59e1f4
mov edx, dword [ebp - 0x418]
cmp ecx, 0x20
mov ecx, dword [ebp - 0x43c]
mov eax, dword [ebp - 0x438]
jne 0x59e14a
cmp edx, 0xff
jne 0x59e14a
cmp ecx, 0xff00
jne 0x59e14a
cmp eax, 0xff0000
jne 0x59e14a
cmp dword [ebp - 0x420], 0xff000000
jne 0x59e162
mov dword [ebp - 0x44c], 2
xor eax, eax
jmp 0x59e1f4
test eax, eax
je 0x59e72b
test ecx, ecx
je 0x59e72b
test edx, edx
je 0x59e72b
push eax
call fcn.005a3920
push dword [ebp - 0x438]
sub eax, 7
mov dword [ebp - 0x450], eax
call fcn.0059d7c0
push dword [ebp - 0x43c]
mov dword [ebp - 0x458], eax
call fcn.005a3920
push dword [ebp - 0x43c]
sub eax, 7
mov dword [ebp - 0x454], eax
call fcn.0059d7c0
push dword [ebp - 0x418]
mov dword [ebp - 0x45c], eax
call fcn.005a3920
push dword [ebp - 0x418]
sub eax, 7
mov dword [ebp - 0x428], eax
call fcn.0059d7c0
push dword [ebp - 0x420]
mov dword [ebp - 0x41c], eax
call fcn.005a3920
push dword [ebp - 0x420]
sub eax, 7
mov dword [ebp - 0x410], eax
call fcn.0059d7c0
add esp, 0x20
mov dword [ebp - 0x464], eax
mov ecx, dword [esi + 4]
mov edx, dword [ebp - 0x440]
mov dword [ebp - 0x434], edi
mov dword [ebp - 0x40c], edx
test ecx, ecx
jle 0x59e5ec
mov ecx, dword [ebp - 0x450]
neg ecx
mov dword [ebp - 0x40c], edx
mov dword [ebp - 0x440], ecx
mov ecx, 8
sub ecx, dword [ebp - 0x458]
mov dword [ebp - 0x470], ecx
mov ecx, dword [ebp - 0x454]
neg ecx
mov dword [ebp - 0x474], ecx
mov ecx, 8
sub ecx, dword [ebp - 0x45c]
mov dword [ebp - 0x478], ecx
mov ecx, dword [ebp - 0x428]
neg ecx
mov dword [ebp - 0x47c], ecx
mov ecx, 8
sub ecx, dword [ebp - 0x41c]
mov dword [ebp - 0x480], ecx
mov ecx, dword [ebp - 0x410]
neg ecx
mov dword [ebp - 0x484], ecx
mov ecx, 8
sub ecx, eax
mov dword [ebp - 0x488], ecx
nop
cmp dword [ebp - 0x44c], 0
mov eax, dword [esi]
mov dword [ebp - 0x42c], 0
je 0x59e3ea
test eax, eax
jle 0x59e598
mov ecx, dword [esi + 0xa8]
nop word [eax + eax]
mov eax, dword [esi + 0xac]
cmp ecx, eax
jae 0x59e2cf
mov dl, byte [ecx]
inc ecx
jmp 0x59e2ef
cmp dword [esi + 0x20], 0
je 0x59e302
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov dl, byte [eax]
lea ecx, [eax + 1]
mov eax, dword [esi + 0xac]
mov dword [esi + 0xa8], ecx
mov byte [edi + ebx + 2], dl
cmp ecx, eax
jae 0x59e307
mov dl, byte [ecx]
inc ecx
jmp 0x59e327
mov byte [edi + ebx + 2], 0
cmp dword [esi + 0x20], 0
je 0x59e340
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov dl, byte [eax]
lea ecx, [eax + 1]
mov eax, dword [esi + 0xac]
mov dword [esi + 0xa8], ecx
mov byte [edi + ebx + 1], dl
cmp ecx, eax
jae 0x59e345
mov dl, byte [ecx]
inc ecx
mov dword [esi + 0xa8], ecx
jmp 0x59e369
mov byte [edi + ebx + 1], 0
cmp dword [esi + 0x20], 0
je 0x59e367
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov dl, byte [eax]
lea ecx, [eax + 1]
mov dword [esi + 0xa8], ecx
jmp 0x59e369
xor dl, dl
mov byte [edi + ebx], dl
add edi, 3
cmp dword [ebp - 0x44c], 2
jne 0x59e3b1
cmp ecx, dword [esi + 0xac]
jae 0x59e38b
mov dl, byte [ecx]
inc ecx
mov dword [esi + 0xa8], ecx
jmp 0x59e3b4
cmp dword [esi + 0x20], 0
je 0x59e3ad
push esi
call fcn.005aad30
mov eax, dword [esi + 0xa8]
add esp, 4
mov dl, byte [eax]
lea ecx, [eax + 1]
mov dword [esi + 0xa8], ecx
jmp 0x59e3b4
xor dl, dl
jmp 0x59e3b4
or dl, 0xff
movzx eax, dl
or dword [ebp - 0x444], eax
cmp dword [ebp - 0x40c], 4
jne 0x59e3ca
mov byte [edi + ebx], dl
inc edi
mov edx, dword [ebp - 0x42c]
inc edx
mov dword [ebp - 0x42c], edx
cmp edx, dword [esi]
jl 0x59e2c0
mov dword [ebp - 0x414], edi
jmp 0x59e598
test eax, eax
jle 0x59e598
push esi
call fcn.005a1490
cmp dword [ebp - 0x424], 0x10
jne 0x59e406
add esp, 4
jmp 0x59e41c
push esi
mov edi, eax
call fcn.005a1490
shl eax, 0x10
add esp, 8
add eax, edi
mov edi, dword [ebp - 0x414]
mov ecx, dword [ebp - 0x450]
mov edx, eax
and edx, dword [ebp - 0x438]
mov dword [ebp - 0x430], eax
mov eax, edx
shr eax, cl
mov ecx, dword [ebp - 0x440]
shl edx, cl
cmp dword [ebp - 0x450], 0
mov ecx, dword [ebp - 0x470]
cmovge edx, eax
mov eax, dword [ebp - 0x458]
shr edx, cl
imul edx, dword [eax*4 + 0x64e238]
mov ecx, dword [eax*4 + 0x64e25c]
sar edx, cl
mov ecx, dword [ebp - 0x454]
mov byte [edi + ebx], dl
inc edi
mov edx, dword [ebp - 0x430]
and edx, dword [ebp - 0x43c]
mov eax, edx
mov dword [ebp - 0x414], edi
shr eax, cl
mov ecx, dword [ebp - 0x474]
shl edx, cl
cmp dword [ebp - 0x454], 0
mov ecx, dword [ebp - 0x478]
cmovge edx, eax
mov eax, dword [ebp - 0x45c]
shr edx, cl
imul edx, dword [eax*4 + 0x64e238]
mov ecx, dword [eax*4 + 0x64e25c]
mov eax, edi
mov edi, dword [ebp - 0x428]
sar edx, cl
mov ecx, edi
mov byte [eax + ebx], dl
inc eax
mov edx, dword [ebp - 0x430]
and edx, dword [ebp - 0x418]
mov dword [ebp - 0x414], eax
mov eax, edx
shr eax, cl
mov ecx, dword [ebp - 0x47c]
shl edx, cl
test edi, edi
mov ecx, dword [ebp - 0x480]
mov edi, dword [ebp - 0x414]
cmovns edx, eax
mov eax, dword [ebp - 0x41c]
shr edx, cl
imul edx, dword [eax*4 + 0x64e238]
mov ecx, dword [eax*4 + 0x64e25c]
mov eax, dword [ebp - 0x420]
sar edx, cl
mov byte [edi + ebx], dl
inc edi
mov dword [ebp - 0x414], edi
test eax, eax
je 0x59e565
mov edx, dword [ebp - 0x430]
mov ecx, dword [ebp - 0x410]
and edx, eax
mov eax, edx
shr eax, cl
mov ecx, dword [ebp - 0x484]
shl edx, cl
cmp dword [ebp - 0x410], 0
mov ecx, dword [ebp - 0x488]
cmovge edx, eax
mov eax, dword [ebp - 0x464]
shr edx, cl
imul edx, dword [eax*4 + 0x64e238]
mov ecx, dword [eax*4 + 0x64e25c]
sar edx, cl
jmp 0x59e56a
mov edx, 0xff
or dword [ebp - 0x444], edx
cmp dword [ebp - 0x40c], 4
jne 0x59e583
mov byte [edi + ebx], dl
inc edi
mov dword [ebp - 0x414], edi
mov eax, dword [ebp - 0x42c]
inc eax
mov dword [ebp - 0x42c], eax
cmp eax, dword [esi]
jl 0x59e3f2
cmp dword [esi + 0x10], 0
mov edx, dword [ebp - 0x448]
je 0x59e5ce
mov eax, dword [esi + 0xac]
mov ecx, eax
sub ecx, dword [esi + 0xa8]
cmp ecx, edx
jge 0x59e5ce
mov dword [esi + 0xa8], eax
mov eax, edx
sub eax, ecx
push eax
push dword [esi + 0x1c]
mov eax, dword [esi + 0x14]
call eax
add esp, 8
jmp 0x59e5d4
add dword [esi + 0xa8], edx
mov eax, dword [ebp - 0x434]
mov ecx, dword [esi + 4]
inc eax
mov dword [ebp - 0x434], eax
cmp eax, ecx
jl 0x59e290
mov edx, dword [ebp - 0x40c]
cmp edx, 4
jne 0x59e619
cmp dword [ebp - 0x444], 0
jne 0x59e619
mov eax, dword [esi]
imul eax, ecx
lea eax, [eax*4 - 1]
test eax, eax
js 0x59e619
mov byte [eax + ebx], 0xff
sub eax, 4
jns 0x59e610
cmp dword [ebp - 0x460], 0
jle 0x59e6cc
mov ecx, dword [esi + 4]
xor edi, edi
mov dword [ebp - 0x434], edi
test ecx, 0xfffffffe
jle 0x59e6cc
mov dword [ebp - 0x41c], edi
mov eax, dword [esi]
sub ecx, edi
dec ecx
mov edx, eax
imul edx, dword [ebp - 0x41c]
xor edi, edi
imul ecx, eax
imul eax, dword [ebp - 0x40c]
mov dword [ebp - 0x460], edx
imul ecx, dword [ebp - 0x40c]
lea edx, [ecx + ebx]
test eax, eax
jle 0x59e6a4
mov ebx, dword [ebp - 0x460]
sub ebx, ecx
nop dword [eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov cl, byte [ebx + edx - 1]
inc edi
mov byte [ebx + edx - 1], al
mov byte [edx - 1], cl
mov eax, dword [esi]
imul eax, dword [ebp - 0x40c]
cmp edi, eax
jl 0x59e680
mov ebx, dword [ebp - 0x468]
mov edi, dword [ebp - 0x434]
mov ecx, dword [esi + 4]
inc edi
mov edx, dword [ebp - 0x40c]
mov eax, ecx
add dword [ebp - 0x41c], edx
sar eax, 1
mov dword [ebp - 0x434], edi
cmp edi, eax
jl 0x59e643
mov eax, dword [ebp - 0x46c]
test eax, eax
je 0x59e6f4
cmp eax, edx
je 0x59e6f4
push dword [esi + 4]
push dword [esi]
push eax
push edx
push ebx
call fcn.0059f580
mov ebx, eax
add esp, 0x14
test ebx, ebx
je 0x59e7a5
mov ecx, dword [ebp - 0x48c]
mov eax, dword [esi]
mov dword [ecx], eax
mov ecx, dword [ebp - 0x490]
mov eax, dword [esi + 4]
mov dword [ecx], eax
mov ecx, dword [ebp - 0x494]
test ecx, ecx
je 0x59e718
mov eax, dword [esi + 8]
mov dword [ecx], eax
pop edi
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b26e6
mov esp, ebp
pop ebp
ret
push ebx
call fcn.005b7d34
mov ecx, dword [0x655918]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop esi
pop ebx
mov dword [eax + 0xc], str.bad_masks
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b26e6
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x655918]
mov eax, dword fs:[0x2c]
pop edi
pop esi
pop ebx
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.outofmem
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005b26e6
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x655918]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.too_large
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005b26e6
mov esp, ebp
pop ebp
ret