	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_fan_auto_nearest
_get_fan_auto_nearest:                  ## @get_fan_auto_nearest
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %r13
	movq	%rcx, %rdi
	callq	_FAN_CHAN_FROM_REG
	xorl	%ecx, %ecx
	testl	%r12d, %r12d
	sete	%dl
	testq	%r15, %r15
	je	LBB0_23
## %bb.1:
	movq	(%r13,%rax,8), %rax
	movb	%dl, %cl
	movq	(%rax,%rcx,8), %r8
	movq	(%rbx), %rax
	movq	(%rax), %r9
	movslq	%r12d, %rsi
	movq	(%r9), %rdx
	movq	(%rdx,%rsi,8), %rax
	cmpq	%r15, %rax
	jne	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	cmpq	%r8, (%rdx,%rcx,8)
	je	LBB0_20
LBB0_3:
	xorl	%ebx, %ebx
	cmpq	%r15, %rax
	setne	%bl
	negl	%ebx
	movq	8(%r9), %rax
	cmpq	%r15, (%rax,%rsi,8)
	jne	LBB0_6
## %bb.4:
	movl	$1, %edi
	cmpq	%r8, (%rax,%rcx,8)
	je	LBB0_20
## %bb.5:
	andl	$1, %ebx
LBB0_6:
	movq	16(%r9), %rax
	movq	(%rax,%rsi,8), %rdx
	cmpq	%r15, %rdx
	jne	LBB0_8
## %bb.7:
	movl	$2, %edi
	cmpq	%r8, (%rax,%rcx,8)
	je	LBB0_20
LBB0_8:
	cmpl	$-1, %ebx
	movl	$2, %eax
	cmovnel	%ebx, %eax
	cmpq	%r15, %rdx
	cmovnel	%ebx, %eax
	movq	24(%r9), %rbx
	movq	(%rbx,%rsi,8), %rdx
	cmpq	%r15, %rdx
	jne	LBB0_10
## %bb.9:
	movl	$3, %edi
	cmpq	%r8, (%rbx,%rcx,8)
	je	LBB0_20
LBB0_10:
	cmpl	$-1, %eax
	movl	$3, %ebx
	cmovnel	%eax, %ebx
	cmpq	%r15, %rdx
	cmovnel	%eax, %ebx
	movq	32(%r9), %rax
	movq	(%rax,%rsi,8), %rdx
	cmpq	%r15, %rdx
	jne	LBB0_12
## %bb.11:
	movl	$4, %edi
	cmpq	%r8, (%rax,%rcx,8)
	je	LBB0_20
LBB0_12:
	cmpl	$-1, %ebx
	movl	$4, %eax
	cmovnel	%ebx, %eax
	cmpq	%r15, %rdx
	cmovnel	%ebx, %eax
	movq	40(%r9), %rbx
	movq	(%rbx,%rsi,8), %rdx
	cmpq	%r15, %rdx
	jne	LBB0_14
## %bb.13:
	movl	$5, %edi
	cmpq	%r8, (%rbx,%rcx,8)
	je	LBB0_20
LBB0_14:
	cmpl	$-1, %eax
	movl	$5, %ebx
	cmovnel	%eax, %ebx
	cmpq	%r15, %rdx
	cmovnel	%eax, %ebx
	movq	48(%r9), %rax
	movq	(%rax,%rsi,8), %rdx
	cmpq	%r15, %rdx
	jne	LBB0_16
## %bb.15:
	movl	$6, %edi
	cmpq	%r8, (%rax,%rcx,8)
	je	LBB0_20
LBB0_16:
	cmpl	$-1, %ebx
	movl	$6, %eax
	cmovnel	%ebx, %eax
	cmpq	%r15, %rdx
	cmovnel	%ebx, %eax
	movq	56(%r9), %rbx
	movq	(%rbx,%rsi,8), %rdx
	cmpq	%r15, %rdx
	jne	LBB0_18
## %bb.17:
	movl	$7, %edi
	cmpq	%r8, (%rbx,%rcx,8)
	je	LBB0_20
LBB0_18:
	cmpl	$-1, %eax
	movl	$7, %edi
	cmovnel	%eax, %edi
	cmpq	%r15, %rdx
	cmovnel	%eax, %edi
	testl	%edi, %edi
	js	LBB0_19
LBB0_20:
	movl	%edi, %eax
	movq	%rax, (%r14)
	jmp	LBB0_21
LBB0_23:
	movq	$0, (%r14)
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_get_fan_auto_nearest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_fan_auto_nearest
_get_fan_auto_nearest:                  ; @get_fan_auto_nearest
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x4
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x8, [x0]
	ldr	x23, [x8]
	mov	x0, x3
	bl	_FAN_CHAN_FROM_REG
	cmp	w21, #0
	cset	w8, eq
	cbz	x20, LBB0_7
