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

Disassembly:
sub esp, 0x58
mov eax, dword [esp + 0x60]
push ebx
push ebp
push esi
mov edx, dword [eax + 0x1c]
mov esi, dword [eax + 0x20]
cmp esi, edx
push edi
mov dword [esp + 0x30], ecx
jae 0x5b4378
mov esi, dword [eax + 0x18]
cmp edx, esi
jae 0x5b4378
cmp esi, dword [eax + 0x14]
jae 0x5b4378
mov edx, dword [ecx]
mov dx, word [edx]
and edx, 0x8000
cmp edx, 0x8000
je 0x5b4378
mov edx, dword [esp + 0x84]
push edx
mov edx, dword [esp + 0x84]
push edx
mov edx, dword [esp + 0x84]
push edx
mov edx, dword [esp + 0x84]
push edx
mov edx, dword [esp + 0x84]
push edx
push eax
mov eax, dword [esp + 0x84]
push eax
call fcn.005b49e0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58
ret 0x1c
mov ecx, dword [eax + 0x28]
mov eax, dword [esp + 0x80]
test eax, eax
mov dword [esp + 0x5c], ecx
mov ebp, 1
mov dword [esp + 0x14], eax
jg 0x5b4397
mov dword [esp + 0x14], ebp
test eax, eax
jge 0x5b439f
neg eax
mov ebp, eax
mov esi, dword [esp + 0x6c]
mov edx, dword [esp + 0x30]
mov bl, byte [esp + 0x7c]
mov dword [esp + 0x10], ebp
mov eax, dword [esi + 0x58]
mov ecx, dword [edx]
shr eax, 3
test bl, bl
lea edi, [ecx + 0xa]
mov dword [esp + 0x3c], eax
je 0x5b43c4
neg eax
mov dword [esp + 0x24], eax
mov al, bl
neg al
sbb eax, eax
mov edx, dword [esi + 0xc]
and al, 0xfe
mov dword [esp + 0x1c], edx
inc eax
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x10]
mov dword [esp + 0x20], eax
mov ax, word [ecx]
and eax, 0x7fff
mov dword [esp + 0x7c], eax
xor eax, eax
mov ax, word [ecx + 2]
imul eax, dword [esp + 0x14]
cdq
idiv ebp
mov ebp, dword [esp + 0x14]
mov esi, eax
movsx eax, word [ecx + 4]
imul eax, ebp
cdq
idiv dword [esp + 0x10]
mov edx, dword [esp + 0x78]
sub edx, eax
movsx eax, word [ecx + 6]
imul eax, dword [esp + 0x2c]
imul eax, ebp
mov dword [esp + 0x78], edx
mov ecx, dword [esp + 0x74]
cdq
idiv dword [esp + 0x10]
sub ecx, eax
mov eax, dword [esp + 0x78]
mov dword [esp + 0x74], ecx
mov ecx, dword [esp + 0x1c]
cmp eax, ecx
jge 0x5b49d0
mov eax, dword [esp + 0x7c]
mov ecx, dword [esp + 0x78]
imul eax, ebp
mov ebp, dword [esp + 0x10]
cdq
idiv ebp
add eax, ecx
js 0x5b49d0
mov eax, dword [esp + 0x74]
test bl, bl
je 0x5b4484
test eax, eax
jl 0x5b49d0
mov ecx, dword [esp + 0x20]
sub eax, esi
cmp eax, ecx
jl 0x5b4498
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x58
ret 0x1c
cmp eax, dword [esp + 0x20]
jge 0x5b49d0
add esi, eax
test esi, esi
jl 0x5b49d0
mov esi, dword [esp + 0x6c]
mov eax, dword [esi]
cmp eax, 2
sete cl
test cl, cl
mov byte [esp + 0x80], cl
jne 0x5b455c
mov ecx, dword [esi + 0x80]
test ecx, ecx
je 0x5b4528
test eax, eax
jne 0x5b4528
mov edx, dword [ecx]
push eax
lea eax, [esi + 4]
push 0x821
push eax
push 0
push ecx
call dword [edx + 0x64]
test eax, eax
jge 0x5b44f5
push str.GXCanvas::lockWrite___Lock.
push eax
push 3
push 0xc
push 0x8b
push str...incgxcanvas.h
call fcn.004565c0
add esp, 0x18
jmp 0x5b44fb
mov dword [esi], 2
mov eax, dword [esi + 0x28]
test eax, eax
jne 0x5b4528
mov ecx, dword [0x624270]
push str.mDesc.lpSurface__0
push 0
push 0
push ecx
push 0xc
push 0xc
push 0x90
push str...incgxcanvas.h
call fcn.00456580
add esp, 0x20
cmp dword [esi], 2
je 0x5b455c
mov edx, dword [0x624270]
push str.GXLLE::draw___Lock.
push 0
push 0
push edx
push 0xc
push 0xc
push 0x2f
push str.C:_aqua_srcgxgxlledither.cpp
call fcn.00456580
add esp, 0x20
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58
ret 0x1c
cmp ebp, 2
jne 0x5b4593
mov eax, dword [esp + 0x30]
mov ecx, dword [eax]
movsx edx, word [ecx + 4]
and edx, 0x80000001
jns 0x5b4578
dec edx
or edx, 0xfffffffe
inc edx
je 0x5b4593
xor eax, eax
mov al, byte [edi]
inc edi
test eax, eax
je 0x5b458f
inc edi
xor ecx, ecx
dec eax
mov cl, byte [edi]
lea edi, [edi + ecx + 1]
jne 0x5b4583
dec dword [esp + 0x7c]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x78]
lea ecx, [edx + eax]
test ecx, ecx
jg 0x5b45dd
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x7c]
sub eax, ebp
mov dword [esp + 0x7c], eax
js 0x5b45dd
test ebp, ebp
jle 0x5b45d0
mov esi, ebp
xor eax, eax
mov al, byte [edi]
inc edi
test eax, eax
je 0x5b45cd
inc edi
xor ebx, ebx
dec eax
mov bl, byte [edi]
lea edi, [edi + ebx + 1]
jne 0x5b45c1
dec esi
jne 0x5b45b8
mov eax, ecx
mov dword [esp + 0x78], eax
lea ecx, [edx + eax]
test ecx, ecx
jle 0x5b45a6
mov ebx, dword [esp + 0x6c]
mov eax, dword [esp + 0x78]
mov edx, dword [esp + 0x3c]
mov byte [esp + 0x60], 0
mov esi, dword [ebx + 0x14]
imul edx, dword [esp + 0x74]
mov ecx, esi
mov byte [esp + 0x61], 0
imul ecx, eax
add ecx, edx
mov edx, dword [ebx + 0x28]
add ecx, edx
mov byte [esp + 0x62], 0
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x1c]
cmp eax, ecx
mov byte [esp + 0x63], 0
jge 0x5b4979
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
mov ebp, dword [esp + 0x7c]
sub ebp, ecx
mov dword [esp + 0x7c], ebp
js 0x5b4979
mov ecx, edi
test edx, edx
mov dword [esp + 0x34], ecx
jle 0x5b496f
mov dword [esp + 0x4c], edx
jmp 0x5b4655
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x34]
test eax, eax
jl 0x5b4908
cmp eax, dword [esp + 0x1c]
jge 0x5b4908
mov edi, dword [esp + 0x34]
mov esi, dword [esp + 0x18]
mov ebp, dword [esp + 0x74]
xor eax, eax
mov al, byte [edi]
xor ebx, ebx
inc edi
mov dword [esp + 0x28], esi
test eax, eax
mov dword [esp + 0x30], ebp
je 0x5b48ca
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x48], eax
xor eax, eax
mov al, byte [edi]
inc edi
test eax, eax
je 0x5b46c7
mov edx, ebx
inc ebx
test edx, edx
jne 0x5b46b4
mov edx, dword [esp + 0x24]
imul edx, ecx
add esi, edx
mov edx, dword [esp + 0x2c]
imul edx, ecx
add ebp, edx
cmp ebx, dword [esp + 0x10]
jl 0x5b46bc
xor ebx, ebx
dec eax
jne 0x5b469b
mov dword [esp + 0x30], ebp
mov dword [esp + 0x28], esi
xor eax, eax
mov al, byte [edi]
inc edi
test eax, eax
je 0x5b48bb
mov dword [esp + 0x44], eax
mov al, byte [edi]
inc edi
mov edx, ebx
inc ebx
test edx, edx
mov byte [esp + 0x38], al
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], ebx
jne 0x5b48a4
mov dword [esp + 0x40], ecx
test ebp, ebp
jl 0x5b4881
cmp ebp, dword [esp + 0x20]
jge 0x5b4881
mov eax, dword [esp + 0x84]
test eax, eax
je 0x5b4846
mov edx, dword [esp + 0x70]
mov ecx, dword [esp + 0x38]
mov ebx, dword [esp + 0x6c]
lea eax, [esp + 0x60]
push eax
mov eax, dword [edx + 0x28]
and ecx, 0xff
mov ecx, dword [eax + ecx*4]
push ecx
mov ecx, ebx
call fcn.005be230
mov eax, dword [esp + 0x84]
mov ecx, dword [esp + 0x60]
xor edx, edx
and ecx, 0xff
mov dl, byte [eax]
mov esi, dword [ebx + 0x68]
add edx, ecx
mov ecx, dword [esp + 0x61]
sar edx, 1
mov byte [esp + 0x60], dl
xor edx, edx
mov dl, byte [eax + 1]
and ecx, 0xff
add edx, ecx
mov edi, dword [ebx + 0x64]
sar edx, 1
mov byte [esp + 0x61], dl
xor edx, edx
mov dl, byte [eax + 2]
mov eax, dword [esp + 0x62]
and eax, 0xff
mov ebp, dword [ebx + 0x60]
add edx, eax
mov eax, dword [esp + 0x63]
sar edx, 1
and eax, 0xff
mov byte [esp + 0x62], dl
mov ebx, dword [ebx + 0x5c]
cdq
push edx
push eax
push 0
push esi
call fcn.005f1d80
push 0
push 0xff
push edx
push eax
call fcn.005f1f10
mov ecx, eax
mov eax, dword [esp + 0x60]
and eax, 0xff
and ecx, esi
cdq
push edx
push eax
push 0
push ebx
mov esi, ecx
call fcn.005f1d80
push 0
push 0xff
push edx
push eax
call fcn.005f1f10
and eax, ebx
or esi, eax
mov eax, dword [esp + 0x61]
and eax, 0xff
cdq
push edx
push eax
push 0
push ebp
call fcn.005f1d80
push 0
push 0xff
push edx
push eax
call fcn.005f1f10
and eax, ebp
or esi, eax
mov eax, dword [esp + 0x62]
and eax, 0xff
cdq
push edx
push eax
push 0
push edi
call fcn.005f1d80
push 0
push 0xff
push edx
push eax
call fcn.005f1f10
mov ebp, dword [esp + 0x30]
mov ebx, dword [esp + 0x58]
and eax, edi
mov edi, dword [esp + 0x54]
or esi, eax
lea eax, [esp + 0x50]
mov dword [esp + 0x50], esi
mov esi, dword [esp + 0x28]
jmp 0x5b4857
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x5c]
and ecx, 0xff
lea eax, [edx + ecx*4]
mov edx, dword [esp + 0x3c]
mov ecx, esi
sub edx, 3
je 0x5b486d
dec edx
jne 0x5b4873
mov cl, byte [eax]
inc eax
mov byte [esi], cl
lea ecx, [esi + 1]
mov dl, byte [eax]
mov byte [ecx], dl
inc ecx
inc eax
mov dl, byte [eax]
mov byte [ecx], dl
mov al, byte [eax + 1]
mov byte [ecx + 1], al
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x2c]
add esi, eax
mov eax, dword [esp + 0x40]
add ebp, edx
dec eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x30], ebp
mov dword [esp + 0x40], eax
jne 0x5b46f6
cmp ebx, dword [esp + 0x10]
jl 0x5b48ac
xor ebx, ebx
mov eax, dword [esp + 0x44]
dec eax
mov dword [esp + 0x44], eax
jne 0x5b46d8
mov eax, dword [esp + 0x48]
dec eax
mov dword [esp + 0x48], eax
jne 0x5b4692
mov ecx, dword [esp + 0x6c]
mov edx, dword [esp + 0x18]
mov esi, dword [ecx + 0x14]
mov ecx, dword [esp + 0x78]
add edx, esi
inc ecx
mov dword [esp + 0x78], ecx
mov ecx, dword [esp + 0x10]
cmp ecx, 1
mov dword [esp + 0x18], edx
jle 0x5b4954
dec ecx
xor eax, eax
mov al, byte [edi]
inc edi
test eax, eax
je 0x5b4903
inc edi
xor edx, edx
dec eax
mov dl, byte [edi]
lea edi, [edi + edx + 1]
jne 0x5b48f7
dec ecx
jne 0x5b48ee
jmp 0x5b4954
mov edi, dword [esp + 0x18]
add edi, esi
inc eax
mov dword [esp + 0x78], eax
xor eax, eax
mov al, byte [ecx]
mov dword [esp + 0x18], edi
test eax, eax
lea edi, [ecx + 1]
je 0x5b492e
inc edi
xor ecx, ecx
dec eax
mov cl, byte [edi]
lea edi, [edi + ecx + 1]
jne 0x5b4922
mov eax, dword [esp + 0x10]
cmp eax, 1
jle 0x5b4954
mov edx, eax
lea ecx, [edx - 1]
xor eax, eax
mov al, byte [edi]
inc edi
test eax, eax
je 0x5b4951
inc edi
xor edx, edx
dec eax
mov dl, byte [edi]
lea edi, [edi + edx + 1]
jne 0x5b4945
dec ecx
jne 0x5b493c
mov eax, dword [esp + 0x4c]
dec eax
mov dword [esp + 0x4c], eax
jne 0x5b464d
mov edx, dword [esp + 0x14]
mov ebx, dword [esp + 0x6c]
mov eax, dword [esp + 0x78]
cmp eax, dword [esp + 0x1c]
jl 0x5b4625
mov al, byte [esp + 0x80]
test al, al
jne 0x5b49d0
mov eax, dword [ebx + 0x80]
test eax, eax
je 0x5b49d0
cmp dword [ebx], 0
je 0x5b49d0
mov ecx, dword [eax]
push 0
push eax
call dword [ecx + 0x80]
test eax, eax
jge 0x5b49ca
push str.GXCanvas::unlockSurface___Unlock.
push eax
push 3
push 0xc
push 0x9d
push str...incgxcanvas.h
call fcn.004565c0
add esp, 0x18
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58
ret 0x1c
mov dword [ebx], 0
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x58
ret 0x1c