	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdp5_ctl_pair                  ## -- Begin function mdp5_ctl_pair
	.p2align	4, 0x90
_mdp5_ctl_pair:                         ## @mdp5_ctl_pair
	.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	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_get_kms
	xorl	%r15d, %r15d
	cmpl	$0, 8(%rbx)
	je	LBB0_11
## %bb.1:
	testl	%r13d, %r13d
	je	LBB0_2
## %bb.3:
	cmpq	$0, 8(%r12)
	jne	LBB0_5
## %bb.4:
	cmpq	$0, 8(%r14)
	je	LBB0_7
LBB0_5:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
LBB0_6:
	callq	_DRM_DEV_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_2:
	movq	$0, 8(%r12)
	movq	$0, 8(%r14)
	movq	_REG_MDP5_SPARE_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%r15d, %r15d
	movq	%rax, %rdi
	xorl	%edx, %edx
LBB0_10:
	callq	_mdp5_write
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%r14), %ecx
	andl	(%r12), %ecx
	movq	_CTL_STAT_BOOKED@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_8
## %bb.9:
	movq	%r14, 8(%r12)
	movq	%r12, 8(%r14)
	movq	_REG_MDP5_SPARE_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, %rdi
	jmp	LBB0_10
LBB0_8:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_MDP5_SPARE_0,4,2           ## @REG_MDP5_SPARE_0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CTLs already paired\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CTL_STAT_BOOKED,4,2            ## @CTL_STAT_BOOKED
L_.str.1:                               ## @.str.1
	.asciz	"Only pair booked CTLs\n"

	.comm	_MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN,4,2 ## @MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mdp5_ctl_pair                  ; -- Begin function mdp5_ctl_pair
	.p2align	2
_mdp5_ctl_pair:                         ; @mdp5_ctl_pair
	.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
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0, #16]
	mov	x0, x21
	bl	_get_kms
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_8
; %bb.1:
	cbz	w22, LBB0_6
; %bb.2:
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_10
LBB0_4:
	ldr	x8, [x21]
	ldr	w0, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	bl	_DRM_DEV_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_6:
	str	xzr, [x20, #8]
	str	xzr, [x19, #8]
Lloh5:
	adrp	x8, _REG_MDP5_SPARE_0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REG_MDP5_SPARE_0@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w2, #0
LBB0_7:
	bl	_mdp5_write
LBB0_8:
	mov	w0, #0
LBB0_9:
	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_10:
	ldr	w8, [x20]
	ldr	w9, [x19]
	and	w8, w9, w8
Lloh8:
	adrp	x9, _CTL_STAT_BOOKED@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CTL_STAT_BOOKED@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w8, w9
	b.eq	LBB0_12
; %bb.11:
	str	x19, [x20, #8]
	str	x20, [x19, #8]
Lloh11:
	adrp	x8, _REG_MDP5_SPARE_0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_MDP5_SPARE_0@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	b	LBB0_7
LBB0_12:
	ldr	x8, [x21]
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_MDP5_SPARE_0,4,2           ; @REG_MDP5_SPARE_0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CTLs already paired\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CTL_STAT_BOOKED,4,2            ; @CTL_STAT_BOOKED
l_.str.1:                               ; @.str.1
	.asciz	"Only pair booked CTLs\n"

	.comm	_MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN,4,2 ; @MDP5_SPARE_0_SPLIT_DPL_SINGLE_FLUSH_EN
.subsections_via_symbols
