	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2_cache_get_event_idx
_l2_cache_get_event_idx:                ## @l2_cache_get_event_idx
	.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	(%rsi), %rax
	movq	_L2CYCLE_CTR_RAW_CODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	_l2_cycle_ctr_idx@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movl	4(%r14), %esi
	callq	_test_and_set_bit
	testq	%rax, %rax
	jne	LBB0_2
## %bb.3:
	movl	(%rbx), %r12d
	jmp	LBB0_7
LBB0_4:
	movq	%rsi, %r15
	movq	8(%r14), %rax
	movl	(%rax), %ebx
	decl	%ebx
	movl	4(%r14), %edi
	movl	%ebx, %esi
	callq	_find_first_zero_bit
	cmpl	%ebx, %eax
	je	LBB0_2
## %bb.5:
	movl	%eax, %r12d
	movq	(%r15), %rdi
	callq	_L2_EVT_GROUP
	movl	%eax, %r15d
	movl	(%r14), %esi
	movl	%eax, %edi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_6
LBB0_2:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_7:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	4(%r14), %esi
	movl	%r12d, %edi
	callq	_set_bit
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	_set_bit
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_L2CYCLE_CTR_RAW_CODE,8,3       ## @L2CYCLE_CTR_RAW_CODE
	.comm	_l2_cycle_ctr_idx,4,2           ## @l2_cycle_ctr_idx
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_l2_cache_get_event_idx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2_cache_get_event_idx
_l2_cache_get_event_idx:                ; @l2_cache_get_event_idx
	.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	x20, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _L2CYCLE_CTR_RAW_CODE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _L2CYCLE_CTR_RAW_CODE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x19, _l2_cycle_ctr_idx@GOTPAGE
Lloh4:
	ldr	x19, [x19, _l2_cycle_ctr_idx@GOTPAGEOFF]
	ldr	w0, [x19]
	ldr	w1, [x20, #4]
	bl	_test_and_set_bit
	cbnz	x0, LBB0_5
; %bb.2:
	ldr	w19, [x19]
	b	LBB0_6
LBB0_3:
	mov	x21, x1
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	sub	w22, w8, #1
	ldr	w0, [x20, #4]
	mov	x1, x22
	bl	_find_first_zero_bit
	cmp	w0, w22
	b.eq	LBB0_5
; %bb.4:
	mov	x19, x0
	ldr	x0, [x21]
	bl	_L2_EVT_GROUP
	mov	x21, x0
	ldr	w1, [x20]
	bl	_test_bit
	cbz	x0, LBB0_7
LBB0_5:
Lloh5:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
	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
	ret
LBB0_7:
	ldr	w1, [x20, #4]
	mov	x0, x19
	bl	_set_bit
	ldr	w1, [x20]
	mov	x0, x21
	bl	_set_bit
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_L2CYCLE_CTR_RAW_CODE,8,3       ; @L2CYCLE_CTR_RAW_CODE
	.comm	_l2_cycle_ctr_idx,4,2           ; @l2_cycle_ctr_idx
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_l2_cache_get_event_idx
.subsections_via_symbols
