	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmc_flush_and_stop             ## -- Begin function tmc_flush_and_stop
	.p2align	4, 0x90
_tmc_flush_and_stop:                    ## @tmc_flush_and_stop
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_TMC_FFCR@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	8(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, %ebx
	movq	_TMC_FFCR_STOP_ON_FLUSH@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	(%r15), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	movq	_TMC_FFCR_FLUSHMAN_BIT@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	(%r15), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	movq	8(%r14), %rdi
	movq	(%r15), %rsi
	movl	(%r12), %edx
	xorl	%ecx, %ecx
	callq	_coresight_timeout
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tmc_wait_for_tmcready          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TMC_FFCR,8,3                   ## @TMC_FFCR
	.comm	_TMC_FFCR_STOP_ON_FLUSH,4,2     ## @TMC_FFCR_STOP_ON_FLUSH
	.comm	_TMC_FFCR_FLUSHMAN_BIT,4,2      ## @TMC_FFCR_FLUSHMAN_BIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout while waiting for completion of Manual Flush\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tmc_flush_and_stop             ; -- Begin function tmc_flush_and_stop
	.p2align	2
_tmc_flush_and_stop:                    ; @tmc_flush_and_stop
	.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	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x21, _TMC_FFCR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _TMC_FFCR@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh2:
	adrp	x8, _TMC_FFCR_STOP_ON_FLUSH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TMC_FFCR_STOP_ON_FLUSH@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w20, w8, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel_relaxed
Lloh5:
	adrp	x22, _TMC_FFCR_FLUSHMAN_BIT@GOTPAGE
Lloh6:
	ldr	x22, [x22, _TMC_FFCR_FLUSHMAN_BIT@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_BIT
	orr	w0, w0, w20
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldr	x0, [x19, #8]
	ldr	x1, [x21]
	ldr	w2, [x22]
	mov	w3, #0
	bl	_coresight_timeout
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x0, [x19]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	mov	x0, x19
	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
	b	_tmc_wait_for_tmcready
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_TMC_FFCR,8,3                   ; @TMC_FFCR
	.comm	_TMC_FFCR_STOP_ON_FLUSH,4,2     ; @TMC_FFCR_STOP_ON_FLUSH
	.comm	_TMC_FFCR_FLUSHMAN_BIT,4,2      ; @TMC_FFCR_FLUSHMAN_BIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout while waiting for completion of Manual Flush\n"

.subsections_via_symbols
