	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dw_mipi_dsi_gen_pkt_hdr_write
_dw_mipi_dsi_gen_pkt_hdr_write:         ## @dw_mipi_dsi_gen_pkt_hdr_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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_DSI_CMD_PKT_STATUS@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	movq	_CMD_PKT_STATUS_TIMEOUT_US@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movl	$1, %edx
	movl	$1000, %ecx                     ## imm = 0x3E8
	callq	_readl_poll_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_2:
	movq	_DSI_GEN_HDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_dsi_write
	movq	_GEN_CMD_EMPTY@GOTPCREL(%rip), %rax
	movq	_GEN_PLD_W_EMPTY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	xorl	%edx, %edx
	orl	(%rax), %ecx
	sete	%dl
	movl	(%r12), %r8d
	movl	$1000, %ecx                     ## imm = 0x3E8
	callq	_readl_poll_timeout
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	movl	(%r14), %edi
	callq	_dev_err
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_DSI_CMD_PKT_STATUS,8,3         ## @DSI_CMD_PKT_STATUS
	.comm	_GEN_CMD_FULL,4,2               ## @GEN_CMD_FULL
	.comm	_CMD_PKT_STATUS_TIMEOUT_US,4,2  ## @CMD_PKT_STATUS_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get available command FIFO\n"

	.comm	_DSI_GEN_HDR,4,2                ## @DSI_GEN_HDR
	.comm	_GEN_CMD_EMPTY,4,2              ## @GEN_CMD_EMPTY
	.comm	_GEN_PLD_W_EMPTY,4,2            ## @GEN_PLD_W_EMPTY
L_.str.1:                               ## @.str.1
	.asciz	"failed to write command FIFO\n"

	.no_dead_strip	_dw_mipi_dsi_gen_pkt_hdr_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dw_mipi_dsi_gen_pkt_hdr_write
_dw_mipi_dsi_gen_pkt_hdr_write:         ; @dw_mipi_dsi_gen_pkt_hdr_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _DSI_CMD_PKT_STATUS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _DSI_CMD_PKT_STATUS@GOTPAGEOFF]
	ldr	x8, [x0, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
Lloh2:
	adrp	x22, _CMD_PKT_STATUS_TIMEOUT_US@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CMD_PKT_STATUS_TIMEOUT_US@GOTPAGEOFF]
	ldr	w4, [x22]
	mov	w2, #1
	mov	w3, #1000
	bl	_readl_poll_timeout
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
Lloh6:
	adrp	x8, _DSI_GEN_HDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DSI_GEN_HDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_dsi_write
Lloh9:
	adrp	x8, _GEN_CMD_EMPTY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GEN_CMD_EMPTY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _GEN_PLD_W_EMPTY@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GEN_PLD_W_EMPTY@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	x9, [x19, #8]
	ldr	x10, [x23]
	add	x0, x10, x9
	cmp	w8, #0
	cset	w2, eq
	ldr	w4, [x22]
	mov	w3, #1000
	bl	_readl_poll_timeout
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.3:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	ldr	w0, [x19]
	bl	_dev_err
LBB0_5:
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_DSI_CMD_PKT_STATUS,8,3         ; @DSI_CMD_PKT_STATUS
	.comm	_GEN_CMD_FULL,4,2               ; @GEN_CMD_FULL
	.comm	_CMD_PKT_STATUS_TIMEOUT_US,4,2  ; @CMD_PKT_STATUS_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to get available command FIFO\n"

	.comm	_DSI_GEN_HDR,4,2                ; @DSI_GEN_HDR
	.comm	_GEN_CMD_EMPTY,4,2              ; @GEN_CMD_EMPTY
	.comm	_GEN_PLD_W_EMPTY,4,2            ; @GEN_PLD_W_EMPTY
l_.str.1:                               ; @.str.1
	.asciz	"failed to write command FIFO\n"

	.no_dead_strip	_dw_mipi_dsi_gen_pkt_hdr_write
.subsections_via_symbols
