Function at 0x40bd70
Capabilities:
Query or enumerate registry value

Disassembly:
sub esp, 0x20c
mov eax, dword [0x4c822c]
xor eax, esp
mov dword [esp + 0x208], eax
push edi
mov edi, dword [esp + 0x214]
push 0x194
push 0
push edi
mov dword [edi + 0x198], 0xff
mov dword [edi + 0x194], 0x34
call fcn.0046e580
add esp, 0xc
push 0x194
push edi
push dword [edi + 0x1c8]
call dword [sym.imp.WINMM.dll_joyGetDevCapsA]
test eax, eax
setne al
cmp dword [edi + 0x68], 0
mov byte [edi + 0x1d0], al
jne 0x40bdef
mov dword [edi + 0x254], 0
lea ecx, [edi + 0x2bc]
mov byte [edi + 0x1d0], 1
jmp 0x40c11c
push esi
test al, al
jne 0x40bf0f
push str.CurrentJoystickSettings
lea eax, [edi + 0x70]
push eax
push str.SystemCurrentControlSetControlMediaResourcesJoystick
push str._s_s_s
lea eax, [esp + 0x20]
push 0x100
push eax
call fcn.0040bcd0
add esp, 0x18
lea eax, [esp + 8]
push eax
push 1
push 0
lea eax, [esp + 0x1c]
push eax
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40bf0f
mov eax, dword [edi + 0x1c8]
push str.OEMName
inc eax
mov dword [esp + 0x10], 0x100
push eax
push str.Joystick_d_s
lea eax, [esp + 0x1c]
push 0x100
push eax
call fcn.0040bcd0
add esp, 0x14
lea eax, [esp + 0xc]
push eax
lea eax, [esp + 0x114]
push eax
push 0
push 0
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [esp + 8]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
jne 0x40bf0f
lea eax, [esp + 0x110]
push eax
push str.SystemCurrentControlSetControlMediaPropertiesPrivatePropertiesJoystickOEM
push str._s_s
lea eax, [esp + 0x1c]
push 0x100
push eax
call fcn.0040bcd0
add esp, 0x14
lea eax, [esp + 8]
push eax
push 1
push esi
lea eax, [esp + 0x1c]
push eax
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40bf0f
lea eax, [esp + 0xc]
mov dword [esp + 0xc], 0x80
push eax
lea eax, [edi + 0x1d1]
push eax
push esi
push esi
push str.OEMName
push dword [esp + 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [esp + 8]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x40bf31
push str.JS:_Failed_to_read_joystick_name_from_registry
call fcn.00406eb0
push 0x80
lea eax, [edi + 4]
push eax
lea eax, [edi + 0x1d1]
push eax
call fcn.00478a00
add esp, 0x10
test byte [edi + 0x60], 0x10
pop esi
je 0x40bf6c
mov dword [edi + 0x254], 8
mov dword [edi + 0x2f8], 0xbf800000
mov dword [edi + 0x2d8], 0x3f800000
mov dword [edi + 0x2f4], 0xbf800000
mov dword [edi + 0x2d4], 0x3f800000
jmp 0x40bf76
mov dword [edi + 0x254], 6
mov eax, dword [edi + 0x58]
lea ecx, [edi + 0x2bc]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2f0], xmm0
mov eax, dword [edi + 0x5c]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2d0], xmm0
mov eax, dword [edi + 0x50]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2ec], xmm0
mov eax, dword [edi + 0x54]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2cc], xmm0
mov eax, dword [edi + 0x48]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2e8], xmm0
mov eax, dword [edi + 0x4c]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2c8], xmm0
mov eax, dword [edi + 0x34]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2e4], xmm0
mov eax, dword [edi + 0x38]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2c4], xmm0
mov eax, dword [edi + 0x2c]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2e0], xmm0
mov eax, dword [edi + 0x30]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2c0], xmm0
mov eax, dword [edi + 0x24]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [edi + 0x2dc], xmm0
mov eax, dword [edi + 0x28]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x48ed60]
cvtpd2ps xmm0, xmm0
movss dword [ecx], xmm0
xor eax, eax
cmp dword [edi + 0x254], eax
jle 0x40c15c
movss xmm1, dword [0x48fc20]
nop
movss xmm0, dword [ecx + 0x20]
inc eax
addss xmm0, dword [ecx]
mov dword [ecx - 0x60], 0
mov dword [ecx - 0x40], 0x3f800000
mulss xmm0, xmm1
movss dword [ecx - 0x20], xmm0
add ecx, 4
cmp eax, dword [edi + 0x254]
jl 0x40c130
mov ecx, dword [esp + 0x20c]
pop edi
xor ecx, esp
call fcn.0041598b
add esp, 0x20c
ret