Function at 0x14004a480
Capabilities:
Link many functions at runtime
Query environment variable

Disassembly:
push rbx
sub rsp, 0x510
mov rax, qword [0x1402581e0]
xor rax, rsp
mov qword [rsp + 0x4f0], rax
lea rdx, [rsp + 0x2f0]
lea rcx, str._PROGRAMFILES_NVIDIA_CorporationNVSMI_nvml.dll
mov r8d, 0x200
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea rcx, [rsp + 0x2f0]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rbx, rax
test rax, rax
jne 0x14004a4f4
cmp dword [0x1402c7bbc], eax
je 0x14004a4f4
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, [rsp + 0x2f0]
lea rdx, str.dlopen__d_:_failed_to_load__s
lea ecx, [rbx + 4]
mov r8d, eax
call fcn.140040950
test rbx, rbx
jne 0x14004a53e
lea rcx, str.nvml.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rbx, rax
test rax, rax
jne 0x14004a535
cmp dword [0x1402c7bbc], eax
je 0x14004a535
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, str.nvml.dll
lea rdx, str.dlopen__d_:_failed_to_load__s
lea ecx, [rbx + 4]
mov r8d, eax
call fcn.140040950
test rbx, rbx
je 0x14004ada8
mov edx, 0x1c8
mov ecx, 1
call qword [sym.imp.MSVCR120.dll_calloc]
lea rdx, str.nvmlInit_v2
mov rcx, rbx
mov qword [rax], rbx
mov qword [0x1402c7e10], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0x50], rax
test rax, rax
jne 0x14004a593
mov rcx, qword [rcx]
lea rdx, str.nvmlInit
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0x50], rax
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetCount_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0x58], rax
test rax, rax
jne 0x14004a5ce
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetCount
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0x58], rax
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetHandleByIndex_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetAPIRestriction
mov qword [rcx + 0x60], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceSetAPIRestriction
mov qword [rcx + 0x68], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetDefaultApplicationsClock
mov qword [rcx + 0x70], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetApplicationsClock
mov qword [rcx + 0x78], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceSetApplicationsClocks
mov qword [rcx + 0x80], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceResetApplicationsClocks
mov qword [rcx + 0x88], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetSupportedGraphicsClocks
mov qword [rcx + 0x90], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetSupportedMemoryClocks
mov qword [rcx + 0x98], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetClockInfo
mov qword [rcx + 0xa0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetMaxClockInfo
mov qword [rcx + 0xa8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPciInfo_v2
mov qword [rcx + 0xb0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0xd8], rax
test rax, rax
jne 0x14004a74d
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetPciInfo
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0xd8], rax
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetCurrPcieLinkGeneration
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetCurrPcieLinkWidth
mov qword [rcx + 0xe0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetMaxPcieLinkGeneration
mov qword [rcx + 0xe8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetMaxPcieLinkWidth
mov qword [rcx + 0xf0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPowerUsage
mov qword [rcx + 0xf8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPowerManagementDefaultLimit
mov qword [rcx + 0x120], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPowerManagementLimit
mov qword [rcx + 0xb8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPowerManagementLimitConstraints
mov qword [rcx + 0xc0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceSetPowerManagementLimit
mov qword [rcx + 0xc8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetName
mov qword [rcx + 0xd0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetTemperature
mov qword [rcx + 0x100], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetFanSpeed
mov qword [rcx + 0x108], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPerformanceState
mov qword [rcx + 0x110], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetSerial
mov qword [rcx + 0x118], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetUUID
mov qword [rcx + 0x128], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetVbiosVersion
mov qword [rcx + 0x130], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlSystemGetDriverVersion
mov qword [rcx + 0x138], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlErrorString
mov qword [rcx + 0x140], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlShutdown
mov qword [rcx + 0x148], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetEnforcedPowerLimit
mov qword [rcx + 0x150], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetPcieThroughput
mov qword [rcx + 0x158], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
lea rdx, str.nvmlDeviceGetClock
mov qword [rcx + 0x160], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402c7e10]
mov qword [rcx + 0x168], rax
mov rax, qword [rcx + 0x50]
test rax, rax
je 0x14004ad71
cmp qword [rcx + 0x150], 0
je 0x14004ad71
cmp qword [rcx + 0x148], 0
je 0x14004ad71
cmp qword [rcx + 0x58], 0
je 0x14004ad71
cmp qword [rcx + 0x60], 0
je 0x14004ad71
cmp qword [rcx + 0xd8], 0
je 0x14004ad71
cmp qword [rcx + 0x100], 0
je 0x14004ad71
call rax
mov rax, qword [0x1402c7e10]
mov r8, qword [rax + 0x140]
test r8, r8
je 0x14004aa67
lea rcx, [0x1402ddad0]
mov edx, 0x20
call r8
mov rax, qword [0x1402c7e10]
lea rcx, [rax + 8]
call qword [rax + 0x58]
mov rcx, qword [0x1402c7e10]
add rcx, 0xc
call fcn.1400017f0
test eax, eax
je 0x14004aa9b
cmp dword [0x1402c7bbc], 0
je 0x14004ad8b
lea rdx, str.Failed_to_query_CUDA_device_count_
jmp 0x14004ad81
mov rbx, qword [0x1402c7e10]
mov qword [rsp + 0x520], rbp
mov qword [rsp + 0x528], rsi
movsxd rsi, dword [rbx + 8]
mov edx, 8
mov qword [rsp + 0x530], rdi
mov rcx, rsi
call qword [sym.imp.MSVCR120.dll_calloc]
mov edx, 4
mov rcx, rsi
mov qword [rbx + 0x40], rax
call qword [sym.imp.MSVCR120.dll_calloc]
mov edx, 4
mov rcx, rsi
mov qword [rbx + 0x10], rax
call qword [sym.imp.MSVCR120.dll_calloc]
mov edx, 4
mov rcx, rsi
mov qword [rbx + 0x18], rax
call qword [sym.imp.MSVCR120.dll_calloc]
mov edx, 4
mov rcx, rsi
mov qword [rbx + 0x20], rax
call qword [sym.imp.MSVCR120.dll_calloc]
mov edx, 4
mov rcx, rsi
mov qword [rbx + 0x28], rax
call qword [sym.imp.MSVCR120.dll_calloc]
movsxd rcx, dword [rbx + 0xc]
mov edx, 4
mov qword [rbx + 0x30], rax
call qword [sym.imp.MSVCR120.dll_calloc]
mov edx, 4
mov rcx, rsi
mov qword [rbx + 0x38], rax
call qword [sym.imp.MSVCR120.dll_calloc]
xor edi, edi
mov qword [rbx + 0x48], rax
test esi, esi
jle 0x14004ab7e
nop word [rax + rax]
mov rax, qword [rbx + 0x40]
movsxd rcx, edi
lea rdx, [rax + rcx*8]
mov ecx, edi
call qword [rbx + 0x60]
mov rbx, qword [0x1402c7e10]
inc edi
cmp edi, dword [rbx + 8]
jl 0x14004ab60
xor ebp, ebp
cmp dword [rbx + 8], ebp
jle 0x14004ac3c
xor esi, esi
xor edi, edi
nop dword [rax]
mov rcx, qword [rbx + 0x40]
lea rdx, [rsp + 0x30]
mov rcx, qword [rcx + rsi]
call qword [rbx + 0xd8]
mov eax, dword [rsp + 0x40]
mov rbx, qword [0x1402c7e10]
mov rcx, qword [rbx + 0x10]
mov dword [rdi + rcx], eax
mov eax, dword [rsp + 0x44]
mov rcx, qword [rbx + 0x18]
mov dword [rdi + rcx], eax
mov eax, dword [rsp + 0x48]
mov rcx, qword [rbx + 0x20]
mov dword [rdi + rcx], eax
mov eax, dword [rsp + 0x50]
mov rcx, qword [rbx + 0x28]
mov dword [rdi + rcx], eax
mov rax, qword [rbx + 0x48]
mov dword [rdi + rax], 2
mov rax, qword [rbx + 0x70]
test rax, rax
je 0x14004ac01
mov rcx, qword [rbx + 0x40]
xor edx, edx
mov rcx, qword [rcx + rsi]
lea r8d, [rdx + 1]
call rax
mov rbx, qword [0x1402c7e10]
mov r9, qword [rbx + 0x68]
test r9, r9
je 0x14004ac29
mov rax, qword [rbx + 0x48]
movsxd rcx, ebp
xor edx, edx
lea r8, [rax + rcx*4]
mov rcx, qword [rbx + 0x40]
mov rcx, qword [rcx + rsi]
call r9
mov rbx, qword [0x1402c7e10]
inc ebp
add rdi, 4
add rsi, 8
cmp ebp, dword [rbx + 8]
jl 0x14004ab90
xor ecx, ecx
cmp dword [rbx + 8], ecx
jle 0x14004ac5c
xor edx, edx
mov rax, qword [rbx + 0x30]
inc ecx
lea rdx, [rdx + 4]
mov dword [rdx + rax - 4], 0xffffffff
cmp ecx, dword [rbx + 8]
jl 0x14004ac45
xor ebp, ebp
cmp dword [rbx + 0xc], ebp
jle 0x14004ad54
mov qword [rsp + 0x508], r14
mov qword [rsp + 0x500], r15
lea r15, [0x1402dd970]
xor r14d, r14d
mov rax, qword [rbx + 0x38]
lea rcx, [rsp + 0x70]
mov edx, ebp
mov dword [r14 + rax], 0xffffffff
call fcn.140001910
mov rbx, qword [0x1402c7e10]
test eax, eax
jne 0x14004ad35
mov edx, dword [rsp + 0x298]
xor esi, esi
mov dword [r14 + r15], edx
cmp dword [rbx + 8], esi
jle 0x14004ad35
xor edi, edi
mov rcx, qword [rbx + 0x10]
mov eax, dword [rsp + 0x2a0]
cmp dword [rdi + rcx], eax
jne 0x14004ad2a
mov rax, qword [rbx + 0x18]
cmp dword [rdi + rax], edx
jne 0x14004ad2a
mov rcx, qword [rbx + 0x20]
mov eax, dword [rsp + 0x29c]
cmp dword [rdi + rcx], eax
jne 0x14004ad2a
cmp dword [0x1402c7bbc], 0
je 0x14004ad14
mov dword [rsp + 0x20], edx
lea rdx, str.CUDA_GPU__d_matches_NVML_GPU__d_by_busId__u
mov r9d, esi
mov r8d, ebp
mov ecx, 4
call fcn.140040950
mov rbx, qword [0x1402c7e10]
mov rax, qword [rbx + 0x30]
mov dword [rdi + rax], ebp
mov rax, qword [rbx + 0x38]
mov dword [r14 + rax], esi
mov edx, dword [rsp + 0x298]
inc esi
add rdi, 4
cmp esi, dword [rbx + 8]
jl 0x14004acc0
inc ebp
add r14, 4
cmp ebp, dword [rbx + 0xc]
jl 0x14004ac81
mov r15, qword [rsp + 0x500]
mov r14, qword [rsp + 0x508]
mov rdi, qword [rsp + 0x530]
mov rsi, qword [rsp + 0x528]
mov rbp, qword [rsp + 0x520]
mov rax, rbx
jmp 0x14004adaa
cmp dword [0x1402c7bbc], 0
je 0x14004ad92
lea rdx, str.Failed_to_obtain_required_NVML_function_pointers
mov ecx, 4
call fcn.140040950
mov rcx, qword [0x1402c7e10]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, qword [0x1402c7e10]
call qword [sym.imp.MSVCR120.dll_free]
xor eax, eax
mov rcx, qword [rsp + 0x4f0]
xor rcx, rsp
call fcn.1401bddc0
add rsp, 0x510
pop rbx
ret