	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun6i_dsi_dcs_read
_sun6i_dsi_dcs_read:                    ## @sun6i_dsi_dcs_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %r15d
	xorl	%edi, %edi
	callq	_SUN6I_DSI_CMD_TX_REG
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_sun6i_dsi_dcs_build_pkt_hdr
	movl	%r15d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_regmap_write
	movl	(%rbx), %edi
	movq	_SUN6I_DSI_CMD_CTL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	$3, %edx
	callq	_regmap_write
	movq	_DSI_START_LPRX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_sun6i_dsi_start
	movq	%rbx, %rdi
	callq	_sun6i_dsi_inst_wait_for_completion
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	(%rbx), %edi
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	movq	_SUN6I_DSI_CMD_CTL_RX_OVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	je	LBB0_4
## %bb.3:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_sun6i_dsi_inst_abort
	jmp	LBB0_7
LBB0_4:
	movl	(%rbx), %ebx
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	callq	_SUN6I_DSI_CMD_RX_REG
	leaq	-36(%rbp), %rdx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_regmap_read
	movl	-36(%rbp), %eax
	movzbl	%al, %ecx
	movq	_MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_6
## %bb.5:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_7
LBB0_6:
	sarl	$8, %eax
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	movl	$1, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SUN6I_DSI_CMD_CTL_REG,4,2      ## @SUN6I_DSI_CMD_CTL_REG
	.comm	_DSI_START_LPRX,4,2             ## @DSI_START_LPRX
	.comm	_SUN6I_DSI_CMD_CTL_RX_OVERFLOW,4,2 ## @SUN6I_DSI_CMD_CTL_RX_OVERFLOW
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT,4,2 ## @MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT
	.no_dead_strip	_sun6i_dsi_dcs_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun6i_dsi_dcs_read
_sun6i_dsi_dcs_read:                    ; @sun6i_dsi_dcs_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
	mov	x19, x1
	mov	x20, x0
	ldr	w21, [x0]
	mov	w0, #0
	bl	_SUN6I_DSI_CMD_TX_REG
	mov	x22, x0
	mov	x0, x20
	mov	x1, x19
	bl	_sun6i_dsi_dcs_build_pkt_hdr
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_regmap_write
	ldr	w0, [x20]
Lloh0:
	adrp	x22, _SUN6I_DSI_CMD_CTL_REG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SUN6I_DSI_CMD_CTL_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w2, #3
	bl	_regmap_write
Lloh2:
	adrp	x8, _DSI_START_LPRX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DSI_START_LPRX@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_sun6i_dsi_start
	mov	x0, x20
	bl	_sun6i_dsi_inst_wait_for_completion
	tbnz	w0, #31, LBB0_4
; %bb.1:
	ldr	w0, [x20]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _SUN6I_DSI_CMD_CTL_RX_OVERFLOW@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SUN6I_DSI_CMD_CTL_RX_OVERFLOW@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
	ldr	w20, [x20]
	mov	w0, #0
	bl	_SUN6I_DSI_CMD_RX_REG
	mov	x1, x0
	add	x2, sp, #12
	mov	x0, x20
	bl	_regmap_read
	ldr	w8, [sp, #12]
Lloh8:
	adrp	x9, _MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w9, w8, uxtb
	b.ne	LBB0_5
LBB0_3:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_4:
	mov	x21, x0
	mov	x0, x20
	bl	_sun6i_dsi_inst_abort
	b	LBB0_6
LBB0_5:
	asr	w8, w8, #8
	ldr	x9, [x19]
	str	w8, [x9]
	mov	w21, #1
LBB0_6:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SUN6I_DSI_CMD_CTL_REG,4,2      ; @SUN6I_DSI_CMD_CTL_REG
	.comm	_DSI_START_LPRX,4,2             ; @DSI_START_LPRX
	.comm	_SUN6I_DSI_CMD_CTL_RX_OVERFLOW,4,2 ; @SUN6I_DSI_CMD_CTL_RX_OVERFLOW
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT,4,2 ; @MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT
	.no_dead_strip	_sun6i_dsi_dcs_read
.subsections_via_symbols
