Function at 0x4c5e00
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x10
push ebp
mov ebp, dword [esp + 0x18]
push esi
push edi
mov eax, dword [ebp + 0x1c]
push eax
call fcn.004645e0
mov dword [esp + 0x1c], eax
mov edi, eax
mov eax, dword [ebp]
push eax
call fcn.004645e0
mov esi, eax
add esp, 8
test esi, esi
jl 0x4c5e33
cmp esi, dword [0xa6a1c4]
jl 0x4c5e44
push esi
push str.ShaderForShaderNum:_bad_num__i
push 1
call dword [0x1313c84]
add esp, 0xc
mov edx, dword [0xa6a1c8]
lea eax, [esi*8]
sub eax, esi
lea ecx, [eax + eax*4]
lea eax, [edx + ecx*4]
mov ecx, dword [0x13e6d84]
mov edx, dword [ecx + 0x20]
test edx, edx
je 0x4c5e6b
mov edi, 0xfffffffd
mov edx, dword [0x13e6d94]
mov ecx, dword [edx + 0x20]
test ecx, ecx
jne 0x4c5e82
mov ecx, dword [0x1313df0]
test ecx, ecx
jne 0x4c5e87
mov edi, 0xfffffffe
push 1
push 1
push 1
push 1
push edi
push eax
call fcn.004a6df0
mov ecx, dword [eax + 0x50]
add esp, 0x18
test ecx, ecx
je 0x4c5ea5
mov eax, dword [0x1313ddc]
mov esi, dword [esp + 0x28]
mov dword [esi + 8], eax
mov ecx, dword [0x13e4254]
mov edx, dword [ecx + 0x20]
test edx, edx
je 0x4c5ec9
mov ecx, dword [eax + 0x64]
test ecx, ecx
jne 0x4c5ec9
mov edx, dword [0x1313ddc]
mov dword [esi + 8], edx
mov eax, dword [esi + 8]
mov cl, byte [eax + 0x58]
test cl, cl
jns 0x4c5ee1
mov dword [esi + 0xc], 0xa6a5e4
pop edi
pop esi
pop ebp
add esp, 0x10
ret
mov ecx, dword [ebp + 0x10]
push ebx
push ecx
call fcn.004645e0
mov ebx, eax
add esp, 4
cmp ebx, 0x40
jle 0x4c5f14
push ebx
push str.WARNING:_MAX_FACE_POINTS_exceeded:__i_n
push 3
call dword [0x1313c80]
mov edx, dword [0x1313ddc]
add esp, 0xc
mov ebx, 0x40
mov dword [esi + 8], edx
mov eax, dword [ebp + 0x18]
push eax
call fcn.004645e0
mov edi, ebx
mov ebp, eax
shl edi, 5
add edi, 0x8c
mov dword [esp + 0x1c], ebp
lea ecx, [edi + ebp*4]
push ecx
call dword [0x1313c94]
mov esi, eax
mov dword [esi + 0x88], edi
mov edi, dword [esp + 0x2c]
mov dword [esi], 1
mov dword [esi + 0x80], ebx
mov dword [esi + 0x84], ebp
mov edx, dword [edi + 0xc]
push edx
call fcn.004645e0
lea ecx, [eax + eax*4]
add esp, 0xc
test ebx, ebx
lea edx, [eax + ecx*2]
mov eax, dword [esp + 0x28]
lea eax, [eax + edx*4]
jle 0x4c60a4
lea edi, [esi + 0xaa]
lea ebp, [eax + 0x2a]
mov dword [esp + 0x14], ebx
lea ecx, [edi - 0x1e]
lea ebx, [ebp - 0x2a]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x10], 3
mov edx, dword [ebx]
push edx
call fcn.00464660
mov eax, dword [esp + 0x2c]
add esp, 4
add ebx, 4
fstp dword [eax]
add eax, 4
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jne 0x4c5f96
lea eax, [edi - 0xa]
lea ebx, [ebp - 0x16]
mov dword [esp + 0x28], eax
mov dword [esp + 0x10], 2
mov ecx, dword [ebx - 8]
push ecx
call fcn.00464660
mov edx, dword [esp + 0x2c]
fstp dword [edx - 8]
mov eax, dword [ebx]
push eax
call fcn.00464660
mov eax, dword [esp + 0x30]
add esp, 8
add ebx, 4
fstp dword [eax]
add eax, 4
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jne 0x4c5fce
mov ecx, dword [0x13145f4]
xor edx, edx
mov dl, byte [ebp]
xor eax, eax
mov al, byte [ebp - 1]
xor ebx, ebx
mov bl, byte [ebp - 2]
shl edx, cl
shl eax, cl
shl ebx, cl
mov ecx, edx
mov dword [esp + 0x28], edx
or ecx, eax
mov dword [esp + 0x10], eax
or ecx, ebx
cmp ecx, 0xff
jle 0x4c6079
cmp ebx, eax
mov ecx, ebx
jg 0x4c603d
mov ecx, eax
cmp ecx, edx
jg 0x4c6043
mov ecx, edx
mov eax, ebx
shl eax, 8
sub eax, ebx
cdq
idiv ecx
mov edx, dword [esp + 0x10]
mov ebx, eax
mov eax, edx
shl eax, 8
sub eax, edx
cdq
idiv ecx
mov edx, dword [esp + 0x28]
mov dword [esp + 0x10], eax
mov eax, edx
shl eax, 8
sub eax, edx
cdq
idiv ecx
mov dword [esp + 0x28], eax
mov edx, eax
mov eax, dword [esp + 0x10]
mov byte [edi - 2], bl
mov byte [edi - 1], al
mov eax, dword [esp + 0x14]
mov byte [edi], dl
mov dl, byte [ebp + 1]
add ebp, 0x2c
mov byte [edi + 1], dl
add edi, 0x20
dec eax
mov dword [esp + 0x14], eax
jne 0x4c5f84
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x24]
mov eax, dword [edi + 0x14]
push eax
call fcn.004645e0
mov ecx, dword [esp + 0x34]
add esp, 4
xor ebx, ebx
lea edx, [ecx + eax*4]
test ebp, ebp
mov dword [esp + 0x30], edx
jle 0x4c60e2
mov eax, dword [esp + 0x30]
mov ecx, dword [eax + ebx*4]
push ecx
call fcn.004645e0
mov ecx, dword [esi + 0x88]
add esp, 4
lea edx, [esi + ebx*4]
inc ebx
cmp ebx, ebp
mov dword [edx + ecx], eax
jl 0x4c60c1
lea ebp, [esi + 4]
lea ebx, [edi + 0x54]
mov dword [esp + 0x24], 3
mov edx, dword [ebx]
push edx
call fcn.00464660
fstp dword [ebp]
mov eax, dword [esp + 0x28]
add esp, 4
add ebx, 4
add ebp, 4
dec eax
mov dword [esp + 0x24], eax
jne 0x4c60f0
fld dword [esi + 0x94]
fmul dword [esi + 0xc]
fld dword [esi + 0x90]
fmul dword [esi + 8]
lea ebx, [esi + 4]
push ebx
faddp st(1)
fld dword [esi + 0x8c]
fmul dword [ebx]
faddp st(1)
fstp dword [esi + 0x10]
call fcn.00462200
fld dword [ebx]
fcomp qword [0x535468]
add esp, 4
fnstsw ax
test ah, 0x44
jp 0x4c614f
xor eax, eax
jmp 0x4c6180
fld dword [esi + 8]
fcomp qword [0x535468]
fnstsw ax
test ah, 0x44
jp 0x4c6166
mov eax, 1
jmp 0x4c6180
fld dword [esi + 0xc]
fcomp qword [0x535468]
fnstsw ax
test ah, 0x44
mov eax, 2
jnp 0x4c6180
mov eax, 3
mov byte [esi + 0x14], al
mov eax, dword [0x1313df0]
test eax, eax
je 0x4c62d4
mov ebx, dword [esp + 0x1c]
cmp ebx, 0xffffffff
je 0x4c62d4
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax + 8]
mov eax, dword [ecx + 0x40]
test eax, eax
jl 0x4c62d4
mov edx, dword [edi + 0x20]
push edx
call fcn.004645e0
mov dword [esi + 0x38], eax
mov eax, dword [edi + 0x24]
push eax
call fcn.004645e0
mov dword [esi + 0x3c], eax
mov ecx, dword [edi + 0x28]
push ecx
call fcn.004645e0
mov dword [esi + 0x30], eax
mov edx, dword [edi + 0x2c]
push edx
call fcn.004645e0
mov dword [esi + 0x34], eax
mov eax, dword [0xa6a56c]
add esp, 0x10
test eax, eax
je 0x4c6202
mov ecx, dword [esi + 0x3c]
mov edx, dword [esi + 0x38]
shl ebx, 7
add ebx, ecx
shl ebx, 7
add ebx, edx
lea eax, [eax + ebx*2]
add ebx, eax
jmp 0x4c6204
xor ebx, ebx
mov dword [esi + 0x40], ebx
lea ebx, [esi + 0x50]
add edi, 0x3c
mov ebp, 3
mov ecx, dword [edi - 0xc]
push ecx
call fcn.00464660
fstp dword [ebx - 0xc]
mov edx, dword [edi]
push edx
call fcn.00464660
fstp dword [ebx]
mov eax, dword [edi + 0xc]
push eax
call fcn.00464660
fstp dword [ebx + 0xc]
add esp, 0xc
add edi, 4
add ebx, 4
dec ebp
jne 0x4c6212
lea edi, [esi + 0x68]
lea eax, [esi + 0x50]
push edi
push eax
call fcn.0045afb0
call fcn.0051a95c
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
fdivr qword [0x535468]
call fcn.0051a95c
mov dword [esp + 0x2c], eax
lea ecx, [esi + 0x5c]
fild dword [esp + 0x2c]
fld st(0)
fmul dword [edi]
fstp dword [edi]
lea edi, [esi + 0x74]
fld st(0)
fmul dword [esi + 0x6c]
push edi
push ecx
fstp dword [esi + 0x6c]
fmul dword [esi + 0x70]
fstp dword [esi + 0x70]
call fcn.0045afb0
add esp, 0x10
call fcn.0051a95c
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
fdivr qword [0x535468]
call fcn.0051a95c
mov dword [esp + 0x24], eax
mov edx, dword [esp + 0x2c]
fild dword [esp + 0x24]
pop ebx
fld st(0)
fmul dword [edi]
fstp dword [edi]
pop edi
fld st(0)
fmul dword [esi + 0x78]
fstp dword [esi + 0x78]
fmul dword [esi + 0x7c]
fstp dword [esi + 0x7c]
mov dword [edx + 0xc], esi
pop esi
pop ebp
add esp, 0x10
ret
mov edx, dword [esp + 0x2c]
mov dword [esi + 0x40], 0
pop ebx
pop edi
mov dword [edx + 0xc], esi
pop esi
pop ebp
add esp, 0x10
ret