	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armpmu_event_set_period        ## -- Begin function armpmu_event_set_period
	.p2align	4, 0x90
_armpmu_event_set_period:               ## @armpmu_event_set_period
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	16(%rdi), %edi
	callq	_to_arm_pmu
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	12(%r12), %r13
	movq	%r13, %rdi
	callq	_local64_read
	movl	%eax, %r14d
	movl	(%r12), %ebx
	movq	%r12, %rdi
	callq	_arm_pmu_event_max_period
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %eax
	negl	%eax
	xorl	%edi, %edi
	cmpl	%eax, %r14d
	setle	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_local64_set
	movl	%ebx, 4(%r12)
	movl	$1, %r15d
	movl	%ebx, %r14d
	jmp	LBB0_3
LBB0_1:
	xorl	%r15d, %r15d
LBB0_3:
	xorl	%edi, %edi
	testl	%r14d, %r14d
	setle	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	addl	%ebx, %r14d
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_local64_set
	movl	%ebx, 4(%r12)
	movl	$1, %r15d
LBB0_5:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %ebx
	sarl	%ebx
	cmpl	%ebx, %r14d
	cmovll	%r14d, %ebx
	leaq	8(%r12), %rdi
	negl	%ebx
	movl	%ebx, %esi
	callq	_local64_set
	andl	%r13d, %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	callq	*(%rax)
	movq	%r12, %rdi
	callq	_perf_event_update_userpage
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armpmu_event_set_period        ; -- Begin function armpmu_event_set_period
	.p2align	2
_armpmu_event_set_period:               ; @armpmu_event_set_period
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_to_arm_pmu
	mov	x20, x0
	add	x23, x19, #12
	mov	x0, x23
	bl	_local64_read
	mov	x22, x0
	ldr	w24, [x19]
	mov	x0, x19
	bl	_arm_pmu_event_max_period
	mov	x21, x0
	neg	w8, w24
	cmp	w22, w8
	cset	w0, le
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x23
	mov	x1, x24
	bl	_local64_set
	str	w24, [x19, #4]
	mov	w25, #1
	mov	x22, x24
	b	LBB0_3
LBB0_2:
	mov	w25, #0
LBB0_3:
	cmp	w22, #1
	cset	w0, lt
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.4:
	add	w22, w22, w24
	mov	x0, x23
	mov	x1, x22
	bl	_local64_set
	str	w24, [x19, #4]
	mov	w25, #1
LBB0_5:
	asr	w8, w21, #1
	cmp	w22, w8
	csel	w8, w22, w8, lt
	add	x0, x19, #8
	neg	w22, w8
	mov	x1, x22
	bl	_local64_set
	ldr	x8, [x20]
	and	w1, w21, w22
	mov	x0, x19
	blr	x8
	mov	x0, x19
	bl	_perf_event_update_userpage
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
