	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmc_update_etf_buffer
_tmc_update_etf_buffer:                 ## @tmc_update_etf_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	4(%rdi), %edi
	callq	_dev_get_drvdata
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	_CS_MODE_PERF@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_28
LBB0_4:
	movq	%r13, %r14
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	(%r12), %edi
	callq	_atomic_read
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.5:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	24(%r13), %rdi
	callq	_CS_UNLOCK
	movq	%r13, %rdi
	callq	_tmc_flush_and_stop
	movq	%r13, %rdi
	callq	_tmc_read_rrp
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_tmc_read_rwp
	movl	%eax, %r12d
	movq	_TMC_STS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r13), %rdi
	callq	_readl_relaxed
	movl	%eax, %r14d
	movq	_TMC_STS_FULL@GOTPCREL(%rip), %rcx
	movq	8(%r13), %rdx
	movl	$1, %eax
	andl	(%rcx), %r14d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_8
## %bb.6:
	movq	%rdx, %r12
	jmp	LBB0_9
LBB0_7:
	xorl	%r12d, %r12d
	jmp	LBB0_27
LBB0_8:
	movl	%r12d, %edi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_CIRC_CNT
	movq	%rax, %r12
	xorl	%eax, %eax
LBB0_9:
	movq	%rbx, %rsi
	cmpq	$0, 32(%rbx)
	je	LBB0_11
## %bb.10:
	testl	%r14d, %r14d
	setne	-44(%rbp)                       ## 1-byte Folded Spill
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_11:
	movb	$1, %cl
	cmpq	(%r15), %r12
	jbe	LBB0_13
## %bb.12:
	movq	%r13, %rdi
	callq	_tmc_get_memwidth_mask
	movslq	%eax, %r12
	andq	(%r15), %r12
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	8(%r13), %rcx
	addq	%rcx, %rax
	subq	%r12, %rax
	movslq	%eax, %rsi
	leaq	-1(%rcx), %rax
	xorl	%edx, %edx
	cmpq	%rax, %rsi
	cmovbel	%edx, %ecx
	subl	%ecx, %esi
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_tmc_write_rrp
	movq	%rbx, %rsi
	cmpq	$0, 32(%rbx)
	sete	%cl
	movl	$1, %eax
LBB0_13:
	testl	%eax, %eax
	setne	-44(%rbp)                       ## 1-byte Folded Spill
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_16
## %bb.14:
	testb	%cl, %cl
	je	LBB0_16
## %bb.15:
	movq	_PERF_AUX_FLAG_TRUNCATED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_perf_aux_output_flag
	movq	%rbx, %rsi
	movb	$1, -44(%rbp)                   ## 1-byte Folded Spill
LBB0_16:
	testq	%r12, %r12
	je	LBB0_29
## %bb.17:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	_barrier_pkt@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	8(%rsi), %r13
	movl	(%rsi), %edx
	xorl	%r14d, %r14d
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_19 Depth=1
	addq	$4, %r14
	cmpq	%r14, %r12
	jbe	LBB0_24
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rsi), %rax
	movl	%edx, %ebx
	movslq	%edx, %rcx
	movq	(%rax,%rcx,8), %r12
	movq	_TMC_RRD@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	24(%rax), %rdi
	callq	_readl_relaxed
	movl	%eax, (%r12,%r13,4)
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	%eax, (%r12,%r13,4)
	addq	$4, %r15
LBB0_22:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movl	%ebx, %edx
	addq	$4, %r13
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jb	LBB0_18
## %bb.23:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	%edx
	movl	24(%rsi), %eax
	decl	%eax
	andl	%eax, %edx
	xorl	%r13d, %r13d
	jmp	LBB0_18
LBB0_24:
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	cmpq	$0, 32(%rsi)
	je	LBB0_26
LBB0_25:
	addq	%r12, 8(%r15)
LBB0_26:
	movq	24(%r13), %rdi
	callq	_CS_LOCK
