	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_dp_mst_allocate_vcpi       ## -- Begin function drm_dp_mst_allocate_vcpi
	.p2align	4, 0x90
_drm_dp_mst_allocate_vcpi:              ## @drm_dp_mst_allocate_vcpi
	.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, %r12d
	movl	%edx, %r14d
	movq	%rdi, %r15
	callq	_drm_dp_mst_topology_get_port_validated
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	js	LBB0_8
## %bb.1:
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	(%r13), %rsi
	testq	%rsi, %rsi
	jle	LBB0_4
## %bb.3:
	movl	8(%r13), %edx
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	cmpl	%r14d, 8(%r13)
	je	LBB0_7
LBB0_4:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	_drm_dp_init_vcpi
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r12d
	movl	(%r15), %esi
	movl	%r14d, %edi
	callq	_DIV_ROUND_UP
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_8
LBB0_6:
	movl	12(%r13), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	%r13, %rdi
	callq	_drm_dp_mst_get_port_malloc
LBB0_7:
	movq	%r13, %rdi
	callq	_drm_dp_mst_topology_put_port
	movl	$1, %ebx
LBB0_8:
	movl	%ebx, %eax
	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	"payload: vcpi %d already allocated for pbn %d - requested pbn %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to init vcpi slots=%d max=63 ret=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"initing vcpi for pbn=%d slots=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_dp_mst_allocate_vcpi       ; -- Begin function drm_dp_mst_allocate_vcpi
	.p2align	2
_drm_dp_mst_allocate_vcpi:              ; @drm_dp_mst_allocate_vcpi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x22, x3
	mov	x19, x2
	mov	x21, x0
	bl	_drm_dp_mst_topology_get_port_validated
	mov	x20, x0
	mov	w0, #0
	tbnz	w22, #31, LBB0_8
; %bb.1:
	cbz	x20, LBB0_8
; %bb.2:
	ldr	x1, [x20]
	cmp	x1, #1
	b.lt	LBB0_4
; %bb.3:
	ldr	w2, [x20, #8]
	str	x19, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_DRM_DEBUG_KMS
	ldr	w8, [x20, #8]
	cmp	w8, w19
	b.eq	LBB0_7
LBB0_4:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x3, x22
	bl	_drm_dp_init_vcpi
	cbz	w0, LBB0_6
; %bb.5:
	mov	x22, x0
	ldr	w1, [x21]
	mov	x0, x19
	bl	_DIV_ROUND_UP
	mov	x1, x0
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_DRM_DEBUG_KMS
	mov	w0, #0
	b	LBB0_8
LBB0_6:
	ldr	w2, [x20, #12]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_DRM_DEBUG_KMS
	mov	x0, x20
	bl	_drm_dp_mst_get_port_malloc
LBB0_7:
	mov	x0, x20
	bl	_drm_dp_mst_topology_put_port
	mov	w0, #1
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"payload: vcpi %d already allocated for pbn %d - requested pbn %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to init vcpi slots=%d max=63 ret=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"initing vcpi for pbn=%d slots=%d\n"

.subsections_via_symbols
