Function at 0x4877a0
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x60
cmp byte [0x507740], 0
je 0x487803
cmp dword [0x507734], 0
je 0x487ba4
mov esi, dword [ebp + 8]
mov dword [esp + 8], 0
mov ecx, dword [esi]
test cl, 1
jne 0x48795b
xor eax, eax
test cl, 2
je 0x487998
lea eax, [esp + 0xc]
push eax
call dword [0x50771c]
add esp, 4
test eax, eax
je 0x487ae1
mov edi, str.nvmlDeviceGetCount_v2___failed
jmp 0x487ba9
mov eax, dword [ebp + 0x20]
mov byte [0x507740], 1
push 0
push 1
push eax
push 0
call dbg.ffLibraryLoad
add esp, 0x10
test eax, eax
je 0x487951
mov esi, eax
push str.nvmlInit_v2
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x487ac3
mov edi, eax
push str.nvmlShutdown
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x487acd
mov ebx, eax
push str.nvmlDeviceGetCount_v2
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x50771c], eax
test eax, eax
je 0x487ad7
push str.nvmlDeviceGetHandleByIndex_v2
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x507720], eax
test eax, eax
je 0x487b4f
push str.nvmlDeviceGetHandleByPciBusId_v2
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x507724], eax
test eax, eax
je 0x487b56
push str.nvmlDeviceGetPciInfo_v3
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x507728], eax
test eax, eax
je 0x487b5d
push str.nvmlDeviceGetTemperature
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x50772c], eax
test eax, eax
je 0x487b64
push str.nvmlDeviceGetMemoryInfo_v2
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x507730], eax
test eax, eax
je 0x487b6b
push str.nvmlDeviceGetNumGpuCores
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x507734], eax
test eax, eax
je 0x487b72
push str.nvmlDeviceGetClockInfo
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x507738], eax
test eax, eax
je 0x487b79
push str.nvmlDeviceGetBrand
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x50773c], eax
test eax, eax
je 0x487b80
call edi
test eax, eax
je 0x487b8e
mov dword [0x507734], 0
mov edi, str.nvmlInit_v2___failed
jmp 0x487b85
mov edi, 0x4fd2f0
jmp 0x487ba9
movupd xmm0, xmmword [esi + 4]
sub esp, 0x1c
movupd xmmword [esp + 0xc], xmm0
lea esi, [esp + 0x2c]
mov dword [esp], esi
call dbg.snprintf
add esp, 0x1c
lea eax, [esp + 8]
push eax
push esi
call dword [0x507724]
add esp, 8
mov edi, str.nvmlDeviceGetHandleByPciBusId_v2___failed
test eax, eax
jne 0x487ba9
mov eax, dword [esp + 8]
lea esi, [result.temp]
lea ecx, [esp + 0xc]
push ecx
push eax
call dword [0x50773c]
add esp, 8
test eax, eax
jne 0x4879ca
mov eax, dword [esp + 0xc]
cmp eax, 0xd
ja 0x4879ca
mov ecx, 0x3066
bt ecx, eax
jae 0x4879ca
mov eax, dword [esi + 0xc]
mov dword [eax], 2
mov edi, dword [esi]
test edi, edi
je 0x487a02
lea eax, [esp + 0x10]
push eax
push 0
push dword [esp + 0x10]
call dword [0x50772c]
add esp, 0xc
test eax, eax
jne 0x487a02
movss xmm0, dword [esp + 0x10]
orpd xmm0, xmmword [0x4fd2d0]
subsd xmm0, qword [0x4fd2e0]
movsd qword [edi], xmm0
mov edi, dword [esi + 4]
test edi, edi
je 0x487a66
xorpd xmm0, xmm0
movapd xmmword [esp + 0x10], xmm0
movapd xmmword [esp + 0x20], xmm0
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x10], 0x2000028
lea eax, [esp + 0x10]
push eax
push dword [esp + 0xc]
call dword [0x507730]
add esp, 8
test eax, eax
jne 0x487a66
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x28]
add edx, eax
mov ebx, dword [esp + 0x2c]
adc ebx, ecx
mov dword [edi], edx
mov dword [edi + 4], ebx
mov dword [edi + 8], eax
mov dword [edi + 0xc], ecx
mov eax, dword [esi + 8]
test eax, eax
je 0x487a7b
push eax
push dword [esp + 0xc]
call dword [0x507734]
add esp, 8
mov esi, dword [esi + 0x10]
test esi, esi
je 0x487abc
lea eax, [esp + 0x10]
push eax
push 0
push dword [esp + 0x10]
call dword [0x507738]
add esp, 0xc
test eax, eax
jne 0x487abc
movss xmm0, dword [esp + 0x10]
orpd xmm0, xmmword [0x4fd2d0]
subsd xmm0, qword [0x4fd2e0]
divsd xmm0, qword [0x4fd2e8]
movsd qword [esi], xmm0
xor edi, edi
jmp 0x487ba9
mov edi, str.dlsym_nvmlInit_v2_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlShutdown_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetCount_v2_failed
jmp 0x487b85
cmp dword [esp + 0xc], 0
je 0x487b48
xor edi, edi
lea ebx, [esp + 8]
jmp 0x487aff
inc edi
mov dword [esp + 8], 0
cmp edi, dword [esp + 0xc]
jae 0x487b48
push ebx
push edi
call dword [0x507720]
add esp, 8
test eax, eax
jne 0x487af0
lea eax, [esp + 0x10]
push eax
push dword [esp + 0xc]
call dword [0x507728]
add esp, 8
test eax, eax
jne 0x487af0
mov eax, dword [esi + 0x14]
shl eax, 0x10
or eax, dword [esi + 0x18]
cmp dword [esp + 0x2c], eax
jne 0x487af0
mov eax, dword [esp + 0x30]
cmp eax, dword [esi + 0x1c]
jne 0x487af0
mov eax, dword [esp + 8]
test eax, eax
jne 0x487998
mov edi, 0x4fd618
jmp 0x487ba9
mov edi, str.dlsym_nvmlDeviceGetHandleByIndex_v2_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetHandleByPciBusId_v2_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetPciInfo_v3_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetTemperature_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetMemoryInfo_v2_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetNumGpuCores_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetClockInfo_failed
jmp 0x487b85
mov edi, str.dlsym_nvmlDeviceGetBrand_failed
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x487ba9
push ebx
call dbg.atexit
add esp, 4
cmp dword [0x507734], 0
jne 0x4877c2
mov edi, str.loading_nvml_library_failed
mov eax, edi
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret