	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_lcb_via_8051
_read_lcb_via_8051:                     ## @read_lcb_via_8051
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	_ICODE_FUNCTIONAL_SIMULATOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	xorl	%r15d, %r15d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_acquire_lcb_access
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_DC_LCB_CFG_RUN@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	sarl	$3, %ebx
	movq	_HCMD_READ_LCB_CSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	movq	%r14, %rcx
	callq	_do_8051_command
	movq	_HCMD_SUCCESS@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpl	(%rcx), %eax
	je	LBB0_7
## %bb.5:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_6:
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_2:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_read_csr
	movl	%eax, (%r14)
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_release_lcb_access
LBB0_7:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ICODE_FUNCTIONAL_SIMULATOR,8,3 ## @ICODE_FUNCTIONAL_SIMULATOR
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_DC_LCB_CFG_RUN,4,2             ## @DC_LCB_CFG_RUN
	.comm	_HCMD_READ_LCB_CSR,4,2          ## @HCMD_READ_LCB_CSR
	.comm	_HCMD_SUCCESS,4,2               ## @HCMD_SUCCESS
	.no_dead_strip	_read_lcb_via_8051
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_lcb_via_8051
_read_lcb_via_8051:                     ; @read_lcb_via_8051
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _ICODE_FUNCTIONAL_SIMULATOR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ICODE_FUNCTIONAL_SIMULATOR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x20
	mov	w1, #0
	bl	_acquire_lcb_access
	cbnz	x0, LBB0_5
; %bb.2:
	mov	x0, x20
	mov	x1, x21
	bl	_read_csr
	str	w0, [x19]
	mov	x0, x20
	mov	w1, #0
	bl	_release_lcb_access
	mov	w0, #0
	b	LBB0_6
LBB0_3:
Lloh3:
	adrp	x8, _DC_LCB_CFG_RUN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DC_LCB_CFG_RUN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	sub	w8, w21, w8
	asr	w2, w8, #3
Lloh6:
	adrp	x8, _HCMD_READ_LCB_CSR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HCMD_READ_LCB_CSR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x3, x19
	bl	_do_8051_command
Lloh9:
	adrp	x8, _HCMD_SUCCESS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HCMD_SUCCESS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _EBUSY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ICODE_FUNCTIONAL_SIMULATOR,8,3 ; @ICODE_FUNCTIONAL_SIMULATOR
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_DC_LCB_CFG_RUN,4,2             ; @DC_LCB_CFG_RUN
	.comm	_HCMD_READ_LCB_CSR,4,2          ; @HCMD_READ_LCB_CSR
	.comm	_HCMD_SUCCESS,4,2               ; @HCMD_SUCCESS
	.no_dead_strip	_read_lcb_via_8051
.subsections_via_symbols
