	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ak8974_selftest
_ak8974_selftest:                       ## @ak8974_selftest
	.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	%rdi, %r15
	movq	8(%rdi), %r14
	movl	(%rdi), %edi
	movq	_AK8974_SELFTEST@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.1:
	movl	-44(%rbp), %eax
	movq	_AK8974_SELFTEST_IDLE@GOTPCREL(%rip), %r13
	cmpl	(%r13), %eax
	jne	LBB0_2
## %bb.3:
	movl	(%r15), %edi
	movq	_AK8974_CTRL3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AK8974_CTRL3_SELFTEST@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_2:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_AK8974_SELFTEST_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	movl	(%r15), %edi
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.6:
	movl	-44(%rbp), %edx
	movq	_AK8974_SELFTEST_OK@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_7
## %bb.10:
	movl	(%r15), %edi
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:
	movl	-44(%rbp), %edx
	cmpl	(%r13), %edx
	jne	LBB0_12
## %bb.13:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_12:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_AK8974_SELFTEST,4,2            ## @AK8974_SELFTEST
	.comm	_AK8974_SELFTEST_IDLE,4,2       ## @AK8974_SELFTEST_IDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"selftest not idle before test\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_AK8974_CTRL3,4,2               ## @AK8974_CTRL3
	.comm	_AK8974_CTRL3_SELFTEST,4,2      ## @AK8974_CTRL3_SELFTEST
L_.str.1:                               ## @.str.1
	.asciz	"could not write CTRL3\n"

	.comm	_AK8974_SELFTEST_DELAY,4,2      ## @AK8974_SELFTEST_DELAY
	.comm	_AK8974_SELFTEST_OK,4,2         ## @AK8974_SELFTEST_OK
L_.str.2:                               ## @.str.2
	.asciz	"selftest result NOT OK (%02x)\n"

L_.str.3:                               ## @.str.3
	.asciz	"selftest not idle after test (%02x)\n"

L_.str.4:                               ## @.str.4
	.asciz	"passed self-test\n"

	.no_dead_strip	_ak8974_selftest
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ak8974_selftest
_ak8974_selftest:                       ; @ak8974_selftest
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x0
	ldr	x19, [x0, #8]
	ldr	w0, [x0]
Lloh0:
	adrp	x22, _AK8974_SELFTEST@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AK8974_SELFTEST@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x23, _AK8974_SELFTEST_IDLE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _AK8974_SELFTEST_IDLE@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.2:
	ldr	w0, [x20]
Lloh4:
	adrp	x8, _AK8974_CTRL3@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AK8974_CTRL3@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _AK8974_CTRL3_SELFTEST@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AK8974_CTRL3_SELFTEST@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	cbz	w0, LBB0_7
; %bb.3:
	mov	x21, x0
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_6
LBB0_4:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	mov	x0, x19
	bl	_dev_err
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
Lloh17:
	adrp	x8, _AK8974_SELFTEST_DELAY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AK8974_SELFTEST_DELAY@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_msleep
	ldr	w0, [x20]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.8:
	ldr	w8, [sp, #12]
Lloh20:
	adrp	x9, _AK8974_SELFTEST_OK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AK8974_SELFTEST_OK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.9:
	ldr	w0, [x20]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.10:
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.11:
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w21, #0
	b	LBB0_6
LBB0_12:
	str	x8, [sp]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_13:
	str	x8, [sp]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_AK8974_SELFTEST,4,2            ; @AK8974_SELFTEST
	.comm	_AK8974_SELFTEST_IDLE,4,2       ; @AK8974_SELFTEST_IDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"selftest not idle before test\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_AK8974_CTRL3,4,2               ; @AK8974_CTRL3
	.comm	_AK8974_CTRL3_SELFTEST,4,2      ; @AK8974_CTRL3_SELFTEST
l_.str.1:                               ; @.str.1
	.asciz	"could not write CTRL3\n"

	.comm	_AK8974_SELFTEST_DELAY,4,2      ; @AK8974_SELFTEST_DELAY
	.comm	_AK8974_SELFTEST_OK,4,2         ; @AK8974_SELFTEST_OK
l_.str.2:                               ; @.str.2
	.asciz	"selftest result NOT OK (%02x)\n"

l_.str.3:                               ; @.str.3
	.asciz	"selftest not idle after test (%02x)\n"

l_.str.4:                               ; @.str.4
	.asciz	"passed self-test\n"

	.no_dead_strip	_ak8974_selftest
.subsections_via_symbols
