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

Disassembly:
sub esp, 0xac
push ebx
mov ebx, dword [esp + 0xb4]
push esi
mov esi, ecx
mov eax, dword [ebx + 8]
mov edx, dword [ebx]
sub eax, edx
test eax, eax
jle 0x10047fc2
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 4]
sub eax, edx
test eax, eax
mov dword [esp + 8], eax
jle 0x10047fc2
mov eax, dword [esi + 0x3c]
push ebp
test eax, eax
lea ecx, [eax + 1]
push edi
mov dword [esi + 0x3c], ecx
jne 0x10047dfa
mov ecx, 0x1e
lea edi, [esp + 0x44]
mov dword [esp + 0x40], 0x7c
push 0
rep stosd dword es:[edi], eax
mov eax, dword [esi + 0x10]
lea ecx, [esp + 0x44]
push 0x801
push ecx
mov edx, dword [eax]
push 0
push eax
call dword [edx + 0x64]
test eax, eax
jge 0x10047de6
dec dword [esi + 0x3c]
jmp 0x10047dfa
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]
add eax, 0x1f
and ecx, 0xffffffe0
and al, 0xe0
sub eax, ecx
mov edi, dword [ebx + 4]
mov dword [esp + 0x3c], edx
mov ebx, dword [esi + 0x38]
cdq
imul ebx, edi
and edx, 0x1f
add eax, edx
mov ebp, eax
mov eax, ecx
imul eax, dword [esi + 0x68]
add ebx, eax
mov eax, dword [esi + 0x48]
add ebx, eax
mov eax, dword [esi + 0x4c]
mov edx, eax
mov eax, ecx
imul edx, edi
mov ecx, edx
mov edi, dword [esi + 0x78]
mov dword [esp + 0x20], ebx
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
add ecx, eax
mov eax, dword [esi + 0x50]
sar ebp, 5
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]
mov dword [esp + 0x28], ebp
and edx, eax
shl edi, cl
mov cl, byte [esi + 0x85]
shr edx, cl
mov cl, byte [esi + 0x84]
shl edx, cl
mov cl, byte [esi + 0x83]
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
mov ecx, dword [esp + 0x18]
test ebp, ebp
mov dword [esp + 0x1c], ecx
jle 0x10047f65
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 0x10047ef8
mov eax, dword [esp + 0x1c]
mov ecx, dword [esi + 0x50]
cmp eax, ecx
jb 0x10047f35
cmp eax, dword [esp + 0x2c]
jb 0x10047f49
mov ecx, dword [0x10115c94]
push str.gxCanvas::updateBitMask_dest_out_of_range
call fcn.1003eae0
mov eax, dword [esp + 0x1c]
mov dword [eax], ebp
add eax, 4
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jne 0x10047eee
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 0x10047ede
mov eax, dword [esi + 0x3c]
pop edi
cmp eax, 1
pop ebp
jne 0x10047fbf
mov ecx, dword [esi + 0x40]
mov eax, dword [esi + 0x30]
cmp ecx, eax
je 0x10047fb1
mov eax, dword [esi + 0x50]
test eax, eax
je 0x10047fb1
lea edx, [esi + 0x54]
mov ecx, esi
push edx
call fcn.10047d70
mov eax, dword [esi + 0x10]
push 0
push eax
mov ecx, dword [eax]
call dword [ecx + 0x80]
dec dword [esi + 0x3c]
pop esi
pop ebx
add esp, 0xac
ret 4