	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amd_get_event_constraints
_amd_get_event_constraints:             ## @amd_get_event_constraints
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_x86_pmu@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	callq	_amd_has_nb
	movq	_unconstrained@GOTPCREL(%rip), %r14
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rbx, %rdi
	callq	_amd_is_nb_event
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	testl	%r12d, %r12d
	jle	LBB0_3
## %bb.4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rcx
	movl	$-1, %eax
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%r14,8), %rdx
	cmpq	%rbx, %rdx
	je	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	negq	%rdx
	movl	$0, %edx
	sbbl	%edx, %edx
	orl	%r14d, %edx
	cmpl	$-1, %eax
	cmovel	%edx, %eax
	incq	%r14
	cmpq	%r14, %r12
	jne	LBB0_5
## %bb.7:
	movl	(%rbx), %r15d
	cmpl	$-1, %r15d
	sete	%cl
	cmpl	$-1, %eax
	jne	LBB0_9
	jmp	LBB0_8
LBB0_3:
	movl	(%rbx), %r15d
	cmpl	$-1, %r15d
	sete	%cl
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	testb	%cl, %cl
	cmovnel	%eax, %r15d
	movl	%r15d, %r13d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r13d, %r14
	leaq	(,%r14,8), %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_cmpxchg
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%r13d
	cmpl	%r12d, %r13d
	movl	$0, %eax
	cmovel	%eax, %r13d
	cmpl	%r15d, %r13d
	jne	LBB0_10
## %bb.12:
	movq	_emptyconstraint@GOTPCREL(%rip), %r14
	jmp	LBB0_14
LBB0_13:
	shlq	$2, %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %r14
LBB0_14:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_x86_pmu,4,2                    ## @x86_pmu
	.comm	_unconstrained,4,2              ## @unconstrained
	.comm	_emptyconstraint,4,2            ## @emptyconstraint
	.no_dead_strip	_amd_get_event_constraints
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amd_get_event_constraints
_amd_get_event_constraints:             ; @amd_get_event_constraints
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _x86_pmu@GOTPAGE
Lloh1:
	ldr	x8, [x8, _x86_pmu@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_amd_has_nb
	cbz	x0, LBB0_7
; %bb.1:
	mov	x0, x19
	bl	_amd_is_nb_event
	cbz	x0, LBB0_7
; %bb.2:
	cmp	w22, #0
	b.le	LBB0_8
; %bb.3:
	mov	x23, #0
	ldr	x9, [x21, #8]
	mov	w8, #-1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x23, lsl #3]
	cmp	x10, x19
	b.eq	LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x10, #0
	csinv	w10, w23, wzr, eq
	cmn	w8, #1
	csel	w8, w10, w8, eq
	add	x23, x23, #1
	cmp	x22, x23
	b.ne	LBB0_4
; %bb.6:
	ldr	w9, [x19]
	cmn	w9, #1
	cset	w10, eq
	cmn	w8, #1
	b.ne	LBB0_10
	b	LBB0_9
LBB0_7:
Lloh3:
	adrp	x20, _unconstrained@GOTPAGE
Lloh4:
	ldr	x20, [x20, _unconstrained@GOTPAGEOFF]
	b	LBB0_14
LBB0_8:
	ldr	w9, [x19]
	cmn	w9, #1
	cset	w10, eq
LBB0_9:
	mov	w8, #0
LBB0_10:
	cmp	w10, #0
	csel	w24, w8, w9, ne
Lloh5:
	adrp	x20, _emptyconstraint@GOTPAGE
Lloh6:
	ldr	x20, [x20, _emptyconstraint@GOTPAGEOFF]
	mov	x8, x24
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x21, #8]
	sxtw	x23, w8
	add	x0, x9, w8, sxtw #3
	mov	x1, #0
	mov	x2, x19
	bl	_cmpxchg
	cbz	x0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	w8, w23, #1
	cmp	w8, w22
	csinc	w8, wzr, w23, eq
	cmp	w8, w24
	b.ne	LBB0_11
	b	LBB0_14
LBB0_13:
	ldr	x8, [x21]
	add	x20, x8, x23, lsl #2
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_x86_pmu,4,2                    ; @x86_pmu
	.comm	_unconstrained,4,2              ; @unconstrained
	.comm	_emptyconstraint,4,2            ; @emptyconstraint
	.no_dead_strip	_amd_get_event_constraints
.subsections_via_symbols
