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

Disassembly:
push rbx
sub rsp, 0x520
mov rax, qword [0x140264330]
xor rax, rsp
mov qword [rsp + 0x500], rax
lea rdx, [rsp + 0x300]
lea rcx, str._PROGRAMFILES_NVIDIA_CorporationNVSMI_nvml.dll
mov r8d, 0x200
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea rcx, [rsp + 0x300]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rbx, rax
test rax, rax
jne 0x14004b704
cmp dword [0x1402d4dbc], eax
je 0x14004b704
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, [rsp + 0x300]
lea rdx, str.dlopen__d_:_failed_to_load__s
lea ecx, [rbx + 4]
mov r8d, eax
call fcn.140041b60
test rbx, rbx
jne 0x14004b74e
lea rcx, str.nvml.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rbx, rax
test rax, rax
jne 0x14004b745
cmp dword [0x1402d4dbc], eax
je 0x14004b745
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.140041b60
test rbx, rbx
je 0x14004bfb8
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 [0x1402d5010], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0x50], rax
test rax, rax
jne 0x14004b7a3
mov rcx, qword [rcx]
lea rdx, str.nvmlInit
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0x50], rax
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetCount_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0x58], rax
test rax, rax
jne 0x14004b7de
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetCount
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0x58], rax
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetHandleByIndex_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetAPIRestriction
mov qword [rcx + 0x60], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceSetAPIRestriction
mov qword [rcx + 0x68], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetDefaultApplicationsClock
mov qword [rcx + 0x70], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetApplicationsClock
mov qword [rcx + 0x78], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceSetApplicationsClocks
mov qword [rcx + 0x80], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceResetApplicationsClocks
mov qword [rcx + 0x88], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetSupportedGraphicsClocks
mov qword [rcx + 0x90], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetSupportedMemoryClocks
mov qword [rcx + 0x98], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetClockInfo
mov qword [rcx + 0xa0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetMaxClockInfo
mov qword [rcx + 0xa8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPciInfo_v2
mov qword [rcx + 0xb0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0xd8], rax
test rax, rax
jne 0x14004b95d
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetPciInfo
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0xd8], rax
mov rcx, qword [rcx]
lea rdx, str.nvmlDeviceGetCurrPcieLinkGeneration
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetCurrPcieLinkWidth
mov qword [rcx + 0xe0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetMaxPcieLinkGeneration
mov qword [rcx + 0xe8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetMaxPcieLinkWidth
mov qword [rcx + 0xf0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPowerUsage
mov qword [rcx + 0xf8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPowerManagementDefaultLimit
mov qword [rcx + 0x120], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPowerManagementLimit
mov qword [rcx + 0xb8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPowerManagementLimitConstraints
mov qword [rcx + 0xc0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceSetPowerManagementLimit
mov qword [rcx + 0xc8], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetName
mov qword [rcx + 0xd0], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetTemperature
mov qword [rcx + 0x100], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetFanSpeed
mov qword [rcx + 0x108], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPerformanceState
mov qword [rcx + 0x110], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetSerial
mov qword [rcx + 0x118], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetUUID
mov qword [rcx + 0x128], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetVbiosVersion
mov qword [rcx + 0x130], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlSystemGetDriverVersion
mov qword [rcx + 0x138], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlErrorString
mov qword [rcx + 0x140], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlShutdown
mov qword [rcx + 0x148], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetEnforcedPowerLimit
mov qword [rcx + 0x150], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetPcieThroughput
mov qword [rcx + 0x158], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
lea rdx, str.nvmlDeviceGetClock
mov qword [rcx + 0x160], rax
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [0x1402d5010]
mov qword [rcx + 0x168], rax
mov rax, qword [rcx + 0x50]
test rax, rax
je 0x14004bf81
cmp qword [rcx + 0x150], 0
je 0x14004bf81
cmp qword [rcx + 0x148], 0
je 0x14004bf81
cmp qword [rcx + 0x58], 0
je 0x14004bf81
cmp qword [rcx + 0x60], 0
je 0x14004bf81
cmp qword [rcx + 0xd8], 0
je 0x14004bf81
cmp qword [rcx + 0x100], 0
je 0x14004bf81
call rax
mov rax, qword [0x1402d5010]
mov r8, qword [rax + 0x140]
test r8, r8
je 0x14004bc77
lea rcx, [0x1402eacd0]
mov edx, 0x20
call r8
mov rax, qword [0x1402d5010]
lea rcx, [rax + 8]
call qword [rax + 0x58]
mov rcx, qword [0x1402d5010]
add rcx, 0xc
call fcn.1400017f0
test eax, eax
je 0x14004bcab
cmp dword [0x1402d4dbc], 0
je 0x14004bf9b
lea rdx, str.Failed_to_query_CUDA_device_count_
jmp 0x14004bf91
mov rbx, qword [0x1402d5010]
mov qword [rsp + 0x530], rbp
mov qword [rsp + 0x538], rsi
movsxd rsi, dword [rbx + 8]
mov edx, 8
mov qword [rsp + 0x540], 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 0x14004bd8e
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 [0x1402d5010]
inc edi
cmp edi, dword [rbx + 8]
jl 0x14004bd70
xor ebp, ebp
cmp dword [rbx + 8], ebp
jle 0x14004be4c
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 [0x1402d5010]
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 0x14004be11
mov rcx, qword [rbx + 0x40]
xor edx, edx
mov rcx, qword [rcx + rsi]
lea r8d, [rdx + 1]
call rax
mov rbx, qword [0x1402d5010]
mov r9, qword [rbx + 0x68]
test r9, r9
je 0x14004be39
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 [0x1402d5010]
inc ebp
add rdi, 4
add rsi, 8
cmp ebp, dword [rbx + 8]
jl 0x14004bda0
xor ecx, ecx
cmp dword [rbx + 8], ecx
jle 0x14004be6c
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 0x14004be55
xor ebp, ebp
cmp dword [rbx + 0xc], ebp
jle 0x14004bf64
mov qword [rsp + 0x518], r14
mov qword [rsp + 0x510], r15
lea r15, [0x1402eab70]
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 [0x1402d5010]
test eax, eax
jne 0x14004bf45
mov edx, dword [rsp + 0x298]
xor esi, esi
mov dword [r14 + r15], edx
cmp dword [rbx + 8], esi
jle 0x14004bf45
xor edi, edi
mov rcx, qword [rbx + 0x10]
mov eax, dword [rsp + 0x2a0]
cmp dword [rdi + rcx], eax
jne 0x14004bf3a
mov rax, qword [rbx + 0x18]
cmp dword [rdi + rax], edx
jne 0x14004bf3a
mov rcx, qword [rbx + 0x20]
mov eax, dword [rsp + 0x29c]
cmp dword [rdi + rcx], eax
jne 0x14004bf3a
cmp dword [0x1402d4dbc], 0
je 0x14004bf24
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.140041b60
mov rbx, qword [0x1402d5010]
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 0x14004bed0
inc ebp
add r14, 4
cmp ebp, dword [rbx + 0xc]
jl 0x14004be91
mov r15, qword [rsp + 0x510]
mov r14, qword [rsp + 0x518]
mov rdi, qword [rsp + 0x540]
mov rsi, qword [rsp + 0x538]
mov rbp, qword [rsp + 0x530]
mov rax, rbx
jmp 0x14004bfba
cmp dword [0x1402d4dbc], 0
je 0x14004bfa2
lea rdx, str.Failed_to_obtain_required_NVML_function_pointers
mov ecx, 4
call fcn.140041b60
mov rcx, qword [0x1402d5010]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, qword [0x1402d5010]
call qword [sym.imp.MSVCR120.dll_free]
xor eax, eax
mov rcx, qword [rsp + 0x500]
xor rcx, rsp
call fcn.1401bb2c0
add rsp, 0x520
pop rbx
ret