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

Disassembly:
push ecx
push ebx
push ebp
push esi
mov esi, dword [esp + 0x14]
push edi
xor ebx, ebx
push esi
mov dword [esp + 0x14], ebx
xor ebp, ebp
call fcn.004af4b0
mov ecx, dword [esp + 0x34]
add esp, 4
add ecx, eax
mov dword [esp + 0x30], ecx
jns 0x49b7ca
mov dword [esp + 0x30], ebx
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0x40
jb 0x49b7ec
push esi
push str.R_CreateImage:___s__is_too_long_n
push 1
call dword [0x160cc64]
add esp, 0xc
push 9
push 0x574ff0
push esi
call fcn.005354d0
add esp, 0xc
test eax, eax
jne 0x49b808
mov dword [esp + 0x10], 1
push 0xa
push str.lightmapD
push esi
call fcn.005354d0
add esp, 0xc
test eax, eax
jne 0x49b821
mov ebp, 1
mov ecx, dword [0x1626244]
test ecx, ecx
jle 0x49b83f
mov eax, 0x1626248
cmp byte [eax], 0
je 0x49b83f
inc ebx
add eax, 0x84
cmp ebx, ecx
jl 0x49b830
cmp ebx, ecx
jne 0x49b864
cmp ecx, 0x600
jne 0x49b85d
push str.R_CreateImage:_MAX_DRAWIMAGES_hit_n
push 1
call dword [0x160cc64]
add esp, 8
jmp 0x49b864
inc ecx
mov dword [0x1626244], ecx
mov eax, ebx
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
shl eax, 5
add eax, ebx
lea edi, [eax*4 + 0x1626248]
mov eax, dword [esp + 0x34]
mov dword [edi + 0x64], ecx
mov cx, word [esp + 0x40]
mov dword [edi + 0x6c], edx
mov dx, word [esp + 0x44]
mov dword [edi + 0x68], ebp
mov ebp, edi
mov dword [edi + 0x70], eax
mov word [edi + 0x74], cx
mov word [edi + 0x76], dx
mov dword [edi + 0x7c], 0
mov eax, esi
sub ebp, esi
mov cl, byte [eax]
mov byte [eax + ebp], cl
inc eax
test cl, cl
jne 0x49b8a9
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov dword [edi + 0x40], eax
mov eax, dword [0x16e0c54]
add ebx, 0x400
mov dword [edi + 0x44], ecx
test eax, eax
mov dword [edi + 0x50], ebx
je 0x49b8e4
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x49b8e4
mov dword [edi + 0x60], 1
jmp 0x49b8eb
mov dword [edi + 0x60], 0
test eax, eax
je 0x49b8fb
mov edx, dword [edi + 0x60]
push edx
call fcn.004aa070
add esp, 4
push edi
call fcn.004a9ff0
mov eax, dword [esp + 0x40]
add esp, 4
test eax, eax
je 0x49bb28
mov eax, dword [edi + 0x64]
mov ebp, dword [edi + 0x44]
mov ebx, dword [edi + 0x40]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x30]
xor ecx, ecx
test eax, eax
jle 0x49b934
mov edx, dword [esp + 0x2c]
mov ecx, eax
cmp eax, edx
jl 0x49b934
lea ecx, [edx - 1]
test ecx, ecx
mov eax, ebx
mov edx, ebp
je 0x49b940
sar eax, cl
sar edx, cl
mov esi, dword [0x16e0b20]
cmp eax, esi
jg 0x49b94e
cmp edx, esi
jle 0x49b955
sar eax, 1
sar edx, 1
inc ecx
jmp 0x49b946
test ecx, ecx
jle 0x49b96c
mov esi, dword [esp + 0x2c]
cmp ecx, esi
jl 0x49b96c
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 + 0x3c]
cmp eax, 0x83f1
mov dword [edi + 0x4c], edx
mov dword [edi + 0x5c], eax
je 0x49b98f
cmp eax, 0x83f0
mov dword [esp + 0x28], 0x10
jne 0x49b997
mov dword [esp + 0x28], 8
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x34], 0
test ecx, ecx
mov dword [esp + 0x30], edx
jle 0x49ba04
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x34], ecx
lea eax, [ebx + 3]
cdq
and edx, 3
add eax, edx
mov esi, eax
sar esi, 2
cmp esi, 1
jle 0x49b9e3
lea eax, [ebp + 3]
cdq
and edx, 3
add eax, edx
sar eax, 2
cmp eax, 1
jle 0x49b9e3
imul eax, esi
imul eax, dword [esp + 0x28]
add dword [esp + 0x30], eax
sar ebx, 1
sar ebp, 1
test ebx, ebx
jne 0x49b9f0
mov ebx, 1
test ebp, ebp
jne 0x49b9f9
mov ebp, 1
mov eax, dword [esp + 0x1c]
dec eax
mov dword [esp + 0x1c], eax
jne 0x49b9b3
mov eax, dword [esp + 0x34]
mov dword [edi + 0x58], 0
sub eax, ecx
test ebx, ebx
mov dword [esp + 0x1c], eax
jne 0x49ba26
test ebp, ebp
je 0x49bac6
mov ebx, 1
test ebp, ebp
jne 0x49ba2f
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 + 0x28]
cmp eax, 1
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], eax
jle 0x49ba68
cmp ecx, 1
jle 0x49ba68
add dword [edi + 0x58], esi
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x1c]
push eax
push esi
push 0
push ebp
push ebx
push ecx
push edx
push 0xde1
call dword [0x16e0b9c]
call fcn.0049df50
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x2c]
cmp eax, ecx
jge 0x49baaf
mov ecx, dword [esp + 0x20]
mov eax, 1
cmp ecx, eax
jle 0x49baaf
cmp dword [esp + 0x24], eax
jle 0x49baaf
add dword [esp + 0x30], esi
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x1c]
sar ebx, 1
sar ebp, 1
inc ecx
inc eax
mov dword [esp + 0x34], ecx
jmp 0x49ba11
cmp dword [esp + 0x38], 1
jle 0x49baf3
fild dword [0x574c84]
push ecx
fstp dword [esp]
push 0x2801
push 0xde1
call dword [0x16dcf30]
fild dword [0x574c88]
push ecx
fstp dword [esp]
jmp 0x49bb0d
push 0x46180400
push 0x2801
push 0xde1
call dword [0x16dcf30]
push 0x46180400
push 0x2800
push 0xde1
call dword [0x16dcf30]
call fcn.0049df50
mov esi, dword [esp + 0x18]
jmp 0x49bb69
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 + 0x44]
lea edx, [edi + 0x5c]
push ecx
mov ecx, dword [esp + 0x44]
push edx
mov edx, dword [edi + 0x68]
push eax
mov eax, dword [esp + 0x48]
push ecx
mov ecx, dword [edi + 0x64]
push edx
mov edx, dword [edi + 0x44]
push eax
mov eax, dword [edi + 0x40]
push ecx
mov ecx, dword [esp + 0x44]
push edx
push eax
push ecx
call fcn.0049bc30
add esp, 0x34
fild dword [esp + 0x40]
push ecx
fstp dword [esp]
push 0x2802
push 0xde1
call dword [0x16dcf30]
fild dword [esp + 0x44]
push ecx
fstp dword [esp]
push 0x2803
push 0xde1
call dword [0x16dcf30]
push 0
push 0xde1
call dword [0x16dced8]
mov eax, dword [edi + 0x60]
cmp eax, 1
mov dword [eax*4 + 0x16e0d20], 0xffffffff
jne 0x49bbc3
push 0
call fcn.004aa070
add esp, 4
mov al, byte [esi]
xor ebx, ebx
test al, al
je 0x49bbfb
mov ebp, 0x77
sub ebp, esi
movsx edx, byte [esi]
push edx
call fcn.005356be
add esp, 4
cmp al, 0x2e
je 0x49bbfb
cmp al, 0x5c
jne 0x49bbe8
mov al, 0x2f
movsx edx, al
lea ecx, [esi + ebp]
mov al, byte [esi + 1]
imul ecx, edx
add ebx, ecx
inc esi
test al, al
jne 0x49bbd2
mov ecx, dword [0x5752f0]
and ebx, 0x3ff
mov dword [edi + 0x78], ecx
mov eax, dword [ebx*4 + 0x99c438]
mov dword [ebx*4 + 0x99c438], edi
mov dword [edi + 0x80], eax
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret