Function at 0x510160
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0xb4
mov eax, dword [0x7161c0]
xor eax, esp
mov dword [esp + 0xb0], eax
push ebx
mov ebx, dword [ebp + 8]
movzx eax, byte [ebx + 2]
push esi
push edi
movzx edi, byte [eax + 0x6503c8]
xor esi, esi
test edi, edi
mov dword [esp + 0x20], edi
jle 0x5101d6
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x5101bd
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x5101c8
push 1
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esp + esi + 0xa4], al
add esi, 1
cmp esi, edi
jl 0x510195
xor esi, esi
test edi, edi
jle 0x510221
lea esp, [esp]
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510208
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510213
push 1
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esp + esi + 0xb4], al
add esi, 1
cmp esi, edi
jl 0x5101e0
xor ecx, ecx
cmp byte [ebx + 2], cl
sete cl
mov esi, ecx
jmp 0x510230
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510258
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510263
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x5102eb
mov edx, dword [ebx + 0x334]
cmp edx, 8
jbe 0x510293
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
sar eax, 0x18
add edx, 0xfffffff8
mov dword [ebx + 0x334], edx
jmp 0x51029e
push 8
push ebx
call fcn.00541d70
add esp, 8
cmp dword [ebx + 0x30], 0
je 0x5102eb
mov edx, eax
and eax, 0x1f
sar edx, 5
or eax, 0x20
add edx, edx
shl eax, 0xd
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
mov eax, dword [ebx + 0x44]
add edx, edx
add edx, edx
mov ecx, 0x650118
sub ecx, edx
test eax, eax
fmul qword [ecx]
mov dword [esp + 0x24], eax
je 0x5102e5
mov edx, dword [ebx + 0x40]
push edx
sub esp, 8
fstp qword [esp]
call dword [esp + 0x30]
add esp, 0xc
fmul qword [ebx + 0x20]
fstp qword [ebx + 0x38]
mov eax, esi
sub esi, 1
test eax, eax
jne 0x510230
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510320
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x51032b
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x510521
mov edx, dword [ebx + 0x334]
cmp edx, 1
mov byte [ebx + 0x48], 0
jbe 0x51035f
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x51036a
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x510521
xor esi, esi
test edi, edi
jle 0x5103c1
jmp 0x510380
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x5103a8
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x5103b3
push 1
push ebx
call fcn.00541cf0
add esp, 8
mov ecx, esi
shl al, cl
add esi, 1
or byte [ebx + 0x48], al
cmp esi, edi
jl 0x510380
mov al, byte [ebx + 2]
cmp al, 1
jbe 0x51042e
cmp al, 2
jne 0x510402
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x5103f4
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x5103ff
push 1
push ebx
call fcn.00541cf0
add esp, 8
mov byte [ebx + 0x49], al
mov edx, dword [ebx + 0x334]
cmp edx, 4
jbe 0x510448
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1c
add edx, 0xfffffffc
mov dword [ebx + 0x334], edx
mov dword [esp + 0x18], eax
jmp 0x510457
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xb0]
xor ecx, esp
call fcn.005d8d34
mov esp, ebp
pop ebp
ret
push 4
push ebx
call fcn.00541cf0
add esp, 8
mov dword [esp + 0x18], eax
mov esi, dword [ebx + 0x334]
cmp esi, 4
jbe 0x51047f
mov edx, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, esi
shl edx, cl
shr edx, 0x1c
add esi, 0xfffffffc
mov dword [ebx + 0x334], esi
jmp 0x510490
push 4
push ebx
call fcn.00541cf0
mov edx, eax
mov eax, dword [esp + 0x20]
add esp, 8
mov dword [esp + 0x24], edx
sub edx, eax
lea ecx, [edx + 3]
test ecx, ecx
jl 0x51042e
mov byte [ebx + 0x321], cl
mov dl, byte [eax + 0x70b768]
mov byte [ebx + 0x320], dl
mov dl, 0xc
imul dl
add al, 0x25
mov byte [ebx + 0x4a], al
mov al, byte [esp + 0x24]
imul dl
add al, 0x49
xor esi, esi
lea edi, [ecx - 1]
test edi, edi
mov byte [ebx + 0x4b], al
mov dword [ebx + 0x4c], esi
jle 0x510521
nop
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x5104f8
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510503
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x51051a
mov eax, 1
mov ecx, esi
shl eax, cl
or dword [ebx + 0x4c], eax
add byte [ebx + 0x321], 0xff
add esi, 1
cmp esi, edi
jl 0x5104d0
cmp byte [ebx + 0x48], 0
je 0x510730
xor ecx, ecx
cmp dword [esp + 0x20], ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x28], ecx
jle 0x5106ba
lea edx, [ebx + 0x50]
mov dword [esp + 0x18], edx
mov al, byte [ebx + 0x48]
shr al, cl
test al, 1
je 0x51069d
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x51057b
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510586
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x51069d
mov edx, dword [ebx + 0x334]
cmp edx, 2
mov dword [esp + 0x34], 1
jbe 0x5105be
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1e
add edx, 0xfffffffe
mov dword [ebx + 0x334], edx
jmp 0x5105c9
push 2
push ebx
call fcn.00541cf0
add esp, 8
lea ecx, [eax + eax*2]
xor edi, edi
cmp byte [ebx + 0x321], 0
mov dword [esp + 0x2c], ecx
jbe 0x51069d
mov edx, dword [esp + 0x18]
mov dword [esp + 0x38], edx
jmp 0x5105f0
mov edx, dword [ebx + 0x334]
cmp edx, 4
jbe 0x510618
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1c
add edx, 0xfffffffc
mov dword [ebx + 0x334], edx
jmp 0x510623
push 4
push ebx
call fcn.00541cf0
add esp, 8
mov edx, dword [ebx + 0x334]
cmp edx, 4
mov esi, eax
jbe 0x51064d
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1c
add edx, 0xfffffffc
mov dword [ebx + 0x334], edx
jmp 0x510658
push 4
push ebx
call fcn.00541cf0
add esp, 8
cmp esi, 0xf
jne 0x510662
shl eax, 0xe
jmp 0x510668
or eax, 0x10
shl eax, 0xd
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x2c]
fild dword [esp + 0x24]
add esi, eax
mov eax, dword [esp + 0x38]
fmul qword [esi*8 + 0x650100]
add edi, 1
add eax, 8
mov dword [esp + 0x38], eax
fstp qword [eax - 8]
movzx ecx, byte [ebx + 0x321]
cmp edi, ecx
jl 0x5105f0
mov ecx, dword [esp + 0x28]
add dword [esp + 0x18], 0x90
add ecx, 1
cmp ecx, dword [esp + 0x20]
mov dword [esp + 0x28], ecx
jl 0x510546
cmp byte [ebx + 2], 2
jne 0x5107db
cmp byte [ebx + 0x49], 0
je 0x510730
cmp dword [esp + 0x34], 0
je 0x510730
xor esi, esi
cmp byte [ebx + 0x321], 0
jbe 0x510730
lea edi, [ebx + 0xe0]
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x51070a
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510715
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x51071f
fld qword [edi]
fchs
fstp qword [edi]
movzx edx, byte [ebx + 0x321]
add esi, 1
add edi, 8
cmp esi, edx
jl 0x5106e2
cmp byte [ebx + 2], 2
jne 0x5107db
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510762
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x51076d
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x5107db
cmp byte [ebx + 0x48], 0
mov byte [ebx + 0x322], 0
je 0x510784
movzx edi, byte [ebx + 0x4a]
jmp 0x510789
mov edi, 0xfd
xor esi, esi
jmp 0x510790
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x5107b8
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x5107c3
push 1
push ebx
call fcn.00541cf0
add esp, 8
mov ecx, esi
shl al, cl
add esi, 1
or byte [ebx + 0x322], al
mov eax, dword [esi*4 + 0x70b754]
cmp eax, edi
jl 0x510790
cmp byte [ebx + 0x48], 0
mov byte [esp + 0x33], 0
mov byte [esp + 0x1f], 0
je 0x510822
mov edx, dword [ebx + 0x334]
cmp edx, 2
jbe 0x510813
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1e
add edx, 0xfffffffe
mov dword [ebx + 0x334], edx
jmp 0x51081e
push 2
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esp + 0x33], al
mov edi, dword [esp + 0x20]
xor esi, esi
test edi, edi
jle 0x51086d
mov edx, dword [ebx + 0x334]
cmp edx, 2
jbe 0x510854
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1e
add edx, 0xfffffffe
mov dword [ebx + 0x334], edx
jmp 0x51085f
push 2
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esp + esi + 0xac], al
add esi, 1
cmp esi, edi
jl 0x51082c
cmp byte [ebx + 3], 0
je 0x5108aa
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x51089b
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x5108a6
push 1
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esp + 0x1f], al
xor edx, edx
test edi, edi
mov dword [esp + 0x28], edx
jle 0x51092d
cmp byte [esp + edx + 0xac], 0
je 0x510922
mov al, byte [ebx + 0x48]
mov cl, dl
shr al, cl
test al, 1
je 0x5108d5
mov cl, byte [ebx + 0x4a]
mov byte [ebx + edx + 0x323], cl
jmp 0x510922
mov esi, dword [ebx + 0x334]
cmp esi, 6
jbe 0x5108fd
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, esi
shl eax, cl
shr eax, 0x1a
add esi, 0xfffffffa
mov dword [ebx + 0x334], esi
jmp 0x51090c
push 6
push ebx
call fcn.00541cf0
mov edx, dword [esp + 0x30]
add esp, 8
cmp eax, 0x3c
jg 0x51042e
mov cl, 3
imul cl
add al, 0x49
mov byte [ebx + edx + 0x323], al
add edx, 1
cmp edx, edi
mov dword [esp + 0x28], edx
jl 0x5108b4
cmp byte [esp + 0x33], 0
mov byte [esp + 0x17], 0
je 0x5109b4
movzx esi, byte [esp + 0x33]
movzx edx, byte [ebx + 0x4a]
movzx eax, byte [ebx + 0x4b]
sub eax, edx
lea ecx, [esi - 1]
mov edi, 3
shl edi, cl
cdq
mov byte [esp + 0x17], 0x40
idiv edi
mov edi, eax
mov eax, dword [ebx + 0x334]
cmp eax, 4
jbe 0x510986
mov edx, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, eax
shl edx, cl
shr edx, 0x1c
add eax, 0xfffffffc
mov dword [ebx + 0x334], eax
mov ecx, edx
jmp 0x510993
push 4
push ebx
call fcn.00541cf0
add esp, 8
mov ecx, eax
movzx eax, byte [ebx + 0x4a]
push edi
lea eax, [eax + ebx + 0x4ab]
add cl, cl
push esi
mov edi, ebx
call fcn.0050f720
add esp, 8
test eax, eax
jne 0x51042e
xor esi, esi
cmp dword [esp + 0x20], esi
jle 0x510a97
lea ecx, [ebx + 0x6ac]
mov dword [esp + 0x18], ecx
lea ebx, [ebx]
mov al, byte [esp + esi + 0xac]
test al, al
je 0x510a82
movzx eax, al
mov dl, 1
mov ecx, esi
shl dl, cl
lea ecx, [eax - 1]
mov dword [esp + 0x24], eax
movzx eax, byte [ebx + esi + 0x323]
or byte [esp + 0x17], dl
mov edi, 3
shl edi, cl
lea eax, [eax + edi - 4]
cdq
idiv edi
mov edi, eax
mov eax, dword [ebx + 0x334]
cmp eax, 4
jbe 0x510a35
mov edx, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, eax
shl edx, cl
shr edx, 0x1c
add eax, 0xfffffffc
mov dword [ebx + 0x334], eax
mov ecx, edx
jmp 0x510a42
push 4
push ebx
call fcn.00541cf0
add esp, 8
mov ecx, eax
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x18]
push edi
push edx
mov edi, ebx
mov byte [eax - 1], cl
call fcn.0050f720
add esp, 8
test eax, eax
jne 0x51042e
mov eax, dword [ebx + 0x334]
cmp eax, 2
jbe 0x510a77
add eax, 0xfffffffe
mov dword [ebx + 0x334], eax
jmp 0x510a82
push 2
push ebx
call fcn.00541cf0
add esp, 8
add dword [esp + 0x18], 0x200
add esi, 1
cmp esi, dword [esp + 0x20]
jl 0x5109d0
cmp byte [esp + 0x1f], 0
je 0x510afe
mov edx, dword [ebx + 0x334]
or byte [esp + 0x17], 0x20
cmp edx, 4
jbe 0x510acb
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1c
add edx, 0xfffffffc
mov dword [ebx + 0x334], edx
jmp 0x510ad6
push 4
push ebx
call fcn.00541cf0
add esp, 8
movzx edx, byte [esp + 0x1f]
mov ecx, eax
push 2
lea eax, [ebx + 0x10ac]
push edx
mov edi, ebx
mov byte [ebx + 0x10ab], cl
call fcn.0050f720
add esp, 8
test eax, eax
jne 0x51042e
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510b26
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510b31
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x510b74
mov edx, dword [ebx + 0x334]
cmp edx, 0xb
mov byte [esp + 0x17], 0xff
jbe 0x510b62
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x15
add edx, 0xfffffff5
mov dword [ebx + 0x334], edx
jmp 0x510b6d
push 0xb
push ebx
call fcn.00541cf0
add esp, 8
mov word [ebx + 0x328], ax
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510b9c
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510ba7
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x510cbc
mov edx, dword [ebx + 0x334]
cmp edx, 6
mov byte [esp + 0x17], 0xff
jbe 0x510bdc
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1a
add edx, 0xfffffffa
mov dword [ebx + 0x334], edx
jmp 0x510be7
push 6
push ebx
call fcn.00541cf0
add esp, 8
cmp byte [ebx + 0x48], 0
mov byte [ebx + 0x33c], al
je 0x510c2c
mov edx, dword [ebx + 0x334]
cmp edx, 7
jbe 0x510c1b
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x19
add edx, 0xfffffff9
mov dword [ebx + 0x334], edx
jmp 0x510c26
push 7
push ebx
call fcn.00541cf0
add esp, 8
mov byte [ebx + 0x33d], al
cmp dword [esp + 0x20], 0
jle 0x510c7d
mov edi, dword [esp + 0x20]
lea esi, [ebx + 0x371]
lea ecx, [ecx]
mov edx, dword [ebx + 0x334]
cmp edx, 7
jbe 0x510c68
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x19
add edx, 0xfffffff9
mov dword [ebx + 0x334], edx
jmp 0x510c73
push 7
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esi], al
add esi, 0x34
sub edi, 1
jne 0x510c40
cmp byte [ebx + 3], 0
je 0x510cbc
mov edx, dword [ebx + 0x334]
cmp edx, 7
jbe 0x510cab
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x19
add edx, 0xfffffff9
mov dword [ebx + 0x334], edx
jmp 0x510cb6
push 7
push ebx
call fcn.00541cf0
add esp, 8
mov byte [ebx + 0x475], al
cmp byte [ebx + 0x48], 0
je 0x510d80
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510cee
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510cf9
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x510d80
mov edx, dword [ebx + 0x334]
or byte [esp + 0x17], 0x40
cmp edx, 3
jbe 0x510d2e
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1d
add edx, 0xfffffffd
mov dword [ebx + 0x334], edx
jmp 0x510d39
push 3
push ebx
call fcn.00541cf0
add esp, 8
mov edx, dword [ebx + 0x334]
mov cl, 9
sub cl, al
cmp edx, 3
mov byte [ebx + 0x4a9], cl
jbe 0x510d6b
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1d
add edx, 0xfffffffd
mov dword [ebx + 0x334], edx
jmp 0x510d76
push 3
push ebx
call fcn.00541cf0
add esp, 8
mov dl, 9
sub dl, al
mov byte [ebx + 0x4aa], dl
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x510da8
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x510db3
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x510ebf
cmp byte [ebx + 0x48], 0
mov byte [esp + 0x17], 0xff
je 0x510dff
mov edx, dword [ebx + 0x334]
cmp edx, 2
jbe 0x510dee
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1e
add edx, 0xfffffffe
mov dword [ebx + 0x334], edx
jmp 0x510df9
push 2
push ebx
call fcn.00541cf0
add esp, 8
mov byte [ebx + 0x33e], al
cmp dword [esp + 0x20], 0
jle 0x510e4d
mov edi, dword [esp + 0x20]
lea esi, [ebx + 0x372]
mov edx, dword [ebx + 0x334]
cmp edx, 2
jbe 0x510e38
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1e
add edx, 0xfffffffe
mov dword [ebx + 0x334], edx
jmp 0x510e43
push 2
push ebx
call fcn.00541cf0
add esp, 8
mov byte [esi], al
add esi, 0x34
sub edi, 1
jne 0x510e10
cmp byte [ebx + 0x48], 0
je 0x510e75
cmp byte [ebx + 0x33e], 1
jne 0x510e75
lea eax, [ebx + 0x33f]
push eax
mov esi, ebx
call fcn.0050f820
add esp, 4
test eax, eax
jne 0x51042e
mov edi, dword [esp + 0x20]
test edi, edi
mov dword [esp + 0x28], 0
jle 0x510ece
lea edi, [ebx + 0x373]
jmp 0x510e90
cmp byte [edi - 1], 1
jne 0x510ea9
push edi
mov esi, ebx
call fcn.0050f820
add esp, 4
test eax, eax
jne 0x51042e
mov eax, dword [esp + 0x28]
add eax, 1
add edi, 0x34
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x28], eax
jl 0x510e90
jmp 0x510eca
cmp byte [esp + 0x17], 0
je 0x511057
mov edi, dword [esp + 0x20]
cmp byte [ebx + 0x33c], 0
jne 0x510f76
cmp byte [ebx + 0x48], 0
mov dl, 0xf8
je 0x510eef
test byte [ebx + 0x33d], dl
jne 0x510f76
cmp byte [ebx + 3], 0
je 0x510efd
test byte [ebx + 0x475], dl
jne 0x510f76
xor eax, eax
test edi, edi
jle 0x510f1e
lea ecx, [ebx + 0x371]
lea esp, [esp]
test byte [ecx], dl
jne 0x510f76
add eax, 1
add ecx, 0x34
cmp eax, edi
jl 0x510f10
push 0x100
lea ecx, [ebx + 0x5ab]
push 0
push ecx
call fcn.005d9e90
add esp, 0xc
test edi, edi
jle 0x510f5b
lea esi, [ebx + 0x7ab]
mov edi, edi
push 0x100
push 0
push esi
call fcn.005d9e90
add esp, 0xc
add esi, 0x200
sub edi, 1
jne 0x510f40
push 0x100
lea edx, [ebx + 0x11ab]
push 0
push edx
call fcn.005d9e90
add esp, 0xc
jmp 0x511057
cmp byte [ebx + 0x48], 0
je 0x510fbe
test byte [esp + 0x17], 0x40
je 0x510fbe
xor ecx, ecx
mov ch, byte [ebx + 0x4aa]
xor edx, edx
mov dh, byte [ebx + 0x4a9]
lea eax, [ebx + 0x4ab]
push eax
movzx eax, byte [ebx + 0x4b]
push ecx
movzx ecx, byte [ebx + 0x4a]
push edx
movzx edx, byte [ebx + 0x320]
push eax
push ecx
push edx
lea eax, [ebx + 0x33d]
push eax
push ebx
call fcn.00545250
add esp, 0x20
xor esi, esi
test edi, edi
jle 0x511022
movzx ecx, byte [esp + 0x17]
lea edx, [ebx + 0x371]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x18], edx
lea edi, [ebx + 0x6ab]
mov ecx, esi
mov eax, 1
shl eax, cl
mov ecx, dword [esp + 0x24]
test ecx, eax
je 0x51100e
movzx edx, byte [ebx + esi + 0x323]
mov eax, dword [esp + 0x18]
push edi
push 0
push 0
push edx
push 0
push 0
push eax
push ebx
call fcn.00545250
add esp, 0x20
add dword [esp + 0x18], 0x34
add esi, 1
add edi, 0x200
cmp esi, dword [esp + 0x20]
jl 0x510fdd
cmp byte [ebx + 3], 0
je 0x511057
test byte [esp + 0x17], 0x20
je 0x511057
lea ecx, [ebx + 0x10ab]
push ecx
push 0
push 0
push 7
push 0
push 0
lea edx, [ebx + 0x475]
push edx
push ebx
mov byte [ebx + 0x476], 2
call fcn.00545250
add esp, 0x20
mov edx, dword [ebx + 0x334]
cmp edx, 1
jbe 0x51107f
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x1f
add edx, 0xffffffff
mov dword [ebx + 0x334], edx
jmp 0x51108a
push 1
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
je 0x5110f8
mov edx, dword [ebx + 0x334]
cmp edx, 9
jbe 0x5110b6
mov eax, dword [ebx + 0x338]
mov ecx, 0x20
sub ecx, edx
shl eax, cl
shr eax, 0x17
add edx, 0xfffffff7
mov dword [ebx + 0x334], edx
jmp 0x5110c1
push 9
push ebx
call fcn.00541cf0
add esp, 8
test eax, eax
mov esi, eax
je 0x5110f8
jmp 0x5110d0
mov eax, dword [ebx + 0x334]
sub esi, 1
cmp eax, 8
jbe 0x5110e9
add eax, 0xfffffff8
mov dword [ebx + 0x334], eax
jmp 0x5110f4
push 8
push ebx
call fcn.00541cf0
add esp, 8
test esi, esi
jne 0x5110d0
mov eax, dword [ebx + 0x12ac]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0x18]
test al, 0x10
je 0x511111
add dword [esp + 0x2c], 0x800
fld qword [ebx + 0x10]
movzx ecx, byte [ebx + 2]
sub esp, 0x18
lea edx, [esp + 0x90]
fstp qword [esp + 0x10]
fld qword [ebx + 8]
fstp qword [esp + 8]
fld qword [ebx + 0x38]
fstp qword [esp]
push eax
push ecx
push edx
call fcn.00543970
mov dword [esp + 0xd0], eax
or eax, 0xffffffff
add esp, 0x24
cmp dword [esp + 0x20], 0
mov dword [esp + 0x70], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x68], eax
mov byte [esp + 0x1f], 0
mov dword [esp + 0x28], 0
jle 0x511275
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x38], ecx
lea eax, [ebx + 0x323]
lea ecx, [esp + 0xb4]
lea edx, [ebx + 0x6ab]
sub ecx, eax
mov dword [esp + 0x24], 0
mov dword [esp + 0x18], eax
mov dword [esp + 0x34], edx
mov dword [esp + 0x3c], ecx
lea ecx, [ecx]
mov eax, dword [esp + 0x18]
movzx ecx, byte [eax]
mov edx, dword [esp + 0x3c]
movzx eax, byte [edx + eax]
mov edx, dword [esp + 0x38]
push ecx
mov ecx, dword [esp + 0x2c]
push eax
sub esp, 8
fld qword [esp + ecx*8 + 0x88]
lea edi, [esp + 0x50]
mov esi, ebx
fstp qword [esp]
push edx
mov edx, dword [esp + 0x48]
call fcn.0050f960
mov al, byte [ebx + 0x48]
mov cl, byte [esp + 0x3c]
shr al, cl
add esp, 0x14
test al, 1
je 0x51121d
cmp byte [esp + 0x1f], 0
jne 0x511217
mov eax, dword [esp + 0x2c]
lea ecx, [esp + 0xb4]
push ecx
mov edx, edi
push edx
mov edx, dword [esp + 0x28]
push eax
lea ecx, [esp + 0x84]
push ecx
push edx
mov byte [esp + 0x33], 1
call fcn.0050fd60
add esp, 0x14
movzx eax, byte [ebx + 0x4b]
jmp 0x511224
mov eax, dword [esp + 0x18]
movzx eax, byte [eax]
mov ecx, dword [esp + 0x24]
lea edx, [eax + ecx]
mov ecx, dword [esp + 0x2c]
lea ecx, [ecx + edx*8]
fldz
add eax, 1
fstp qword [ecx]
add ecx, 8
cmp eax, 0x100
jl 0x511232
mov eax, dword [esp + 0x28]
add dword [esp + 0x34], 0x200
add dword [esp + 0x38], 0x800
add dword [esp + 0x18], 1
add dword [esp + 0x24], 0x100
add eax, 1
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x28], eax
jl 0x5111a0
cmp byte [ebx + 2], 2
jne 0x5112fa
mov al, byte [ebx + 0x323]
mov cl, byte [ebx + 0x324]
cmp al, cl
jae 0x511294
movzx edx, al
mov dword [esp + 0x18], edx
jmp 0x51129b
movzx eax, cl
mov dword [esp + 0x18], eax
movzx edx, byte [ebx + 0x322]
mov esi, dword [esp + 0x2c]
mov eax, 0xd
mov edi, 0x70b758
test dl, 1
jne 0x5112be
mov eax, dword [edi]
sar edx, 1
add edi, 4
jmp 0x5112f2
mov ecx, dword [edi]
sar edx, 1
add edi, 4
cmp ecx, dword [esp + 0x18]
jle 0x5112d0
mov ecx, dword [esp + 0x18]
nop
fld qword [esi + eax*8]
add eax, 1
cmp eax, ecx
fld qword [esi + eax*8 + 0x7f8]
fld st(0)
fadd st(2)
fstp qword [esi + eax*8 - 8]
fsubp st(1)
fstp qword [esi + eax*8 + 0x7f8]
jl 0x5112d0
cmp eax, dword [esp + 0x18]
jl 0x5112b0
jmp 0x5112fe
mov esi, dword [esp + 0x2c]
cmp byte [ebx + 3], 0
je 0x51137e
mov eax, dword [esp + 0x2c]
push 7
push 0
sub esp, 8
test byte [ebx + 0x18], 0x10
lea edx, [ebx + 0x10ab]
lea edi, [esp + 0x50]
mov esi, ebx
je 0x511367
fld qword [ebx + 0x38]
add eax, 0xfffff800
fstp qword [esp]
push eax
call fcn.0050f960
mov edx, dword [esp + 0x40]
xor eax, eax
lea edi, [edx - 0x7c8]
mov ecx, 0x1f2
rep stosd dword es:[edi], eax
fld qword [ebx + 0x28]
fstp qword [esp + 0xc]
add esp, 0xc
lea ecx, [edx + 0x2800]
push ecx
lea eax, [edx - 0x800]
push eax
call fcn.00542230
add esp, 0x10
jmp 0x51137a
fldz
add eax, 0x2800
fstp qword [esp]
push eax
call fcn.0050f960
add esp, 0x14
mov esi, dword [esp + 0x2c]
mov ecx, dword [ebx + 0x18]
mov dl, byte [esp + 0xa4]
and ecx, 0xf
movzx edi, byte [ecx + 0x6503c8]
mov ecx, dword [esp + 0x20]
xor eax, eax
cmp edi, ecx
jge 0x51147e
mov eax, 1
cmp ecx, eax
jle 0x5113c4
lea esp, [esp]
cmp byte [esp + eax + 0xa4], dl
jne 0x51147e
add eax, 1
cmp eax, ecx
jl 0x5113b0
fld qword [ebx + 0x10]
mov eax, dword [ebx + 0x18]
movzx edx, byte [ebx + 2]
sub esp, 0x18
fstp qword [esp + 0x10]
fld qword [ebx + 8]
fstp qword [esp + 8]
fldz
fstp qword [esp]
push eax
push edx
push esi
call fcn.00544c10
add esp, 0x24
cmp dword [ebx + 0x12b0], 0
jne 0x51142d
fld qword [ebx + 0x10]
mov eax, dword [ebx + 0x18]
movzx ecx, byte [ebx + 2]
sub esp, 0x18
lea edx, [esi + 0x3000]
mov dword [ebx + 0x12b0], 1
fstp qword [esp + 0x10]
fld qword [ebx + 8]
fstp qword [esp + 8]
fldz
fstp qword [esp]
push eax
push ecx
push edx
call fcn.00544c10
add esp, 0x24
cmp byte [esp + 0xa4], 0
je 0x511596
test edi, edi
jle 0x5115c4
fld qword [ebx + 0x28]
sub esp, 8
lea eax, [esi + 0x3000]
fstp qword [esp]
push eax
push esi
call fcn.00542db0
add esp, 0x10
add esi, 0x800
sub edi, 1
jne 0x511443
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xb0]
xor ecx, esp
call fcn.005d8d34
mov esp, ebp
pop ebp
ret
cmp eax, ecx
jge 0x5113c4
cmp dword [ebx + 0x12b0], 0
je 0x5114b1
mov eax, dword [ebx + 0x18]
movzx edx, byte [ebx + 2]
push eax
push edx
lea eax, [esi + 0x3000]
push eax
mov dword [ebx + 0x12b0], 0
call fcn.005450a0
add esp, 0xc
xor edi, edi
cmp dword [esp + 0x20], edi
mov dword [esp + 0x28], edi
jle 0x511556
mov dword [esp + 0x18], esi
fldz
mov edx, 1
mov ecx, edi
fld st(0)
shl edx, cl
test dword [esp + 0xac], edx
jne 0x5114e0
fstp st(0)
fld qword [ebx + 0x28]
fxch st(1)
fcomp qword [esp + edi*8 + 0x78]
fnstsw ax
test ah, 0x44
jnp 0x511525
mov eax, dword [esp + 0x18]
sub esp, 8
cmp byte [esp + edi + 0xac], 0
fstp qword [esp]
je 0x511513
lea ecx, [eax + 0x3000]
push ecx
push eax
call fcn.00542db0
add esp, 0x10
jmp 0x51153d
lea edx, [eax + 0x3000]
push edx
push eax
call fcn.00542230
add esp, 0x10
jmp 0x51153d
mov esi, dword [esp + 0x18]
lea edi, [esi + 8]
fstp qword [esi]
mov ecx, 0x1fe
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x28]
mov esi, dword [esp + 0x2c]
add dword [esp + 0x18], 0x800
add edi, 1
cmp edi, dword [esp + 0x20]
mov dword [esp + 0x28], edi
jl 0x5114c5
fld qword [ebx + 0x10]
mov eax, dword [ebx + 0x18]
movzx ecx, byte [ebx + 2]
sub esp, 0x18
fstp qword [esp + 0x10]
fld qword [ebx + 8]
fstp qword [esp + 8]
fld qword [ebx + 0x28]
fstp qword [esp]
push eax
push ecx
push esi
call fcn.00544c10
add esp, 0x24
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xb0]
xor ecx, esp
call fcn.005d8d34
mov esp, ebp
pop ebp
ret
test edi, edi
jle 0x5115c4
lea ebx, [ebx]
fld qword [ebx + 0x28]
sub esp, 8
lea ecx, [esi + 0x3000]
fstp qword [esp]
push ecx
push esi
call fcn.00542230
add esp, 0x10
add esi, 0x800
sub edi, 1
jne 0x5115a0
mov ecx, dword [esp + 0xbc]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.005d8d34
mov esp, ebp
pop ebp
ret