	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mipi_dsi_create_packet         ## -- Begin function mipi_dsi_create_packet
	.p2align	4, 0x90
_mipi_dsi_create_packet:                ## @mipi_dsi_create_packet
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	movl	(%rbx), %edi
	callq	_mipi_dsi_packet_format_is_short
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	(%rbx), %edi
	callq	_mipi_dsi_packet_format_is_long
	testq	%rax, %rax
	je	LBB0_2
LBB0_5:
	cmpl	$4, 4(%rbx)
	jl	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_6:
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	shll	$6, %ecx
	movzbl	%cl, %ecx
	andl	$63, %eax
	orl	%ecx, %eax
	movq	(%r14), %rcx
	movl	%eax, (%rcx)
	movl	(%rbx), %edi
	callq	_mipi_dsi_packet_format_is_long
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movzbl	8(%rbx), %eax
	movq	(%r14), %rcx
	movl	%eax, 4(%rcx)
	movzbl	9(%rbx), %eax
	movl	%eax, 8(%rcx)
	movl	8(%rbx), %eax
	movl	%eax, 8(%r14)
	movq	16(%rbx), %rcx
	movq	%rcx, 16(%r14)
	jmp	LBB0_13
LBB0_8:
	movq	16(%rbx), %rax
	cmpl	$0, 8(%rbx)
	jle	LBB0_10
## %bb.9:
	movl	(%rax), %r15d
LBB0_10:
	movq	(%r14), %rcx
	movl	%r15d, 4(%rcx)
	xorl	%edx, %edx
	cmpl	$2, 8(%rbx)
	jl	LBB0_12
## %bb.11:
	movl	4(%rax), %edx
LBB0_12:
	movl	%edx, 8(%rcx)
	movl	8(%r14), %eax
LBB0_13:
	addl	$8, %eax
	movl	%eax, 24(%r14)
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mipi_dsi_create_packet         ; -- Begin function mipi_dsi_create_packet
	.p2align	2
_mipi_dsi_create_packet:                ; @mipi_dsi_create_packet
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_5
; %bb.2:
	mov	x19, x0
	ldr	w0, [x20]
	bl	_mipi_dsi_packet_format_is_short
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x20]
	bl	_mipi_dsi_packet_format_is_long
	cbz	x0, LBB0_5
LBB0_4:
	ldr	w8, [x20, #4]
	cmp	w8, #4
	b.lt	LBB0_6
LBB0_5:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldp	w9, w8, [x20]
	and	w9, w9, #0x3f
	bfi	w9, w8, #6, #2
	ldr	x8, [x19]
	str	w9, [x8]
	ldr	w0, [x20]
	bl	_mipi_dsi_packet_format_is_long
	cbz	x0, LBB0_8
; %bb.7:
	ldrb	w8, [x20, #8]
	ldr	x9, [x19]
	str	w8, [x9, #4]
	ldrb	w8, [x20, #9]
	str	w8, [x9, #8]
	ldr	w8, [x20, #8]
	str	w8, [x19, #8]
	ldr	x9, [x20, #16]
	str	x9, [x19, #16]
	b	LBB0_15
LBB0_8:
	ldr	x8, [x20, #16]
	ldr	w9, [x20, #8]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.9:
	ldr	w10, [x8]
	b	LBB0_11
LBB0_10:
	mov	w10, #0
LBB0_11:
	ldr	x9, [x19]
	str	w10, [x9, #4]
	ldr	w10, [x20, #8]
	cmp	w10, #1
	b.le	LBB0_13
; %bb.12:
	ldr	w8, [x8, #4]
	b	LBB0_14
LBB0_13:
	mov	w8, #0
LBB0_14:
	str	w8, [x9, #8]
	ldr	w8, [x19, #8]
LBB0_15:
	mov	w0, #0
	add	w8, w8, #8
	str	w8, [x19, #24]
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
