	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_dsi_cmdq
_mtk_dsi_cmdq:                          ## @mtk_dsi_cmdq
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	(%rsi), %rbx
	movl	8(%rsi), %r15d
	movl	%r15d, %edi
	callq	_MTK_DSI_HOST_IS_READ
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_BTA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	12(%r13), %eax
	cmpl	$3, %eax
	jl	LBB0_8
LBB0_7:
	leal	3(%rax), %edi
	movq	_CONFIG@GOTPCREL(%rip), %rcx
	movq	_DATA_ID@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	orq	(%rcx), %rdx
	shrl	$2, %edi
	movq	_DATA_0@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rdx
	incl	%edi
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movq	_DATA_1@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	shll	$16, %eax
	shll	$8, %r15d
	orl	%eax, %r15d
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movl	$4, %r14d
	cmpl	$0, 12(%r13)
	jne	LBB0_10
	jmp	LBB0_12
LBB0_2:
	movl	12(%r13), %eax
	cmpl	$3, %eax
	jl	LBB0_3
## %bb.4:
	movq	_LONG_PACKET@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_SHORT_PACKET@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	cmpl	$3, %eax
	jge	LBB0_7
LBB0_8:
	movq	_CONFIG@GOTPCREL(%rip), %rax
	movq	_DATA_ID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orq	(%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	shll	$8, %r15d
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movl	$2, %r14d
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
	cmpl	$0, 12(%r13)
	je	LBB0_12
LBB0_10:
	movq	%r13, %r15
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movsbl	(%rbx,%r13), %edi
	movq	(%r12), %rsi
	movq	_DSI_CMDQ0@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	addq	%r14, %rsi
	addq	%r13, %rsi
	callq	_writeb
	incq	%r13
	movslq	12(%r15), %rax
	cmpq	%rax, %r13
	jb	LBB0_11
LBB0_12:
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	orl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	movq	_DSI_CMDQ0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_mtk_dsi_mask
	movq	_DSI_CMDQ_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_CMDQ_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r12, %rdi
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_dsi_mask                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BTA,4,2                        ## @BTA
	.comm	_LONG_PACKET,4,2                ## @LONG_PACKET
	.comm	_SHORT_PACKET,4,2               ## @SHORT_PACKET
	.comm	_CONFIG,8,3                     ## @CONFIG
	.comm	_DATA_ID,8,3                    ## @DATA_ID
	.comm	_DATA_0,8,3                     ## @DATA_0
	.comm	_DATA_1,8,3                     ## @DATA_1
	.comm	_DSI_CMDQ0,8,3                  ## @DSI_CMDQ0
	.comm	_DSI_CMDQ_SIZE,8,3              ## @DSI_CMDQ_SIZE
	.comm	_CMDQ_SIZE,8,3                  ## @CMDQ_SIZE
	.no_dead_strip	_mtk_dsi_cmdq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_dsi_cmdq
_mtk_dsi_cmdq:                          ; @mtk_dsi_cmdq
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	x24, [x1]
	ldr	w23, [x1, #8]
	mov	x0, x23
	bl	_MTK_DSI_HOST_IS_READ
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _BTA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BTA@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	ldr	w8, [x20, #12]
	cmp	w8, #3
	b.lt	LBB0_4
LBB0_2:
	add	w9, w8, #3
Lloh3:
	adrp	x10, _CONFIG@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CONFIG@GOTPAGEOFF]
	lsr	w9, w9, #2
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _DATA_ID@GOTPAGE
Lloh7:
	ldr	x11, [x11, _DATA_ID@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	orr	x10, x11, x10
Lloh9:
	adrp	x11, _DATA_0@GOTPAGE
Lloh10:
	ldr	x11, [x11, _DATA_0@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	orr	x10, x10, x11
Lloh12:
	adrp	x11, _DATA_1@GOTPAGE
Lloh13:
	ldr	x11, [x11, _DATA_1@GOTPAGEOFF]
	add	w21, w9, #1
Lloh14:
	ldr	x9, [x11]
	orr	x22, x10, x9
	lsl	w8, w8, #16
	orr	w23, w8, w23, lsl #8
	mov	w26, #4
	b	LBB0_5
LBB0_3:
Lloh15:
	adrp	x9, _LONG_PACKET@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LONG_PACKET@GOTPAGEOFF]
	ldr	w8, [x20, #12]
Lloh17:
	adrp	x10, _SHORT_PACKET@GOTPAGE
Lloh18:
	ldr	x10, [x10, _SHORT_PACKET@GOTPAGEOFF]
	cmp	w8, #2
	csel	x9, x9, x10, gt
	ldr	w25, [x9]
	cmp	w8, #3
	b.ge	LBB0_2
LBB0_4:
Lloh19:
	adrp	x8, _CONFIG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CONFIG@GOTPAGEOFF]
Lloh21:
	adrp	x9, _DATA_ID@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DATA_ID@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
Lloh24:
	ldr	x9, [x9]
	orr	x22, x9, x8
	lsl	w23, w23, #8
	mov	w21, #1
	mov	w26, #2
LBB0_5:
	ldr	w8, [x20, #12]
Lloh25:
	adrp	x27, _DSI_CMDQ0@GOTPAGE
Lloh26:
	ldr	x27, [x27, _DSI_CMDQ0@GOTPAGEOFF]
	cbz	w8, LBB0_8
; %bb.6:
	mov	x28, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldrsb	w0, [x24, x28]
	ldr	x8, [x19]
	ldr	x9, [x27]
	add	x8, x8, x9
	add	x9, x26, x28
	add	x1, x9, x8
	bl	_writeb
	add	x28, x28, #1
	ldrsw	x8, [x20, #12]
	cmp	x28, x8
	b.lo	LBB0_7
LBB0_8:
	orr	w3, w23, w25
	ldr	x1, [x27]
	mov	x0, x19
	mov	x2, x22
	bl	_mtk_dsi_mask
Lloh27:
	adrp	x8, _DSI_CMDQ_SIZE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DSI_CMDQ_SIZE@GOTPAGEOFF]
Lloh29:
	adrp	x9, _CMDQ_SIZE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CMDQ_SIZE@GOTPAGEOFF]
Lloh31:
	ldr	x1, [x8]
Lloh32:
	ldr	x2, [x9]
	mov	x0, x19
	mov	x3, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mtk_dsi_mask
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh23
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_BTA,4,2                        ; @BTA
	.comm	_LONG_PACKET,4,2                ; @LONG_PACKET
	.comm	_SHORT_PACKET,4,2               ; @SHORT_PACKET
	.comm	_CONFIG,8,3                     ; @CONFIG
	.comm	_DATA_ID,8,3                    ; @DATA_ID
	.comm	_DATA_0,8,3                     ; @DATA_0
	.comm	_DATA_1,8,3                     ; @DATA_1
	.comm	_DSI_CMDQ0,8,3                  ; @DSI_CMDQ0
	.comm	_DSI_CMDQ_SIZE,8,3              ; @DSI_CMDQ_SIZE
	.comm	_CMDQ_SIZE,8,3                  ; @CMDQ_SIZE
	.no_dead_strip	_mtk_dsi_cmdq
.subsections_via_symbols
