Function at 0x50f6d0
Capabilities:
Terminate process

Disassembly:
sub esp, 0xa4
mov eax, dword [esp + 0xb8]
push ebx
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0xb0]
push ebp
push esi
mov esi, dword [esp + 0xbc]
lea ecx, [eax - 1]
test eax, ecx
push edi
jne 0x50f710
test eax, eax
je 0x50f710
lea edx, [esi - 1]
test esi, edx
jne 0x50f710
test esi, esi
je 0x50f710
mov eax, 1
jmp 0x50f712
xor eax, eax
push str.texture_size_must_be_powers_of_2
push eax
call fcn.004015b0
mov ebx, dword [esp + 0xcc]
add esp, 8
test bh, 0x10
je 0x50f739
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xa4
ret
mov ebp, dword [esp + 0xb8]
lea eax, [ebp + ebp*2]
lea ebp, [ebp + eax*4]
shl ebp, 3
mov dword [esp + 0x30], ebp
mov eax, dword [ebp + 0xac12f4]
test eax, eax
jne 0x50f767
mov eax, dword [ebp + 0xac1330]
test eax, eax
jne 0x50f767
xor eax, eax
jmp 0x50f76c
mov eax, 1
test al, al
sete cl
push str.texture_slot_already_used
push ecx
call fcn.004015b0
fild dword [esp + 0xc4]
mov dx, word [esp + 0xc4]
mov eax, 0x3f800000
mov edi, ebx
mov dword [ebp + 0xac12e0], eax
fstp dword [esp + 0x24]
fld dword [0x53b27c]
fdiv dword [esp + 0x24]
mov dword [ebp + 0xac12dc], eax
mov eax, dword [esp + 0xd4]
and edi, 0xff
add esp, 8
and ebx, 0xff00
mov word [ebp + 0xac12d8], dx
test edi, edi
mov word [ebp + 0xac12da], si
mov dword [ebp + 0xac12f8], eax
mov dword [ebp + 0xac12ec], 0
mov dword [esp + 0x20], edi
mov dword [esp + 0x34], ebx
fstp dword [ebp + 0xac12e4]
fild dword [esp + 0xc0]
fstp dword [esp + 0x1c]
fld dword [0x53b27c]
fdiv dword [esp + 0x1c]
fstp dword [ebp + 0xac12e8]
je 0x50f81b
cmp edi, 2
je 0x50f81b
cmp edi, 7
je 0x50f81b
xor ecx, ecx
jmp 0x50f820
mov ecx, 1
mov eax, dword [ebp + 0xac12f0]
mov edx, eax
xor edx, ecx
and edx, 1
xor edx, eax
mov eax, dword [esp + 0xd0]
test eax, eax
mov dword [ebp + 0xac12f0], edx
jne 0x50f848
mov byte [ebp + 0xac1300], al
jmp 0x50f85a
push 0x1f
push eax
lea eax, [ebp + 0xac1300]
push eax
call fcn.00529e10
add esp, 0xc
mov ecx, dword [esp + 0xd4]
test edi, edi
mov dword [ebp + 0xac1320], ecx
jne 0x50f873
xor eax, eax
mov dword [esp + 0x10], eax
jmp 0x50f8aa
cmp edi, 2
jne 0x50f883
mov eax, 1
mov dword [esp + 0x10], eax
jmp 0x50f8aa
cmp edi, 1
jne 0x50f893
mov eax, 2
mov dword [esp + 0x10], eax
jmp 0x50f8aa
mov eax, edi
sub eax, 7
neg eax
sbb eax, eax
and al, 0xfc
add eax, 3
cmp eax, 3
mov dword [esp + 0x10], eax
je 0x50f8c2
lea edx, [eax + eax*8]
lea ecx, [eax + edx*2]
test byte [ecx*4 + 0x568898], 1
je 0x50f8c2
mov dword [ebp + 0xac12fc], eax
jmp 0x50f8ce
mov edx, dword [0xadb36c]
mov dword [ebp + 0xac12fc], edx
mov eax, dword [esp + 0xcc]
and eax, 0x200
mov dword [esp + 0x2c], eax
je 0x50f8f5
mov eax, dword [0xadb3b8]
lea ecx, [eax + eax]
mov eax, dword [esp + 0xbc]
mov dword [esp + 0x28], ecx
jmp 0x50f903
mov eax, dword [esp + 0xbc]
lea edx, [eax + eax]
mov dword [esp + 0x28], edx
cmp edi, 7
jne 0x50f90c
shl dword [esp + 0x28], 1
cmp ebx, 0x100
je 0x50f958
cmp ebx, 0xd00
je 0x50f958
cmp ebx, 0x200
je 0x50f958
cmp ebx, 0x300
je 0x50f934
cmp ebx, 0x400
jne 0x50f988
mov ecx, dword [esp + 0xc8]
mov edx, dword [esp + 0xbc]
xor eax, eax
cmp ebx, 0x400
sete al
push eax
push ecx
push esi
push edx
call fcn.005115d0
jmp 0x50f97a
mov ecx, dword [esp + 0xc8]
mov edx, dword [esp + 0xbc]
xor eax, eax
cmp ebx, 0x200
sete al
push eax
push ecx
push esi
push edx
call fcn.00511400
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0xcc]
add esp, 0x10
mov dword [ebp + 0xac12f4], 0
mov edi, dword [0xadb3a8]
mov ecx, dword [0xadb3ac]
cmp eax, edi
jg 0x50ff3b
cmp esi, ecx
jg 0x50ff3b
mov ecx, dword [0xadb3bc]
inc ecx
mov dword [0xadb3bc], ecx
mov edx, dword [ebp + 0xac12fc]
mov dword [ebp + 0xac1328], ecx
lea ecx, [edx + edx*8]
lea edx, [edx + ecx*2]
shl edx, 2
cmp dword [edx + 0x568874], 0x20
jne 0x50f9e6
lea edi, [eax*4]
mov dword [esp + 0x14], edi
jmp 0x50f9ee
add eax, eax
mov dword [esp + 0x14], eax
mov edi, eax
mov eax, dword [0x6b78f8]
test eax, eax
je 0x50fba1
mov ecx, edi
imul ecx, esi
push ecx
call fcn.0052a227
test eax, eax
setne dl
push str.out_of_memory_loading_softrend_textures__r_n
push edx
mov dword [ebp + 0xac12f4], eax
call fcn.004015b0
mov ebx, dword [ebp + 0xac12f8]
mov ecx, dword [esp + 0x1c]
or bh, 4
add esp, 0xc
mov eax, ebx
mov dword [ebp + 0xac12f8], ebx
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 0xac12fc]
cmp ecx, eax
jne 0x50fae3
mov eax, dword [esp + 0x24]
mov edx, dword [ebp + 0xac12f4]
test edi, edi
mov dword [esp + 0x18], edi
jne 0x50fa65
mov ecx, dword [esp + 0xbc]
add ecx, ecx
mov dword [esp + 0x18], ecx
test esi, esi
jle 0x50faa1
mov ecx, dword [esp + 0xc0]
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x18]
mov esi, eax
mov ebx, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x28]
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
add eax, edi
add edx, esi
dec ecx
mov dword [esp + 0x10], ecx
jne 0x50fa74
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x510120
mov eax, dword [ebp + 0xac12f8]
mov ecx, dword [esp + 0xc8]
and ah, 0xfd
or eax, 0x2006
mov dword [ebp + 0xac12f8], eax
mov eax, dword [0xadb3a0]
test eax, eax
mov dword [ebp + 0xac1334], ecx
je 0x50ff09
mov ecx, dword [eax + 8]
jmp 0x50ff10
cmp ecx, 1
mov byte [esp + 0x20], 0
jne 0x50fb6c
mov eax, dword [esp + 0xbc]
mov ebx, dword [esp + 0x24]
imul eax, esi
lea ecx, [eax + eax*4]
mov eax, 0x51eb851f
shl ecx, 2
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [esp + 0x18], edx
xor edx, edx
test esi, esi
jle 0x50fb63
xor edi, edi
mov ecx, ebx
mov ax, word [ecx]
shr ax, 0xc
test ax, ax
jbe 0x50fb3d
cmp ax, 0xf
jae 0x50fb3d
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x18], eax
js 0x50fb52
inc edi
add ecx, 2
cmp edi, esi
jl 0x50fb20
mov edi, dword [esp + 0x28]
add ebx, edi
inc edx
cmp edx, esi
jl 0x50fb1c
jmp 0x50fb5f
mov eax, dword [esp + 0x1c]
or ah, 0x10
mov dword [ebp + 0xac12f8], eax
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x20], 1
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0xbc]
push edx
mov edx, dword [ebp + 0xac12f4]
push esi
push eax
mov eax, dword [ebp + 0xac12fc]
push eax
mov eax, dword [esp + 0x38]
push edi
push edx
push ecx
mov ecx, dword [esp + 0x40]
push eax
push ecx
call fcn.0050f4a0
add esp, 0x24
jmp 0x50faa1
xor esi, esi
mov ecx, 0x1f
mov si, word [ebp + 0xac12d8]
xor eax, eax
lea edi, [esp + 0x38]
xor ebx, ebx
mov bx, word [ebp + 0xac12da]
mov dword [esp + 0x14], esi
rep stosd dword es:[edi], eax
mov eax, dword [0x6b7900]
mov dword [esp + 0x44], esi
lea esi, [edx + 0x56889c]
mov ecx, 8
lea edi, [esp + 0x80]
mov dword [esp + 0x38], 0x7c
mov dword [esp + 0x3c], 0x1007
mov dword [esp + 0x40], ebx
mov dword [esp + 0xa0], 0x1800
push 0
rep movsd dword es:[edi], dword [esi]
mov edx, dword [eax]
lea ecx, [esp + 0x1c]
push ecx
lea ecx, [esp + 0x40]
push ecx
push eax
call dword [edx + 0x18]
mov esi, eax
test esi, esi
je 0x50fc3a
push 0x7d2
push str.C:_backupSpideyPCSpideyPCD3dPCTex.cpp
push esi
call fcn.004fc820
add esp, 0xc
test esi, esi
jge 0x50fc3a
call fcn.005001b0
push esi
call fcn.0052a101
mov eax, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x3c]
push 0x20
mov edx, dword [eax]
push ecx
push 0
push eax
call dword [edx + 0x64]
mov esi, eax
test esi, esi
je 0x50fc77
push 0x7d5
push str.C:_backupSpideyPCSpideyPCD3dPCTex.cpp
push esi
call fcn.004fc820
add esp, 0xc
test esi, esi
jge 0x50fc77
call fcn.005001b0
push esi
call fcn.0052a101
mov eax, dword [ebp + 0xac12fc]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x48]
cmp eax, ecx
mov dword [esp + 0x1c], edx
jne 0x50fd04
mov esi, dword [esp + 0x14]
lea ecx, [eax + eax*8]
lea edx, [eax + ecx*2]
lea ecx, [esi*4]
cmp dword [edx*4 + 0x568874], 0x20
je 0x50fcab
lea ecx, [esi + esi]
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x5c]
test ecx, ecx
mov dword [esp + 0x20], ecx
jne 0x50fcc2
lea ecx, [esi + esi]
mov dword [esp + 0x20], ecx
test ebx, ebx
jle 0x50fdb7
mov dword [esp + 0x10], ebx
mov ecx, dword [esp + 0x20]
mov esi, eax
mov ebp, ecx
mov edi, edx
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 + 0x28]
mov esi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x10]
add eax, edi
add edx, esi
dec ecx
mov dword [esp + 0x10], ecx
jne 0x50fcce
mov ebp, dword [esp + 0x30]
jmp 0x50fdb7
cmp ecx, 1
mov byte [esp + 0x1c], 0
jne 0x50fd88
mov eax, ebx
mov edi, dword [esp + 0x24]
imul eax, dword [esp + 0x14]
lea ecx, [eax + eax*4]
mov eax, 0x51eb851f
shl ecx, 2
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [esp + 0x20], edx
xor edx, edx
test ebx, ebx
jle 0x50fd7f
xor esi, esi
mov ecx, edi
mov ax, word [ecx]
shr ax, 0xc
test ax, ax
jbe 0x50fd5b
cmp ax, 0xf
jae 0x50fd5b
mov eax, dword [esp + 0x20]
dec eax
mov dword [esp + 0x20], eax
js 0x50fd70
inc esi
add ecx, 2
cmp esi, ebx
jl 0x50fd3e
mov esi, dword [esp + 0x28]
add edi, esi
inc edx
cmp edx, ebx
jl 0x50fd3a
jmp 0x50fd7f
mov eax, dword [ebp + 0xac12f8]
or ah, 0x10
mov dword [ebp + 0xac12f8], eax
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x1c], 1
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
push edx
mov edx, dword [esp + 0x4c]
push ebx
push eax
mov eax, dword [ebp + 0xac12fc]
push eax
mov eax, dword [esp + 0x6c]
push edx
mov edx, dword [esp + 0x38]
push eax
push ecx
mov ecx, dword [esp + 0x44]
push ecx
push edx
call fcn.0050f4a0
add esp, 0x24
mov eax, dword [esp + 0x18]
push 0
push eax
mov ecx, dword [eax]
call dword [ecx + 0x80]
mov esi, eax
test esi, esi
je 0x50fdee
push 0x7f1
push str.C:_backupSpideyPCSpideyPCD3dPCTex.cpp
push esi
call fcn.004fc820
add esp, 0xc
test esi, esi
jge 0x50fdee
call fcn.005001b0
push esi
call fcn.0052a101
mov edx, dword [esp + 0x14]
mov ecx, 0x1f
xor eax, eax
lea edi, [esp + 0x38]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0xac12fc]
mov dword [esp + 0x44], edx
lea edi, [esp + 0x80]
mov dword [esp + 0x38], 0x7c
lea ecx, [eax + eax*8]
mov dword [esp + 0x3c], 0x1007
mov dword [esp + 0x40], ebx
mov dword [esp + 0xa0], 0x1000
lea edx, [eax + ecx*2]
mov eax, dword [0x6b7900]
mov ecx, 8
mov dword [esp + 0xa4], 0x10
lea esi, [edx*4 + 0x56889c]
push 0
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [eax]
lea edi, [ebp + 0xac12f4]
lea edx, [esp + 0x3c]
push edi
push edx
push eax
call dword [ecx + 0x18]
mov esi, eax
test esi, esi
je 0x50fe8f
push 0x7fe
push str.C:_backupSpideyPCSpideyPCD3dPCTex.cpp
push esi
call fcn.004fc820
add esp, 0xc
test esi, esi
jge 0x50fe8f
call fcn.005001b0
push esi
call fcn.0052a101
mov edi, dword [edi]
mov ecx, dword [esp + 0x18]
push 0
push 0x1000000
mov eax, dword [edi]
push 0
push ecx
push 0
push edi
call dword [eax + 0x14]
mov esi, eax
test esi, esi
je 0x50fecf
push 0x801
push str.C:_backupSpideyPCSpideyPCD3dPCTex.cpp
push esi
call fcn.004fc820
add esp, 0xc
test esi, esi
jge 0x50fecf
call fcn.005001b0
push esi
call fcn.0052a101
mov eax, dword [esp + 0x18]
push eax
mov edx, dword [eax]
call dword [edx + 8]
mov esi, eax
test esi, esi
je 0x50faa1
push 0x833
push str.C:_backupSpideyPCSpideyPCD3dPCTex.cpp
push esi
call fcn.004fc820
add esp, 0xc
test esi, esi
jge 0x50faa1
call fcn.005001b0
push esi
call fcn.0052a101
mov ecx, dword [esp + 0xc4]
test eax, eax
mov dword [ebp + 0xac1338], ecx
je 0x50ff2b
xor ecx, ecx
mov cx, word [eax + 6]
mov dword [ebp + 0xac133c], ecx
jmp 0x510120
mov ecx, 0x10000
mov dword [ebp + 0xac133c], ecx
jmp 0x510120
cdq
idiv edi
mov ebx, eax
mov eax, dword [esp + 0xbc]
imul edi, ebx
cmp edi, eax
jge 0x50ff4f
inc ebx
mov eax, esi
cdq
idiv ecx
imul ecx, eax
cmp ecx, esi
jge 0x50ff5c
inc eax
imul eax, ebx
mov ecx, dword [ebp + 0xac12f8]
mov dword [ebp + 0xac132c], eax
lea edx, [eax*4]
or ch, 2
push edx
mov dword [ebp + 0xac12f8], ecx
call fcn.0052a227
mov ecx, dword [esp + 0xc0]
mov dword [ebp + 0xac1330], eax
xor eax, eax
add esp, 4
cmp esi, eax
mov dword [esp + 0x10], eax
mov dword [0xadb3b8], ecx
mov dword [esp + 0x14], eax
jle 0x510116
mov eax, dword [0xadb3a8]
mov ecx, dword [0xadb3ac]
jmp 0x50ffbd
mov esi, dword [esp + 0xc0]
sub esi, dword [esp + 0x14]
cmp esi, ecx
mov dword [esp + 0x1c], esi
jle 0x50ffcd
mov dword [esp + 0x1c], ecx
mov edx, dword [esp + 0xbc]
mov dword [esp + 0x18], 0
test edx, edx
jle 0x5100fd
mov ecx, dword [esp + 0x14]
imul ecx, edx
mov dword [esp + 0x2c], ecx
mov edi, dword [esp + 0xbc]
mov edx, dword [esp + 0x18]
sub edi, edx
cmp edi, eax
jle 0x510002
mov edi, eax
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
add edx, eax
push str.texture_data_pointer_must_be_aligned_to_4_byte_boundary
lea ebx, [ecx + edx*2]
test bl, 3
sete dl
push edx
call fcn.004015b0
add esp, 8
mov esi, 8
mov eax, 0xac1670
mov ecx, dword [eax - 0x3c]
test ecx, ecx
jne 0x51003d
cmp dword [eax], 0
je 0x51004a
add eax, 0x68
inc esi
cmp eax, 0xadb330
jge 0x510052
jmp 0x510031
cmp esi, 0x400
jl 0x51005f
push str.out_of_texture_handles.
call fcn.004015b0
add esp, 4
push str.id_must_fit_into_10_bits_
push 1
call fcn.004015b0
mov eax, dword [esp + 0xdc]
mov edx, dword [esp + 0xd4]
mov ecx, dword [esp + 0xd8]
push eax
mov eax, dword [esp + 0x2c]
or dh, 2
push ecx
mov ecx, dword [esp + 0x2c]
push edx
push ebx
push eax
push ecx
push edi
push esi
call fcn.0050f6d0
add esp, 0x28
test eax, eax
je 0x5100c4
mov ecx, dword [esp + 0x20]
lea edx, [esi + esi*2]
lea eax, [esi + edx*4]
shl eax, 3
mov dword [eax + 0xac1334], ebx
mov dword [eax + 0xac1338], ecx
mov dword [eax + 0xac133c], 0x10000
jmp 0x5100c7
or esi, 0xffffffff
mov edx, dword [ebp + 0xac1330]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov dword [edx + eax*4], esi
mov edx, dword [esp + 0xbc]
inc eax
mov dword [esp + 0x10], eax
mov eax, dword [0xadb3a8]
add ecx, eax
cmp ecx, edx
mov dword [esp + 0x18], ecx
jl 0x50ffef
mov ecx, dword [0xadb3ac]
mov edx, dword [esp + 0x14]
mov esi, dword [esp + 0xc0]
add edx, ecx
cmp edx, esi
mov dword [esp + 0x14], edx
jl 0x50ffb6
mov dword [0xadb3b8], 0
mov eax, dword [esp + 0x34]
cmp eax, 0x100
je 0x510147
cmp eax, 0x200
je 0x510147
cmp eax, 0x300
je 0x510147
cmp eax, 0x400
je 0x510147
cmp eax, 0xd00
jne 0x510154
mov eax, dword [esp + 0x24]
push eax
call fcn.0052a3c0
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xa4
ret