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

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x40fdba
sub esp, 0x70
mov edx, dword [0xc85ed0]
mov ecx, dword [esp + 0x74]
sub ecx, edx
mov edx, dword [0xc85ec8]
mov ebx, ecx
shr ecx, 4
sub edx, ecx
dec edx
mov dword [esp + 0x6c], edx
shr ebx, 2
mov dword [esp + 0x24], ebx
mov ecx, ebx
and ecx, 3
mov ebp, dword [esp + 0x80]
mov esi, dword [ebp + 0x14]
mov dword [esp + 0x60], esi
mov edi, dword [esp + 0x78]
cmp edi, 8
je 0x40fd53
mov eax, edi
movzx edi, byte [ebp + 0xf]
xchg edi, eax
test al, 0x40
xchg edi, eax
jne 0x40fd20
mov ecx, dword [ebp]
mov dword [esp + 0x3c], ecx
mov edi, dword [esp + 0x7c]
cmp ecx, edi
jae 0x40fd11
mov edx, dword [ebp + 4]
shr edx, 2
cmp edx, 0x19
ja 0x40fce7
mov dword [esp + 0x58], eax
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x50], ecx
xor ecx, ecx
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x50]
mov ebx, dword [esp + 0x2c]
cmp ebx, edx
jae 0x40f944
lea eax, [ebx + 8]
movzx ebp, byte [esi]
mov ecx, ebx
shl ebp, cl
cmp ecx, 0x20
sbb ecx, ecx
and ecx, ebp
mov ebx, dword [esp + 0x20]
or ecx, ebx
mov ebx, esi
inc ebx
mov esi, ebx
mov ebx, dword [esp + 0x24]
mov ebp, dword [esp + 0x80]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x78]
mov ecx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x2c]
cmp ebx, edx
jb 0x40f905
mov edx, ecx
shr ecx, 2
lea ebx, [ecx + ecx]
cmp ebx, 0x19
ja 0x40fcde
mov ebx, dword [esp + 0x20]
mov esi, ecx
mov dword [esp + 0x20], ebx
cmp ecx, 0x20
ja 0x40f982
shl ebx, cl
cmp ecx, 0x20
sbb eax, eax
and ebx, eax
mov eax, dword [esp + 0x20]
or ebx, eax
add ecx, ecx
mov eax, dword [esp + 0x78]
mov dword [esp + 0x20], ebx
cmp ecx, 0x20
jbe 0x40f964
test esi, esi
je 0x40fcd7
mov ecx, eax
mov eax, 0x19
xor edx, edx
div esi
imul esi, eax
mov eax, ecx
mov ecx, esi
mov edx, 1
shl edx, cl
cmp ecx, 0x20
sbb ebp, ebp
and ebp, edx
lea edx, [ebp - 1]
and edx, ebx
xor ebx, ebx
mov ebp, ecx
xor esi, esi
mov dword [esp + 0x30], ebp
mov dword [esp + 0x64], esi
mov dword [esp + 0x20], edx
test ebx, ebx
je 0x40fccc
mov ecx, edx
movzx edx, byte [ebx]
inc ebx
mov dword [esp + 0x48], eax
mov eax, 8
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x34], edx
mov ebp, dword [esp + 0x3c]
cmp edi, ebp
jne 0x40fc93
mov ebp, dword [esp + 0x80]
mov edi, dword [ebp + 4]
shr edi, 2
test edi, edi
je 0x40fc25
cmp edi, 2
jae 0x40fc1e
mov ebp, 2
mov edi, dword [esp + 0x24]
test edi, 3
jne 0x40fc06
mov edi, edx
and edx, 0xf
or edx, 0xd0
cmp ebp, 4
ja 0x40faac
mov ecx, 4
mov ebx, dword [esp + 0x6c]
cmp ecx, ebp
jbe 0x40faa6
mov esi, ecx
sub ecx, ebp
add ecx, 0xfffffffc
neg ecx
mov ebp, 1
shl ebp, cl
cmp ecx, 0x20
sbb edi, edi
and edi, ebp
lea ebp, [edi - 1]
mov edi, ebp
shl ebp, 4
or edi, ebp
and edi, edx
shr eax, 2
cmp esi, eax
ja 0x40fa9e
xchg edi, eax
mov byte [ebx], al
xchg edi, eax
mov ecx, ebx
dec ecx
lea edx, [esi + 4]
cmp edx, eax
ja 0x40fa87
mov byte [ecx], 0
add edx, 4
mov ebx, ecx
dec ebx
mov ecx, ebx
cmp edx, eax
jbe 0x40fa78
xor ebx, ebx
add eax, 2
cmp edx, eax
jne 0x40fa9a
movzx eax, byte [ecx]
and eax, 0xffffffcc
or eax, ebx
mov byte [ecx], al
add esp, 0x70
ret
mov edx, esi
mov ecx, ebx
mov ebx, edi
jmp 0x40fa89
mov esi, ecx
mov edi, edx
jmp 0x40fa63
mov eax, dword [esp + 0x6c]
mov byte [eax], dl
dec eax
shr edi, 4
mov edx, dword [esp + 0x28]
add edx, 0xfffffff8
mov dword [esp + 0x40], eax
mov eax, 4
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x34], edi
mov dword [esp + 0x28], edx
and edi, 0xf
or edi, 0xf0
mov edx, dword [esp + 0x1c]
add edx, 4
cmp edx, ebp
jae 0x40fbfd
xchg edi, ebx
mov byte [eax], bl
xchg edi, ebx
dec eax
mov dword [esp + 0x6c], eax
mov edx, dword [esp + 0x34]
shr edx, 4
cmp esi, ebx
je 0x40fb79
mov edi, dword [esp + 0x28]
cmp edi, 8
jae 0x40fb70
movzx esi, byte [ebx]
mov ecx, edi
shl esi, cl
cmp ecx, 0x20
sbb eax, eax
and eax, esi
or edx, eax
mov eax, ebx
inc eax
mov ebx, edx
and edx, 0xf
or edx, 0xf0
mov esi, dword [esp + 0x1c]
add esi, 8
cmp esi, ebp
jae 0x40fb5f
mov edi, dword [esp + 0x6c]
mov byte [edi], dl
mov edx, edi
dec edx
shr ebx, 4
mov edi, dword [esp + 0x60]
mov edi, ebx
mov dword [esp + 0x1c], esi
mov ebx, eax
mov esi, dword [esp + 0x64]
mov eax, edx
mov edx, ecx
mov ecx, dword [esp + 0x20]
jmp 0x40face
mov eax, dword [esp + 0x6c]
mov ecx, esi
mov ebx, eax
mov eax, dword [esp + 0x78]
jmp 0x40fa3c
add edi, 0xfffffff8
mov ecx, edi
mov eax, ebx
jmp 0x40fb20
test ebx, ebx
je 0x40fbc6
movzx ebx, byte [ebx]
mov ecx, dword [esp + 0x28]
shl ebx, cl
cmp ecx, 0x20
sbb edi, edi
and edi, ebx
or edx, edi
mov ebx, dword [esp + 0x30]
lea edi, [ebx + ecx]
cmp edi, 8
jae 0x40fbb7
mov ebx, dword [esp + 0x60]
movzx esi, byte [ebx]
mov ecx, edi
shl esi, cl
cmp ecx, 0x20
sbb eax, eax
and eax, esi
or edx, eax
mov eax, ebx
inc eax
jmp 0x40fb20
lea ecx, [ebx + ecx - 8]
mov ebx, dword [esp + 0x60]
mov eax, ebx
jmp 0x40fb20
mov edi, dword [esp + 0x28]
cmp edi, 8
jae 0x40fbf5
mov ecx, edi
mov esi, dword [esp + 0x20]
shl esi, cl
cmp ecx, 0x20
sbb eax, eax
and eax, esi
or edx, eax
mov eax, dword [esp + 0x30]
lea esi, [eax + ecx]
lea ecx, [esi - 8]
mov eax, ebx
mov ebx, dword [esp + 0x60]
jmp 0x40fb20
mov eax, dword [esp + 0x30]
mov esi, edi
jmp 0x40fbe7
mov esi, edx
mov edx, edi
jmp 0x40fb63
lea eax, [0x99dac2]
mov dword [esp], eax
mov dword [esp + 4], 0x21
call dbg.runtime.throw
ud2
mov ebp, edi
jmp 0x40fa13
mov dword [esp], ebp
call dbg.runtime.(*_type).string
mov eax, dword [esp + 8]
mov dword [esp + 0x38], eax
mov ecx, dword [esp + 4]
mov dword [esp + 0x68], ecx
call dbg.runtime.printlock
lea eax, [0x995a24]
mov dword [esp], eax
mov dword [esp + 4], 0x16
call dbg.runtime.printstring
call dbg.runtime.printsp
mov eax, dword [esp + 0x68]
mov dword [esp], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 4], eax
call dbg.runtime.printstring
call dbg.runtime.printnl
call dbg.runtime.printunlock
lea eax, [0x9a3d1e]
mov dword [esp], eax
mov dword [esp + 4], 0x2d
call dbg.runtime.throw
ud2
test ebp, ebp
je 0x40fcc5
mov eax, edi
xor edx, edx
div ebp
lea edx, [eax - 1]
imul ebp, edx
mov edx, dword [esp + 0x80]
mov eax, edx
mov edx, dword [edx + 4]
lea edi, [ebp + edx]
shr edi, 2
mov edx, dword [esp + 0x34]
mov ebp, eax
mov eax, dword [esp + 0x78]
jmp 0x40f9fd
call dbg.runtime.panicdivide
ud2
mov dword [esp + 0x28], ecx
mov ecx, edx
jmp 0x40f9e0
call dbg.runtime.panicdivide
ud2
mov edx, dword [esp + 0x20]
jmp 0x40f9af
add edx, 7
shr edx, 3
lea eax, [edx - 1]
mov ebx, esi
lea edx, [edx + ebx - 1]
shr ecx, 2
shl eax, 3
sub ecx, eax
mov eax, dword [esp + 0x78]
mov ebx, esi
mov ebp, ecx
mov esi, edx
xor edx, edx
xor ecx, ecx
jmp 0x40f9b5
mov ebx, esi
xor ecx, ecx
mov ebp, ecx
xor esi, esi
mov edx, ebp
jmp 0x40f9b5
mov ebx, esi
add ebx, 4
mov esi, dword [ebp + 4]
mov ebp, dword [ebp]
mov dword [esp + 0xc], ebp
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], esi
mov ecx, dword [esp + 0x7c]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ebx
call dbg.runtime.heapBitsSetTypeGCProg
add esp, 0x70
ret
mov eax, dword [ebp]
cmp eax, 4
jne 0x40fd93
mov eax, dword [esp + 0x7c]
cmp eax, 4
jne 0x40fd83
movzx eax, byte [edx]
mov ebx, 0x33
shl ebx, cl
not ebx
and eax, ebx
mov byte [edx], al
mov ebx, 0x11
shl ebx, cl
or eax, ebx
mov byte [edx], al
add esp, 0x70
ret
movzx eax, byte [edx]
mov ebx, 0x13
shl ebx, cl
or eax, ebx
mov byte [edx], al
jmp 0x40fd7f
movzx eax, byte [esi]
movzx ebx, byte [edx]
mov ebp, 0x33
shl ebp, cl
xchg ebp, ebx
not ebx
xchg ebp, ebx
and ebx, ebp
mov byte [edx], bl
and eax, 3
or eax, 0x10
shl eax, cl
or ebx, eax
mov byte [edx], bl
add esp, 0x70
ret
call dbg.runtime.morestack_noctxt
jmp dbg.runtime.heapBitsSetType