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

Disassembly:
push rdi
sub rsp, 0x540
mov rax, qword [0x1401858e0]
xor rax, rsp
mov qword [rsp + 0x510], rax
mov r8d, 0x200
lea rdx, [rsp + 0x310]
lea rcx, str._PROGRAMFILES_NVIDIA_CorporationNVSMI_nvml.dll
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea rcx, [rsp + 0x310]
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
jne 0x14003cbb4
cmp byte [0x1401965da], al
je 0x14003cbb4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea r9, [rsp + 0x310]
lea rdx, str.dlopen__d_:_failed_to_load__s
lea ecx, [rdi + 4]
call fcn.140033bd0
test rdi, rdi
jne 0x14003cc01
lea rcx, str.nvml.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov rdi, rax
test rax, rax
jne 0x14003cbf5
cmp byte [0x1401965da], al
je 0x14003cbf5
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.140033bd0
test rdi, rdi
jne 0x14003cc01
xor eax, eax
jmp 0x14003d07c
mov edx, 0x1d0
mov qword [rsp + 0x550], 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 + 0x58], rax
test rax, rax
jne 0x14003cc4c
mov rcx, qword [rbx]
lea rdx, str.nvmlInit
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x58], rax
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetCount_v2
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x60], rax
test rax, rax
jne 0x14003cc79
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetCount
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x60], 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 + 0x68], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceSetAPIRestriction
mov qword [rbx + 0x70], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetDefaultApplicationsClock
mov qword [rbx + 0x78], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetApplicationsClock
mov qword [rbx + 0x80], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceSetApplicationsClocks
mov qword [rbx + 0x88], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceResetApplicationsClocks
mov qword [rbx + 0x90], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetSupportedGraphicsClocks
mov qword [rbx + 0x98], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetSupportedMemoryClocks
mov qword [rbx + 0xa0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetClockInfo
mov qword [rbx + 0xa8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetMaxClockInfo
mov qword [rbx + 0xb0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPciInfo_v2
mov qword [rbx + 0xb8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0xe0], rax
test rax, rax
jne 0x14003cda0
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPciInfo
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0xe0], 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 + 0xe8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetMaxPcieLinkGeneration
mov qword [rbx + 0xf0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetMaxPcieLinkWidth
mov qword [rbx + 0xf8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerUsage
mov qword [rbx + 0x100], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerManagementDefaultLimit
mov qword [rbx + 0x128], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerManagementLimit
mov qword [rbx + 0xc0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPowerManagementLimitConstraints
mov qword [rbx + 0xc8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceSetPowerManagementLimit
mov qword [rbx + 0xd0], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetName
mov qword [rbx + 0xd8], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetTemperature
mov qword [rbx + 0x108], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetFanSpeed
mov qword [rbx + 0x110], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetPerformanceState
mov qword [rbx + 0x118], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetSerial
mov qword [rbx + 0x120], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetUUID
mov qword [rbx + 0x130], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetVbiosVersion
mov qword [rbx + 0x138], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlSystemGetDriverVersion
mov qword [rbx + 0x140], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlErrorString
mov qword [rbx + 0x148], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlShutdown
mov qword [rbx + 0x150], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetEnforcedPowerLimit
mov qword [rbx + 0x158], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x160], rax
lea rdx, str.nvmlDeviceGetPcieThroughput
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rcx, qword [rbx]
lea rdx, str.nvmlDeviceGetClock
mov qword [rbx + 0x168], rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbx + 0x170], rax
mov rax, qword [rbx + 0x58]
test rax, rax
je 0x14003d355
cmp qword [rbx + 0x158], 0
je 0x14003d355
cmp qword [rbx + 0x150], 0
je 0x14003d355
cmp qword [rbx + 0x60], 0
je 0x14003d355
cmp qword [rbx + 0x68], 0
je 0x14003d355
cmp qword [rbx + 0xe0], 0
je 0x14003d355
cmp qword [rbx + 0x108], 0
je 0x14003d355
mov qword [rsp + 0x538], r12
mov qword [rsp + 0x528], r14
call rax
mov rax, qword [rbx + 0x148]
test rax, rax
je 0x14003d021
mov edx, reloc.WLDAP32.dll_Ordinal_32
lea rcx, [0x140196c40]
call rax
lea rcx, [rbx + 8]
call qword [rbx + 0x60]
lea rcx, [rbx + 0xc]
call qword [sym.imp.cudart64_91.dll_cudaGetDeviceCount]
test eax, eax
je 0x14003d095
cmp byte [0x1401965da], 0
je 0x14003d050
lea rdx, str.Failed_to_query_CUDA_device_count_
mov ecx, 4
call fcn.140033bd0
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 + 0x538]
mov r14, qword [rsp + 0x528]
mov rbx, qword [rsp + 0x550]
mov rcx, qword [rsp + 0x510]
xor rcx, rsp
call fcn.1401150e0
add rsp, 0x540
pop rdi
ret
movsxd rcx, dword [rbx + 8]
mov edx, 8
mov qword [rsp + 0x558], 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 + 0x48], 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 + 8]
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 + 0xc]
mov edx, 4
mov qword [rbx + 0x38], 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 + 0x40], rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
xor edi, edi
mov qword [rbx + 0x50], rax
cmp dword [rbx + 8], edi
jle 0x14003d167
nop
mov rax, qword [rbx + 0x48]
movsxd rcx, edi
lea rdx, [rax + rcx*8]
mov ecx, edi
call qword [rbx + 0x68]
inc edi
cmp edi, dword [rbx + 8]
jl 0x14003d150
xor ebp, ebp
mov qword [rsp + 0x560], rsi
cmp dword [rbx + 8], ebp
jle 0x14003d222
xor esi, esi
xor edi, edi
nop
mov rcx, qword [rbx + 0x48]
lea rdx, [rsp + 0x30]
mov rcx, qword [rcx + rsi]
call qword [rbx + 0xe0]
mov eax, dword [rsp + 0x40]
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 + 0x4c]
mov rcx, qword [rbx + 0x28]
mov dword [rdi + rcx], eax
mov eax, dword [rsp + 0x50]
mov rcx, qword [rbx + 0x30]
mov dword [rdi + rcx], eax
mov rax, qword [rbx + 0x50]
mov dword [rdi + rax], 2
mov rax, qword [rbx + 0x78]
test rax, rax
je 0x14003d1ee
mov rcx, qword [rbx + 0x48]
xor edx, edx
mov rcx, qword [rcx + rsi]
lea r8d, [rdx + 1]
call rax
mov r9, qword [rbx + 0x70]
test r9, r9
je 0x14003d20f
mov rax, qword [rbx + 0x50]
xor edx, edx
movsxd rcx, ebp
lea r8, [rax + rcx*4]
mov rcx, qword [rbx + 0x48]
mov rcx, qword [rcx + rsi]
call r9
inc ebp
add rdi, 4
add rsi, 8
cmp ebp, dword [rbx + 8]
jl 0x14003d180
xor edx, edx
cmp dword [rbx + 8], edx
jle 0x14003d247
xor ecx, ecx
nop dword [rax + rax]
mov rax, qword [rbx + 0x38]
lea rcx, [rcx + 4]
inc edx
mov dword [rcx + rax - 4], 0xffffffff
cmp edx, dword [rbx + 8]
jl 0x14003d230
xor ebp, ebp
cmp dword [rbx + 0xc], ebp
jle 0x14003d33d
mov qword [rsp + 0x530], r13
lea r13, [0x140196940]
mov qword [rsp + 0x520], r15
xor r15d, r15d
nop dword [rax]
mov rax, qword [rbx + 0x40]
lea rcx, [rsp + 0x70]
mov edx, ebp
mov dword [r15 + rax], 0xffffffff
call qword [sym.imp.cudart64_91.dll_cudaGetDeviceProperties]
test eax, eax
jne 0x14003d31e
mov edx, dword [rsp + 0x298]
xor esi, esi
mov dword [r15 + r13], edx
cmp dword [rbx + 8], esi
jle 0x14003d31e
xor edi, edi
nop word [rax + rax]
mov rcx, qword [rbx + 0x10]
mov eax, dword [rsp + 0x2a0]
cmp dword [rdi + rcx], eax
jne 0x14003d313
mov rax, qword [rbx + 0x18]
cmp dword [rdi + rax], edx
jne 0x14003d313
mov rcx, qword [rbx + 0x20]
mov eax, dword [rsp + 0x29c]
cmp dword [rdi + rcx], eax
jne 0x14003d313
cmp byte [0x1401965da], 0
je 0x14003d2fd
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.140033bd0
mov rax, qword [rbx + 0x38]
mov dword [rdi + rax], ebp
mov rax, qword [rbx + 0x40]
mov dword [r15 + rax], esi
mov edx, dword [rsp + 0x298]
inc esi
add rdi, 4
cmp esi, dword [rbx + 8]
jl 0x14003d2b0
inc ebp
add r15, 4
cmp ebp, dword [rbx + 0xc]
jl 0x14003d270
mov r15, qword [rsp + 0x520]
mov r13, qword [rsp + 0x530]
mov rsi, qword [rsp + 0x560]
mov rax, rbx
mov rbp, qword [rsp + 0x558]
jmp 0x14003d064
cmp byte [0x1401965da], 0
je 0x14003d36f
lea rdx, str.Failed_to_obtain_required_NVML_function_pointers
mov ecx, 4
call fcn.140033bd0
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 0x14003d074