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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
push 0xffffffffffffffff
push 0x8663db
mov eax, dword fs:[0]
push eax
sub esp, 0xa4
push ebx
push ebp
push esi
push edi
mov eax, dword [0x8ce6f4]
xor eax, esp
push eax
lea eax, [esp + 0xb8]
mov dword fs:[0], eax
mov eax, dword [ecx + 0x230]
lea edi, [ecx + 0x22c]
push eax
mov dword [esp + 0x28], edi
call dword [sym.imp.USER32.dll_IsMenu]
xor ebx, ebx
test eax, eax
jne 0x507b40
call dword [sym.imp.USER32.dll_CreatePopupMenu]
push eax
mov ecx, edi
call fcn.007d8636
jmp 0x507b56
mov esi, dword [sym.imp.USER32.dll_RemoveMenu]
mov ecx, dword [edi + 4]
push 0x400
push ebx
push ecx
call esi
test eax, eax
jne 0x507b46
call fcn.007c9a2f
mov eax, dword [eax + 4]
add eax, 0x1f0
mov dword [esp + 0x34], eax
call fcn.007cff5d
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x507b81
push 0x80004005
call fcn.004a8210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x2c], esi
push 0x3749
mov dword [esp + 0xc4], ebx
call fcn.007cfe78
cmp eax, ebx
je 0x507bb9
push 0x3749
push eax
lea ecx, [esp + 0x34]
call fcn.004a8d10
mov esi, dword [esp + 0x2c]
mov ecx, dword [edi + 4]
mov ebp, dword [sym.imp.USER32.dll_AppendMenuW]
push esi
push 0x3aa
push ebx
push ecx
mov dword [esp + 0xd0], 0xffffffff
call ebp
lea eax, [esi - 0x10]
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x507bf3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call fcn.007cff5d
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x507c0d
push 0x80004005
call fcn.004a8210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x2c], esi
push 0x374a
mov dword [esp + 0xc4], 1
call fcn.007cfe78
cmp eax, ebx
je 0x507c49
push 0x374a
push eax
lea ecx, [esp + 0x34]
call fcn.004a8d10
mov esi, dword [esp + 0x2c]
mov ecx, dword [edi + 4]
push esi
push 0x3a9
push ebx
push ecx
mov dword [esp + 0xd0], 0xffffffff
call ebp
lea eax, [esi - 0x10]
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x507c7d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [edi + 4]
push ecx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], 0xaf0
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x70], ebx
mov dword [esp + 0x74], ebx
mov dword [esp + 0x78], ebx
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x80], 0xa
mov dword [esp + 0xc0], 2
call fcn.007c9a2f
mov ecx, dword [eax + 4]
lea edx, [esp + 0x6c]
push edx
push ebx
lea ecx, [ecx + 0x1f0]
call fcn.004b5cd0
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x20], eax
cmp eax, ebx
je 0x50827a
mov ecx, dword [esp + 0x20]
xor eax, eax
xor ebx, ebx
cmp ecx, ebx
setne al
cmp eax, ebx
je 0x507b77
mov esi, dword [ecx + 8]
mov ecx, dword [ecx]
mov dword [esp + 0x20], ecx
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
cmp dword [esi - 4], ebx
lea ecx, [esi - 4]
jl 0x507d29
cmp eax, dword [esi - 0x10]
jne 0x507d29
lea edi, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x507d61
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
cmp edi, ebx
je 0x5082f1
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.0080217f
add esp, 0x10
add edi, 0x10
mov dword [esp + 0x1c], edi
push 0x40d4a4
push 0x4022f8
lea ecx, [esp + 0x24]
mov byte [esp + 0xc8], 3
call fcn.004aa070
push 0x40d538
push 0x402314
lea ecx, [esp + 0x24]
call fcn.004aa070
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], 0xa
push 3
push 0x3b
lea ecx, [esp + 0x5c]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x48]
push eax
mov byte [esp + 0xd4], 4
call fcn.004b6310
mov eax, dword [esp + 0x4c]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x507df5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0x58]
call fcn.004b3400
mov ecx, dword [eax]
mov esi, dword [esp + 0x1c]
lea eax, [ecx - 0x10]
add esi, 0xfffffff0
mov byte [esp + 0xc0], 5
cmp eax, esi
je 0x507e61
cmp dword [esi + 0xc], ebx
lea edi, [esi + 0xc]
jl 0x507e53
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x507e53
push eax
call fcn.004a9b50
mov ebp, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x507e4a
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
add ebp, 0x10
mov dword [esp + 0x1c], ebp
jmp 0x507e61
mov eax, dword [ecx - 0xc]
push eax
push ecx
lea ecx, [esp + 0x24]
call fcn.004a8db0
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff0
mov byte [esp + 0xc0], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x507e89
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call fcn.007cff5d
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x507b77
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea ebx, [eax + 0x10]
mov dword [esp + 0x28], ebx
cmp dword [esp + 0x5c], 0
mov byte [esp + 0xc0], 6
je 0x508150
mov eax, dword [esp + 0x54]
xor edi, edi
xor ecx, ecx
cmp eax, edi
setne cl
mov dword [esp + 0x4c], edi
mov dword [esp + 0x50], edi
cmp ecx, edi
je 0x507b77
mov eax, dword [eax + 8]
lea ecx, [esp + 0x4c]
push ecx
push 0x4071f8
push eax
call fcn.00803d5e
add esp, 0xc
cmp eax, 1
jne 0x507f45
mov ecx, dword [esp + 0x50]
cmp ecx, edi
jl 0x507f45
mov eax, dword [esp + 0x4c]
jg 0x507f0a
cmp eax, edi
jbe 0x507f45
fldz
sub esp, 8
fstp qword [esp]
push ecx
push eax
call fcn.005c2f90
mov edx, eax
shr edx, 0x10
movzx ecx, dl
push ecx
mov edx, eax
shr edx, 8
movzx ecx, dl
movzx edx, al
push ecx
push edx
lea eax, [esp + 0x44]
push 0x4071d4
push eax
call fcn.004aa600
mov ebx, dword [esp + 0x4c]
add esp, 0x24
cmp dword [esp + 0x5c], 1
jbe 0x508009
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x58]
call fcn.004b3400
mov eax, dword [esp + 0x40]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x507f7e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x54]
xor ecx, ecx
cmp eax, edi
setne cl
mov dword [esp + 0x30], edi
cmp ecx, edi
je 0x507b77
mov eax, dword [eax + 8]
lea ecx, [esp + 0x30]
push ecx
push 0x403a48
push eax
call fcn.00803d5e
add esp, 0xc
cmp eax, 1
jne 0x508009
cmp dword [esp + 0x30], edi
je 0x508009
lea eax, [ebx - 0x10]
push eax
call fcn.004a9b50
lea esi, [eax + 0x10]
mov dword [esp + 0x48], esi
push esi
lea edx, [esp + 0x30]
push 0x40d570
push edx
mov byte [esp + 0xd0], 7
call fcn.004aa600
lea eax, [esi - 0x10]
add esp, 0x10
mov byte [esp + 0xc0], 6
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x508005
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebx, dword [esp + 0x28]
cmp dword [ebx - 0xc], edi
je 0x508150
mov ecx, dword [ebx - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
lea esi, [ebx - 0x10]
call eax
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x508039
cmp eax, dword [esi]
jne 0x508039
mov edi, esi
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x508074
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x5082f1
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov eax, dword [esi + 4]
lea edx, [eax + eax + 2]
push edx
add esi, 0x10
push esi
lea eax, [eax + eax + 2]
lea ecx, [edi + 0x10]
push eax
push ecx
call fcn.0080217f
add esp, 0x10
lea ebp, [edi + 0x10]
mov dword [esp + 0x44], ebp
mov esi, dword [esp + 0x1c]
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
mov byte [esp + 0xc0], 8
call eax
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x5080ad
cmp eax, dword [esi - 0x10]
jne 0x5080ad
lea edi, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x5080e5
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x5082f1
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea edx, [eax + eax + 2]
push edx
push esi
lea eax, [eax + eax + 2]
lea ecx, [edi + 0x10]
push eax
push ecx
call fcn.0080217f
add esp, 0x10
lea esi, [edi + 0x10]
mov dword [esp + 0x48], esi
push ebp
push esi
lea ecx, [esp + 0x24]
push 0x40d55c
push ecx
mov byte [esp + 0xd0], 9
call fcn.004aa600
lea eax, [esi - 0x10]
add esp, 0x10
mov byte [esp + 0xc0], 8
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x50812c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov byte [esp + 0xc0], 6
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x508150
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebp, dword [esp + 0x1c]
xor edi, edi
cmp dword [ebp - 0xc], edi
je 0x508170
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
push ebp
push ecx
push edi
push eax
call dword [sym.imp.USER32.dll_AppendMenuW]
inc dword [esp + 0x18]
lea eax, [ebx - 0x10]
mov byte [esp + 0xc0], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x508198
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0xc0], 3
cmp dword [esp + 0x5c], edi
jbe 0x5081fd
mov esi, dword [esp + 0x54]
xor eax, eax
cmp esi, edi
setne al
cmp eax, edi
je 0x507b77
mov ecx, dword [esi]
mov dword [esp + 0x54], ecx
mov eax, dword [esi + 8]
sub eax, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5081de
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x64]
mov dword [esi], ecx
dec dword [esp + 0x5c]
mov dword [esp + 0x64], esi
jne 0x5081f7
lea ecx, [esp + 0x54]
call fcn.004afe70
cmp dword [esp + 0x5c], edi
ja 0x5081a6
mov eax, dword [esp + 0x60]
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], edi
mov dword [esp + 0x64], edi
cmp eax, edi
je 0x508226
mov esi, dword [eax]
push eax
call fcn.00803053
add esp, 4
mov eax, esi
cmp esi, edi
jne 0x508211
mov dword [esp + 0x60], edi
lea eax, [ebp - 0x10]
mov byte [esp + 0xc0], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x50824a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esp + 0x20], edi
jne 0x507ce6
cmp dword [esp + 0x18], 0xaf0
jbe 0x50827a
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
push 0
push 0
push 0xc00
push ecx
push eax
call dword [sym.imp.USER32.dll_InsertMenuW]
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x6c]
push eax
push 1
mov dword [esp + 0x20], 0xed8
call fcn.004b5cd0
mov eax, dword [esp + 0x6c]
mov ebp, eax
test eax, eax
je 0x508547
xor eax, eax
test ebp, ebp
setne al
test eax, eax
je 0x507b77
mov esi, dword [ebp + 8]
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov ebp, dword [ebp]
mov eax, dword [edx + 0x10]
mov dword [esp + 0x20], ebp
call eax
cmp dword [esi - 4], 0
lea ecx, [esi - 4]
jl 0x5082f6
cmp eax, dword [esi - 0x10]
jne 0x5082f6
lea edi, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x50832a
call fcn.004a8580
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x5082f1
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.0080217f
add esp, 0x10
add edi, 0x10
mov dword [esp + 0x1c], edi
push 0x40d4a4
push 0x4022f8
lea ecx, [esp + 0x24]
mov byte [esp + 0xc8], 0xa
call fcn.004aa070
xor ebx, ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], 0xa
push 2
push 0x3b
lea ecx, [esp + 0x5c]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x50]
push eax
mov byte [esp + 0xd4], 0xb
call fcn.004b6310
mov eax, dword [esp + 0x54]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x5083ad
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0x58]
call fcn.004b3400
mov ecx, dword [eax]
mov edi, dword [esp + 0x1c]
lea eax, [ecx - 0x10]
lea esi, [edi - 0x10]
mov byte [esp + 0xc0], 0xc
cmp eax, esi
je 0x508421
cmp dword [esi + 0xc], ebx
lea edi, [esi + 0xc]
jl 0x50840f
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x50840f
push eax
call fcn.004a9b50
mov ebp, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x508402
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
lea edi, [ebp + 0x10]
mov ebp, dword [esp + 0x20]
mov dword [esp + 0x1c], edi
jmp 0x508421
mov eax, dword [ecx - 0xc]
push eax
push ecx
lea ecx, [esp + 0x24]
call fcn.004a8db0
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff0
mov byte [esp + 0xc0], 0xb
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x508449
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [edi - 0xc], ebx
je 0x508463
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
push edi
push ecx
push ebx
push eax
call dword [sym.imp.USER32.dll_AppendMenuW]
inc dword [esp + 0x18]
mov byte [esp + 0xc0], 0xa
cmp dword [esp + 0x5c], ebx
jbe 0x5084cc
mov esi, dword [esp + 0x54]
xor eax, eax
cmp esi, ebx
setne al
cmp eax, ebx
je 0x507b77
mov ecx, dword [esi]
mov dword [esp + 0x54], ecx
mov eax, dword [esi + 8]
sub eax, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5084ad
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x64]
mov dword [esi], ecx
dec dword [esp + 0x5c]
mov dword [esp + 0x64], esi
jne 0x5084c6
lea ecx, [esp + 0x54]
call fcn.004afe70
cmp dword [esp + 0x5c], ebx
ja 0x508475
mov eax, dword [esp + 0x60]
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x64], ebx
cmp eax, ebx
je 0x5084f5
mov esi, dword [eax]
push eax
call fcn.00803053
add esp, 4
mov eax, esi
cmp esi, ebx
jne 0x5084e0
mov dword [esp + 0x60], ebx
lea eax, [edi - 0x10]
mov byte [esp + 0xc0], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x508519
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp ebp, ebx
jne 0x5082b2
cmp dword [esp + 0x18], 0xed8
jbe 0x508547
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
push 0
push 0
push 0xc00
push ecx
push eax
call dword [sym.imp.USER32.dll_InsertMenuW]
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 4]
push edx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov ecx, dword [esp + 0x34]
lea eax, [esp + 0x6c]
push eax
push 2
mov dword [esp + 0x20], 0xf3c
call fcn.004b5cd0
mov eax, dword [esp + 0x6c]
xor ebx, ebx
mov ebp, eax
cmp eax, ebx
je 0x5087f1
xor eax, eax
cmp ebp, ebx
setne al
cmp eax, ebx
je 0x507b77
mov esi, dword [ebp + 8]
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov ebp, dword [ebp]
mov eax, dword [edx + 0x10]
mov dword [esp + 0x20], ebp
call eax
cmp dword [esi - 4], ebx
lea ecx, [esi - 4]
jl 0x5085bb
cmp eax, dword [esi - 0x10]
jne 0x5085bb
lea edi, [esi - 0x10]
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x5085f3
mov ecx, dword [esi - 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
cmp edi, ebx
je 0x5082f1
mov eax, dword [esi - 0xc]
mov dword [edi + 4], eax
mov eax, dword [esi - 0xc]
lea ecx, [eax + eax + 2]
push ecx
lea edx, [eax + eax + 2]
push esi
push edx
lea eax, [edi + 0x10]
push eax
call fcn.0080217f
add esp, 0x10
add edi, 0x10
mov dword [esp + 0x1c], edi
push 0x40d4a4
push 0x4022f8
lea ecx, [esp + 0x24]
mov byte [esp + 0xc8], 0xd
call fcn.004aa070
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], 0xa
push 2
push 0x3b
lea ecx, [esp + 0x5c]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x50]
push eax
mov byte [esp + 0xd4], 0xe
call fcn.004b6310
mov eax, dword [esp + 0x54]
add eax, 0xfffffff0
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x508674
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0x58]
call fcn.004b3400
mov ecx, dword [eax]
mov edi, dword [esp + 0x1c]
lea eax, [ecx - 0x10]
lea esi, [edi - 0x10]
mov byte [esp + 0xc0], 0xf
cmp eax, esi
je 0x5086e8
cmp dword [esi + 0xc], ebx
lea edi, [esi + 0xc]
jl 0x5086d6
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x5086d6
push eax
call fcn.004a9b50
mov ebp, eax
add esp, 4
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x5086c9
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
lea edi, [ebp + 0x10]
mov ebp, dword [esp + 0x20]
mov dword [esp + 0x1c], edi
jmp 0x5086e8
mov eax, dword [ecx - 0xc]
push eax
push ecx
lea ecx, [esp + 0x24]
call fcn.004a8db0
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff0
mov byte [esp + 0xc0], 0xe
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x508710
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [edi - 0xc], ebx
je 0x50872a
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
push edi
push ecx
push ebx
push eax
call dword [sym.imp.USER32.dll_AppendMenuW]
inc dword [esp + 0x18]
mov byte [esp + 0xc0], 0xd
cmp dword [esp + 0x5c], ebx
jbe 0x508797
lea esp, [esp]
mov esi, dword [esp + 0x54]
xor eax, eax
cmp esi, ebx
setne al
cmp eax, ebx
je 0x507b77
mov ecx, dword [esi]
mov dword [esp + 0x54], ecx
mov eax, dword [esi + 8]
sub eax, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x508778
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x64]
mov dword [esi], ecx
dec dword [esp + 0x5c]
mov dword [esp + 0x64], esi
jne 0x508791
lea ecx, [esp + 0x54]
call fcn.004afe70
cmp dword [esp + 0x5c], ebx
ja 0x508740
mov eax, dword [esp + 0x60]
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], ebx
mov dword [esp + 0x64], ebx
cmp eax, ebx
je 0x5087c5
jmp 0x5087b0
mov esi, dword [eax]
push eax
call fcn.00803053
add esp, 4
mov eax, esi
cmp esi, ebx
jne 0x5087b0
mov dword [esp + 0x60], ebx
lea eax, [edi - 0x10]
mov byte [esp + 0xc0], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x5087e9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp ebp, ebx
jne 0x50857d
lea ecx, [esp + 0x6c]
call fcn.004afe70
mov ecx, dword [esp + 0xb8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret