	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmc_read_prepare_etr           ## -- Begin function tmc_read_prepare_etr
	.p2align	4, 0x90
_tmc_read_prepare_etr:                  ## @tmc_read_prepare_etr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_TMC_CONFIG_TYPE_ETR@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	leaq	24(%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	cmpl	$0, 8(%rbx)
	je	LBB0_5
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_5:
	cmpl	$0, 28(%rbx)
	je	LBB0_6
## %bb.7:
	movq	16(%rbx), %rax
	movq	_CS_MODE_SYSFS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	___tmc_etr_disable_hw
LBB0_9:
	movl	$1, 8(%rbx)
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_TMC_CONFIG_TYPE_ETR,8,3        ## @TMC_CONFIG_TYPE_ETR
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_CS_MODE_SYSFS,8,3              ## @CS_MODE_SYSFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmc_read_prepare_etr           ; -- Begin function tmc_read_prepare_etr
	.p2align	2
_tmc_read_prepare_etr:                  ; @tmc_read_prepare_etr
	.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
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _TMC_CONFIG_TYPE_ETR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TMC_CONFIG_TYPE_ETR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_2:
	add	x19, x20, #24
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_5:
	ldr	w8, [x20, #28]
	cbz	w8, LBB0_11
; %bb.6:
	ldr	x8, [x20, #16]
Lloh8:
	adrp	x9, _CS_MODE_SYSFS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CS_MODE_SYSFS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	___tmc_etr_disable_hw
LBB0_8:
	mov	w21, #0
	mov	w8, #1
	str	w8, [x20, #8]
LBB0_9:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_10:
	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_11:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_TMC_CONFIG_TYPE_ETR,8,3        ; @TMC_CONFIG_TYPE_ETR
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_CS_MODE_SYSFS,8,3              ; @CS_MODE_SYSFS
.subsections_via_symbols
