	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmc_enable_etr_sink_perf
_tmc_enable_etr_sink_perf:              ## @tmc_enable_etr_sink_perf
	.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	%rsi, %r13
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_etm_perf_sink_config
	movq	%rax, %r12
	leaq	12(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	(%r14), %rax
	movq	_CS_MODE_SYSFS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	testq	%r12, %r12
	je	LBB0_4
## %bb.5:
	xorl	%edi, %edi
	cmpq	$0, 8(%r12)
	sete	%dil
	jmp	LBB0_6
LBB0_4:
	movl	$1, %edi
LBB0_6:
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r12), %ecx
	movl	8(%r14), %eax
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.9:
	cmpl	%ecx, %eax
	jne	LBB0_1
LBB0_10:
	movl	(%r13), %edi
	movq	%r12, %rsi
	movl	%ecx, %r13d
	callq	_PERF_IDX2OFF
	movl	%r13d, %ecx
	movl	%eax, 16(%r12)
	cmpl	%r13d, 8(%r14)
	jne	LBB0_12
## %bb.11:
	movl	(%rbx), %edi
	jmp	LBB0_14
LBB0_12:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r12), %rsi
	movq	%r14, %rdi
	callq	_tmc_etr_enable_hw
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	movl	%r13d, 8(%r14)
	movq	_CS_MODE_PERF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	8(%r12), %rax
	movq	%rax, 16(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
LBB0_14:
	callq	_atomic_inc
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_CS_MODE_SYSFS,8,3              ## @CS_MODE_SYSFS
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CS_MODE_PERF,8,3               ## @CS_MODE_PERF
	.no_dead_strip	_tmc_enable_etr_sink_perf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmc_enable_etr_sink_perf
_tmc_enable_etr_sink_perf:              ; @tmc_enable_etr_sink_perf
	.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	x23, x1
	mov	x20, x0
	ldr	w0, [x0, #4]
	bl	_dev_get_drvdata
	mov	x21, x0
	mov	x0, x23
	bl	_etm_perf_sink_config
	mov	x22, x0
	add	x19, x21, #12
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _CS_MODE_SYSFS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CS_MODE_SYSFS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	cbz	x22, LBB0_7
; %bb.3:
	ldr	x8, [x22, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_6:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x23
	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
LBB0_7:
	mov	w0, #1
	bl	_WARN_ON
	cbnz	x0, LBB0_4
LBB0_8:
	ldr	w24, [x22]
	ldr	w8, [x21, #8]
	cmn	w8, #1
	ccmp	w8, w24, #4, ne
	b.ne	LBB0_1
; %bb.9:
	ldr	w0, [x23]
	mov	x1, x22
	bl	_PERF_IDX2OFF
	str	w0, [x22, #16]
	ldr	w8, [x21, #8]
	cmp	w8, w24
	b.ne	LBB0_11
; %bb.10:
	ldr	w0, [x20]
	bl	_atomic_inc
	mov	w23, #0
	b	LBB0_6
LBB0_11:
	ldr	x1, [x22, #8]
	mov	x0, x21
	bl	_tmc_etr_enable_hw
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.12:
Lloh7:
	adrp	x8, _CS_MODE_PERF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CS_MODE_PERF@GOTPAGEOFF]
	str	w24, [x21, #8]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x21]
	ldr	x8, [x22, #8]
	str	x8, [x21, #16]
	ldr	w0, [x20]
	bl	_atomic_inc
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CS_MODE_SYSFS,8,3              ; @CS_MODE_SYSFS
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CS_MODE_PERF,8,3               ; @CS_MODE_PERF
	.no_dead_strip	_tmc_enable_etr_sink_perf
.subsections_via_symbols
