	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fcu_fan_get_pwm
_fcu_fan_get_pwm:                       ## @fcu_fan_get_pwm
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	callq	_device_get_softc
	movq	%rax, %r12
	movq	(%r13), %rdx
	movq	_FCU_FAN_PWM@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_16
## %bb.1:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	_FCU_PWM_AVAILABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %esi
	movl	4(%r12), %edi
	leaq	-64(%rbp), %rcx
	callq	_fcu_read_1
	movl	$-1, %r15d
	testq	%rax, %rax
	js	LBB0_14
## %bb.2:
	movl	-64(%rbp), %eax
	movl	8(%r13), %edx
	btl	%edx, %eax
	jae	LBB0_3
## %bb.5:
	movq	_FCU_PWM_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %esi
	movl	4(%r12), %edi
	leaq	-60(%rbp), %rcx
	callq	_fcu_read_1
	testq	%rax, %rax
	js	LBB0_14
## %bb.6:
	movl	-60(%rbp), %eax
	movl	8(%r13), %edx
	btl	%edx, %eax
	jae	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_16:
	leaq	L_.str.3(%rip), %rsi
	movl	%r14d, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_device_printf
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_14
LBB0_3:
	leaq	L_.str(%rip), %rsi
LBB0_4:
	movl	%r14d, %edi
	callq	_device_printf
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.15:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_FCU_PWM_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %esi
	movl	4(%r12), %edi
	leaq	-68(%rbp), %rcx
	callq	_fcu_read_1
	testq	%rax, %rax
	js	LBB0_14
## %bb.9:
	movl	-68(%rbp), %eax
	movl	8(%r13), %edx
	btl	%edx, %eax
	jae	LBB0_10
## %bb.11:
	movl	%edx, %edi
	callq	_FCU_PWM_SGET
	movl	(%r12), %esi
	movl	4(%r12), %edi
	leaq	-56(%rbp), %rcx
	movl	%eax, %edx
	callq	_fcu_read_1
	testq	%rax, %rax
	js	LBB0_14
## %bb.12:
	imull	$1000, -56(%rbp), %eax          ## imm = 0x3E8
	cltq
	imulq	$-845519051, %rax, %rcx         ## imm = 0xCD9A6735
	shrq	$32, %rcx
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$11, %eax
	addl	%ecx, %eax
	movl	%eax, (%rbx)
	movl	8(%r13), %edi
	callq	_FCU_PWM_RPM
	movl	(%r12), %esi
	movl	4(%r12), %edi
	leaq	-56(%rbp), %rcx
	movl	%eax, %edx
	callq	_fcu_read_1
	testq	%rax, %rax
	js	LBB0_14
## %bb.13:
	movq	_fcu_rpm_shift@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	$8, %cl
	subb	%al, %cl
	movl	-56(%rbp), %edx
	shll	%cl, %edx
	movl	-52(%rbp), %esi
	movl	%eax, %ecx
	sarl	%cl, %esi
	orl	%edx, %esi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%esi, (%rax)
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_4
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FCU_FAN_PWM,8,3                ## @FCU_FAN_PWM
	.comm	_FCU_PWM_AVAILABLE,4,2          ## @FCU_PWM_AVAILABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PWM Fan not available ID: %d\n"

	.comm	_FCU_PWM_FAIL,4,2               ## @FCU_PWM_FAIL
L_.str.1:                               ## @.str.1
	.asciz	"PWM Fan failed ID: %d\n"

	.comm	_FCU_PWM_ACTIVE,4,2             ## @FCU_PWM_ACTIVE
L_.str.2:                               ## @.str.2
	.asciz	"PWM Fan not active ID: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Unknown fan type: %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_fcu_rpm_shift,4,2              ## @fcu_rpm_shift
	.no_dead_strip	_fcu_fan_get_pwm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fcu_fan_get_pwm
