	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arm_spe_pmu_stop
_arm_spe_pmu_stop:                      ## @arm_spe_pmu_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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_to_spe_pmu
	movl	(%rax), %edi
	callq	_this_cpu_ptr
	movq	%rax, %r14
	movq	_PERF_HES_STOPPED@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%rbx)
	jne	LBB0_9
## %bb.1:
	xorl	%eax, %eax
	callq	_arm_spe_pmu_disable_and_drain_local
	movq	_PERF_EF_UPDATE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	callq	_perf_get_aux
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_arm_spe_pmu_buf_get_fault_act
	movq	_SPE_PMU_BUF_FAULT_ACT_SPURIOUS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_arm_spe_perf_aux_output_end
	jmp	LBB0_7
LBB0_2:
	movl	(%rbx), %eax
	jmp	LBB0_8
LBB0_6:
	movq	_SYS_PMBSR_EL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_write_sysreg_s
LBB0_7:
	leaq	4(%rbx), %r14
	movq	_SYS_PMSICR_EL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_read_sysreg_s
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_local64_set
	movq	_PERF_HES_UPTODATE@GOTPCREL(%rip), %rcx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
LBB0_8:
	orl	(%r12), %eax
	movl	%eax, (%rbx)
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PERF_HES_STOPPED,4,2           ## @PERF_HES_STOPPED
	.comm	_PERF_EF_UPDATE,4,2             ## @PERF_EF_UPDATE
	.comm	_SPE_PMU_BUF_FAULT_ACT_SPURIOUS,4,2 ## @SPE_PMU_BUF_FAULT_ACT_SPURIOUS
	.comm	_SYS_PMBSR_EL1,4,2              ## @SYS_PMBSR_EL1
	.comm	_SYS_PMSICR_EL1,4,2             ## @SYS_PMSICR_EL1
	.comm	_PERF_HES_UPTODATE,4,2          ## @PERF_HES_UPTODATE
	.no_dead_strip	_arm_spe_pmu_stop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arm_spe_pmu_stop
_arm_spe_pmu_stop:                      ; @arm_spe_pmu_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	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_to_spe_pmu
	ldr	w0, [x0]
	bl	_this_cpu_ptr
	ldr	w8, [x19]
Lloh0:
	adrp	x22, _PERF_HES_STOPPED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PERF_HES_STOPPED@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.1:
	mov	x20, x0
	bl	_arm_spe_pmu_disable_and_drain_local
Lloh2:
	adrp	x8, _PERF_EF_UPDATE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PERF_EF_UPDATE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_5
; %bb.2:
	mov	x0, x20
	bl	_perf_get_aux
	cbz	x0, LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_arm_spe_pmu_buf_get_fault_act
Lloh5:
	adrp	x8, _SPE_PMU_BUF_FAULT_ACT_SPURIOUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SPE_PMU_BUF_FAULT_ACT_SPURIOUS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_arm_spe_perf_aux_output_end
	b	LBB0_7
LBB0_5:
	ldr	w8, [x19]
	b	LBB0_8
LBB0_6:
Lloh8:
	adrp	x8, _SYS_PMBSR_EL1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SYS_PMBSR_EL1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_write_sysreg_s
LBB0_7:
	add	x20, x19, #4
Lloh11:
	adrp	x8, _SYS_PMSICR_EL1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SYS_PMSICR_EL1@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_read_sysreg_s
	mov	x1, x0
	mov	x0, x20
	bl	_local64_set
Lloh14:
	adrp	x8, _PERF_HES_UPTODATE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PERF_HES_UPTODATE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	ldr	w9, [x22]
	orr	w8, w8, w9
	str	w8, [x19]
LBB0_9:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PERF_HES_STOPPED,4,2           ; @PERF_HES_STOPPED
	.comm	_PERF_EF_UPDATE,4,2             ; @PERF_EF_UPDATE
	.comm	_SPE_PMU_BUF_FAULT_ACT_SPURIOUS,4,2 ; @SPE_PMU_BUF_FAULT_ACT_SPURIOUS
	.comm	_SYS_PMBSR_EL1,4,2              ; @SYS_PMBSR_EL1
	.comm	_SYS_PMSICR_EL1,4,2             ; @SYS_PMSICR_EL1
	.comm	_PERF_HES_UPTODATE,4,2          ; @PERF_HES_UPTODATE
	.no_dead_strip	_arm_spe_pmu_stop
.subsections_via_symbols
