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

Disassembly:
push rdi
sub rsp, 0x530
mov rax, qword [0x14017f8e0]
xor rax, rsp
mov qword [rsp + 0x500], rax
mov r8d, 0x200
lea rdx, [rsp + 0x300]
lea rcx, str._PROGRAMFILES_NVIDIA_CorporationNVSMI_nvml.dll
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea rcx, [rsp + 0x300]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
jne 0x14003c1e4
cmp byte [0x140190372], al
je 0x14003c1e4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea r9, [rsp + 0x300]
lea rdx, str.dlopen__d_:_failed_to_load__s
lea ecx, [rdi + 4]
call fcn.140033450
test rdi, rdi
jne 0x14003c231
lea rcx, str.nvml.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
jne 0x14003c225
cmp byte [0x140190372], al
je 0x14003c225
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea r9, str.nvml.dll
lea rdx, str.dlopen__d_:_failed_to_load__s
lea ecx, [rdi + 4]
call fcn.140033450
test rdi, rdi
jne 0x14003c231
xor eax, eax
jmp 0x14003c6f1
mov edx, 0x168
mov qword [rsp + 0x540], rbx
mov ecx, 1
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
test rax, rax
jne 0x14003c27c
mov rcx, qword [rbx]
lea rdx, str.nvmlInit
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x50], rax
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetCount_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x58], rax
test rax, rax
jne 0x14003c2a9
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetCount
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x58], rax
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetHandleByIndex_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetAPIRestriction
mov qword [rbx + 0x60], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceSetAPIRestriction
mov qword [rbx + 0x68], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetDefaultApplicationsClock
mov qword [rbx + 0x70], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetApplicationsClock
mov qword [rbx + 0x78], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceSetApplicationsClocks
mov qword [rbx + 0x80], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceResetApplicationsClocks
mov qword [rbx + 0x88], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetSupportedGraphicsClocks
mov qword [rbx + 0x90], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetSupportedMemoryClocks
mov qword [rbx + 0x98], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetClockInfo
mov qword [rbx + 0xa0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetMaxClockInfo
mov qword [rbx + 0xa8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPciInfo_v2
mov qword [rbx + 0xb0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0xd8], rax
test rax, rax
jne 0x14003c3cd
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPciInfo
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0xd8], rax
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetCurrPcieLinkGeneration
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetCurrPcieLinkWidth
mov qword [rbx + 0xe0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetMaxPcieLinkGeneration
mov qword [rbx + 0xe8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetMaxPcieLinkWidth
mov qword [rbx + 0xf0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerUsage
mov qword [rbx + 0xf8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerManagementDefaultLimit
mov qword [rbx + 0x120], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerManagementLimit
mov qword [rbx + 0xb8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerManagementLimitConstraints
mov qword [rbx + 0xc0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceSetPowerManagementLimit
mov qword [rbx + 0xc8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetName
mov qword [rbx + 0xd0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetTemperature
mov qword [rbx + 0x100], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetFanSpeed
mov qword [rbx + 0x108], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPerformanceState
mov qword [rbx + 0x110], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetSerial
mov qword [rbx + 0x118], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetUUID
mov qword [rbx + 0x128], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetVbiosVersion
mov qword [rbx + 0x130], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlSystemGetDriverVersion
mov qword [rbx + 0x138], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlErrorString
mov qword [rbx + 0x140], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlShutdown
mov qword [rbx + 0x148], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetEnforcedPowerLimit
mov qword [rbx + 0x150], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x158], rax
lea rdx, str.nvmlDeviceGetPcieThroughput
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x160], rax
mov rax, qword [rbx + 0x50]
test rax, rax
je 0x14003ca35
cmp qword [rbx + 0x150], 0
je 0x14003ca35
cmp qword [rbx + 0x148], 0
je 0x14003ca35
cmp qword [rbx + 0x58], 0
je 0x14003ca35
cmp qword [rbx + 0x60], 0
je 0x14003ca35
cmp qword [rbx + 0xd8], 0
je 0x14003ca35
cmp qword [rbx + 0x100], 0
je 0x14003ca35
call rax
test eax, eax
je 0x14003c634
mov ecx, eax
call qword [rbx + 0x148]
lea rdx, str.nvmlInit___failed:__s
mov ecx, 1
mov r8, rax
call fcn.140033450
xor eax, eax
jmp 0x14003c6e9
mov qword [rsp + 0x528], r12
lea rcx, [0x1401909b0]
mov edx, reloc.WLDAP32.dll_Ordinal_32
mov qword [rsp + 0x518], r14
call qword [rbx + 0x140]
test eax, eax
je 0x14003c676
mov ecx, eax
call qword [rbx + 0x148]
lea rdx, str.nvmlSystemGetDriverVersion___failed:__s
mov ecx, 1
mov r8, rax
call fcn.140033450
lea rcx, [rbx + 8]
call qword [rbx + 0x58]
test eax, eax
je 0x14003c69d
mov ecx, eax
call qword [rbx + 0x148]
lea rdx, str.nvmlDeviceGetCount___failed:__s
mov ecx, 1
mov r8, rax
call fcn.140033450
lea rcx, [rbx + 0xc]
call qword [sym.imp.cudart64_80.dll_cudaGetDeviceCount]
test eax, eax
je 0x14003c70a
cmp byte [0x140190372], 0
je 0x14003c6c5
lea rdx, str.Failed_to_query_CUDA_device_count_
mov ecx, 4
call fcn.140033450
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 r12, qword [rsp + 0x528]
mov r14, qword [rsp + 0x518]
mov rbx, qword [rsp + 0x540]
mov rcx, qword [rsp + 0x500]
xor rcx, rsp
call fcn.140111120
add rsp, 0x530
pop rdi
ret
movsxd rcx, dword [rbx + 8]
mov edx, 8
mov qword [rsp + 0x548], rbp
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]
xor edi, edi
mov qword [rbx + 0x48], rax
cmp dword [rbx + 8], edi
jle 0x14003c7fa
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rbx + 0x40]
movsxd rcx, edi
lea rdx, [rax + rcx*8]
mov ecx, edi
call qword [rbx + 0x60]
test eax, eax
je 0x14003c7f3
mov ecx, eax
call qword [rbx + 0x148]
mov r8d, edi
lea rdx, str.GPU__d:_nvmlDeviceGetHandleByIndex___failed:__s
mov r9, rax
mov ecx, 1
call fcn.140033450
inc edi
cmp edi, dword [rbx + 8]
jl 0x14003c7c0
xor ebp, ebp
mov qword [rsp + 0x550], rsi
cmp dword [rbx + 8], ebp
jle 0x14003c901
xor edi, edi
xor esi, esi
mov rcx, qword [rbx + 0x40]
lea rdx, [rsp + 0x30]
mov rcx, qword [rcx + rdi]
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 0x14003c8a5
mov rcx, qword [rbx + 0x40]
xor edx, edx
mov rcx, qword [rcx + rdi]
lea r8d, [rdx + 1]
call rax
test eax, eax
je 0x14003c8a5
cmp byte [0x140190372], 0
je 0x14003c8a5
mov ecx, eax
call qword [rbx + 0x148]
mov r8, qword [rbx + 0x40]
lea rdx, str.Device__d:_nvmlDeviceSetAPIRestriction___failed:__s
mov r9, rax
mov ecx, 1
mov r8, qword [r8 + rdi]
call fcn.140033450
mov r9, qword [rbx + 0x68]
test r9, r9
je 0x14003c8ee
mov rax, qword [rbx + 0x48]
xor edx, edx
movsxd rcx, ebp
lea r8, [rax + rcx*4]
mov rcx, qword [rbx + 0x40]
mov rcx, qword [rcx + rdi]
call r9
test eax, eax
je 0x14003c8ee
mov ecx, eax
call qword [rbx + 0x148]
mov r8, qword [rbx + 0x40]
lea rdx, str.Device__d:_nvmlDeviceGetAPIRestriction___failed:__s
mov r9, rax
mov ecx, 1
mov r8, qword [r8 + rdi]
call fcn.140033450
inc ebp
add rsi, 4
add rdi, 8
cmp ebp, dword [rbx + 8]
jl 0x14003c811
xor edx, edx
cmp dword [rbx + 8], edx
jle 0x14003c927
xor ecx, ecx
nop word [rax + rax]
mov rax, qword [rbx + 0x30]
lea rcx, [rcx + 4]
inc edx
mov dword [rcx + rax - 4], 0xffffffff
cmp edx, dword [rbx + 8]
jl 0x14003c910
xor ebp, ebp
cmp dword [rbx + 0xc], ebp
jle 0x14003ca1d
mov qword [rsp + 0x520], r13
lea r13, [0x1401906b0]
mov qword [rsp + 0x510], r15
xor r15d, r15d
nop dword [rax]
mov rax, qword [rbx + 0x38]
lea rcx, [rsp + 0x70]
mov edx, ebp
mov dword [r15 + rax], 0xffffffff
call qword [sym.imp.cudart64_80.dll_cudaGetDeviceProperties]
test eax, eax
jne 0x14003c9fe
mov edx, dword [rsp + 0x298]
xor esi, esi
mov dword [r15 + r13], edx
cmp dword [rbx + 8], esi
jle 0x14003c9fe
xor edi, edi
nop word [rax + rax]
mov rcx, qword [rbx + 0x10]
mov eax, dword [rsp + 0x2a0]
cmp dword [rdi + rcx], eax
jne 0x14003c9f3
mov rax, qword [rbx + 0x18]
cmp dword [rdi + rax], edx
jne 0x14003c9f3
mov rcx, qword [rbx + 0x20]
mov eax, dword [rsp + 0x29c]
cmp dword [rdi + rcx], eax
jne 0x14003c9f3
cmp byte [0x140190372], 0
je 0x14003c9dd
mov dword [rsp + 0x20], edx
mov r9d, esi
lea rdx, str.CUDA_GPU__d_matches_NVML_GPU__d_by_busId__u
mov r8d, ebp
mov ecx, 4
call fcn.140033450
mov rax, qword [rbx + 0x30]
mov dword [rdi + rax], ebp
mov rax, qword [rbx + 0x38]
mov dword [r15 + rax], esi
mov edx, dword [rsp + 0x298]
inc esi
add rdi, 4
cmp esi, dword [rbx + 8]
jl 0x14003c990
inc ebp
add r15, 4
cmp ebp, dword [rbx + 0xc]
jl 0x14003c950
mov r15, qword [rsp + 0x510]
mov r13, qword [rsp + 0x520]
mov rsi, qword [rsp + 0x550]
mov rax, rbx
mov rbp, qword [rsp + 0x548]
jmp 0x14003c6d9
cmp byte [0x140190372], 0
je 0x14003ca4f
lea rdx, str.Failed_to_obtain_required_NVML_function_pointers
mov ecx, 4
call fcn.140033450
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
jmp 0x14003c6e9