	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aic26_reg_read
_aic26_reg_read:                        ## @aic26_reg_read
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_AIC26_NUM_REGS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jbe	LBB0_1
## %bb.2:
	movl	%esi, %ebx
	movq	(%rdi), %r14
	movq	8(%rdi), %r15
	movl	%esi, %edi
	callq	_AIC26_READ_COMMAND_WORD
	movzbl	%ah, %ecx
	movl	%ecx, -40(%rbp)
	movzbl	%al, %eax
	movl	%eax, -36(%rbp)
	movq	(%r15), %rdi
	leaq	-40(%rbp), %rcx
	movq	%rcx, %rsi
	movl	$2, %edx
	movl	$2, %r8d
	callq	_spi_write_then_read
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_1:
	movl	$1, %edi
	callq	_WARN_ON_ONCE
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movl	-40(%rbp), %eax
	shll	$8, %eax
	orl	-36(%rbp), %eax
	movl	%ebx, %ecx
	movl	%eax, (%r14,%rcx,4)
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_7
## %bb.6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AIC26_NUM_REGS,4,2             ## @AIC26_NUM_REGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AIC26 reg read error\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aic26_reg_read
_aic26_reg_read:                        ; @aic26_reg_read
	.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]
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, x1
	ldp	x20, x21, [x0]
	mov	x0, x1
	bl	_AIC26_READ_COMMAND_WORD
	ubfx	w8, w0, #8, #8
	and	w9, w0, #0xff
	stp	w8, w9, [sp]
	ldr	x0, [x21]
	mov	x1, sp
	mov	x3, sp
	mov	w2, #2
	mov	w4, #2
	bl	_spi_write_then_read
	cbz	w0, LBB0_4
; %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]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
	mov	w0, #1
	bl	_WARN_ON_ONCE
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	ldp	w8, w9, [sp]
	orr	w0, w9, w8, lsl #8
	str	w0, [x20, w19, uxtw #2]
LBB0_5:
	ldr	x8, [sp, #8]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	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_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AIC26_NUM_REGS,4,2             ; @AIC26_NUM_REGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AIC26 reg read error\n"

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