LBB0_27:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_28:
	movq	%r12, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	xorl	%r12d, %r12d
	cmpq	$0, 32(%rsi)
	jne	LBB0_25
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_CS_MODE_PERF,8,3               ## @CS_MODE_PERF
	.comm	_TMC_STS,8,3                    ## @TMC_STS
	.comm	_TMC_STS_FULL,4,2               ## @TMC_STS_FULL
	.comm	_PERF_AUX_FLAG_TRUNCATED,4,2    ## @PERF_AUX_FLAG_TRUNCATED
	.comm	_barrier_pkt,8,3                ## @barrier_pkt
	.comm	_TMC_RRD,8,3                    ## @TMC_RRD
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_tmc_update_etf_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_etf_buffer
_tmc_update_etf_buffer:                 ; @tmc_update_etf_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	ldr	w0, [x0, #4]
	bl	_dev_get_drvdata
	cbz	x21, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CS_MODE_PERF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CS_MODE_PERF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_3
LBB0_2:
	mov	x23, #0
	b	LBB0_28
LBB0_3:
	add	x26, x20, #16
	mov	x0, x26
	bl	_spin_lock_irqsave
	ldr	w0, [x23]
	bl	_atomic_read
	cmp	w0, #1
	b.ne	LBB0_7
; %bb.4:
	ldr	x0, [x20, #24]
	bl	_CS_UNLOCK
	mov	x0, x20
	bl	_tmc_flush_and_stop
	mov	x0, x20
	bl	_tmc_read_rrp
	mov	x25, x0
	mov	x0, x20
	bl	_tmc_read_rwp
	mov	x24, x0
	ldr	x8, [x20, #24]
Lloh3:
	adrp	x9, _TMC_STS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TMC_STS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh6:
	adrp	x8, _TMC_STS_FULL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TMC_STS_FULL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x23, [x20, #8]
	ands	w19, w8, w0
	b.eq	LBB0_8
; %bb.5:
	mov	w8, #1
	ldr	x9, [x21, #32]
	cbz	x9, LBB0_9
LBB0_6:
	cmp	w19, #0
	cset	w24, ne
	b	LBB0_15
LBB0_7:
	mov	x23, #0
	b	LBB0_27
LBB0_8:
	mov	x0, x24
	mov	x1, x25
	mov	x2, x23
	bl	_CIRC_CNT
	mov	x23, x0
	mov	w8, #0
	ldr	x9, [x21, #32]
	cbnz	x9, LBB0_6
LBB0_9:
	ldr	x9, [x22]
	cmp	x23, x9
	b.ls	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_tmc_get_memwidth_mask
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x22]
	sxtw	x9, w0
	and	x23, x8, x9
	ldr	x8, [x20, #8]
	add	x9, x8, w24, uxtw
	sub	x10, x8, #1
	sub	x9, x9, x23
	cmp	x10, w9, sxtw
	csel	w8, w8, wzr, lo
	sub	w1, w9, w8
	mov	x0, x20
	bl	_tmc_write_rrp
	ldr	x8, [x21, #32]
	cmp	x8, #0
	cset	w9, eq
	mov	w8, #1
	b	LBB0_12
LBB0_11:
	mov	w9, #1
LBB0_12:
	cmp	w8, #0
	cset	w24, ne
	cbz	w8, LBB0_15
; %bb.13:
	cbz	w9, LBB0_15
; %bb.14:
Lloh9:
	adrp	x8, _PERF_AUX_FLAG_TRUNCATED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PERF_AUX_FLAG_TRUNCATED@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_perf_aux_output_flag
	mov	w24, #1
LBB0_15:
	cbz	x23, LBB0_24
; %bb.16:
	stp	x26, x22, [sp]                  ; 16-byte Folded Spill
	mov	x25, #0
Lloh12:
	adrp	x8, _barrier_pkt@GOTPAGE
Lloh13:
	ldr	x8, [x8, _barrier_pkt@GOTPAGEOFF]
Lloh14:
	ldr	x26, [x8]
	ldr	x27, [x21, #8]
	ldr	w28, [x21]
Lloh15:
	adrp	x19, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x19, [x19, _PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x25, x25, #4
	cmp	x23, x25
	b.ls	LBB0_23
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #16]
	ldr	x22, [x8, w28, sxtw #3]
	ldr	x8, [x20, #24]
Lloh17:
	adrp	x9, _TMC_RRD@GOTPAGE
Lloh18:
	ldr	x9, [x9, _TMC_RRD@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
	str	w0, [x22, x27, lsl #2]
	cbz	w24, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w8, [x26]
	cbz	w8, LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	str	w8, [x22, x27, lsl #2]
	add	x26, x26, #4
LBB0_21:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x27, x27, #4
	ldr	x8, [x19]
	cmp	x27, x8
	b.lo	LBB0_17
; %bb.22:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x27, #0
	add	w8, w28, #1
	ldr	w9, [x21, #24]
	sub	w9, w9, #1
	and	w28, w9, w8
	b	LBB0_17
LBB0_23:
	ldp	x26, x22, [sp]                  ; 16-byte Folded Reload
LBB0_24:
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_26
; %bb.25:
	ldr	x8, [x22, #8]
	add	x8, x8, x23
	str	x8, [x22, #8]
LBB0_26:
	ldr	x0, [x20, #24]
	bl	_CS_LOCK
LBB0_27:
	mov	x0, x26
	bl	_spin_unlock_irqrestore
LBB0_28:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_CS_MODE_PERF,8,3               ; @CS_MODE_PERF
	.comm	_TMC_STS,8,3                    ; @TMC_STS
	.comm	_TMC_STS_FULL,4,2               ; @TMC_STS_FULL
	.comm	_PERF_AUX_FLAG_TRUNCATED,4,2    ; @PERF_AUX_FLAG_TRUNCATED
	.comm	_barrier_pkt,8,3                ; @barrier_pkt
	.comm	_TMC_RRD,8,3                    ; @TMC_RRD
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_tmc_update_etf_buffer
.subsections_via_symbols