_fcu_fan_get_pwm:                       ; @fcu_fan_get_pwm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	str	xzr, [sp, #8]
	str	wzr, [sp, #4]
	bl	_device_get_softc
	ldr	x2, [x20]
Lloh3:
	adrp	x8, _FCU_FAN_PWM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FCU_FAN_PWM@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x2, x8
	b.ne	LBB0_6
; %bb.1:
	mov	x22, x0
Lloh6:
	adrp	x8, _FCU_PWM_AVAILABLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FCU_PWM_AVAILABLE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	ldr	w0, [x0, #4]
	ldr	w1, [x22]
	add	x3, sp, #8
	bl	_fcu_read_1
	tbnz	x0, #63, LBB0_9
; %bb.2:
	ldr	w8, [sp, #8]
	ldr	w2, [x20, #8]
	lsr	w8, w8, w2
	tbz	w8, #0, LBB0_7
; %bb.3:
Lloh9:
	adrp	x8, _FCU_PWM_FAIL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FCU_PWM_FAIL@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	ldp	w1, w0, [x22]
	add	x3, sp, #4
	bl	_fcu_read_1
	tbnz	x0, #63, LBB0_9
; %bb.4:
	ldr	w8, [sp, #4]
	ldr	w2, [x20, #8]
	lsr	w8, w8, w2
	tbz	w8, #0, LBB0_12
; %bb.5:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_device_printf
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_7:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
LBB0_8:
	mov	x0, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_device_printf
LBB0_9:
	mov	w0, #-1
LBB0_10:
	ldr	x8, [sp, #24]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_12:
Lloh24:
	adrp	x8, _FCU_PWM_ACTIVE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _FCU_PWM_ACTIVE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	ldp	w1, w0, [x22]
	add	x3, sp, #12
	bl	_fcu_read_1
	tbnz	x0, #63, LBB0_9
; %bb.13:
	ldr	w8, [sp, #12]
	ldr	w2, [x20, #8]
	lsr	w8, w8, w2
	tbz	w8, #0, LBB0_17
; %bb.14:
	mov	x0, x2
	bl	_FCU_PWM_SGET
	mov	x2, x0
	ldp	w1, w0, [x22]
	add	x3, sp, #16
	bl	_fcu_read_1
	tbnz	x0, #63, LBB0_9
; %bb.15:
	ldr	w8, [sp, #16]
	mov	w9, #1000
	mul	w8, w8, w9
	mov	w9, #26421
	movk	w9, #52634, lsl #16
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #11
	add	w8, w9, w8, lsr #31
	str	w8, [x21]
	ldr	w0, [x20, #8]
	bl	_FCU_PWM_RPM
	mov	x2, x0
	ldp	w1, w0, [x22]
	add	x3, sp, #16
	bl	_fcu_read_1
	tbnz	x0, #63, LBB0_9
; %bb.16:
	mov	w0, #0
Lloh27:
	adrp	x8, _fcu_rpm_shift@GOTPAGE
Lloh28:
	ldr	x8, [x8, _fcu_rpm_shift@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	mov	w9, #8
	sub	w9, w9, w8
	ldp	w10, w11, [sp, #16]
	lsl	w9, w10, w9
	asr	w8, w11, w8
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_10
LBB0_17:
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_FCU_FAN_PWM,8,3                ; @FCU_FAN_PWM
	.comm	_FCU_PWM_AVAILABLE,4,2          ; @FCU_PWM_AVAILABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PWM Fan not available ID: %d\n"

	.comm	_FCU_PWM_FAIL,4,2               ; @FCU_PWM_FAIL
l_.str.1:                               ; @.str.1
	.asciz	"PWM Fan failed ID: %d\n"

	.comm	_FCU_PWM_ACTIVE,4,2             ; @FCU_PWM_ACTIVE
l_.str.2:                               ; @.str.2
	.asciz	"PWM Fan not active ID: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Unknown fan type: %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_fcu_rpm_shift,4,2              ; @fcu_rpm_shift
	.no_dead_strip	_fcu_fan_get_pwm
.subsections_via_symbols
