	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmc_enable_etr_sink_sysfs
_tmc_enable_etr_sink_sysfs:             ## @tmc_enable_etr_sink_sysfs
	.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
	movl	(%rdi), %edi
	callq	_dev_get_drvdata
	movq	%rax, %rbx
	leaq	16(%rax), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	24(%rbx), %rdi
	callq	_READ_ONCE
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%rax), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_3
## %bb.2:
	xorl	%r12d, %r12d
	cmpq	$0, 32(%rbx)
	jne	LBB0_7
	jmp	LBB0_6
LBB0_3:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	callq	_tmc_etr_setup_sysfs_buf
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.25:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_4:
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 32(%rbx)
	jne	LBB0_7
LBB0_6:
	movq	8(%rbx), %rax
	movq	_CS_MODE_PERF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
LBB0_7:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_20:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	testq	%r12, %r12
	je	LBB0_22
## %bb.21:
	movq	%r12, %rdi
	callq	_tmc_etr_free_sysfs_buf
LBB0_22:
	testl	%r13d, %r13d
	jne	LBB0_24
## %bb.23:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	xorl	%r13d, %r13d
LBB0_24:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_CS_MODE_SYSFS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movl	4(%r14), %edi
	callq	_atomic_inc
	xorl	%r13d, %r13d
	jmp	LBB0_20
LBB0_10:
	movq	24(%rbx), %rdi
	callq	_READ_ONCE
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	testq	%r12, %r12
	je	LBB0_12
## %bb.13:
	movq	(%rax), %rcx
	cmpq	(%r12), %rcx
	jne	LBB0_15
## %bb.14:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_16
LBB0_15:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, 24(%rbx)
	jmp	LBB0_16
LBB0_12:
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
LBB0_16:
	movq	24(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_tmc_etr_enable_hw
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %r13d
	jmp	LBB0_19
LBB0_18:
	movq	_CS_MODE_SYSFS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movl	4(%r14), %edi
	callq	_atomic_inc
	xorl	%r13d, %r13d
LBB0_19:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_CS_MODE_PERF,8,3               ## @CS_MODE_PERF
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_CS_MODE_SYSFS,8,3              ## @CS_MODE_SYSFS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TMC-ETR enabled\n"

	.no_dead_strip	_tmc_enable_etr_sink_sysfs
.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_sysfs
_tmc_enable_etr_sink_sysfs:             ; @tmc_enable_etr_sink_sysfs
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	w0, [x0]
	bl	_dev_get_drvdata
	mov	x21, x0
	add	x20, x0, #16
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x0, [x21, #24]
	bl	_READ_ONCE
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x0]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	mov	x22, #0
	ldr	x8, [x21, #32]
	cbnz	x8, LBB0_7
	b	LBB0_6
LBB0_3:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x21
	bl	_tmc_etr_setup_sysfs_buf
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_5:
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	x8, [x21, #32]
	cbnz	x8, LBB0_7
LBB0_6:
	ldr	x8, [x21, #8]
Lloh0:
	adrp	x9, _CS_MODE_PERF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CS_MODE_PERF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
LBB0_7:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_8:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	cbz	x22, LBB0_10
; %bb.9:
	mov	x0, x22
	bl	_tmc_etr_free_sysfs_buf
LBB0_10:
	cbnz	w24, LBB0_12
; %bb.11:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_12:
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh8:
	adrp	x25, _CS_MODE_SYSFS@GOTPAGE
Lloh9:
	ldr	x25, [x25, _CS_MODE_SYSFS@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
	ldr	w0, [x19, #4]
	bl	_atomic_inc
	mov	w24, #0
	b	LBB0_8
LBB0_15:
	ldr	x0, [x21, #24]
	bl	_READ_ONCE
	mov	x23, x0
	cbz	x0, LBB0_19
; %bb.16:
	cbz	x22, LBB0_20
; %bb.17:
	ldr	x8, [x23]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.18:
	mov	x23, x22
	b	LBB0_21
LBB0_19:
	str	x22, [x21, #24]
	b	LBB0_21
LBB0_20:
	mov	x23, #0
LBB0_21:
	ldr	x1, [x21, #24]
	mov	x0, x21
	bl	_tmc_etr_enable_hw
	mov	x24, x0
	cbnz	w0, LBB0_23
; %bb.22:
	ldr	x8, [x25]
	str	x8, [x21, #8]
	ldr	w0, [x19, #4]
	bl	_atomic_inc
LBB0_23:
	mov	x22, x23
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_CS_MODE_PERF,8,3               ; @CS_MODE_PERF
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_CS_MODE_SYSFS,8,3              ; @CS_MODE_SYSFS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TMC-ETR enabled\n"

	.no_dead_strip	_tmc_enable_etr_sink_sysfs
.subsections_via_symbols
