	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsu_pmu_get_event_idx
_dsu_pmu_get_event_idx:                 ## @dsu_pmu_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rsi), %rbx
	movl	(%rsi), %edi
	callq	_to_dsu_pmu
	movq	%rax, %r15
	movq	(%r14), %rax
	movq	_DSU_PMU_EVT_CYCLES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rbx
	jne	LBB0_4
## %bb.1:
	movq	_DSU_PMU_IDX_CYCLE_COUNTER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	%rax, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	jne	LBB0_2
## %bb.3:
	movl	(%rbx), %ebx
	jmp	LBB0_6
LBB0_4:
	movl	(%r15), %esi
	movq	%rax, %rdi
	callq	_find_first_zero_bit
	cmpl	(%r15), %eax
	jge	LBB0_2
## %bb.5:
	movl	%eax, %ebx
	movq	(%r14), %rsi
	movl	%eax, %edi
	callq	_set_bit
	jmp	LBB0_6
LBB0_2:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DSU_PMU_EVT_CYCLES,8,3         ## @DSU_PMU_EVT_CYCLES
	.comm	_DSU_PMU_IDX_CYCLE_COUNTER,4,2  ## @DSU_PMU_IDX_CYCLE_COUNTER
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_dsu_pmu_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 dsu_pmu_get_event_idx
_dsu_pmu_get_event_idx:                 ; @dsu_pmu_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	x19, x0
	ldr	x20, [x1, #8]
	ldr	w0, [x1]
	bl	_to_dsu_pmu
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _DSU_PMU_EVT_CYCLES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DSU_PMU_EVT_CYCLES@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x20, x9
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x19, _DSU_PMU_IDX_CYCLE_COUNTER@GOTPAGE
Lloh4:
	ldr	x19, [x19, _DSU_PMU_IDX_CYCLE_COUNTER@GOTPAGEOFF]
	ldr	w0, [x19]
	mov	x1, x8
	bl	_test_and_set_bit
	cbnz	x0, LBB0_5
; %bb.2:
	ldr	w20, [x19]
	b	LBB0_6
LBB0_3:
	mov	x21, x0
	ldr	w1, [x0]
	mov	x0, x8
	bl	_find_first_zero_bit
	ldr	w8, [x21]
	cmp	w0, w8
	b.ge	LBB0_5
; %bb.4:
	mov	x20, x0
	ldr	x1, [x19]
	bl	_set_bit
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DSU_PMU_EVT_CYCLES,8,3         ; @DSU_PMU_EVT_CYCLES
	.comm	_DSU_PMU_IDX_CYCLE_COUNTER,4,2  ; @DSU_PMU_IDX_CYCLE_COUNTER
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_dsu_pmu_get_event_idx
.subsections_via_symbols
