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

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x14]
push esi
push edi
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
xor ebx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x10], ebx
cmp ecx, 0x40
mov dword [esp + 0x14], ebx
jb 0x486497
push ebp
push str.R_CreateImage:___s__is_too_long_n
push 1
call dword [0x12ff6a4]
add esp, 0xc
push 9
push 0x554698
push ebp
call fcn.00518140
add esp, 0xc
test eax, eax
jne 0x4864b3
mov dword [esp + 0x10], 1
push 0xa
push str.lightmapD
push ebp
call fcn.00518140
add esp, 0xc
test eax, eax
jne 0x4864cf
mov dword [esp + 0x14], 1
mov ecx, dword [0x1318c78]
cmp ebx, ecx
jge 0x4864ef
mov eax, 0x1318c7c
cmp byte [eax], 0
je 0x4864ed
inc ebx
add eax, 0x84
cmp ebx, ecx
jl 0x4864de
cmp ebx, ecx
jne 0x486512
cmp ecx, 0x600
jne 0x48650b
push str.R_CreateImage:_MAX_DRAWIMAGES_hit_n
push 1
call dword [0x12ff6a4]
add esp, 8
jmp 0x486512
inc ecx
mov dword [0x1318c78], ecx
mov eax, ebx
mov ecx, dword [esp + 0x2c]
shl eax, 5
mov edx, dword [esp + 0x14]
add eax, ebx
mov esi, dword [esp + 0x34]
lea edi, [eax*4 + 0x1318c7c]
mov eax, dword [esp + 0x38]
mov dword [edi + 0x64], ecx
mov cx, word [esp + 0x44]
mov dword [edi + 0x70], eax
mov dword [edi + 0x68], edx
mov dx, word [esp + 0x48]
mov word [edi + 0x74], cx
mov ecx, dword [esp + 0x1c]
mov eax, ebp
mov ebp, edi
mov dword [edi + 0x6c], esi
mov word [edi + 0x76], dx
mov dword [edi + 0x7c], 0
sub ebp, ecx
mov cl, byte [eax]
mov byte [eax + ebp], cl
inc eax
test cl, cl
jne 0x48655f
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
mov dword [edi + 0x40], eax
mov eax, dword [0x13d3658]
add ebx, 0x400
mov dword [edi + 0x44], ecx
test eax, eax
mov dword [edi + 0x50], ebx
je 0x48659a
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x48659a
mov dword [edi + 0x60], 1
jmp 0x4865a1
mov dword [edi + 0x60], 0
test eax, eax
je 0x4865b1
mov edx, dword [edi + 0x60]
push edx
call fcn.00494e60
add esp, 4
push edi
call fcn.00494de0
mov eax, dword [esp + 0x44]
add esp, 4
test eax, eax
je 0x4867e1
mov eax, dword [edi + 0x64]
mov ebp, dword [edi + 0x44]
mov ebx, dword [edi + 0x40]
xor ecx, ecx
test esi, esi
mov dword [esp + 0x3c], eax
je 0x4865f1
mov ecx, dword [0x13d0c98]
mov ecx, dword [ecx + 0x20]
test ecx, ecx
jle 0x4865f1
mov eax, dword [esp + 0x30]
cmp ecx, eax
jl 0x4865f1
lea ecx, [eax - 1]
test ecx, ecx
mov eax, ebx
mov edx, ebp
je 0x4865fd
sar eax, cl
sar edx, cl
mov esi, dword [0x13d3540]
cmp eax, esi
jg 0x48660b
cmp edx, esi
jle 0x486612
sar eax, 1
sar edx, 1
inc ecx
jmp 0x486603
test ecx, ecx
jle 0x486629
mov esi, dword [esp + 0x30]
cmp ecx, esi
jl 0x486629
lea ecx, [esi - 1]
mov eax, ebx
mov edx, ebp
sar eax, cl
sar edx, cl
mov dword [edi + 0x48], eax
mov eax, dword [esp + 0x40]
cmp eax, 0x83f1
mov dword [edi + 0x4c], edx
mov dword [edi + 0x5c], eax
je 0x48664c
cmp eax, 0x83f0
mov dword [esp + 0x2c], 0x10
jne 0x486654
mov dword [esp + 0x2c], 8
mov edx, dword [esp + 0x20]
mov dword [esp + 0x20], 0
test ecx, ecx
mov dword [esp + 0x38], edx
jle 0x4866c1
mov dword [esp + 0x34], ecx
mov dword [esp + 0x20], ecx
lea eax, [ebx + 3]
cdq
and edx, 3
add eax, edx
mov esi, eax
sar esi, 2
cmp esi, 1
jle 0x4866a0
lea eax, [ebp + 3]
cdq
and edx, 3
add eax, edx
sar eax, 2
cmp eax, 1
jle 0x4866a0
imul eax, esi
imul eax, dword [esp + 0x2c]
add dword [esp + 0x38], eax
sar ebx, 1
sar ebp, 1
test ebx, ebx
jne 0x4866ad
mov ebx, 1
test ebp, ebp
jne 0x4866b6
mov ebp, 1
mov eax, dword [esp + 0x34]
dec eax
mov dword [esp + 0x34], eax
jne 0x486670
mov eax, dword [esp + 0x20]
mov dword [edi + 0x58], 0
sub eax, ecx
test ebx, ebx
mov dword [esp + 0x34], eax
jne 0x4866e3
test ebp, ebp
je 0x486783
mov ebx, 1
test ebp, ebp
jne 0x4866ec
mov ebp, 1
lea eax, [ebp + 3]
cdq
and edx, 3
add eax, edx
mov ecx, eax
lea eax, [ebx + 3]
cdq
and edx, 3
sar ecx, 2
add eax, edx
mov esi, ecx
sar eax, 2
imul esi, eax
imul esi, dword [esp + 0x2c]
cmp eax, 1
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], eax
jle 0x486725
cmp ecx, 1
jle 0x486725
add dword [edi + 0x58], esi
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x34]
push eax
push esi
push 0
push ebp
push ebx
push ecx
push edx
push 0xde1
call dword [0x13d35b8]
call fcn.00488fc0
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x30]
cmp eax, ecx
jge 0x48676c
mov ecx, dword [esp + 0x24]
mov eax, 1
cmp ecx, eax
jle 0x48676c
cmp dword [esp + 0x28], eax
jle 0x48676c
add dword [esp + 0x38], esi
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x34]
sar ebx, 1
sar ebp, 1
inc ecx
inc eax
mov dword [esp + 0x20], ecx
jmp 0x4866ce
cmp dword [esp + 0x3c], 1
jle 0x4867b0
fild dword [0x55432c]
push ecx
fstp dword [esp]
push 0x2801
push 0xde1
call dword [0x13d095c]
fild dword [0x554330]
push ecx
fstp dword [esp]
jmp 0x4867ca
push 0x46180400
push 0x2801
push 0xde1
call dword [0x13d095c]
push 0x46180400
push 0x2800
push 0xde1
call dword [0x13d095c]
call fcn.00488fc0
jmp 0x48681e
mov ecx, dword [esp + 0x10]
lea edx, [edi + 0x58]
push ecx
lea eax, [edi + 0x4c]
push edx
lea ecx, [edi + 0x48]
push eax
mov eax, dword [esp + 0x48]
lea edx, [edi + 0x5c]
push ecx
mov ecx, dword [esp + 0x48]
push edx
mov edx, dword [edi + 0x68]
push eax
mov eax, dword [edi + 0x64]
push ecx
mov ecx, dword [edi + 0x44]
push edx
mov edx, dword [edi + 0x40]
push esi
push eax
mov eax, dword [esp + 0x48]
push ecx
push edx
push eax
call fcn.004868e0
add esp, 0x34
fild dword [esp + 0x44]
push ecx
fstp dword [esp]
push 0x2802
push 0xde1
call dword [0x13d095c]
fild dword [esp + 0x48]
push ecx
fstp dword [esp]
push 0x2803
push 0xde1
call dword [0x13d095c]
push 0
push 0xde1
call dword [0x13d0904]
mov eax, dword [edi + 0x60]
cmp eax, 1
mov dword [eax*4 + 0x13d3740], 0xffffffff
jne 0x486878
push 0
call fcn.00494e60
add esp, 4
mov esi, dword [esp + 0x1c]
xor ebx, ebx
cmp byte [esi], 0
je 0x4868b3
mov ebp, 0x77
sub ebp, esi
movsx ecx, byte [esi]
push ecx
call fcn.00517f27
add esp, 4
cmp al, 0x2e
je 0x4868b3
cmp al, 0x5c
jne 0x4868a0
mov al, 0x2f
movsx eax, al
lea edx, [esi + ebp]
imul edx, eax
mov al, byte [esi + 1]
add ebx, edx
inc esi
test al, al
jne 0x48688a
mov edx, dword [0x5549e8]
and ebx, 0x3ff
mov dword [edi + 0x78], edx
mov eax, edi
mov ecx, dword [ebx*4 + 0x7bbc50]
mov dword [ebx*4 + 0x7bbc50], edi
mov dword [edi + 0x80], ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret