	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ld9040_dcs_write
_ld9040_dcs_write:                      ## @ld9040_dcs_write
	.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
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.1:
	movq	%rdi, %r14
	cmpl	$0, (%rdi)
	js	LBB0_8
## %bb.2:
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rcx
	callq	_dev_dbg
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ld9040_spi_write_word
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movl	$256, %r13d                     ## imm = 0x100
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$1, %rbx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	4(%r15), %esi
	orl	%r13d, %esi
	addq	$4, %r15
	movq	%r14, %rdi
	callq	_ld9040_spi_write_word
	decq	%rbx
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	movl	%eax, %r12d
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	movl	%ebx, %ecx
	movq	%r15, %r8
	callq	_dev_err
	movl	%r12d, (%r14)
LBB0_7:
	movl	$300, %edi                      ## imm = 0x12C
	movl	$310, %esi                      ## imm = 0x136
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_usleep_range                   ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing dcs seq: %*ph\n"

L_.str.1:                               ## @.str.1
	.asciz	"error %d writing dcs seq: %*ph\n"

	.no_dead_strip	_ld9040_dcs_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ld9040_dcs_write
_ld9040_dcs_write:                      ; @ld9040_dcs_write
	.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
	cbz	x2, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	tbnz	w8, #31, LBB0_6
; %bb.2:
	mov	x20, x2
	mov	x21, x1
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x21
	bl	_dev_dbg
	ldr	w1, [x21]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_ld9040_spi_write_word
	cbnz	w0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	x20, x20, #1
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x21, #4]!
	orr	w1, w8, #0x100
	b	LBB0_3
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
LBB0_7:
	mov	x22, x0
	ldr	w0, [x19, #4]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	mov	x3, x20
	mov	x4, x21
	bl	_dev_err
	str	w22, [x19]
LBB0_8:
	mov	w0, #300
	mov	w1, #310
	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
	b	_usleep_range
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing dcs seq: %*ph\n"

l_.str.1:                               ; @.str.1
	.asciz	"error %d writing dcs seq: %*ph\n"

	.no_dead_strip	_ld9040_dcs_write
.subsections_via_symbols
