	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsi_send_pkt_hdr
_dsi_send_pkt_hdr:                      ## @dsi_send_pkt_hdr
	.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	%ecx, %r13d
	movq	%rdx, %r12
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_i915
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_dsi_port_to_transcoder
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_header_credits_available
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movl	%r15d, %edi
	callq	_DSI_CMD_TXHDR
	movl	%eax, %edi
	callq	_I915_READ
	movq	_PAYLOAD_PRESENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	orl	%eax, %edx
	notl	%ecx
	andl	%eax, %ecx
	testq	%r12, %r12
	cmovnel	%edx, %ecx
	movq	_VBLANK_FENCE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ecx, %eax
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.3:
	movq	_LP_DATA_TRANSFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_4:
	orl	%eax, %r13d
	movq	_PARAM_WC_MASK@GOTPCREL(%rip), %rax
	movq	_VC_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%rax), %eax
	orl	%edx, %eax
	movq	_DT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	orl	%r8d, %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %esi
	andl	%esi, %edx
	movq	_VC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	movl	4(%rbx), %edi
	andl	%r8d, %esi
	movq	_DT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	movq	_PARAM_WC_LOWER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edi
	notl	%eax
	andl	%r13d, %eax
	movl	8(%rbx), %ebx
	movq	_PARAM_WC_UPPER_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%edx, %esi
	orl	%esi, %edi
	orl	%edi, %ebx
	orl	%eax, %ebx
	movl	%r15d, %edi
	callq	_DSI_CMD_TXHDR
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movl	$-1, %eax
LBB0_5:
	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	"send pkt header failed, not enough hdr credits\n"

	.comm	_PAYLOAD_PRESENT,4,2            ## @PAYLOAD_PRESENT
	.comm	_VBLANK_FENCE,4,2               ## @VBLANK_FENCE
	.comm	_LP_DATA_TRANSFER,4,2           ## @LP_DATA_TRANSFER
	.comm	_PARAM_WC_MASK,4,2              ## @PARAM_WC_MASK
	.comm	_VC_MASK,4,2                    ## @VC_MASK
	.comm	_DT_MASK,4,2                    ## @DT_MASK
	.comm	_VC_SHIFT,4,2                   ## @VC_SHIFT
	.comm	_DT_SHIFT,4,2                   ## @DT_SHIFT
	.comm	_PARAM_WC_LOWER_SHIFT,4,2       ## @PARAM_WC_LOWER_SHIFT
	.comm	_PARAM_WC_UPPER_SHIFT,4,2       ## @PARAM_WC_UPPER_SHIFT
	.no_dead_strip	_dsi_send_pkt_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsi_send_pkt_hdr
_dsi_send_pkt_hdr:                      ; @dsi_send_pkt_hdr
	.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, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_i915
	mov	x23, x0
	ldr	w0, [x20]
	bl	_dsi_port_to_transcoder
	mov	x20, x0
	mov	x0, x23
	mov	x1, x20
	bl	_header_credits_available
	cmp	w0, #0
	b.le	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_DSI_CMD_TXHDR
	bl	_I915_READ
Lloh0:
	adrp	x8, _PAYLOAD_PRESENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAYLOAD_PRESENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w9, w8, w0
	bic	w8, w0, w8
	cmp	x22, #0
	csel	w8, w8, w9, eq
Lloh3:
	adrp	x9, _VBLANK_FENCE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VBLANK_FENCE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _LP_DATA_TRANSFER@GOTPAGE
Lloh7:
	ldr	x10, [x10, _LP_DATA_TRANSFER@GOTPAGEOFF]
	bic	w8, w8, w9
Lloh8:
	ldr	w9, [x10]
	cmp	w21, #0
	csel	w9, wzr, w9, eq
Lloh9:
	adrp	x10, _PARAM_WC_MASK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _PARAM_WC_MASK@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh11:
	ldr	w9, [x10]
Lloh12:
	adrp	x10, _VC_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _VC_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh15:
	adrp	x11, _DT_MASK@GOTPAGE
Lloh16:
	ldr	x11, [x11, _DT_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x11]
	orr	w9, w9, w11
	bic	w8, w8, w9
	ldp	w9, w12, [x19]
	and	w10, w9, w10
Lloh18:
	adrp	x13, _VC_SHIFT@GOTPAGE
Lloh19:
	ldr	x13, [x13, _VC_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w13, [x13]
	lsl	w10, w10, w13
	orr	w8, w10, w8
	and	w9, w9, w11
Lloh21:
	adrp	x10, _DT_SHIFT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _DT_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w8, w9
Lloh24:
	adrp	x9, _PARAM_WC_LOWER_SHIFT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _PARAM_WC_LOWER_SHIFT@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	lsl	w9, w12, w9
	orr	w8, w8, w9
	ldr	w9, [x19, #8]
Lloh27:
	adrp	x10, _PARAM_WC_UPPER_SHIFT@GOTPAGE
Lloh28:
	ldr	x10, [x10, _PARAM_WC_UPPER_SHIFT@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w19, w8, w9
	mov	x0, x20
	bl	_DSI_CMD_TXHDR
	mov	x1, x19
	bl	_I915_WRITE
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	w0, #-1
LBB0_3:
	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 AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"send pkt header failed, not enough hdr credits\n"

	.comm	_PAYLOAD_PRESENT,4,2            ; @PAYLOAD_PRESENT
	.comm	_VBLANK_FENCE,4,2               ; @VBLANK_FENCE
	.comm	_LP_DATA_TRANSFER,4,2           ; @LP_DATA_TRANSFER
	.comm	_PARAM_WC_MASK,4,2              ; @PARAM_WC_MASK
	.comm	_VC_MASK,4,2                    ; @VC_MASK
	.comm	_DT_MASK,4,2                    ; @DT_MASK
	.comm	_VC_SHIFT,4,2                   ; @VC_SHIFT
	.comm	_DT_SHIFT,4,2                   ; @DT_SHIFT
	.comm	_PARAM_WC_LOWER_SHIFT,4,2       ; @PARAM_WC_LOWER_SHIFT
	.comm	_PARAM_WC_UPPER_SHIFT,4,2       ; @PARAM_WC_UPPER_SHIFT
	.no_dead_strip	_dsi_send_pkt_hdr
.subsections_via_symbols
