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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5a08a1
mov eax, dword fs:[0]
push eax
sub esp, 0x38
push ebx
push esi
push edi
mov eax, dword [0x60f520]
xor eax, esp
push eax
lea eax, [esp + 0x48]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x18], edi
mov eax, dword [0x6403e0]
test eax, eax
jne 0x499bf0
push 0x438
call fcn.00551c81
add esp, 4
mov dword [esp + 0x14], eax
mov dword [esp + 0x50], 0
test eax, eax
je 0x499be1
mov ecx, eax
call fcn.00485ee0
jmp 0x499be3
xor eax, eax
mov dword [esp + 0x50], 0xffffffff
mov dword [0x6403e0], eax
mov ebx, dword [eax + 0x100]
test ebx, ebx
je 0x499fc0
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
push ecx
lea eax, [esp + 0x24]
mov dword [esp + 0x54], 1
push eax
mov ecx, ebx
call fcn.00471340
mov ecx, dword [esp + 0x24]
xor eax, eax
mov edx, dword [esp + 0x20]
sub ecx, edx
sar ecx, 2
test ecx, ecx
je 0x499c4a
mov edi, edi
cmp dword [edx + eax*4], edi
je 0x499cbc
inc eax
cmp eax, ecx
jb 0x499c40
push str.SetAllItemState
lea ecx, [esp + 0x14]
mov dword [esp + 0x38], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 1
call fcn.0040c2d0
lea eax, [esp + 0x2c]
mov byte [esp + 0x50], 2
push eax
push ecx
mov ecx, dword [esp + 0x18]
mov esi, esp
lea ecx, [ecx - 0x10]
call fcn.0040c3c0
add eax, 0x10
mov dword [esi], eax
mov ecx, dword [0x643590]
call fcn.0043bcf0
mov byte [esp + 0x50], 1
or ecx, 0xffffffff
mov edx, dword [esp + 0x10]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x499cbc
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push str.SetItemState
lea ecx, [esp + 0x14]
mov dword [esp + 0x44], edi
mov dword [esp + 0x40], 1
mov dword [esp + 0x3c], 0
call fcn.0040c2d0
mov byte [esp + 0x50], 3
lea eax, [esp + 0x38]
mov esi, dword [esp + 0x10]
push eax
push ecx
mov dword [esp + 0x1c], esp
mov ecx, dword [esi - 0x10]
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [esi - 4], 0
lea edx, [esi - 4]
mov ecx, eax
jl 0x499d17
cmp ecx, dword [esi - 0x10]
jne 0x499d17
lea edi, [esi - 0x10]
mov eax, 1
lock xadd dword [edx], eax
jmp 0x499d51
mov eax, dword [ecx]
push 2
push dword [esi - 0xc]
call dword [eax]
mov edi, eax
test edi, edi
jne 0x499d2b
call fcn.0040c3b0
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov ecx, dword [esi - 0xc]
lea eax, [ecx*2 + 2]
push eax
lea eax, [ecx*2 + 2]
push esi
push eax
lea eax, [edi + 0x10]
push eax
call fcn.00551ae9
add esp, 0x10
mov ecx, dword [esp + 0x1c]
lea eax, [edi + 0x10]
mov dword [ecx], eax
mov ecx, dword [0x643590]
call fcn.0043bcf0
mov byte [esp + 0x50], 1
or ecx, 0xffffffff
mov edx, dword [esp + 0x10]
add edx, 0xfffffff0
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x499d88
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edi, dword [esp + 0x24]
mov esi, dword [esp + 0x20]
cmp esi, edi
je 0x499dab
mov ecx, dword [esi]
test ecx, ecx
je 0x499da0
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
add esi, 4
cmp esi, edi
jne 0x499d94
mov esi, dword [esp + 0x20]
push ecx
lea eax, [esp + 0x24]
mov dword [esp + 0x28], esi
push eax
mov ecx, ebx
call fcn.00471340
mov ebx, dword [esp + 0x24]
mov eax, ebx
mov ecx, dword [esp + 0x20]
sub eax, ecx
sar eax, 2
cmp eax, 1
jbe 0x499e8c
mov esi, ecx
cmp ecx, ebx
je 0x499e19
lea ebx, [ebx]
mov eax, dword [esi]
mov eax, dword [eax + 0x104]
cmp dword [eax + 0x78], 0
jne 0x499df7
add esi, 4
cmp esi, ebx
jne 0x499de0
jmp 0x499e19
cmp esi, ebx
je 0x499e8c
push dword [esp + 0x18]
mov edx, ebx
mov ecx, esi
call fcn.0049c010
mov ebx, dword [esp + 0x28]
add esp, 4
mov ecx, dword [esp + 0x20]
mov esi, eax
cmp esi, ebx
je 0x499e8c
lea eax, [esi + 4]
mov edi, eax
cmp edi, ebx
je 0x499e5c
mov edx, esi
sub edx, eax
mov dword [esp + 0x14], edx
mov edi, edi
mov ecx, dword [edi]
cmp dword [edx + edi], ecx
je 0x499e51
mov dword [edi], 0
mov eax, dword [edx + edi]
mov dword [edx + edi], ecx
test eax, eax
je 0x499e51
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
mov edx, dword [esp + 0x14]
add edi, 4
cmp edi, ebx
jne 0x499e30
mov ebx, dword [esp + 0x24]
lea edi, [ebx - 4]
cmp edi, ebx
je 0x499e7a
mov ecx, dword [edi]
test ecx, ecx
je 0x499e6f
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
add edi, 4
cmp edi, ebx
jne 0x499e63
mov ebx, dword [esp + 0x24]
sub ebx, 4
lea eax, [esi + 4]
mov dword [esp + 0x24], ebx
cmp esi, ebx
jne 0x499e20
mov ecx, dword [esp + 0x20]
sub ebx, ecx
and ebx, 0xfffffffc
cmp ebx, 4
jne 0x499f44
mov esi, dword [esp + 0x18]
mov ecx, dword [esi + 0x104]
cmp dword [ecx + 0x78], 0
je 0x499f02
lea eax, [esp + 0x18]
push eax
call fcn.004501b0
mov byte [esp + 0x50], bl
mov ecx, dword [eax]
mov eax, dword [ecx]
call dword [eax + 0xc]
mov byte [esp + 0x50], 1
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x499f88
or ebx, 0xffffffff
lea eax, [esi + 4]
mov ecx, ebx
lock xadd dword [eax], ecx
jne 0x499f88
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lea eax, [esi + 8]
lock xadd dword [eax], ebx
dec ebx
jne 0x499f88
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
jmp 0x499f88
mov eax, dword [0x64199c]
test eax, eax
jne 0x499f3a
push 0x63c
call fcn.00551c81
add esp, 4
mov dword [esp + 0x18], eax
mov byte [esp + 0x50], 5
test eax, eax
je 0x499f2e
mov ecx, eax
call fcn.0042c130
jmp 0x499f30
xor eax, eax
mov byte [esp + 0x50], 1
mov dword [0x64199c], eax
push esi
mov ecx, eax
call fcn.0042c620
jmp 0x499f88
mov eax, dword [0x64199c]
test eax, eax
jne 0x499f7c
push 0x63c
call fcn.00551c81
add esp, 4
mov dword [esp + 0x18], eax
mov byte [esp + 0x50], 6
test eax, eax
je 0x499f70
mov ecx, eax
call fcn.0042c130
jmp 0x499f72
xor eax, eax
mov byte [esp + 0x50], 1
mov dword [0x64199c], eax
lea ecx, [esp + 0x20]
push ecx
mov ecx, eax
call fcn.0042d3d0
mov dword [esp + 0x50], 0xffffffff
mov esi, dword [esp + 0x20]
test esi, esi
je 0x499fc0
mov edi, dword [esp + 0x24]
cmp esi, edi
je 0x499fb7
mov ecx, dword [esi]
test ecx, ecx
je 0x499fac
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
add esi, 4
cmp esi, edi
jne 0x499fa0
mov esi, dword [esp + 0x20]
push esi
call fcn.00551995
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x48]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10