	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __read_8051_data
___read_8051_data:                      ## @__read_8051_data
	.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
	movl	%esi, %ebx
	movq	_DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_DC_DC8051_CFG_RAM_ACCESS_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%ebx, %edx
	callq	_write_csr
	movl	(%r14), %esi
	movq	_DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_write_csr
	movq	_DC_DC8051_CFG_RAM_ACCESS_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_read_csr
	movq	_DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	jne	LBB0_5
## %bb.1:
	movl	$-1, %ebx
	movq	_DC8051_ACCESS_TIMEOUT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	cmpl	(%r14), %ebx
	jge	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$10, %edi
	callq	_ndelay
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_read_csr
	testl	%eax, (%r13)
	je	LBB0_2
LBB0_5:
	movq	_DC_DC8051_CFG_RAM_ACCESS_RD_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_read_csr
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dd_dev_err
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_CTRL
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK
	.comm	_DC_DC8051_CFG_RAM_ACCESS_STATUS,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_STATUS
	.comm	_DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK
	.comm	_DC8051_ACCESS_TIMEOUT,4,2      ## @DC8051_ACCESS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout reading 8051 data\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_DC_DC8051_CFG_RAM_ACCESS_RD_DATA,4,2 ## @DC_DC8051_CFG_RAM_ACCESS_RD_DATA
	.no_dead_strip	___read_8051_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __read_8051_data
___read_8051_data:                      ; @__read_8051_data
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x8, _DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT@GOTPAGEOFF]
	and	w8, w8, w1
Lloh5:
	ldr	w9, [x9]
	lsl	w21, w8, w9
Lloh6:
	adrp	x22, _DC_DC8051_CFG_RAM_ACCESS_CTRL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _DC_DC8051_CFG_RAM_ACCESS_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x2, x21
	bl	_write_csr
	ldr	w1, [x22]
Lloh8:
	adrp	x8, _DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w2, w8, w21
	mov	x0, x20
	bl	_write_csr
Lloh11:
	adrp	x21, _DC_DC8051_CFG_RAM_ACCESS_STATUS@GOTPAGE
Lloh12:
	ldr	x21, [x21, _DC_DC8051_CFG_RAM_ACCESS_STATUS@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_read_csr
Lloh13:
	adrp	x22, _DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK@GOTPAGE
Lloh14:
	ldr	x22, [x22, _DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK@GOTPAGEOFF]
	ldr	w8, [x22]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.1:
	mov	w23, #-1
Lloh15:
	adrp	x24, _DC8051_ACCESS_TIMEOUT@GOTPAGE
Lloh16:
	ldr	x24, [x24, _DC8051_ACCESS_TIMEOUT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	add	w23, w23, #1
	cmp	w23, w8
	b.ge	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_ndelay
	ldr	w1, [x21]
	mov	x0, x20
	bl	_read_csr
	ldr	w8, [x22]
	tst	w8, w0
	b.eq	LBB0_2
LBB0_4:
Lloh17:
	adrp	x8, _DC_DC8051_CFG_RAM_ACCESS_RD_DATA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DC_DC8051_CFG_RAM_ACCESS_RD_DATA@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_read_csr
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_6
LBB0_5:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dd_dev_err
Lloh22:
	adrp	x8, _ENXIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_MASK
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_CTRL_ADDRESS_SHIFT
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_CTRL
	.comm	_DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_CTRL_READ_ENA_SMASK
	.comm	_DC_DC8051_CFG_RAM_ACCESS_STATUS,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_STATUS
	.comm	_DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_STATUS_ACCESS_COMPLETED_SMASK
	.comm	_DC8051_ACCESS_TIMEOUT,4,2      ; @DC8051_ACCESS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout reading 8051 data\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_DC_DC8051_CFG_RAM_ACCESS_RD_DATA,4,2 ; @DC_DC8051_CFG_RAM_ACCESS_RD_DATA
	.no_dead_strip	___read_8051_data
.subsections_via_symbols
