	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function afe4403_read
_afe4403_read:                          ## @afe4403_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	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	%esi, -64(%rbp)
	movq	_AFE440X_CONTROL0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	$0, -44(%rbp)
	movq	_AFE440X_CONTROL0_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movl	(%rdi), %edi
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	callq	_spi_write_then_read
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movl	(%rbx), %edi
	leaq	-64(%rbp), %rsi
	leaq	-60(%rbp), %rcx
	movl	$1, %edx
	movl	$3, %r8d
	xorl	%eax, %eax
	callq	_spi_write_then_read
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	-60(%rbp), %eax
	movl	-56(%rbp), %ecx
	shll	$16, %eax
	shll	$8, %ecx
	orl	%eax, %ecx
	orl	-52(%rbp), %ecx
	movl	%ecx, (%r14)
	movq	_AFE440X_CONTROL0_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movl	(%rbx), %edi
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	callq	_spi_write_then_read
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AFE440X_CONTROL0,4,2           ## @AFE440X_CONTROL0
	.comm	_AFE440X_CONTROL0_READ,4,2      ## @AFE440X_CONTROL0_READ
	.comm	_AFE440X_CONTROL0_WRITE,4,2     ## @AFE440X_CONTROL0_WRITE
	.no_dead_strip	_afe4403_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function afe4403_read
_afe4403_read:                          ; @afe4403_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	str	w1, [sp, #40]
Lloh3:
	adrp	x8, _AFE440X_CONTROL0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AFE440X_CONTROL0@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	w8, wzr, [x29, #-40]
Lloh6:
	adrp	x8, _AFE440X_CONTROL0_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AFE440X_CONTROL0_READ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	stp	wzr, w8, [x29, #-32]
	ldr	w0, [x0]
	stp	xzr, xzr, [sp, #16]
	mov	w8, #4
	sub	x9, x29, #40
	stp	x9, x8, [sp]
	bl	_spi_write_then_read
	cbnz	w0, LBB0_3
; %bb.1:
	ldr	w0, [x19]
	mov	w8, #3
	add	x9, sp, #44
	stp	x9, x8, [sp, #16]
	mov	w8, #1
	add	x9, sp, #40
	stp	x9, x8, [sp]
	bl	_spi_write_then_read
	cbnz	w0, LBB0_3
; %bb.2:
	ldp	w8, w9, [sp, #44]
	lsl	w9, w9, #8
	orr	w8, w9, w8, lsl #16
	ldr	w9, [sp, #52]
	orr	w8, w8, w9
	str	w8, [x20]
Lloh9:
	adrp	x8, _AFE440X_CONTROL0_WRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AFE440X_CONTROL0_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	stur	w8, [x29, #-28]
	ldr	w0, [x19]
	stp	xzr, xzr, [sp, #16]
	mov	w8, #4
	sub	x9, x29, #40
	stp	x9, x8, [sp]
	bl	_spi_write_then_read
LBB0_3:
	ldur	x8, [x29, #-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_5
; %bb.4:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AFE440X_CONTROL0,4,2           ; @AFE440X_CONTROL0
	.comm	_AFE440X_CONTROL0_READ,4,2      ; @AFE440X_CONTROL0_READ
	.comm	_AFE440X_CONTROL0_WRITE,4,2     ; @AFE440X_CONTROL0_WRITE
	.no_dead_strip	_afe4403_read
.subsections_via_symbols
