	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_dsi_host_transfer
_mtk_dsi_host_transfer:                 ## @mtk_dsi_host_transfer
	.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	$80, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_host_to_dsi
	movq	%rax, %r12
	movq	_CMD_DONE_INT_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_DSI_MODE_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r12), %rdi
	callq	_readl
	movq	_MODE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_17
## %bb.15:
	movl	%ebx, %eax
	addq	$80, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	20(%r14), %edi
	callq	_MTK_DSI_HOST_IS_READ
	xorl	%edx, %edx
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_LPRX_RD_RDY_INT_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_5:
	orl	%ebx, %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_mtk_dsi_host_send_cmd
	testq	%rax, %rax
	js	LBB0_6
## %bb.8:
	movl	20(%r14), %edi
	callq	_MTK_DSI_HOST_IS_READ
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	cmpl	$0, 16(%r14)
	je	LBB0_16
## %bb.11:
	movq	(%r12), %rdi
	movq	_DSI_RX_DATA0@GOTPCREL(%rip), %r15
	addq	(%r15), %rdi
	callq	_readb
	movl	%eax, -112(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	incq	%rdi
	callq	_readb
	movl	%eax, -108(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$2, %rdi
	callq	_readb
	movl	%eax, -104(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$3, %rdi
	callq	_readb
	movl	%eax, -100(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$4, %rdi
	callq	_readb
	movl	%eax, -96(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$5, %rdi
	callq	_readb
	movl	%eax, -92(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$6, %rdi
	callq	_readb
	movl	%eax, -88(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$7, %rdi
	callq	_readb
	movl	%eax, -84(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$8, %rdi
	callq	_readb
	movl	%eax, -80(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$9, %rdi
	callq	_readb
	movl	%eax, -76(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$10, %rdi
	callq	_readb
	movl	%eax, -72(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$11, %rdi
	callq	_readb
	movl	%eax, -68(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$12, %rdi
	callq	_readb
	movl	%eax, -64(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$13, %rdi
	callq	_readb
	movl	%eax, -60(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$14, %rdi
	callq	_readb
	movl	%eax, -56(%rbp)
	movq	(%r12), %rax
	movq	(%r15), %rcx
	leaq	(%rax,%rcx), %rdi
	addq	$15, %rdi
	callq	_readb
	movl	%eax, -52(%rbp)
	movl	-112(%rbp), %edi
	leaq	-112(%rbp), %rsi
	callq	_mtk_dsi_recv_cnt
	movl	(%r14), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	cmpl	$10, %ecx
	movl	$10, %ebx
	cmovll	%ecx, %ebx
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.12:
	leaq	-108(%rbp), %rcx
	leaq	-96(%rbp), %rsi
	cmpl	$3, %eax
	cmovlq	%rcx, %rsi
	movl	16(%r14), %edi
	movl	%ebx, %edx
	callq	_memcpy
LBB0_13:
	movq	8(%r14), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	callq	_DRM_INFO
	jmp	LBB0_14
LBB0_6:
	movq	_ETIME@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_16:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_DONE_INT_FLAG,4,2          ## @CMD_DONE_INT_FLAG
	.comm	_DSI_MODE_CTRL,8,3              ## @DSI_MODE_CTRL
	.comm	_MODE,4,2                       ## @MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dsi engine is not command mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LPRX_RD_RDY_INT_FLAG,4,2       ## @LPRX_RD_RDY_INT_FLAG
	.comm	_ETIME,4,2                      ## @ETIME
L_.str.1:                               ## @.str.1
	.asciz	"dsi receive buffer size may be NULL\n"

	.comm	_DSI_RX_DATA0,8,3               ## @DSI_RX_DATA0
L_.str.2:                               ## @.str.2
	.asciz	"dsi get %d byte data from the panel address(0x%x)\n"

	.no_dead_strip	_mtk_dsi_host_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_dsi_host_transfer
_mtk_dsi_host_transfer:                 ; @mtk_dsi_host_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_host_to_dsi
	mov	x20, x0
Lloh3:
	adrp	x8, _CMD_DONE_INT_FLAG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_DONE_INT_FLAG@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	ldr	x8, [x0]
Lloh6:
	adrp	x9, _DSI_MODE_CTRL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DSI_MODE_CTRL@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh9:
	adrp	x8, _MODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MODE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.1:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
LBB0_2:
	bl	_DRM_ERROR
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	ldur	x8, [x29, #-40]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.5:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	ldr	w0, [x19, #20]
	bl	_MTK_DSI_HOST_IS_READ
Lloh19:
	adrp	x8, _LPRX_RD_RDY_INT_FLAG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LPRX_RD_RDY_INT_FLAG@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w2, w8, w21
	mov	x0, x20
	mov	x1, x19
	bl	_mtk_dsi_host_send_cmd
	tbnz	x0, #63, LBB0_12
; %bb.7:
	ldr	w0, [x19, #20]
	bl	_MTK_DSI_HOST_IS_READ
	cbz	x0, LBB0_13
; %bb.8:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_14
; %bb.9:
	ldr	x8, [x20]
Lloh22:
	adrp	x22, _DSI_RX_DATA0@GOTPAGE
Lloh23:
	ldr	x22, [x22, _DSI_RX_DATA0@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x8, x9
	bl	_readb
	str	w0, [sp, #8]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #1
	bl	_readb
	add	x21, sp, #8
	str	w0, [sp, #12]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #2
	bl	_readb
	str	w0, [sp, #16]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #3
	bl	_readb
	str	w0, [sp, #20]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #4
	bl	_readb
	str	w0, [sp, #24]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #5
	bl	_readb
	str	w0, [sp, #28]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #6
	bl	_readb
	str	w0, [sp, #32]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #7
	bl	_readb
	str	w0, [sp, #36]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #8
	bl	_readb
	str	w0, [sp, #40]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #9
	bl	_readb
	str	w0, [sp, #44]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #10
	bl	_readb
	str	w0, [sp, #48]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #11
	bl	_readb
	str	w0, [sp, #52]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #12
	bl	_readb
	str	w0, [sp, #56]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #13
	bl	_readb
	str	w0, [sp, #60]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #14
	bl	_readb
	str	w0, [sp, #64]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x8, x8, x9
	add	x0, x8, #15
	bl	_readb
	str	w0, [sp, #68]
	ldr	w0, [sp, #8]
	add	x1, sp, #8
	bl	_mtk_dsi_recv_cnt
	ldr	w8, [x19]
	cmp	w0, w8
	csel	w8, w0, w8, lt
	mov	w9, #10
	cmp	w8, #10
	csel	w20, w8, w9, lt
	cbz	w20, LBB0_11
; %bb.10:
	add	x8, x21, #4
	add	x9, x21, #16
	cmp	w0, #2
	csel	x1, x9, x8, gt
	ldr	w0, [x19, #16]
	mov	x2, x20
	bl	_memcpy
LBB0_11:
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_DRM_INFO
	b	LBB0_4
LBB0_12:
Lloh26:
	adrp	x8, _ETIME@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
	b	LBB0_3
LBB0_13:
	mov	w20, #0
	b	LBB0_4
LBB0_14:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_DONE_INT_FLAG,4,2          ; @CMD_DONE_INT_FLAG
	.comm	_DSI_MODE_CTRL,8,3              ; @DSI_MODE_CTRL
	.comm	_MODE,4,2                       ; @MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dsi engine is not command mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LPRX_RD_RDY_INT_FLAG,4,2       ; @LPRX_RD_RDY_INT_FLAG
	.comm	_ETIME,4,2                      ; @ETIME
l_.str.1:                               ; @.str.1
	.asciz	"dsi receive buffer size may be NULL\n"

	.comm	_DSI_RX_DATA0,8,3               ; @DSI_RX_DATA0
l_.str.2:                               ; @.str.2
	.asciz	"dsi get %d byte data from the panel address(0x%x)\n"

	.no_dead_strip	_mtk_dsi_host_transfer
.subsections_via_symbols