; %bb.1:
	ldr	x9, [x23, x0, lsl #3]
	ldr	x9, [x9, w8, uxtw #3]
	ldr	x10, [x22]
	ldr	x10, [x10]
	ldr	x11, [x10]
	ldr	x12, [x11, w21, sxtw #3]
	cmp	x12, x20
	b.ne	LBB0_4
; %bb.2:
	ldr	x11, [x11, x8, lsl #3]
	cmp	x11, x9
	b.ne	LBB0_4
; %bb.3:
	mov	w8, #0
	b	LBB0_28
LBB0_4:
	sxtw	x11, w21
	cmp	x12, x20
	csetm	w12, ne
	ldr	x13, [x10, #8]
	ldr	x14, [x13, x11, lsl #3]
	cmp	x14, x20
	b.ne	LBB0_9
; %bb.5:
	ldr	x13, [x13, x8, lsl #3]
	cmp	x13, x9
	b.ne	LBB0_8
; %bb.6:
	mov	w8, #1
	b	LBB0_28
LBB0_7:
	mov	w0, #0
	str	xzr, [x19]
	b	LBB0_29
LBB0_8:
	and	w12, w12, #0x1
LBB0_9:
	ldr	x14, [x10, #16]
	ldr	x13, [x14, x11, lsl #3]
	cmp	x13, x20
	b.ne	LBB0_12
; %bb.10:
	ldr	x14, [x14, x8, lsl #3]
	cmp	x14, x9
	b.ne	LBB0_12
; %bb.11:
	mov	w8, #2
	b	LBB0_28
LBB0_12:
	cmn	w12, #1
	ccmp	x13, x20, #0, eq
	mov	w13, #2
	csel	w12, w13, w12, eq
	ldr	x14, [x10, #24]
	ldr	x13, [x14, x11, lsl #3]
	cmp	x13, x20
	b.ne	LBB0_15
; %bb.13:
	ldr	x14, [x14, x8, lsl #3]
	cmp	x14, x9
	b.ne	LBB0_15
; %bb.14:
	mov	w8, #3
	b	LBB0_28
LBB0_15:
	cmn	w12, #1
	ccmp	x13, x20, #0, eq
	mov	w13, #3
	csel	w12, w13, w12, eq
	ldr	x14, [x10, #32]
	ldr	x13, [x14, x11, lsl #3]
	cmp	x13, x20
	b.ne	LBB0_18
; %bb.16:
	ldr	x14, [x14, x8, lsl #3]
	cmp	x14, x9
	b.ne	LBB0_18
; %bb.17:
	mov	w8, #4
	b	LBB0_28
LBB0_18:
	cmn	w12, #1
	ccmp	x13, x20, #0, eq
	mov	w13, #4
	csel	w12, w13, w12, eq
	ldr	x14, [x10, #40]
	ldr	x13, [x14, x11, lsl #3]
	cmp	x13, x20
	b.ne	LBB0_21
; %bb.19:
	ldr	x14, [x14, x8, lsl #3]
	cmp	x14, x9
	b.ne	LBB0_21
; %bb.20:
	mov	w8, #5
	b	LBB0_28
LBB0_21:
	cmn	w12, #1
	ccmp	x13, x20, #0, eq
	mov	w13, #5
	csel	w12, w13, w12, eq
	ldr	x14, [x10, #48]
	ldr	x13, [x14, x11, lsl #3]
	cmp	x13, x20
	b.ne	LBB0_24
; %bb.22:
	ldr	x14, [x14, x8, lsl #3]
	cmp	x14, x9
	b.ne	LBB0_24
; %bb.23:
	mov	w8, #6
	b	LBB0_28
LBB0_24:
	cmn	w12, #1
	ccmp	x13, x20, #0, eq
	mov	w13, #6
	csel	w12, w13, w12, eq
	ldr	x13, [x10, #56]
	ldr	x10, [x13, x11, lsl #3]
	cmp	x10, x20
	b.ne	LBB0_27
; %bb.25:
	ldr	x8, [x13, x8, lsl #3]
	cmp	x8, x9
	b.ne	LBB0_27
; %bb.26:
	mov	w8, #7
	b	LBB0_28
LBB0_27:
	cmn	w12, #1
	ccmp	x10, x20, #0, eq
	mov	w8, #7
	csel	w8, w8, w12, eq
	tbnz	w8, #31, LBB0_30
LBB0_28:
	mov	w0, #0
	mov	w8, w8
	str	x8, [x19]
LBB0_29:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_30:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_29
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_get_fan_auto_nearest
.subsections_via_symbols
