	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmc_read_prepare_etb           ## -- Begin function tmc_read_prepare_etb
	.p2align	4, 0x90
_tmc_read_prepare_etb:                  ## @tmc_read_prepare_etb
	.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_ETB@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%cl
	movq	_TMC_CONFIG_TYPE_ETF@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	setne	%al
	andb	%cl, %al
	movzbl	%al, %edi
	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_13
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
	jmp	LBB0_4
LBB0_5:
	movq	_TMC_MODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	40(%rbx), %rdi
	callq	_readl_relaxed
	movq	_TMC_MODE_CIRCULAR_BUFFER@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.7:
	movq	16(%rbx), %rax
	movq	_CS_MODE_PERF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.8:
	cmpq	$0, 32(%rbx)
	je	LBB0_6
## %bb.9:
	movq	_CS_MODE_SYSFS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	___tmc_etb_disable_hw
LBB0_11:
	movl	$1, 8(%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TMC_CONFIG_TYPE_ETB,8,3        ## @TMC_CONFIG_TYPE_ETB
	.comm	_TMC_CONFIG_TYPE_ETF,8,3        ## @TMC_CONFIG_TYPE_ETF
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TMC_MODE,8,3                   ## @TMC_MODE
	.comm	_TMC_MODE_CIRCULAR_BUFFER,4,2   ## @TMC_MODE_CIRCULAR_BUFFER
	.comm	_CS_MODE_PERF,8,3               ## @CS_MODE_PERF
	.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_etb           ; -- Begin function tmc_read_prepare_etb
	.p2align	2
_tmc_read_prepare_etb:                  ; @tmc_read_prepare_etb
	.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_ETB@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TMC_CONFIG_TYPE_ETB@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh3:
	adrp	x9, _TMC_CONFIG_TYPE_ETF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TMC_CONFIG_TYPE_ETF@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
	cset	w0, ne
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_2:
	add	x19, x20, #24
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	ldr	x8, [x20, #40]
Lloh11:
	adrp	x9, _TMC_MODE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TMC_MODE@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh14:
	adrp	x8, _TMC_MODE_CIRCULAR_BUFFER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TMC_MODE_CIRCULAR_BUFFER@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.5:
	ldr	x8, [x20, #16]
Lloh17:
	adrp	x9, _CS_MODE_PERF@GOTPAGE
Lloh18:
	ldr	x9, [x9, _CS_MODE_PERF@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.6:
	ldr	x9, [x20, #32]
	cbz	x9, LBB0_10
; %bb.7:
Lloh20:
	adrp	x9, _CS_MODE_SYSFS@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CS_MODE_SYSFS@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x20
	bl	___tmc_etb_disable_hw
LBB0_9:
	mov	w21, #0
	mov	w8, #1
	str	w8, [x20, #8]
	b	LBB0_12
LBB0_10:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
LBB0_13:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_TMC_CONFIG_TYPE_ETB,8,3        ; @TMC_CONFIG_TYPE_ETB
	.comm	_TMC_CONFIG_TYPE_ETF,8,3        ; @TMC_CONFIG_TYPE_ETF
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TMC_MODE,8,3                   ; @TMC_MODE
	.comm	_TMC_MODE_CIRCULAR_BUFFER,4,2   ; @TMC_MODE_CIRCULAR_BUFFER
	.comm	_CS_MODE_PERF,8,3               ; @CS_MODE_PERF
	.comm	_CS_MODE_SYSFS,8,3              ; @CS_MODE_SYSFS
.subsections_via_symbols
