	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hm_get_corespeed_with_devices_idx ## -- Begin function hm_get_corespeed_with_devices_idx
	.p2align	4, 0x90
_hm_get_corespeed_with_devices_idx:     ## @hm_get_corespeed_with_devices_idx
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rbx
	movl	$-1, %r14d
	cmpl	$0, (%rbx)
	je	LBB0_18
## %bb.1:
	movq	8(%rbx), %rax
	movslq	%esi, %rcx
	leaq	(%rcx,%rcx,2), %r15
	cmpl	$0, (%rax,%r15,4)
	je	LBB0_18
## %bb.2:
	movq	(%rdi), %rcx
	movq	(%rcx), %rcx
	cmpl	$1, (%rcx,%r15,8)
	jne	LBB0_6
## %bb.3:
	cmpq	$0, 16(%rbx)
	je	LBB0_6
LBB0_4:
	movl	4(%rax,%r15,4), %esi
	movq	_NVML_CLOCK_SM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-32(%rbp), %rcx
	callq	_hm_NVML_nvmlDeviceGetClockInfo
	cmpl	$-1, %eax
	je	LBB0_17
LBB0_5:
	movl	-32(%rbp), %r14d
	jmp	LBB0_18
LBB0_6:
	cmpl	$1, 4(%rcx,%r15,8)
	jne	LBB0_19
## %bb.7:
	movq	_CL_DEVICE_TYPE_GPU@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 8(%rcx,%r15,8)
	je	LBB0_18
## %bb.8:
	movq	16(%rcx,%r15,8), %rcx
	movq	_VENDOR_ID_AMD@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_14
## %bb.9:
	cmpq	$0, 32(%rbx)
	je	LBB0_12
## %bb.10:
	movl	$8, -32(%rbp)
	movl	8(%rax,%r15,4), %esi
	leaq	-32(%rbp), %rdx
	callq	_hm_ADL_Overdrive_CurrentActivity_Get
	cmpl	$-1, %eax
	je	LBB0_17
## %bb.11:
	movslq	-28(%rbp), %rax
	imulq	$1374389535, %rax, %r14         ## imm = 0x51EB851F
	movq	%r14, %rax
	shrq	$63, %rax
	sarq	$37, %r14
	addl	%eax, %r14d
	jmp	LBB0_18
LBB0_12:
	cmpq	$0, 24(%rbx)
	je	LBB0_14
## %bb.13:
	leaq	-32(%rbp), %rdx
	callq	_hm_SYSFS_get_pp_dpm_sclk
	cmpl	$-1, %eax
	jne	LBB0_5
LBB0_17:
	movq	8(%rbx), %rax
	movl	$0, (%rax,%r15,4)
	jmp	LBB0_18
LBB0_14:
	movq	_VENDOR_ID_NV@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_19
## %bb.15:
	cmpq	$0, 16(%rbx)
	jne	LBB0_4
LBB0_19:
	leaq	(%rax,%r15,4), %rax
	movl	$0, (%rax)
LBB0_18:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVML_CLOCK_SM,4,2              ## @NVML_CLOCK_SM
	.comm	_CL_DEVICE_TYPE_GPU,4,2         ## @CL_DEVICE_TYPE_GPU
	.comm	_VENDOR_ID_AMD,8,3              ## @VENDOR_ID_AMD
	.comm	_VENDOR_ID_NV,8,3               ## @VENDOR_ID_NV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hm_get_corespeed_with_devices_idx ; -- Begin function hm_get_corespeed_with_devices_idx
	.p2align	2
_hm_get_corespeed_with_devices_idx:     ; @hm_get_corespeed_with_devices_idx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x19, [x0, #8]
	ldr	w8, [x19]
	cbz	w8, LBB0_18
; %bb.1:
	ldr	x8, [x19, #8]
	mov	w9, #12
	smaddl	x9, w1, w9, x8
	ldr	w10, [x9]
	cbz	w10, LBB0_18
; %bb.2:
	ldr	x10, [x0]
	sxtw	x20, w1
	ldr	x10, [x10]
	mov	w11, #24
	mul	x11, x20, x11
	ldr	w11, [x10, x11]
	cmp	w11, #1
	b.ne	LBB0_6
; %bb.3:
	ldr	x11, [x19, #16]
	cbz	x11, LBB0_6
LBB0_4:
	mov	w9, #12
	madd	x8, x20, x9, x8
	ldr	w1, [x8, #4]
Lloh0:
	adrp	x8, _NVML_CLOCK_SM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVML_CLOCK_SM@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #8
	bl	_hm_NVML_nvmlDeviceGetClockInfo
	cmn	w0, #1
	b.eq	LBB0_14
LBB0_5:
	ldr	w0, [sp, #8]
	b	LBB0_19
LBB0_6:
	mov	w11, #24
	madd	x11, x20, x11, x10
	ldr	w11, [x11, #4]
	cmp	w11, #1
	b.ne	LBB0_17
; %bb.7:
	mov	w11, #24
	madd	x11, x20, x11, x10
	ldr	w11, [x11, #8]
Lloh3:
	adrp	x12, _CL_DEVICE_TYPE_GPU@GOTPAGE
Lloh4:
	ldr	x12, [x12, _CL_DEVICE_TYPE_GPU@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x12]
	tst	w12, w11
	b.eq	LBB0_18
; %bb.8:
	mov	w11, #24
	madd	x10, x20, x11, x10
	ldr	x10, [x10, #16]
Lloh6:
	adrp	x11, _VENDOR_ID_AMD@GOTPAGE
Lloh7:
	ldr	x11, [x11, _VENDOR_ID_AMD@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_15
; %bb.9:
	ldr	x11, [x19, #32]
	cbz	x11, LBB0_12
; %bb.10:
	mov	w9, #8
	str	w9, [sp, #8]
	mov	w9, #12
	madd	x8, x20, x9, x8
	ldr	w1, [x8, #8]
	add	x2, sp, #8
	bl	_hm_ADL_Overdrive_CurrentActivity_Get
	cmn	w0, #1
	b.eq	LBB0_14
; %bb.11:
	ldrsw	x8, [sp, #12]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w0, w8, w9
	b	LBB0_19
LBB0_12:
	ldr	x11, [x19, #24]
	cbz	x11, LBB0_15
; %bb.13:
	add	x2, sp, #8
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_hm_SYSFS_get_pp_dpm_sclk
	cmn	w0, #1
	b.ne	LBB0_5
LBB0_14:
	ldr	x8, [x19, #8]
	mov	w9, #12
	mul	x9, x20, x9
	str	wzr, [x8, x9]
	b	LBB0_19
LBB0_15:
Lloh9:
	adrp	x11, _VENDOR_ID_NV@GOTPAGE
Lloh10:
	ldr	x11, [x11, _VENDOR_ID_NV@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_17
; %bb.16:
	ldr	x10, [x19, #16]
	cbnz	x10, LBB0_4
LBB0_17:
	str	wzr, [x9]
LBB0_18:
	mov	w0, #-1
LBB0_19:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NVML_CLOCK_SM,4,2              ; @NVML_CLOCK_SM
	.comm	_CL_DEVICE_TYPE_GPU,4,2         ; @CL_DEVICE_TYPE_GPU
	.comm	_VENDOR_ID_AMD,8,3              ; @VENDOR_ID_AMD
	.comm	_VENDOR_ID_NV,8,3               ; @VENDOR_ID_NV
.subsections_via_symbols
