	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function coresight_disable_link
_coresight_disable_link:                ## @coresight_disable_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	%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
	testq	%rsi, %rsi
	je	LBB0_16
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_16
## %bb.2:
	movq	%rdi, %r13
	callq	_coresight_find_link_inport
	movl	%eax, %r14d
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_coresight_find_link_outport
	movl	%eax, %r15d
	movl	24(%r13), %eax
	movq	_CORESIGHT_DEV_SUBTYPE_LINK_MERG@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	movq	16(%r13), %rcx
	movl	%r14d, %eax
	jmp	LBB0_7
LBB0_4:
	movq	_CORESIGHT_DEV_SUBTYPE_LINK_SPLIT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.6:
	movq	16(%r13), %rcx
	addq	$4, %rcx
	movl	%r15d, %eax
LBB0_7:
	movl	(%rcx), %r12d
	jmp	LBB0_8
LBB0_5:
	movl	$1, %r12d
	xorl	%eax, %eax
LBB0_8:
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	8(%r13), %rdi
	callq	_atomic_dec_return
	testq	%rax, %rax
	jne	LBB0_11
## %bb.9:
	movq	%r13, %rdi
	callq	_link_ops
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.10:
	movq	%r13, %rdi
	callq	_link_ops
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	*(%rax)
LBB0_11:
	testl	%r12d, %r12d
	jle	LBB0_15
## %bb.12:
	movl	%r12d, %r14d
	shlq	$2, %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rdi
	addq	%rbx, %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jne	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_14 Depth=1
	addq	$4, %rbx
	cmpq	%rbx, %r14
	jne	LBB0_14
LBB0_15:
	movl	$0, (%r13)
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CORESIGHT_DEV_SUBTYPE_LINK_MERG,4,2 ## @CORESIGHT_DEV_SUBTYPE_LINK_MERG
	.comm	_CORESIGHT_DEV_SUBTYPE_LINK_SPLIT,4,2 ## @CORESIGHT_DEV_SUBTYPE_LINK_SPLIT
	.no_dead_strip	_coresight_disable_link
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function coresight_disable_link
_coresight_disable_link:                ; @coresight_disable_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	x1, LBB0_16
; %bb.1:
	mov	x21, x2
	cbz	x2, LBB0_16
; %bb.2:
	mov	x19, x0
	bl	_coresight_find_link_inport
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	bl	_coresight_find_link_outport
	mov	x21, x0
	ldr	w8, [x19, #24]
Lloh0:
	adrp	x9, _CORESIGHT_DEV_SUBTYPE_LINK_MERG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CORESIGHT_DEV_SUBTYPE_LINK_MERG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	ldr	x9, [x19, #16]
	mov	x8, x20
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x9, _CORESIGHT_DEV_SUBTYPE_LINK_SPLIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CORESIGHT_DEV_SUBTYPE_LINK_SPLIT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x19, #16]
	add	x9, x8, #4
	mov	x8, x21
LBB0_6:
	ldr	w22, [x9]
	b	LBB0_8
LBB0_7:
	mov	w8, #0
	mov	w22, #1
LBB0_8:
	ldr	x9, [x19, #8]
	add	x0, x9, w8, sxtw #2
	bl	_atomic_dec_return
	cbnz	x0, LBB0_11
; %bb.9:
	mov	x0, x19
	bl	_link_ops
	ldr	x8, [x0]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_link_ops
	ldr	x8, [x0]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	blr	x8
LBB0_11:
	cmp	w22, #1
	b.lt	LBB0_15
; %bb.12:
	mov	x20, #0
	mov	w8, w22
	lsl	x21, x8, #2
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x20
	bl	_atomic_read
	cbnz	x0, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x20, x20, #4
	cmp	x21, x20
	b.ne	LBB0_13
LBB0_15:
	str	wzr, [x19]
LBB0_16:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CORESIGHT_DEV_SUBTYPE_LINK_MERG,4,2 ; @CORESIGHT_DEV_SUBTYPE_LINK_MERG
	.comm	_CORESIGHT_DEV_SUBTYPE_LINK_SPLIT,4,2 ; @CORESIGHT_DEV_SUBTYPE_LINK_SPLIT
	.no_dead_strip	_coresight_disable_link
.subsections_via_symbols
