	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ak4104_spi_write
_ak4104_spi_write:                      ## @ak4104_spi_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	cmpl	%esi, 8(%rdi)
	jbe	LBB0_1
## %bb.2:
	movl	%edx, %r14d
	movq	(%rdi), %r12
	movq	_AK4104_REG_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %esi
	movq	_AK4104_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	orq	%rsi, %r13
	xorl	%ebx, %ebx
	cmpl	%edx, (%r12,%r13,4)
	je	LBB0_7
## %bb.3:
	movq	16(%rdi), %r15
	movl	%r13d, -56(%rbp)
	movl	%r14d, -52(%rbp)
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_spi_write
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%r14d, (%r12,%r13,4)
	jmp	LBB0_7
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AK4104_REG_MASK,4,2            ## @AK4104_REG_MASK
	.comm	_AK4104_WRITE,4,2               ## @AK4104_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SPI write failed\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ak4104_spi_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ak4104_spi_write
_ak4104_spi_write:                      ; @ak4104_spi_write
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	w8, [x0, #8]
	cmp	w8, w1
	b.ls	LBB0_3
; %bb.1:
	mov	x19, x2
	ldr	x21, [x0]
Lloh3:
	adrp	x8, _AK4104_REG_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AK4104_REG_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, w1
Lloh6:
	adrp	x10, _AK4104_WRITE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _AK4104_WRITE@GOTPAGEOFF]
	and	x8, x8, x9
Lloh8:
	ldr	w9, [x10]
	orr	x22, x8, x9
	ldr	w8, [x21, x22, lsl #2]
	cmp	w8, w2
	b.ne	LBB0_4
; %bb.2:
	mov	w0, #0
	b	LBB0_7
LBB0_3:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	x20, [x0, #16]
	stp	w22, w19, [sp]
	mov	x1, sp
	mov	x0, x20
	mov	w2, #8
	bl	_spi_write
	cbz	x0, LBB0_9
; %bb.5:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldr	x8, [sp, #8]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.8:
	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
LBB0_9:
	str	w19, [x21, x22, lsl #2]
	b	LBB0_7
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AK4104_REG_MASK,4,2            ; @AK4104_REG_MASK
	.comm	_AK4104_WRITE,4,2               ; @AK4104_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SPI write failed\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ak4104_spi_write
.subsections_via_symbols
