	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_coresight_register             ## -- Begin function coresight_register
	.p2align	4, 0x90
_coresight_register:                    ## @coresight_register
	.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
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$80, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	(%r14), %rax
	movq	_CORESIGHT_DEV_TYPE_LINK@GOTPCREL(%rip), %rcx
	movq	_CORESIGHT_DEV_TYPE_LINKSINK@GOTPCREL(%rip), %r13
	movl	$1, %edi
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	cmpq	(%r13), %rax
	jne	LBB0_9
LBB0_4:
	movl	32(%r14), %eax
	movq	_CORESIGHT_DEV_SUBTYPE_LINK_MERG@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	movq	8(%r14), %rax
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_6:
	movq	_CORESIGHT_DEV_SUBTYPE_LINK_SPLIT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_9
## %bb.7:
	movq	8(%r14), %rax
	addq	$4, %rax
LBB0_8:
	movl	(%rax), %edi
LBB0_9:
	movl	(%rbx), %edx
	movl	$4, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, 72(%r12)
	movq	8(%r14), %rax
	movq	%rax, 64(%r12)
	movq	(%r14), %rax
	movq	%rax, (%r12)
	movl	32(%r14), %ecx
	movl	%ecx, 60(%r12)
	movl	28(%r14), %ecx
	movl	%ecx, 56(%r12)
	movl	$0, 8(%r12)
	movq	_coresight_dev_type@GOTPCREL(%rip), %rcx
	shlq	$2, %rax
	addq	(%rcx), %rax
	movq	%r12, %r15
	addq	$16, %r15
	movq	%rax, 48(%r12)
	movl	24(%r14), %eax
	movl	%eax, 40(%r12)
	movl	20(%r14), %edi
	movl	%edi, 36(%r12)
	movq	_coresight_device_release@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movq	_coresight_bustype@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r12)
	callq	_dev_fwnode
	movl	%eax, %edi
	callq	_fwnode_handle_get
	movl	%eax, 16(%r12)
	movl	16(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_set_name
	movq	%r15, %rdi
	callq	_device_register
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_put_device
	jmp	LBB0_17
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_kfree
LBB0_17:
	movq	8(%r14), %rdi
	callq	_coresight_release_platform_data
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_13:
	movq	(%r12), %rax
	movq	_CORESIGHT_DEV_TYPE_SINK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.14:
	cmpq	(%r13), %rax
	jne	LBB0_18
LBB0_15:
	movq	%r12, %rdi
	callq	_etm_perf_add_symlink_sink
	testl	%eax, %eax
	je	LBB0_18
## %bb.16:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_device_unregister
	jmp	LBB0_17
LBB0_18:
	movq	_coresight_mutex@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_coresight_fixup_device_conns
	movq	%r12, %rdi
	callq	_coresight_fixup_orphan_conns
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CORESIGHT_DEV_TYPE_LINK,8,3    ## @CORESIGHT_DEV_TYPE_LINK
	.comm	_CORESIGHT_DEV_TYPE_LINKSINK,8,3 ## @CORESIGHT_DEV_TYPE_LINKSINK
	.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
	.comm	_coresight_dev_type,8,3         ## @coresight_dev_type
	.comm	_coresight_device_release,4,2   ## @coresight_device_release
	.comm	_coresight_bustype,4,2          ## @coresight_bustype
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_CORESIGHT_DEV_TYPE_SINK,8,3    ## @CORESIGHT_DEV_TYPE_SINK
	.comm	_coresight_mutex,4,2            ## @coresight_mutex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_coresight_register             ; -- Begin function coresight_register
	.p2align	2
_coresight_register:                    ; @coresight_register
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #80
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _CORESIGHT_DEV_TYPE_LINK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CORESIGHT_DEV_TYPE_LINK@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	adrp	x23, _CORESIGHT_DEV_TYPE_LINKSINK@GOTPAGE
Lloh6:
	ldr	x23, [x23, _CORESIGHT_DEV_TYPE_LINKSINK@GOTPAGEOFF]
	ldr	x10, [x23]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_8
; %bb.2:
	ldr	w8, [x19, #32]
Lloh7:
	adrp	x9, _CORESIGHT_DEV_SUBTYPE_LINK_MERG@GOTPAGE
Lloh8:
	ldr	x9, [x9, _CORESIGHT_DEV_SUBTYPE_LINK_MERG@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x19, #8]
	b	LBB0_7
LBB0_4:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_13
LBB0_5:
Lloh13:
	adrp	x9, _CORESIGHT_DEV_SUBTYPE_LINK_SPLIT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CORESIGHT_DEV_SUBTYPE_LINK_SPLIT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.6:
	ldr	x8, [x19, #8]
	add	x8, x8, #4
LBB0_7:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_8:
	mov	w0, #1
LBB0_9:
	ldr	w2, [x21]
	mov	w1, #4
	bl	_kcalloc
	cbz	x0, LBB0_12
; %bb.10:
	ldp	x9, x8, [x19]
	stp	x8, x0, [x20, #64]
	str	x9, [x20]
	ldr	w8, [x19, #32]
	str	w8, [x20, #60]
	ldr	w8, [x19, #28]
	str	w8, [x20, #56]
	str	wzr, [x20, #8]
Lloh16:
	adrp	x8, _coresight_dev_type@GOTPAGE
Lloh17:
	ldr	x8, [x8, _coresight_dev_type@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	add	x8, x8, x9, lsl #2
	str	x8, [x20, #48]
	ldur	d0, [x19, #20]
	stur	d0, [x20, #36]
Lloh19:
	adrp	x8, _coresight_device_release@GOTPAGE
Lloh20:
	ldr	x8, [x8, _coresight_device_release@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x20, #32]
Lloh22:
	adrp	x8, _coresight_bustype@GOTPAGE
Lloh23:
	ldr	x8, [x8, _coresight_bustype@GOTPAGEOFF]
	str	x8, [x20, #24]
	fmov	w0, s0
	bl	_dev_fwnode
	bl	_fwnode_handle_get
	mov	x21, x20
	str	w0, [x21, #16]!
	ldr	w2, [x19, #16]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_set_name
	mov	x0, x21
	bl	_device_register
	cbz	w0, LBB0_14
; %bb.11:
	mov	x22, x0
	mov	x0, x21
	bl	_put_device
	b	LBB0_13
LBB0_12:
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x20
	bl	_kfree
LBB0_13:
	ldr	x0, [x19, #8]
	bl	_coresight_release_platform_data
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_14:
	ldr	x8, [x20]
Lloh29:
	adrp	x9, _CORESIGHT_DEV_TYPE_SINK@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CORESIGHT_DEV_TYPE_SINK@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_16
; %bb.15:
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_18
LBB0_16:
	mov	x0, x20
	bl	_etm_perf_add_symlink_sink
	cbz	w0, LBB0_18
; %bb.17:
	mov	x22, x0
	mov	x0, x21
	bl	_device_unregister
	b	LBB0_13
LBB0_18:
Lloh32:
	adrp	x19, _coresight_mutex@GOTPAGE
Lloh33:
	ldr	x19, [x19, _coresight_mutex@GOTPAGEOFF]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_coresight_fixup_device_conns
	mov	x0, x20
	bl	_coresight_fixup_orphan_conns
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CORESIGHT_DEV_TYPE_LINK,8,3    ; @CORESIGHT_DEV_TYPE_LINK
	.comm	_CORESIGHT_DEV_TYPE_LINKSINK,8,3 ; @CORESIGHT_DEV_TYPE_LINKSINK
	.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
	.comm	_coresight_dev_type,8,3         ; @coresight_dev_type
	.comm	_coresight_device_release,4,2   ; @coresight_device_release
	.comm	_coresight_bustype,4,2          ; @coresight_bustype
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_CORESIGHT_DEV_TYPE_SINK,8,3    ; @CORESIGHT_DEV_TYPE_SINK
	.comm	_coresight_mutex,4,2            ; @coresight_mutex
.subsections_via_symbols
