Function at 0x4da7e0
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.004737d0
mov dword [esp + 0x1c], eax
mov edi, eax
mov eax, dword [ebp]
push eax
call fcn.004737d0
mov esi, eax
add esp, 8
test esi, esi
jl 0x4da813
cmp esi, dword [0xc0f6a4]
jl 0x4da824
push esi
push str.ShaderForShaderNum:_bad_num__i
push 1
call dword [0x160cc64]
add esp, 0xc
mov edx, dword [0xc0f6a8]
lea eax, [esi*8]
sub eax, esi
lea ecx, [eax + eax*4]
lea eax, [edx + ecx*4]
mov ecx, dword [0x16e0d84]
mov edx, dword [ecx + 0x20]
test edx, edx
je 0x4da84b
mov edi, 0xfffffffd
mov edx, dword [0x16e0d98]
mov ecx, dword [edx + 0x20]
test ecx, ecx
jne 0x4da862
mov ecx, dword [0x160cdd0]
test ecx, ecx
jne 0x4da867
mov edi, 0xfffffffe
mov ecx, dword [0x16dd27c]
push 1
push 1
mov edx, dword [ecx + 0x20]
push edx
push 1
push edi
push eax
call fcn.004b9ec0
mov ecx, dword [eax + 0x50]
add esp, 0x18
test ecx, ecx
je 0x4da88d
mov eax, dword [0x160cdbc]
mov esi, dword [esp + 0x28]
mov dword [esi + 8], eax
mov ecx, dword [0x16dd254]
mov edx, dword [ecx + 0x20]
test edx, edx
je 0x4da8b1
mov ecx, dword [eax + 0x64]
test ecx, ecx
jne 0x4da8b1
mov edx, dword [0x160cdbc]
mov dword [esi + 8], edx
mov eax, dword [esi + 8]
mov cl, byte [eax + 0x58]
test cl, cl
jns 0x4da8c9
mov dword [esi + 0xc], 0xc0fac4
pop edi
pop esi
pop ebp
add esp, 0x10
ret
mov ecx, dword [ebp + 0x10]
push ebx
push ecx
call fcn.004737d0
mov ebx, eax
add esp, 4
cmp ebx, 0x40
jle 0x4da8fc
push ebx
push str.WARNING:_MAX_FACE_POINTS_exceeded:__i_n
push 3
call dword [0x160cc60]
mov edx, dword [0x160cdbc]
add esp, 0xc
mov ebx, 0x40
mov dword [esi + 8], edx
mov eax, dword [ebp + 0x18]
push eax
call fcn.004737d0
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 [0x160cc74]
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.004737d0
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 0x4daa8c
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.00473850
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 0x4da97e
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.00473850
mov edx, dword [esp + 0x2c]
fstp dword [edx - 8]
mov eax, dword [ebx]
push eax
call fcn.00473850
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 0x4da9b6
mov ecx, dword [0x160d5e0]
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 0x4daa61
cmp ebx, eax
mov ecx, ebx
jg 0x4daa25
mov ecx, eax
cmp ecx, edx
jg 0x4daa2b
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 0x4da96c
mov ebp, dword [esp + 0x18]
mov edi, dword [esp + 0x24]
mov eax, dword [edi + 0x14]
push eax
call fcn.004737d0
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 0x4daad4
mov eax, dword [esp + 0x30]
lea edi, [ebx*4]
mov ecx, dword [edi + eax]
push ecx
call fcn.004737d0
mov edx, dword [esi + 0x88]
add esp, 4
add edx, edi
inc ebx
cmp ebx, ebp
mov dword [edx + esi], eax
jl 0x4daaa9
mov edi, dword [esp + 0x24]
lea ebp, [esi + 4]
lea ebx, [edi + 0x54]
mov dword [esp + 0x24], 3
mov eax, dword [ebx]
push eax
call fcn.00473850
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 0x4daae2
fld dword [esi + 0x90]
fmul dword [esi + 8]
fld dword [esi + 0x8c]
fmul dword [esi + 4]
lea ebx, [esi + 4]
push ebx
faddp st(1)
fld dword [esi + 0x94]
fmul dword [esi + 0xc]
faddp st(1)
fstp dword [esi + 0x10]
call fcn.004713e0
fld dword [ebx]
fcomp qword [0x54e488]
add esp, 4
fnstsw ax
test ah, 0x44
jp 0x4dab42
xor eax, eax
jmp 0x4dab73
fld dword [esi + 8]
fcomp qword [0x54e488]
fnstsw ax
test ah, 0x44
jp 0x4dab59
mov eax, 1
jmp 0x4dab73
fld dword [esi + 0xc]
fcomp qword [0x54e488]
fnstsw ax
test ah, 0x44
mov eax, 2
jnp 0x4dab73
mov eax, 3
mov byte [esi + 0x14], al
mov eax, dword [0x160cdd0]
test eax, eax
je 0x4dacc7
mov ebx, dword [esp + 0x1c]
cmp ebx, 0xffffffff
je 0x4dacc7
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx + 8]
mov eax, dword [edx + 0x40]
test eax, eax
jl 0x4dacc7
mov eax, dword [edi + 0x20]
push eax
call fcn.004737d0
mov dword [esi + 0x38], eax
mov ecx, dword [edi + 0x24]
push ecx
call fcn.004737d0
mov dword [esi + 0x3c], eax
mov edx, dword [edi + 0x28]
push edx
call fcn.004737d0
mov dword [esi + 0x30], eax
mov eax, dword [edi + 0x2c]
push eax
call fcn.004737d0
mov dword [esi + 0x34], eax
mov eax, dword [0xc0fa4c]
add esp, 0x10
test eax, eax
je 0x4dabf5
mov ebp, dword [esi + 0x3c]
mov ecx, dword [esi + 0x38]
shl ebx, 7
add ebx, ebp
shl ebx, 7
add ebx, ecx
lea ecx, [eax + ebx*2]
add ebx, ecx
jmp 0x4dabf7
xor ebx, ebx
mov dword [esi + 0x40], ebx
lea ebx, [esi + 0x50]
add edi, 0x3c
mov ebp, 3
mov edx, dword [edi - 0xc]
push edx
call fcn.00473850
fstp dword [ebx - 0xc]
mov eax, dword [edi]
push eax
call fcn.00473850
fstp dword [ebx]
mov ecx, dword [edi + 0xc]
push ecx
call fcn.00473850
fstp dword [ebx + 0xc]
add esp, 0xc
add edi, 4
add ebx, 4
dec ebp
jne 0x4dac05
lea edi, [esi + 0x68]
lea eax, [esi + 0x50]
push edi
push eax
call fcn.004695c0
call fcn.00532e5c
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
fdivr qword [0x54e488]
call fcn.00532e5c
mov dword [esp + 0x2c], eax
lea edx, [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 edx
fstp dword [esi + 0x6c]
fmul dword [esi + 0x70]
fstp dword [esi + 0x70]
call fcn.004695c0
add esp, 0x10
call fcn.00532e5c
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
fdivr qword [0x54e488]
call fcn.00532e5c
mov dword [esp + 0x24], eax
mov eax, 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 [eax + 0xc], esi
pop esi
pop ebp
add esp, 0x10
ret
mov eax, dword [esp + 0x2c]
mov dword [esi + 0x40], 0
pop ebx
pop edi
mov dword [eax + 0xc], esi
pop esi
pop ebp
add esp, 0x10
ret