	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aic26_reg_write
_aic26_reg_write:                       ## @aic26_reg_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_AIC26_NUM_REGS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jbe	LBB0_1
## %bb.3:
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	(%rdi), %r15
	movq	8(%rdi), %r12
	movl	%esi, %edi
	callq	_AIC26_WRITE_COMMAND_WORD
	movzbl	%ah, %ecx
	movl	%ecx, -64(%rbp)
	movzbl	%al, %eax
	movl	%eax, -60(%rbp)
	movl	%r14d, %eax
	shrl	$8, %eax
	movl	%eax, -56(%rbp)
	movl	%r14d, -52(%rbp)
	movq	(%r12), %rdi
	leaq	-64(%rbp), %rsi
	movl	$4, %edx
	callq	_spi_write
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movl	$1, %edi
	callq	_WARN_ON_ONCE
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%ebx, %eax
	movl	%r14d, (%r15,%rax,4)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AIC26_NUM_REGS,4,2             ## @AIC26_NUM_REGS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AIC26 reg read error\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aic26_reg_write
_aic26_reg_write:                       ; @aic26_reg_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _AIC26_NUM_REGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AIC26_NUM_REGS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ls	LBB0_3
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	ldp	x22, x21, [x0]
	mov	x0, x1
	bl	_AIC26_WRITE_COMMAND_WORD
	ubfx	w8, w0, #8, #8
	and	w9, w0, #0xff
	stp	w8, w9, [sp, #8]
	lsr	w8, w19, #8
	stp	w8, w19, [sp, #16]
	ldr	x0, [x21]
	add	x1, sp, #8
	mov	w2, #4
	bl	_spi_write
	cbz	w0, LBB0_7
; %bb.2:
	ldr	x0, [x21]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
	mov	w0, #1
	bl	_WARN_ON_ONCE
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.6:
	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
	add	sp, sp, #80
	ret
LBB0_7:
	str	w19, [x22, w20, uxtw #2]
	b	LBB0_5
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AIC26_NUM_REGS,4,2             ; @AIC26_NUM_REGS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AIC26 reg read error\n"

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