	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___media_entity_setup_link      ## -- Begin function __media_entity_setup_link
	.p2align	4, 0x90
___media_entity_setup_link:             ## @__media_entity_setup_link
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.3:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_MEDIA_LNK_FL_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%rdi), %eax
	notl	%ecx
	movl	%eax, %edx
	xorl	%esi, %edx
	testl	%ecx, %edx
	je	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_MEDIA_LNK_FL_IMMUTABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	xorl	%ecx, %ecx
	cmpl	%r14d, %eax
	cmovel	%ecx, %ebx
	jmp	LBB0_18
LBB0_6:
	xorl	%ebx, %ebx
	cmpl	%r14d, %eax
	je	LBB0_18
## %bb.7:
	movq	16(%r15), %rcx
	movq	(%rcx), %rcx
	movq	_MEDIA_LNK_FL_DYNAMIC@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_8
LBB0_11:
	movq	(%rcx), %r12
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.12:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	_MEDIA_DEV_NOTIFY_PRE_LINK_CH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*%rax
	testl	%eax, %eax
	js	LBB0_14
LBB0_15:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	___media_entity_setup_link_notify
	movl	%eax, %ebx
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.17:
	movq	_MEDIA_DEV_NOTIFY_POST_LINK_CH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*%rcx
	jmp	LBB0_18
LBB0_8:
	cmpq	$0, 8(%rcx)
	jne	LBB0_10
## %bb.9:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_11
LBB0_10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_14:
	movl	%eax, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_MEDIA_LNK_FL_ENABLED,4,2       ## @MEDIA_LNK_FL_ENABLED
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MEDIA_LNK_FL_IMMUTABLE,4,2     ## @MEDIA_LNK_FL_IMMUTABLE
	.comm	_MEDIA_LNK_FL_DYNAMIC,4,2       ## @MEDIA_LNK_FL_DYNAMIC
	.comm	_MEDIA_DEV_NOTIFY_PRE_LINK_CH,4,2 ## @MEDIA_DEV_NOTIFY_PRE_LINK_CH
	.comm	_MEDIA_DEV_NOTIFY_POST_LINK_CH,4,2 ## @MEDIA_DEV_NOTIFY_POST_LINK_CH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___media_entity_setup_link      ; -- Begin function __media_entity_setup_link
	.p2align	2
___media_entity_setup_link:             ; @__media_entity_setup_link
	.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
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _MEDIA_LNK_FL_ENABLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MEDIA_LNK_FL_ENABLED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldr	w8, [x0]
	eor	w10, w8, w1
	bics	wzr, w10, w9
	b.eq	LBB0_5
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	mov	x0, x21
	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_5:
Lloh5:
	adrp	x9, _MEDIA_LNK_FL_IMMUTABLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MEDIA_LNK_FL_IMMUTABLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh8:
	adrp	x9, _EINVAL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w19
	csneg	w21, wzr, w9, eq
	b	LBB0_4
LBB0_7:
	cmp	w8, w19
	b.ne	LBB0_9
; %bb.8:
	mov	w21, #0
	b	LBB0_4
LBB0_9:
	ldr	x9, [x20, #16]
	ldr	x9, [x9]
Lloh11:
	adrp	x10, _MEDIA_LNK_FL_DYNAMIC@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MEDIA_LNK_FL_DYNAMIC@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_16
LBB0_10:
	ldr	x22, [x9]
	ldr	x8, [x22]
	cbz	x8, LBB0_13
; %bb.11:
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.12:
Lloh14:
	adrp	x9, _MEDIA_DEV_NOTIFY_PRE_LINK_CH@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MEDIA_DEV_NOTIFY_PRE_LINK_CH@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x9]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	tbnz	w0, #31, LBB0_19
LBB0_13:
	mov	x0, x20
	mov	x1, x19
	bl	___media_entity_setup_link_notify
	mov	x21, x0
	ldr	x8, [x22]
	cbz	x8, LBB0_4
; %bb.14:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.15:
Lloh17:
	adrp	x9, _MEDIA_DEV_NOTIFY_POST_LINK_CH@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MEDIA_DEV_NOTIFY_POST_LINK_CH@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x9]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	b	LBB0_4
LBB0_16:
	ldr	x8, [x9, #8]
	cbnz	x8, LBB0_18
; %bb.17:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_10
LBB0_18:
Lloh20:
	adrp	x8, _EBUSY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_3
LBB0_19:
	mov	x21, x0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_MEDIA_LNK_FL_ENABLED,4,2       ; @MEDIA_LNK_FL_ENABLED
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MEDIA_LNK_FL_IMMUTABLE,4,2     ; @MEDIA_LNK_FL_IMMUTABLE
	.comm	_MEDIA_LNK_FL_DYNAMIC,4,2       ; @MEDIA_LNK_FL_DYNAMIC
	.comm	_MEDIA_DEV_NOTIFY_PRE_LINK_CH,4,2 ; @MEDIA_DEV_NOTIFY_PRE_LINK_CH
	.comm	_MEDIA_DEV_NOTIFY_POST_LINK_CH,4,2 ; @MEDIA_DEV_NOTIFY_POST_LINK_CH
.subsections_via_symbols
