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

Disassembly:
push rdi
sub rsp, 0x6b0
mov rax, qword [0x1400b44c0]
xor rax, rsp
mov qword [rsp + 0x680], rax
mov r8d, 0x200
lea rdx, [rsp + 0x480]
lea rcx, str._PROGRAMFILES_NVIDIA_CorporationNVSMI_nvml.dll
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea rcx, [rsp + 0x480]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
jne 0x1400359c5
lea rcx, str.nvml.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
je 0x1400360ea
mov qword [rsp + 0x6c0], rbx
mov edx, 0x1d0
mov qword [rsp + 0x6c8], rbp
mov ecx, 1
mov qword [rsp + 0x6d0], rsi
mov qword [rsp + 0x6a8], r12
mov qword [rsp + 0x6a0], r13
mov qword [rsp + 0x698], r14
mov qword [rsp + 0x690], r15
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
lea rdx, str.nvmlInit_v2
mov rcx, rdi
mov rbx, rax
mov qword [rax], rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x50], rax
mov rsi, rax
test rax, rax
jne 0x140035a46
lea rdx, str.nvmlInit
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rsi, rax
mov qword [rbx + 0x50], rax
lea rdx, str.nvmlDeviceGetCount_v2
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x58], rax
mov rbp, rax
test rax, rax
jne 0x140035a79
lea rdx, str.nvmlDeviceGetCount
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rbp, rax
mov qword [rbx + 0x58], rax
lea rdx, str.nvmlDeviceGetHandleByIndex_v2
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetAPIRestriction
mov rcx, rdi
mov r12, rax
mov qword [rbx + 0x60], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceSetAPIRestriction
mov rcx, rdi
mov qword [rbx + 0x68], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetDefaultApplicationsClock
mov rcx, rdi
mov qword [rbx + 0x70], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetApplicationsClock
mov rcx, rdi
mov qword [rbx + 0x80], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceSetApplicationsClocks
mov rcx, rdi
mov qword [rbx + 0x78], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceResetApplicationsClocks
mov rcx, rdi
mov qword [rbx + 0x88], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetSupportedGraphicsClocks
mov rcx, rdi
mov qword [rbx + 0x90], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetSupportedMemoryClocks
mov rcx, rdi
mov qword [rbx + 0x98], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetClockInfo
mov rcx, rdi
mov qword [rbx + 0xa0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetMaxClockInfo
mov rcx, rdi
mov qword [rbx + 0xa8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPciInfo_v2
mov rcx, rdi
mov qword [rbx + 0xb0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0xd8], rax
mov r14, rax
test rax, rax
jne 0x140035ba6
lea rdx, str.nvmlDeviceGetPciInfo
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r14, rax
mov qword [rbx + 0xd8], rax
lea rdx, str.nvmlDeviceGetCurrPcieLinkGeneration
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetCurrPcieLinkWidth
mov rcx, rdi
mov qword [rbx + 0xe0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetMaxPcieLinkGeneration
mov rcx, rdi
mov qword [rbx + 0xe8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetMaxPcieLinkWidth
mov rcx, rdi
mov qword [rbx + 0xf0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPowerUsage
mov rcx, rdi
mov qword [rbx + 0xf8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPowerManagementDefaultLimit
mov rcx, rdi
mov qword [rbx + 0x128], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPowerManagementLimit
mov rcx, rdi
mov qword [rbx + 0xb8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPowerManagementLimitConstraints
mov rcx, rdi
mov qword [rbx + 0xc0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceSetPowerManagementLimit
mov rcx, rdi
mov qword [rbx + 0xc8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetName
mov rcx, rdi
mov qword [rbx + 0xd0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetTemperature
mov rcx, rdi
mov qword [rsp + 0x28], rax
mov qword [rbx + 0x100], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetFanSpeed
mov rcx, rdi
mov qword [rbx + 0x108], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPerformanceState
mov rcx, rdi
mov qword [rbx + 0x110], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetUtilizationRates
mov rcx, rdi
mov qword [rbx + 0x118], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetSerial
mov rcx, rdi
mov qword [rbx + 0x120], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetUUID
mov rcx, rdi
mov qword [rbx + 0x130], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetVbiosVersion
mov rcx, rdi
mov qword [rbx + 0x138], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlSystemGetDriverVersion
mov rcx, rdi
mov qword [rbx + 0x140], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlErrorString
mov rcx, rdi
mov r15, rax
mov qword [rbx + 0x148], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x20], rax
lea rdx, str.nvmlShutdown
mov qword [rbx + 0x150], rax
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetEnforcedPowerLimit
mov rcx, rdi
mov r13, rax
mov qword [rbx + 0x158], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetPcieThroughput
mov rcx, rdi
mov qword [rbx + 0x160], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.nvmlDeviceGetClock
mov rcx, rdi
mov qword [rbx + 0x168], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x170], rax
test rsi, rsi
je 0x140036092
test r13, r13
je 0x140036092
cmp qword [rsp + 0x20], 0
je 0x140036092
test rbp, rbp
je 0x140036092
test r12, r12
je 0x140036092
test r14, r14
je 0x140036092
cmp qword [rsp + 0x28], 0
je 0x140036092
call rsi
test r15, r15
je 0x140035e22
mov edx, 0x20
lea rcx, [0x1400b8a78]
call r15
lea rcx, [rbx + 8]
call qword [rbx + 0x58]
lea rcx, [rbx + 0xc]
call fcn.14003d450
test eax, eax
je 0x140035e42
lea rcx, str.Failed_to_query_CUDA_device_count_
jmp 0x140036099
movsxd rcx, dword [rbx + 8]
mov edx, 8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 8]
mov edx, 4
mov qword [rbx + 0x40], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 8]
mov edx, 4
mov qword [rbx + 0x10], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 8]
mov edx, 4
mov qword [rbx + 0x18], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 8]
mov edx, 4
mov qword [rbx + 0x20], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 8]
mov edx, 4
mov qword [rbx + 0x28], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 0xc]
mov edx, 4
mov qword [rbx + 0x30], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
movsxd rcx, dword [rbx + 8]
mov edx, 4
mov qword [rbx + 0x38], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov qword [rbx + 0x48], rax
xor esi, esi
mov eax, dword [rbx + 8]
test eax, eax
jle 0x140035f09
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rbx + 0x40]
movsxd rcx, esi
lea rdx, [rax + rcx*8]
mov ecx, esi
call qword [rbx + 0x60]
mov eax, dword [rbx + 8]
inc esi
cmp esi, eax
jl 0x140035ef0
xor ebp, ebp
test eax, eax
jle 0x140035fbb
xor r14d, r14d
xor esi, esi
nop dword [rax + rax]
mov rcx, qword [rbx + 0x40]
lea rdx, [rsp + 0x30]
mov rcx, qword [r14 + rcx]
call qword [rbx + 0xd8]
mov eax, dword [rsp + 0x40]
mov rcx, qword [rbx + 0x10]
mov dword [rsi + rcx], eax
mov eax, dword [rsp + 0x44]
mov rcx, qword [rbx + 0x18]
mov dword [rsi + rcx], eax
mov eax, dword [rsp + 0x48]
mov rcx, qword [rbx + 0x20]
mov dword [rsi + rcx], eax
mov eax, dword [rsp + 0x50]
mov rcx, qword [rbx + 0x28]
mov dword [rsi + rcx], eax
mov rax, qword [rbx + 0x48]
mov dword [rsi + rax], 2
mov rax, qword [rbx + 0x70]
test rax, rax
je 0x140035f85
mov rcx, qword [rbx + 0x40]
xor edx, edx
mov r8d, 1
mov rcx, qword [r14 + rcx]
call rax
mov r9, qword [rbx + 0x68]
test r9, r9
je 0x140035fa6
mov rax, qword [rbx + 0x48]
xor edx, edx
movsxd rcx, ebp
lea r8, [rax + rcx*4]
mov rcx, qword [rbx + 0x40]
mov rcx, qword [r14 + rcx]
call r9
mov eax, dword [rbx + 8]
inc ebp
add rsi, 4
add r14, 8
cmp ebp, eax
jl 0x140035f20
xor edx, edx
test eax, eax
jle 0x140035fda
xor ecx, ecx
mov rax, qword [rbx + 0x30]
lea rcx, [rcx + 4]
inc edx
mov dword [rcx + rax - 4], 0xffffffff
cmp edx, dword [rbx + 8]
jl 0x140035fc3
xor esi, esi
cmp dword [rbx + 0xc], esi
jle 0x14003608d
xor r14d, r14d
lea rbp, [0x1400b8cc0]
nop
mov rax, qword [rbx + 0x38]
lea rcx, [rsp + 0x70]
mov edx, esi
mov dword [r14 + rax], 0xffffffff
call fcn.14003d580
test eax, eax
jne 0x14003607e
mov r9d, dword [rsp + 0x2b8]
xor r8d, r8d
mov dword [r14 + rbp], r9d
cmp dword [rbx + 8], r8d
jle 0x14003607e
xor edx, edx
nop dword [rax]
nop word [rax + rax]
mov rcx, qword [rbx + 0x10]
mov eax, dword [rsp + 0x2c0]
cmp dword [rdx + rcx], eax
jne 0x140036071
mov rax, qword [rbx + 0x18]
cmp dword [rdx + rax], r9d
jne 0x140036071
mov rcx, qword [rbx + 0x20]
mov eax, dword [rsp + 0x2bc]
cmp dword [rdx + rcx], eax
jne 0x140036071
mov rax, qword [rbx + 0x30]
mov dword [rdx + rax], esi
mov rax, qword [rbx + 0x38]
mov dword [r14 + rax], r8d
mov r9d, dword [rsp + 0x2b8]
inc r8d
add rdx, 4
cmp r8d, dword [rbx + 8]
jl 0x140036030
inc esi
add r14, 4
cmp esi, dword [rbx + 0xc]
jl 0x140035ff0
mov rax, rbx
jmp 0x1400360b2
lea rcx, str.Failed_to_obtain_required_NVML_function_pointers
call fcn.1400080e0
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor eax, eax
mov r14, qword [rsp + 0x698]
mov r13, qword [rsp + 0x6a0]
mov r12, qword [rsp + 0x6a8]
mov rsi, qword [rsp + 0x6d0]
mov rbp, qword [rsp + 0x6c8]
mov rbx, qword [rsp + 0x6c0]
mov r15, qword [rsp + 0x690]
mov rcx, qword [rsp + 0x680]
xor rcx, rsp
call fcn.14007a0e0
add rsp, 0x6b0
pop rdi
ret