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

Disassembly:
sub esp, 0xac
push ebx
mov ebx, dword [esp + 0xb4]
mov eax, dword [ebx + 8]
sub eax, dword [ebx]
test eax, eax
push esi
mov esi, ecx
jle 0x10045282
mov eax, dword [ebx + 0xc]
sub eax, dword [ebx + 4]
test eax, eax
mov dword [esp + 8], eax
jle 0x10045282
mov eax, dword [esi + 0x3c]
test eax, eax
push ebp
lea ecx, [eax + 1]
push edi
mov dword [esi + 0x3c], ecx
jne 0x100450c6
push 0
mov dword [esp + 0x44], 0x7c
mov ecx, 0x1e
lea edi, [esp + 0x48]
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0x10]
mov edx, dword [eax]
push 0x801
lea ecx, [esp + 0x48]
push ecx
push 0
push eax
call dword [edx + 0x64]
test eax, eax
jge 0x100450b2
dec dword [esi + 0x3c]
jmp 0x100450c6
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x64]
mov ecx, dword [esi + 0x30]
mov dword [esi + 0x38], edx
mov dword [esi + 0x48], eax
mov dword [esi + 0x40], ecx
mov eax, dword [ebx + 8]
mov ecx, dword [ebx]
mov edx, dword [ebx + 0xc]
mov edi, dword [ebx + 4]
mov ebx, dword [esi + 0x38]
add eax, 0x1f
imul ebx, edi
mov dword [esp + 0x3c], edx
and ecx, 0xffffffe0
and eax, 0xffffffe0
sub eax, ecx
cdq
and edx, 0x1f
add eax, edx
mov ebp, eax
mov eax, ecx
imul eax, dword [esi + 0x68]
add ebx, eax
add ebx, dword [esi + 0x48]
mov eax, dword [esi + 0x4c]
mov edx, eax
imul edx, edi
mov edi, dword [esi + 0x78]
mov eax, ecx
mov ecx, edx
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
add ecx, eax
mov eax, dword [esi + 0x50]
lea edx, [eax + ecx*4]
mov eax, dword [esi + 0xbc]
mov cl, byte [esi + 0x87]
and edi, eax
shr edi, cl
mov cl, byte [esi + 0x86]
mov dword [esp + 0x18], edx
mov edx, dword [esi + 0x74]
shl edi, cl
mov cl, byte [esi + 0x85]
and edx, eax
shr edx, cl
mov cl, byte [esi + 0x84]
sar ebp, 5
mov dword [esp + 0x28], ebp
shl edx, cl
mov cl, byte [esi + 0x83]
mov dword [esp + 0x20], ebx
or edi, edx
mov edx, dword [esi + 0x70]
and edx, eax
shr edx, cl
mov cl, byte [esi + 0x82]
shl edx, cl
mov cl, byte [esi + 0x81]
or edi, edx
mov edx, dword [esi + 0x6c]
and edx, eax
mov eax, dword [esi + 0x50]
shr edx, cl
mov cl, byte [esi + 0x80]
shl edx, cl
mov ecx, dword [esi + 0x7c]
or edi, edx
or edi, ecx
mov ecx, dword [esi + 0x60]
and edi, 0xffffff
imul ecx, dword [esi + 0x4c]
lea edx, [eax + ecx*4]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x14], eax
test ebp, ebp
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], ecx
jle 0x10045229
mov dword [esp + 0x10], ebp
xor ebp, ebp
mov dword [esp + 0x24], 0x20
mov ecx, ebx
call dword [esi + 0x8c]
mov ecx, dword [esi + 0x68]
and eax, 0xffffff
xor edx, edx
cmp eax, edi
setne dl
lea eax, [ebp + ebp]
add ebx, ecx
or edx, eax
mov eax, dword [esp + 0x24]
dec eax
mov ebp, edx
mov dword [esp + 0x24], eax
jne 0x100451c3
mov eax, dword [esp + 0x1c]
cmp eax, dword [esi + 0x50]
jb 0x100451fe
cmp eax, dword [esp + 0x2c]
jb 0x10045212
mov ecx, dword [0x101314b4]
push str.gxCanvas::updateBitMask_dest_out_of_range
call fcn.1003c570
mov eax, dword [esp + 0x1c]
mov dword [eax], ebp
add eax, 4
mov dword [esp + 0x1c], eax
dec dword [esp + 0x10]
jne 0x100451b9
mov ebx, dword [esp + 0x20]
mov ebp, dword [esp + 0x28]
mov ecx, dword [esi + 0x4c]
mov edx, dword [esp + 0x18]
lea eax, [edx + ecx*4]
mov ecx, dword [esi + 0x38]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x14]
add ebx, ecx
dec eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x14], eax
jne 0x100451a9
cmp dword [esi + 0x3c], 1
pop edi
pop ebp
jne 0x1004527f
mov ecx, dword [esi + 0x40]
cmp ecx, dword [esi + 0x30]
je 0x10045271
mov eax, dword [esi + 0x50]
test eax, eax
je 0x10045271
lea edx, [esi + 0x54]
push edx
mov ecx, esi
call fcn.10045040
mov eax, dword [esi + 0x10]
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x80]
dec dword [esi + 0x3c]
pop esi
pop ebx
add esp, 0xac
ret 4