Function at 0x4022f0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x458fb6
mov eax, dword fs:[0]
push eax
sub esp, 0x730
mov eax, dword [0x4aabf0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edx, dword [ebp + 0x20]
mov ecx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
mov dword [ebp - 0x620], edx
mov edx, dword [0x4acbd0]
mov dword [ebp - 0x62c], ecx
mov dword [ebp - 0x628], eax
mov dword [ebp - 0x61c], edx
cmp edx, 0x40
jb 0x402357
mov dword [ebp - 0x61c], 0x40
mov edx, dword [eax + 8]
mov ecx, dword [ecx + 0x18]
push 0x402240
push 0x402220
push 0x40
mov dword [ebp - 0x618], edx
mov edx, dword [eax + 0x18]
push 0x18
lea eax, [ebp - 0x610]
push eax
mov dword [ebp - 0x638], ecx
mov dword [ebp - 0x634], edx
call fcn.00447da1
xor edi, edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x630], edi
mov dword [ebp - 0x624], edi
cmp dword [ebp - 0x61c], edi
jbe 0x402681
lea esi, [ebp - 0x610]
mov ecx, dword [ebp - 0x620]
push ecx
call fcn.00406bc0
mov ecx, eax
add esp, 4
mov dword [esi], ecx
test ecx, ecx
je 0x4026e3
test ebx, ebx
je 0x40250f
cmp dword [ebx], 0x38
jne 0x40250f
cmp dword [ebx + 4], 0
je 0x4024c6
fldz
fcom qword [ebx + 8]
fnstsw ax
test ah, 5
jnp 0x40240b
fcom qword [ebx + 0x10]
fnstsw ax
test ah, 5
jnp 0x40240b
fcomp qword [ebx + 0x18]
fnstsw ax
test ah, 5
jp 0x4024c6
jmp 0x40240d
fstp st(0)
mov edx, dword [ecx]
mov eax, dword [edx + 8]
push 1
push 0x45b058
call eax
fld qword [0x45b050]
fcomp qword [ebx + 8]
fnstsw ax
test ah, 5
jp 0x402430
fld qword [ebx + 8]
jmp 0x402436
fld dword [0x45b048]
mov ecx, dword [esi]
fstp dword [ebp - 0x614]
mov edx, dword [ecx]
fld dword [ebp - 0x614]
mov eax, dword [edx + 4]
push ecx
fstp dword [esp]
push str.WeightR
call eax
fld qword [0x45b050]
fcomp qword [ebx + 0x10]
fnstsw ax
test ah, 5
jp 0x402469
fld qword [ebx + 0x10]
jmp 0x40246f
fld dword [0x45b048]
mov ecx, dword [esi]
fstp dword [ebp - 0x614]
mov edx, dword [ecx]
fld dword [ebp - 0x614]
mov eax, dword [edx + 4]
push ecx
fstp dword [esp]
push str.WeightG
call eax
fld qword [0x45b050]
fcomp qword [ebx + 0x18]
fnstsw ax
test ah, 5
jp 0x4024a2
fld qword [ebx + 0x18]
jmp 0x4024a8
fld dword [0x45b048]
mov ecx, dword [esi]
fstp dword [ebp - 0x614]
mov edx, dword [ecx]
fld dword [ebp - 0x614]
mov eax, dword [edx + 4]
push ecx
fstp dword [esp]
push str.WeightB
call eax
mov ecx, dword [esi]
mov eax, dword [ebx + 0x20]
mov edx, dword [ecx]
mov edx, dword [edx + 8]
push eax
push str.UseAdaptiveWeighting
call edx
mov ecx, dword [esi]
mov edx, dword [ebx + 0x24]
mov eax, dword [ecx]
mov eax, dword [eax + 8]
push edx
push str.DXT1UseAlpha
call eax
movzx eax, byte [ebx + 0x28]
mov ecx, dword [esi]
mov edx, dword [ecx]
mov edx, dword [edx + 8]
push eax
push str.AlphaThreshold
call edx
mov ecx, dword [esi]
mov edx, dword [ebx + 0x30]
mov eax, dword [ecx]
mov eax, dword [eax + 8]
push edx
push 0x45afe4
call eax
mov ecx, dword [ebp - 0x62c]
mov edx, dword [ecx + 0x10]
push edx
call fcn.004077c0
mov edi, dword [ebp - 0x61c]
sub edi, dword [ebp - 0x624]
add esp, 4
mov dword [ebp - 0x614], eax
cmp edi, 1
jbe 0x402570
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 0x18]
call edx
mov ecx, eax
mov eax, dword [ebp - 0x618]
xor edx, edx
div edi
xor edx, edx
lea eax, [ecx + eax - 1]
div ecx
imul eax, ecx
mov ecx, dword [ebp - 0x618]
mov edi, eax
cmp eax, ecx
jb 0x402566
mov edi, ecx
sub ecx, edi
mov dword [ebp - 0x618], ecx
jmp 0x402576
mov edi, dword [ebp - 0x618]
test edi, edi
je 0x40265f
mov eax, dword [ebp - 0x638]
push eax
mov eax, dword [ebp - 0x62c]
mov ecx, dword [eax + 0xc]
mov edx, dword [eax + 4]
mov eax, dword [ebp - 0x614]
push ecx
push edi
push edx
push eax
call fcn.00407250
mov ecx, dword [esi]
mov dword [esi + 4], eax
mov eax, dword [ebp - 0x634]
mov edx, dword [ecx]
mov edx, dword [edx + 0x1c]
add esp, 0x14
push eax
mov eax, dword [ebp - 0x628]
mov eax, dword [eax + 0xc]
push eax
mov eax, dword [ebp - 0x628]
mov eax, dword [eax + 4]
push edi
push eax
call edx
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x62c]
mov ecx, dword [eax + 0xc]
mov edx, dword [eax + 4]
mov eax, dword [eax + 0x10]
push ecx
push edi
push edx
push eax
call fcn.00401ea0
mov ecx, dword [ebp - 0x628]
mov edx, dword [ecx + 4]
add dword [ebp - 0x638], eax
mov eax, dword [ebp - 0x620]
push edi
push edx
push eax
call fcn.00406fa0
add dword [ebp - 0x634], eax
add esp, 0x1c
cmp dword [esi + 4], 0
je 0x402706
cmp dword [esi + 8], 0
je 0x402706
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x1c]
mov dword [esi + 0xc], ecx
lea ecx, [ebp - 0x63c]
push ecx
push 0
push esi
push 0x402290
push 0
push 0
mov dword [esi + 0x10], edx
mov dword [esi + 0x14], eax
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebp - 0x630]
mov dword [ebp + ecx*4 - 0x73c], eax
inc ecx
mov dword [ebp - 0x630], ecx
mov eax, dword [ebp - 0x624]
inc eax
add esi, 0x18
mov dword [ebp - 0x624], eax
cmp eax, dword [ebp - 0x61c]
jb 0x4023af
mov edi, dword [ebp - 0x630]
push 0xffffffffffffffff
push 1
lea ecx, [ebp - 0x73c]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
xor ebx, ebx
xor esi, esi
test edi, edi
je 0x4026d1
test ebx, ebx
jne 0x4026be
mov eax, dword [ebp + esi*4 - 0x73c]
lea edx, [ebp - 0x620]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
test eax, eax
je 0x4026be
mov ebx, dword [ebp - 0x620]
mov ecx, dword [ebp + esi*4 - 0x73c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc esi
cmp esi, edi
jb 0x40269b
mov eax, ebx
sub eax, 0
je 0x402730
dec eax
je 0x402729
dec eax
jne 0x402729
lea esi, [eax + 1]
jmp 0x402732
push 0x402240
push 0x40
push 0x18
lea edx, [ebp - 0x610]
push edx
mov dword [ebp - 4], 0xffffffff
call fcn.00447cd4
mov eax, 7
jmp 0x402750
push 0x402240
push 0x40
push 0x18
lea eax, [ebp - 0x610]
push eax
mov dword [ebp - 4], 0xffffffff
call fcn.00447cd4
mov eax, 8
jmp 0x402750
mov esi, 8
jmp 0x402732
xor esi, esi
push 0x402240
push 0x40
push 0x18
lea edx, [ebp - 0x610]
push edx
mov dword [ebp - 4], 0xffffffff
call fcn.00447cd4
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004481ef
mov esp, ebp
pop ebp
ret