	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xc2028_get_afc
_xc2028_get_afc:                        ## @xc2028_get_afc
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %r15
	movl	$0, -36(%rbp)
	movl	$0, -40(%rbp)
	movq	%r15, %rdi
	callq	_check_device_status
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_XREG_LOCK@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_xc2028_get_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_14
## %bb.5:
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_6
LBB0_11:
	cmpl	$2, %eax
	je	LBB0_14
## %bb.12:
	movq	_XREG_FREQ_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_xc2028_get_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_14
## %bb.13:
	imull	$15625, -40(%rbp), %esi         ## imm = 0x3D09
	movl	%esi, (%r14)
	leaq	L_.str(%rip), %rdi
	callq	_tuner_dbg
	jmp	LBB0_14
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_3:
	movl	$0, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_6:
	movl	$6, %edi
	callq	_msleep
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_xc2028_get_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_14
## %bb.7:
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	LBB0_11
## %bb.8:
	movl	$6, %edi
	callq	_msleep
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_xc2028_get_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_14
## %bb.9:
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movl	$6, %edi
	callq	_msleep
	movl	-36(%rbp), %eax
	jmp	LBB0_11
LBB0_14:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_15:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XREG_LOCK,4,2                  ## @XREG_LOCK
	.comm	_XREG_FREQ_ERROR,4,2            ## @XREG_FREQ_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AFC is %d Hz\n"

	.no_dead_strip	_xc2028_get_afc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xc2028_get_afc
_xc2028_get_afc:                        ; @xc2028_get_afc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	ldr	x19, [x0]
	str	xzr, [sp, #8]
	mov	x0, x19
	bl	_check_device_status
	mov	x21, x0
	tbnz	w0, #31, LBB0_14
; %bb.1:
	cbz	w21, LBB0_7
; %bb.2:
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x22, _XREG_LOCK@GOTPAGE
Lloh1:
	ldr	x22, [x22, _XREG_LOCK@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_xc2028_get_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.3:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_8
LBB0_4:
	cmp	w8, #2
	b.eq	LBB0_13
; %bb.5:
Lloh2:
	adrp	x8, _XREG_FREQ_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XREG_FREQ_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_xc2028_get_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.6:
	ldr	w8, [sp, #8]
	mov	w9, #15625
	mul	w1, w8, w9
	str	w1, [x20]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_tuner_dbg
	b	LBB0_13
LBB0_7:
	str	wzr, [x20]
	b	LBB0_14
LBB0_8:
	mov	w0, #6
	bl	_msleep
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_xc2028_get_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.9:
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_4
; %bb.10:
	mov	w0, #6
	bl	_msleep
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_xc2028_get_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.11:
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_4
; %bb.12:
	mov	w0, #6
	bl	_msleep
	ldr	w8, [sp, #12]
	b	LBB0_4
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_14:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_XREG_LOCK,4,2                  ; @XREG_LOCK
	.comm	_XREG_FREQ_ERROR,4,2            ; @XREG_FREQ_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AFC is %d Hz\n"

	.no_dead_strip	_xc2028_get_afc
.subsections_via_symbols
