Function at 0x40c360
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x4c
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
push ebx
push ebp
push esi
cmp eax, ecx
push edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], ecx
jne 0x40c3aa
lea eax, [eax + eax*4]
mov dword [esp + 0x64], 1
lea ecx, [eax*2 + 0x66bd80]
mov edx, dword [eax*2 + 0x66bd80]
mov dword [esp + 0x48], edx
mov eax, dword [ecx + 4]
mov dword [esp + 0x4c], eax
mov si, word [ecx + 8]
mov word [esp + 0x50], si
jmp 0x40c3fc
lea edx, [eax + eax*4]
mov dword [esp + 0x64], 2
lea eax, [edx*2 + 0x66bd80]
mov edx, dword [edx*2 + 0x66bd80]
mov dword [esp + 0x48], edx
mov edx, dword [eax + 4]
mov dword [esp + 0x4c], edx
mov si, word [eax + 8]
lea eax, [ecx + ecx*4]
mov word [esp + 0x50], si
lea ecx, [eax*2 + 0x66bd80]
mov edx, dword [eax*2 + 0x66bd80]
mov dword [esp + 0x52], edx
mov eax, dword [ecx + 4]
mov dword [esp + 0x56], eax
mov cx, word [ecx + 8]
mov word [esp + 0x5a], cx
call fcn.0040b940
call fcn.00407d20
call fcn.0040b940
call fcn.00422660
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x64]
test eax, eax
mov dword [esp + 0x60], 0
jle 0x40c536
lea ebp, [esp + 0x4c]
mov dword [esp + 0x18], ebp
mov ax, word [ebp + 2]
mov dx, word [ebp + 4]
mov dword [esp + 0x20], eax
xor edi, edi
movsx eax, ax
shl eax, 1
mov dword [esp + 0x14], edi
mov word [esp + 0x1c], dx
mov dword [esp + 0x24], eax
push 0x10
call fcn.004225a0
mov dx, word [esp + 0x24]
mov ebx, eax
mov eax, dword [esp + 0x64]
mov byte [ebx], 1
mov word [ebx + 2], dx
lea ecx, [edi + eax*2]
mov ax, word [esp + 0x20]
mov word [ebx + 4], ax
mov dword [ebx + 0xc], 0
movsx edx, word [ebx + 2]
mov dword [esp + ecx*4 + 0x3c], ebx
movsx ecx, word [ebx + 4]
imul ecx, edx
shl ecx, 1
push ecx
call fcn.004225a0
movsx ecx, word [ebp]
movsx edx, word [ebp - 2]
add esp, 8
mov dword [ebx + 8], eax
mov ecx, dword [ecx*4 + 0x637f98]
test edi, edi
jne 0x40c4b6
add ecx, edx
mov edx, dword [0x637f88]
jmp 0x40c4be
add ecx, edx
mov edx, dword [0x637f8c]
lea esi, [edx + ecx*2]
xor edx, edx
cmp word [ebx + 4], dx
mov dword [esp + 0x10], esi
jle 0x40c507
mov ecx, dword [esp + 0x24]
mov edi, eax
mov ebp, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
movsx ecx, word [ebx + 2]
mov esi, dword [esp + 0x10]
lea eax, [eax + ecx*2]
add esi, 0x640
movsx ecx, word [ebx + 4]
inc edx
mov dword [esp + 0x10], esi
cmp edx, ecx
jl 0x40c4cd
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
inc edi
cmp edi, 2
mov dword [esp + 0x14], edi
jl 0x40c450
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
inc eax
add ebp, 0xa
cmp eax, ecx
mov dword [esp + 0x60], eax
mov dword [esp + 0x18], ebp
jl 0x40c430
mov si, word [esp + 0x50]
mov eax, dword [esp + 0x68]
and eax, 0xff
cmp eax, 0xc
ja case.default.0x40c548
jmp dword [eax*4 + 0x40d2c4]
mov ebp, dword [esp + 0x70]
test ebp, ebp
jg 0x40c560
mov ebp, 1
mov dword [esp + 0x70], ebp
mov edi, dword [esp + 0x6c]
mov ebx, ebp
movsx eax, si
cdq
idiv edi
mov dword [esp + 0x60], ebx
mov esi, eax
cmp ebp, esi
mov dword [esp + 0x20], esi
jge case.default.0x40c548
mov ecx, dword [esp + 0x64]
test ecx, ecx
jle 0x40c650
lea eax, [esp + 0x4c]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], eax
test edi, edi
jle 0x40c636
movsx edx, word [eax - 2]
movsx eax, word [eax]
mov dword [esp + 0x24], edx
mov dword [esp + 0x18], edi
lea ecx, [eax*4 + 0x637f98]
mov dword [esp + 0x10], ecx
mov edx, dword [esp + 0x10]
mov edi, dword [esp + 0x24]
mov ecx, dword [0x637f8c]
mov eax, dword [edx]
add eax, edi
shl eax, 1
lea edx, [eax + ecx]
mov ecx, dword [0x637f88]
add eax, ecx
test ebx, ebx
jle 0x40c612
movsx ecx, word [esp + 0x4e]
add ecx, ecx
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x68]
mov esi, edx
mov ebp, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
add edx, 0x640
and ecx, 3
add eax, 0x640
dec ebx
rep movsb byte es:[edi], byte [esi]
jne 0x40c5e6
mov esi, dword [esp + 0x20]
mov ebx, dword [esp + 0x60]
mov ecx, dword [esp + 0x10]
lea eax, [esi*4]
add ecx, eax
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], eax
jne 0x40c5b8
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x6c]
mov ecx, dword [esp + 0x1c]
add eax, 0xa
dec ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], ecx
jne 0x40c596
mov ebp, dword [esp + 0x70]
mov eax, dword [esp + 0x74]
test eax, eax
je 0x40c65a
call eax
call fcn.00445510
add ebx, ebp
cmp ebx, esi
mov dword [esp + 0x60], ebx
jl 0x40c57e
jmp case.default.0x40c548
mov ecx, dword [esp + 0x70]
test ecx, ecx
jg 0x40c683
mov ecx, 1
mov dword [esp + 0x70], ecx
movsx eax, si
sar eax, 1
cmp ecx, eax
mov dword [esp + 0x60], ecx
mov dword [esp + 0x6c], eax
jge case.default.0x40c548
mov esi, dword [esp + 0x64]
mov edi, dword [esp + 0x74]
test esi, esi
jle 0x40c7ad
lea ebp, [esp + 0x4c]
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], ebp
movsx ebx, word [ebp]
movsx ecx, word [ebp - 2]
mov eax, dword [ebx*4 + 0x637f98]
mov edx, dword [0x637f8c]
add eax, ecx
mov ecx, dword [0x637f88]
shl eax, 1
add edx, eax
add eax, ecx
mov ecx, dword [esp + 0x60]
test ecx, ecx
jle 0x40c722
movsx ecx, word [esp + 0x4e]
add ecx, ecx
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x68]
mov esi, edx
mov ebp, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
add edx, 0x640
and ecx, 3
add eax, 0x640
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x40c6f2
mov ebp, dword [esp + 0x18]
movsx edx, word [ebp + 4]
movsx ecx, word [ebp - 2]
add edx, ebx
mov eax, dword [edx*4 + 0x637f94]
add eax, ecx
mov ecx, dword [0x637f8c]
shl eax, 1
lea edx, [eax + ecx]
mov ecx, dword [0x637f88]
add eax, ecx
mov ecx, dword [esp + 0x60]
test ecx, ecx
jle 0x40c78f
movsx ecx, word [esp + 0x4e]
add ecx, ecx
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x68]
mov esi, edx
mov ebx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
sub edx, 0x640
and ecx, 3
sub eax, 0x640
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x40c763
mov eax, dword [esp + 0x14]
add ebp, 0xa
dec eax
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], eax
jne 0x40c6b4
mov esi, dword [esp + 0x64]
mov edi, dword [esp + 0x74]
test edi, edi
je 0x40c7b3
call edi
call fcn.00445510
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x6c]
add eax, edx
cmp eax, ecx
mov dword [esp + 0x60], eax
jl 0x40c6a0
jmp case.default.0x40c548
mov ecx, dword [esp + 0x70]
test ecx, ecx
jg 0x40c7e8
mov ecx, 1
mov dword [esp + 0x70], ecx
movsx eax, si
sar eax, 1
cmp ecx, eax
mov dword [esp + 0x60], ecx
mov dword [esp + 0x6c], eax
jge case.default.0x40c548
mov edi, dword [esp + 0x74]
mov esi, dword [esp + 0x64]
test esi, esi
jle 0x40c914
lea ebp, [esp + 0x4a]
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], ebp
movsx edx, word [ebp + 2]
mov edi, dword [esp + 0x6c]
movsx ecx, word [ebp]
add edx, edi
mov eax, dword [edx*4 + 0x637f98]
lea ebx, [edx*4 + 0x637f98]
add eax, ecx
mov ecx, dword [0x637f8c]
shl eax, 1
lea edx, [eax + ecx]
mov ecx, dword [0x637f88]
add eax, ecx
mov ecx, dword [esp + 0x60]
test ecx, ecx
jle 0x40c895
movsx ecx, word [esp + 0x4e]
add ecx, ecx
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x68]
mov esi, edx
mov ebp, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
sub edx, 0x640
and ecx, 3
sub eax, 0x640
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x40c865
mov ebp, dword [esp + 0x18]
movsx ecx, word [ebp]
mov eax, dword [ebx]
mov edx, dword [0x637f8c]
add eax, ecx
mov ecx, dword [0x637f88]
shl eax, 1
add edx, eax
add eax, ecx
mov ecx, dword [esp + 0x60]
test ecx, ecx
jle 0x40c8f6
movsx ecx, word [esp + 0x4e]
add ecx, ecx
mov dword [esp + 0x68], ecx
mov ecx, dword [esp + 0x60]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x68]
mov esi, edx
mov ebx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
add edx, 0x640
and ecx, 3
add eax, 0x640
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
dec ecx
mov dword [esp + 0x1c], ecx
jne 0x40c8ca
mov eax, dword [esp + 0x14]
add ebp, 0xa
dec eax
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], eax
jne 0x40c819
mov edi, dword [esp + 0x74]
mov esi, dword [esp + 0x64]
test edi, edi
je 0x40c91a
call edi
call fcn.00445510
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x6c]
add eax, edx
cmp eax, ecx
mov dword [esp + 0x60], eax
jl 0x40c805
jmp case.default.0x40c548
mov ebx, dword [esp + 0x70]
movsx ebp, si
cmp ebx, ebp
mov dword [esp + 0x60], ebx
mov dword [esp + 0x6c], ebp
jge case.default.0x40c548
mov edi, dword [esp + 0x64]
mov esi, ebx
neg esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x68], esi
test edi, edi
jle 0x40c9de
lea ebp, [esp + 0x2c]
lea ebx, [esp + 0x50]
lea esi, [esp + 0x3c]
mov dword [esp + 0x1c], edi
mov edx, dword [esi - 4]
mov eax, dword [esp + 0x68]
mov edi, dword [ebp]
push 0x100
push 0
push 0
push edx
push eax
push 0
push edi
call fcn.00410200
mov ecx, dword [esi]
push 0x100
movsx edx, word [ebx]
push 0
push 0
push ecx
mov ecx, dword [esp + 0x8c]
sub edx, ecx
push edx
push 0
push edi
call fcn.00410200
mov eax, dword [esp + 0x54]
add esp, 0x38
add esi, 8
add ebx, 0xa
add ebp, 4
dec eax
mov dword [esp + 0x1c], eax
jne 0x40c979
mov esi, dword [esp + 0x10]
mov ebp, dword [esp + 0x6c]
mov edi, dword [esp + 0x64]
mov ebx, dword [esp + 0x70]
mov eax, dword [esp + 0x74]
test eax, eax
je 0x40c9e8
call eax
call fcn.00445510
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x68]
add eax, ebx
add edx, esi
cmp eax, ebp
mov dword [esp + 0x60], eax
mov dword [esp + 0x68], edx
jl 0x40c965
jmp case.default.0x40c548
mov ebx, dword [esp + 0x70]
movsx esi, si
cmp ebx, esi
mov dword [esp + 0x60], ebx
mov dword [esp + 0x6c], esi
jge case.default.0x40c548
mov ebp, dword [esp + 0x74]
mov edi, dword [esp + 0x64]
test edi, edi
jle 0x40caa6
lea ebp, [esp + 0x2c]
lea ebx, [esp + 0x50]
lea esi, [esp + 0x3c]
mov dword [esp + 0x68], edi
mov eax, dword [esi - 4]
mov ecx, dword [esp + 0x60]
mov edi, dword [ebp]
push 0x100
push 0
push 0
push eax
push ecx
push 0
push edi
call fcn.00410200
movsx eax, word [ebx]
mov ecx, dword [esp + 0x7c]
mov edx, dword [esi]
push 0x100
push 0
push 0
sub ecx, eax
push edx
push ecx
push 0
push edi
call fcn.00410200
mov eax, dword [esp + 0xa0]
add esp, 0x38
add esi, 8
add ebx, 0xa
add ebp, 4
dec eax
mov dword [esp + 0x68], eax
jne 0x40ca41
mov esi, dword [esp + 0x6c]
mov edi, dword [esp + 0x64]
mov ebx, dword [esp + 0x70]
mov ebp, dword [esp + 0x74]
test ebp, ebp
je 0x40caac
call ebp
call fcn.00445510
mov eax, dword [esp + 0x60]
add eax, ebx
cmp eax, esi
mov dword [esp + 0x60], eax
jl 0x40ca2d
jmp case.default.0x40c548
movsx eax, word [esp + 0x4e]
mov ebx, dword [esp + 0x70]
cmp ebx, eax
mov dword [esp + 0x60], ebx
jge case.default.0x40c548
mov ebp, dword [esp + 0x74]
mov edi, dword [esp + 0x64]
mov esi, ebx
neg esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x6c], esi
test edi, edi
jle 0x40cb6d
lea ebp, [esp + 0x2c]
lea ebx, [esp + 0x4e]
lea esi, [esp + 0x3c]
mov dword [esp + 0x68], edi
mov edx, dword [esi - 4]
mov eax, dword [esp + 0x6c]
mov edi, dword [ebp]
push 0x100
push 0
push 0
push edx
push 0
push eax
push edi
call fcn.00410200
mov ecx, dword [esi]
push 0x100
movsx edx, word [ebx]
push 0
push 0
push ecx
mov ecx, dword [esp + 0x8c]
sub edx, ecx
push 0
push edx
push edi
call fcn.00410200
mov eax, dword [esp + 0xa0]
add esp, 0x38
add esi, 8
add ebx, 0xa
add ebp, 4
dec eax
mov dword [esp + 0x68], eax
jne 0x40cb05
mov esi, dword [esp + 0x10]
mov edi, dword [esp + 0x64]
mov ebx, dword [esp + 0x70]
mov ebp, dword [esp + 0x74]
test ebp, ebp
je 0x40cb73
call ebp
call fcn.00445510
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x60]
add eax, esi
add ecx, ebx
mov dword [esp + 0x6c], eax
mov dword [esp + 0x60], ecx
movsx eax, word [esp + 0x4e]
cmp ecx, eax
jl 0x40caf1
jmp case.default.0x40c548
movsx eax, word [esp + 0x4e]
mov esi, dword [esp + 0x70]
cmp esi, eax
mov dword [esp + 0x60], esi
jge case.default.0x40c548
mov ebx, dword [esp + 0x74]
mov edi, dword [esp + 0x64]
test edi, edi
jle 0x40cc30
lea ebp, [esp + 0x2c]
lea ebx, [esp + 0x4e]
lea esi, [esp + 0x3c]
mov dword [esp + 0x6c], edi
mov eax, dword [esi - 4]
mov ecx, dword [esp + 0x60]
mov edi, dword [ebp]
push 0x100
push 0
push 0
push eax
push 0
push ecx
push edi
call fcn.00410200
movsx eax, word [ebx]
mov edx, dword [esi]
mov ecx, dword [esp + 0x7c]
push 0x100
push 0
push 0
push edx
sub ecx, eax
push 0
push ecx
push edi
call fcn.00410200
mov eax, dword [esp + 0xa4]
add esp, 0x38
add esi, 8
add ebx, 0xa
add ebp, 4
dec eax
mov dword [esp + 0x6c], eax
jne 0x40cbcf
mov edi, dword [esp + 0x64]
mov esi, dword [esp + 0x70]
mov ebx, dword [esp + 0x74]
test ebx, ebx
je 0x40cc36
call ebx
call fcn.00445510
mov ecx, dword [esp + 0x60]
movsx eax, word [esp + 0x4e]
add ecx, esi
cmp ecx, eax
mov dword [esp + 0x60], ecx
jl 0x40cbbb
jmp case.default.0x40c548
mov edi, dword [esp + 0x70]
movsx esi, si
cmp edi, esi
mov dword [esp + 0x60], edi
mov dword [esp + 0x6c], esi
jge case.default.0x40c548
mov ebx, dword [esp + 0x74]
mov ebp, dword [esp + 0x64]
test ebp, ebp
jle 0x40cd17
lea edx, [esp + 0x2c]
lea ebx, [esp + 0x50]
mov dword [esp + 0x68], edx
lea edi, [esp + 0x3c]
mov dword [esp + 0x1c], ebp
movsx esi, word [ebx]
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0x68]
movsx ebp, word [ebx - 2]
mov ecx, dword [edi - 4]
mov eax, dword [eax]
sub esi, edx
push 0x100
push esi
push ebp
push 0
push 0
push ecx
push 0
push 0
push eax
call fcn.00410340
mov edx, dword [esp + 0x84]
mov eax, dword [edi]
mov ecx, dword [esp + 0x8c]
push 0x100
push edx
push ebp
push 0
push 0
push eax
mov eax, dword [ecx]
push esi
push 0
push eax
call fcn.00410340
mov ecx, dword [esp + 0xb0]
mov eax, dword [esp + 0x64]
add esp, 0x48
add edi, 8
add ebx, 0xa
add ecx, 4
dec eax
mov dword [esp + 0x68], ecx
mov dword [esp + 0x1c], eax
jne 0x40cc92
mov ebp, dword [esp + 0x64]
mov esi, dword [esp + 0x6c]
mov edi, dword [esp + 0x70]
mov ebx, dword [esp + 0x74]
test ebx, ebx
je 0x40cd1d
call ebx
call fcn.00445510
mov eax, dword [esp + 0x60]
add eax, edi
cmp eax, esi
mov dword [esp + 0x60], eax
jl 0x40cc76
jmp case.default.0x40c548
mov edi, dword [esp + 0x70]
movsx esi, si
cmp edi, esi
mov ebx, edi
mov dword [esp + 0x6c], esi
jge case.default.0x40c548
mov ebp, dword [esp + 0x64]
test ebp, ebp
jle 0x40cde7
lea edx, [esp + 0x2c]
lea edi, [esp + 0x3c]
mov dword [esp + 0x60], edx
lea esi, [esp + 0x4e]
mov dword [esp + 0x68], ebp
movsx ecx, word [esi + 2]
movsx ebp, word [esi]
mov eax, dword [esp + 0x60]
mov edx, dword [edi - 4]
sub ecx, ebx
push 0x100
mov eax, dword [eax]
push ecx
push ebp
push 0
push 0
push edx
push ebx
push 0
push eax
call fcn.00410340
mov eax, dword [edi]
mov ecx, dword [esp + 0x84]
push 0x100
push ebx
push ebp
push 0
push 0
push eax
mov eax, dword [ecx]
push 0
push 0
push eax
call fcn.00410340
mov ecx, dword [esp + 0xa8]
mov eax, dword [esp + 0xb0]
add esp, 0x48
add esi, 0xa
add edi, 8
add ecx, 4
dec eax
mov dword [esp + 0x60], ecx
mov dword [esp + 0x68], eax
jne 0x40cd6e
mov ebp, dword [esp + 0x64]
mov esi, dword [esp + 0x6c]
mov edi, dword [esp + 0x70]
mov eax, dword [esp + 0x74]
test eax, eax
je 0x40cdf1
call eax
call fcn.00445510
add ebx, edi
cmp ebx, esi
jl 0x40cd52
jmp case.default.0x40c548
movsx ecx, word [esp + 0x4e]
mov eax, dword [esp + 0x70]
cmp eax, ecx
mov dword [esp + 0x60], eax
jge case.default.0x40c548
mov edi, dword [esp + 0x74]
mov esi, dword [esp + 0x64]
test esi, esi
jle 0x40cebe
lea edx, [esp + 0x2c]
lea ebx, [esp + 0x4e]
mov dword [esp + 0x6c], edx
lea edi, [esp + 0x3c]
mov dword [esp + 0x68], esi
movsx esi, word [ebx]
movsx ebp, word [ebx + 2]
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0x6c]
mov ecx, dword [edi - 4]
sub esi, edx
mov eax, dword [eax]
push 0x100
push ebp
push esi
push 0
push 0
push ecx
push 0
push 0
push eax
call fcn.00410340
mov edx, dword [esp + 0x84]
mov eax, dword [edi]
mov ecx, dword [esp + 0x90]
push 0x100
push ebp
push edx
push 0
push 0
push eax
mov eax, dword [ecx]
push 0
push esi
push eax
call fcn.00410340
mov ecx, dword [esp + 0xb4]
mov eax, dword [esp + 0xb0]
add esp, 0x48
add edi, 8
add ebx, 0xa
add ecx, 4
dec eax
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x68], eax
jne 0x40ce3e
mov esi, dword [esp + 0x64]
mov edi, dword [esp + 0x74]
test edi, edi
je 0x40cec4
call edi
call fcn.00445510
mov ecx, dword [esp + 0x60]
mov ebx, dword [esp + 0x70]
movsx eax, word [esp + 0x4e]
add ecx, ebx
cmp ecx, eax
mov dword [esp + 0x60], ecx
jl 0x40ce22
jmp case.default.0x40c548
movsx eax, word [esp + 0x4e]
mov esi, dword [esp + 0x70]
cmp esi, eax
mov ebx, esi
jge case.default.0x40c548
mov edi, dword [esp + 0x74]
mov ebp, dword [esp + 0x64]
test ebp, ebp
jle 0x40cf99
lea edx, [esp + 0x2c]
lea edi, [esp + 0x3c]
mov dword [esp + 0x6c], edx
lea esi, [esp + 0x50]
mov dword [esp + 0x60], ebp
movsx ecx, word [esi - 2]
movsx ebp, word [esi]
mov eax, dword [esp + 0x6c]
mov edx, dword [edi - 4]
push 0x100
sub ecx, ebx
mov eax, dword [eax]
push ebp
push ecx
push 0
push 0
push edx
push 0
push ebx
push eax
call fcn.00410340
mov eax, dword [edi]
mov ecx, dword [esp + 0x90]
push 0x100
push ebp
push ebx
push 0
push 0
push eax
mov eax, dword [ecx]
push 0
push 0
push eax
call fcn.00410340
mov ecx, dword [esp + 0xb4]
mov eax, dword [esp + 0xa8]
add esp, 0x48
add esi, 0xa
add edi, 8
add ecx, 4
dec eax
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x60], eax
jne 0x40cf20
mov ebp, dword [esp + 0x64]
mov esi, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
test edi, edi
je 0x40cf9f
call edi
call fcn.00445510
movsx eax, word [esp + 0x4e]
add ebx, esi
cmp ebx, eax
jl 0x40cf04
jmp case.default.0x40c548
mov esi, dword [esp + 0x70]
cmp esi, 0x100
mov dword [esp + 0x60], esi
jge case.default.0x40c548
mov edi, dword [esp + 0x74]
mov ebp, dword [esp + 0x64]
test ebp, ebp
jle 0x40d027
lea ebx, [esp + 0x2c]
lea esi, [esp + 0x3c]
mov edx, dword [esi - 4]
mov edi, dword [ebx]
push 0x100
push 0
push 0
push edx
push 0
push 0
push edi
call fcn.00410200
mov eax, dword [esp + 0x7c]
mov ecx, dword [esi]
push eax
push 0
push 8
push ecx
push 0
push 0
push edi
call fcn.00410200
add esp, 0x38
add esi, 8
add ebx, 4
dec ebp
jne 0x40cfe0
mov esi, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
mov ebp, dword [esp + 0x64]
test edi, edi
je 0x40d02d
call edi
call fcn.00445510
mov eax, dword [esp + 0x60]
add eax, esi
cmp eax, 0x100
mov dword [esp + 0x60], eax
jl 0x40cfd4
jmp case.default.0x40c548
mov esi, dword [esp + 0x70]
test esi, esi
jg 0x40d059
mov esi, 1
mov dword [esp + 0x70], esi
mov ecx, dword [esp + 0x38]
movsx eax, word [ecx + 2]
movsx ecx, word [ecx + 4]
sar ecx, 1
mov edx, ecx
mov dword [esp + 0x20], ecx
sar eax, 1
imul edx, ecx
mov ecx, eax
mov dword [esp + 0x14], eax
imul ecx, eax
add edx, ecx
mov dword [esp + 0x6c], edx
fild dword [esp + 0x6c]
fsqrt
call fcn.0047ddb0
mov ecx, 0xffff
cmp esi, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x60], esi
jge case.default.0x40c548
fld qword [0x485680]
fild dword [esp + 0x60]
fld st(1)
fcos
fmul st(1)
call fcn.0047ddb0
fld st(1)
fsin
mov edi, dword [esp + 0x14]
mov esi, eax
add esi, edi
fmul st(1)
call fcn.0047ddb0
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
add eax, edx
cmp esi, ecx
jne 0x40d0e9
cmp eax, dword [esp + 0x18]
je 0x40d262
mov edx, dword [esp + 0x38]
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], eax
movsx ecx, word [edx + 4]
dec ecx
cmp eax, ecx
jg 0x40d262
mov ecx, dword [esp + 0x14]
lea edx, [ecx + ecx]
sub edx, esi
sub esi, ecx
mov ebx, edx
mov dword [esp + 0x24], edx
shl esi, 1
test ebx, ebx
mov dword [esp + 0x28], esi
mov ecx, esi
jge 0x40d123
add ecx, ebx
xor ebx, ebx
mov edi, dword [esp + 0x38]
movsx edi, word [edi + 2]
cmp ecx, edi
jle 0x40d131
mov ecx, edi
test ecx, ecx
jl 0x40d262
mov edi, dword [esp + 0x64]
test edi, edi
jle 0x40d1c0
lea edx, [ecx + ecx]
lea ecx, [esp + 0x3c]
mov dword [esp + 0x6c], ecx
mov ecx, edi
mov dword [esp + 0x68], edx
lea edx, [esp + 0x4a]
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x6c]
movsx ebp, word [edx]
mov esi, dword [ecx]
mov ecx, dword [esp + 0x68]
add edx, 0xa
movsx edi, word [esi + 2]
imul edi, eax
mov esi, dword [esi + 8]
add edi, ebx
lea esi, [esi + edi*2]
movsx edi, word [edx - 8]
add edi, eax
mov edi, dword [edi*4 + 0x637f98]
add edi, ebp
mov ebp, dword [0x637f88]
add edi, ebx
lea edi, [ebp + edi*2]
mov ebp, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x6c]
mov ecx, dword [esp + 0x10]
add edi, 8
dec ecx
mov dword [esp + 0x6c], edi
mov dword [esp + 0x10], ecx
jne 0x40d15a
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
add ecx, ecx
sub ecx, eax
dec ecx
mov dword [esp + 0x28], ecx
js 0x40d262
mov ebx, edx
mov eax, esi
test ebx, ebx
jge 0x40d1df
add eax, ebx
xor ebx, ebx
mov edx, dword [esp + 0x38]
movsx ecx, word [edx + 2]
cmp eax, ecx
jle 0x40d1ed
mov eax, ecx
test eax, eax
jl 0x40d262
mov ecx, dword [esp + 0x64]
test ecx, ecx
jle 0x40d262
add eax, eax
lea ebp, [esp + 0x3c]
mov dword [esp + 0x68], eax
lea eax, [esp + 0x4a]
mov dword [esp + 0x6c], ecx
mov edx, dword [ebp]
mov edi, dword [esp + 0x28]
mov ecx, dword [esp + 0x68]
add ebp, 8
movsx esi, word [edx + 2]
imul esi, edi
mov edx, dword [edx + 8]
add esi, ebx
add eax, 0xa
lea esi, [edx + esi*2]
movsx edx, word [eax - 8]
add edx, edi
movsx edi, word [eax - 0xa]
mov edx, dword [edx*4 + 0x637f98]
add edx, edi
mov edi, dword [0x637f88]
add edx, ebx
lea edi, [edi + edx*2]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x6c]
dec ecx
mov dword [esp + 0x6c], ecx
jne 0x40d20b
fxch st(1)
fadd qword [0x485680]
fxch st(1)
fld st(1)
fcomp qword [0x485678]
fnstsw ax
test ah, 1
jne 0x40d0b3
mov eax, dword [esp + 0x74]
fstp st(0)
test eax, eax
fstp st(0)
je 0x40d28d
call eax
call fcn.00445510
mov eax, dword [esp + 0x60]
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x2c]
add eax, edx
cmp eax, ecx
mov dword [esp + 0x60], eax
jl 0x40d0a9
mov eax, dword [esp + 0x34]
push eax
call fcn.00422680
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret