	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hm_get_threshold_slowdown_with_devices_idx ## -- Begin function hm_get_threshold_slowdown_with_devices_idx
	.p2align	4, 0x90
_hm_get_threshold_slowdown_with_devices_idx: ## @hm_get_threshold_slowdown_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), %r15
	movl	$-1, %r14d
	cmpl	$0, (%r15)
	je	LBB0_17
## %bb.1:
	movq	8(%r15), %rax
	movslq	%esi, %rdx
	movq	%rdx, %rbx
	shlq	$4, %rbx
	cmpl	$0, (%rax,%rbx)
	je	LBB0_17
## %bb.2:
	movq	(%rdi), %rcx
	movq	(%rcx), %rcx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	$1, (%rcx,%rdx,8)
	jne	LBB0_6
## %bb.3:
	cmpq	$0, 16(%r15)
	je	LBB0_6
LBB0_4:
	movl	$0, -28(%rbp)
	movl	8(%rax,%rbx), %esi
	movq	_NVML_TEMPERATURE_THRESHOLD_SLOWDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rcx
	callq	_hm_NVML_nvmlDeviceGetTemperatureThreshold
	cmpl	$-1, %eax
	je	LBB0_16
## %bb.5:
	movl	-28(%rbp), %r14d
	jmp	LBB0_17
LBB0_6:
	cmpl	$1, 4(%rcx,%rdx,8)
	jne	LBB0_18
## %bb.7:
	movq	_CL_DEVICE_TYPE_GPU@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, 8(%rcx,%rdx,8)
	je	LBB0_17
## %bb.8:
	movq	16(%rcx,%rdx,8), %rcx
	movq	_VENDOR_ID_AMD@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_13
## %bb.9:
	cmpq	$0, 24(%r15)
	je	LBB0_13
## %bb.10:
	cmpl	$6, 4(%rax,%rbx)
	jne	LBB0_13
## %bb.11:
	movl	$0, -28(%rbp)
	movl	$0, -32(%rbp)
	movl	12(%rax,%rbx), %esi
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rcx
	callq	_hm_ADL_Overdrive6_TargetTemperatureData_Get
	cmpl	$-1, %eax
	je	LBB0_16
## %bb.12:
	movl	-32(%rbp), %r14d
	jmp	LBB0_17
LBB0_13:
	movq	_VENDOR_ID_NV@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_18
## %bb.14:
	cmpq	$0, 16(%r15)
	jne	LBB0_4
LBB0_18:
	addq	%rbx, %rax
	movl	$0, (%rax)
	jmp	LBB0_17
LBB0_16:
	movq	8(%r15), %rax
	movl	$0, (%rax,%rbx)
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVML_TEMPERATURE_THRESHOLD_SLOWDOWN,4,2 ## @NVML_TEMPERATURE_THRESHOLD_SLOWDOWN
	.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_threshold_slowdown_with_devices_idx ; -- Begin function hm_get_threshold_slowdown_with_devices_idx
	.p2align	2
_hm_get_threshold_slowdown_with_devices_idx: ; @hm_get_threshold_slowdown_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_16
; %bb.1:
	ldr	x8, [x19, #8]
	add	x9, x8, w1, sxtw #4
	ldr	w10, [x9]
	cbz	w10, LBB0_16
; %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:
	str	wzr, [sp, #12]
	add	x8, x8, x20, lsl #4
	ldr	w1, [x8, #8]
Lloh0:
	adrp	x8, _NVML_TEMPERATURE_THRESHOLD_SLOWDOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVML_TEMPERATURE_THRESHOLD_SLOWDOWN@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x3, sp, #12
	bl	_hm_NVML_nvmlDeviceGetTemperatureThreshold
	cmn	w0, #1
	b.eq	LBB0_18
; %bb.5:
	ldr	w0, [sp, #12]
	b	LBB0_17
LBB0_6:
	mov	w11, #24
	madd	x11, x20, x11, x10
	ldr	w11, [x11, #4]
	cmp	w11, #1
	b.ne	LBB0_15
; %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_16
; %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_13
; %bb.9:
	ldr	x11, [x19, #24]
	cbz	x11, LBB0_13
; %bb.10:
	add	x11, x8, x20, lsl #4
	ldr	w12, [x11, #4]
	cmp	w12, #6
	b.ne	LBB0_13
; %bb.11:
	str	xzr, [sp, #8]
	ldr	w1, [x11, #12]
	add	x2, sp, #12
	add	x3, sp, #8
	bl	_hm_ADL_Overdrive6_TargetTemperatureData_Get
	cmn	w0, #1
	b.eq	LBB0_18
; %bb.12:
	ldr	w0, [sp, #8]
	b	LBB0_17
LBB0_13:
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_15
; %bb.14:
	ldr	x10, [x19, #16]
	cbnz	x10, LBB0_4
LBB0_15:
	str	wzr, [x9]
LBB0_16:
	mov	w0, #-1
LBB0_17:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_18:
	ldr	x8, [x19, #8]
	lsl	x9, x20, #4
	str	wzr, [x8, x9]
	b	LBB0_17
	.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_TEMPERATURE_THRESHOLD_SLOWDOWN,4,2 ; @NVML_TEMPERATURE_THRESHOLD_SLOWDOWN
	.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
