	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmc_update_etr_buffer
_tmc_update_etr_buffer:                 ## @tmc_update_etr_buffer
	.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	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	8(%r15), %r13
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %edi
	callq	_atomic_read
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.2:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	xorl	%edi, %edi
	cmpq	%r13, 8(%r14)
	setne	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	cmpq	$0, (%r15)
	sete	%al
	movl	$1, %ebx
	xorl	%r12d, %r12d
	testb	%al, %al
	je	LBB0_15
LBB0_13:
	testl	%ebx, %ebx
	je	LBB0_15
## %bb.14:
	movq	_PERF_AUX_FLAG_TRUNCATED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_perf_aux_output_flag
	jmp	LBB0_15
LBB0_1:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r12d, %r12d
LBB0_15:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	4(%r14), %edi
	callq	_CS_UNLOCK
	movq	%r14, %rdi
	callq	_tmc_flush_and_stop
	movq	%r14, %rdi
	callq	_tmc_sync_etr_buf
	movl	4(%r14), %edi
	callq	_CS_LOCK
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r13), %ebx
	movq	8(%r13), %rsi
	movq	16(%r13), %r12
	cmpq	$0, (%r15)
	jne	LBB0_7
## %bb.5:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	(%rax), %r12
	jbe	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_tmc_get_memwidth_mask
	movq	%rax, %r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	andq	(%rax), %r12
	movq	8(%r13), %rsi
	movq	24(%r13), %rax
	movq	%rsi, %r14
	subq	%r12, %r14
	addq	16(%r13), %r14
	xorl	%ecx, %ecx
	cmpq	%rax, %r14
	cmovaeq	%rax, %rcx
	subq	%rcx, %r14
	movl	$1, %ebx
	jmp	LBB0_9
LBB0_7:
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.8:
	movq	%rsi, %r14
LBB0_9:
	movq	%r13, %rdi
	callq	_tmc_etr_buf_insert_barrier_packet
	movq	%r14, %rsi
	jmp	LBB0_10
LBB0_16:
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_tmc_etr_sync_perf_buffer
	cmpq	$0, (%r15)
	je	LBB0_11
## %bb.17:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	%r12, 8(%rax)
	jmp	LBB0_15
LBB0_11:
	movb	$1, %al
	testb	%al, %al
	jne	LBB0_13
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_PERF_AUX_FLAG_TRUNCATED,4,2    ## @PERF_AUX_FLAG_TRUNCATED
	.no_dead_strip	_tmc_update_etr_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmc_update_etr_buffer
_tmc_update_etr_buffer:                 ; @tmc_update_etr_buffer
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w0, [x0, #4]
	bl	_dev_get_drvdata
	mov	x23, x0
	ldr	x22, [x20, #8]
	bl	_spin_lock_irqsave
	ldr	w0, [x21]
	bl	_atomic_read
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x23, #8]
	cmp	x8, x22
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_7
; %bb.2:
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	x21, #0
	ldr	x8, [x20]
	cmp	x8, #0
	cset	w8, eq
	mov	w24, #1
	cbz	w8, LBB0_6
LBB0_3:
	cbz	w24, LBB0_6
; %bb.4:
Lloh0:
	adrp	x8, _PERF_AUX_FLAG_TRUNCATED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PERF_AUX_FLAG_TRUNCATED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_perf_aux_output_flag
	b	LBB0_6
LBB0_5:
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	x21, #0
LBB0_6:
	mov	x0, x21
	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:
	ldr	w0, [x23, #4]
	bl	_CS_UNLOCK
	mov	x0, x23
	bl	_tmc_flush_and_stop
	mov	x0, x23
	bl	_tmc_sync_etr_buf
	ldr	w0, [x23, #4]
	bl	_CS_LOCK
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	ldr	w24, [x22]
	ldp	x1, x21, [x22, #8]
	ldr	x8, [x20]
	cbnz	x8, LBB0_10
; %bb.8:
	ldr	x8, [x19]
	cmp	x21, x8
	b.ls	LBB0_10
; %bb.9:
	mov	x0, x23
	bl	_tmc_get_memwidth_mask
	ldr	x8, [x19]
	and	x21, x8, x0
	ldp	x1, x8, [x22, #8]
	sub	x9, x1, x21
	add	x8, x9, x8
	ldr	x9, [x22, #24]
	cmp	x8, x9
	csel	x9, xzr, x9, lo
	sub	x23, x8, x9
	mov	w24, #1
	b	LBB0_12
LBB0_10:
	cbz	w24, LBB0_13
; %bb.11:
	mov	x23, x1
LBB0_12:
	mov	x0, x22
	bl	_tmc_etr_buf_insert_barrier_packet
	mov	x1, x23
LBB0_13:
	mov	x0, x20
	mov	x2, x21
	bl	_tmc_etr_sync_perf_buffer
	ldr	x8, [x20]
	cbz	x8, LBB0_15
; %bb.14:
	ldr	x8, [x19, #8]
	add	x8, x8, x21
	str	x8, [x19, #8]
	b	LBB0_6
LBB0_15:
	mov	w8, #1
	cbnz	w8, LBB0_3
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PERF_AUX_FLAG_TRUNCATED,4,2    ; @PERF_AUX_FLAG_TRUNCATED
	.no_dead_strip	_tmc_update_etr_buffer
.subsections_via_symbols
