	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uncore_assign_events
_uncore_assign_events:                  ## @uncore_assign_events
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_UNCORE_PMC_IDX_MAX@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_BITS_TO_LONGS
	movl	%eax, %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	(%r15), %r14d
	movq	%r14, %rax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_bitmap_zero
	movl	(%r15), %edx
	movl	%r13d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_12
## %bb.1:
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movq	%r12, %r14
	movl	%edx, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r14, %rdi
	callq	_uncore_get_event_constraint
	movq	%rax, %r13
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax,%rbx,8)
	movl	8(%r13), %esi
	movl	%r12d, %edi
	callq	_min
	movl	%eax, %r12d
	movl	8(%r13), %esi
	movl	%r15d, %edi
	callq	_max
	movl	%eax, %r15d
	incq	%rbx
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_2
## %bb.3:
	movl	%r12d, -84(%rbp)                ## 4-byte Spill
	xorl	%ebx, %ebx
	movq	%r14, %r12
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_14
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %r13
	movl	(%r13), %edi
	cmpl	$-1, %edi
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14,%rbx,8), %rax
	movq	(%rax), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %edi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %edi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	___set_bit
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %eax
	movl	%eax, (%rcx,%rbx,4)
	jmp	LBB0_4
LBB0_10:
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	movl	-84(%rbp), %edx                 ## 4-byte Reload
	cmpl	%r13d, %ebx
	jne	LBB0_13
LBB0_11:
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_12:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	cmpl	%r13d, %ebx
	je	LBB0_11
LBB0_13:
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%r15d, %ecx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_perf_assign_events
	testl	%eax, %eax
	setne	%r14b
	jmp	LBB0_16
LBB0_14:
	xorl	%r14d, %r14d
	movl	-60(%rbp), %r13d                ## 4-byte Reload
LBB0_15:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
LBB0_16:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	testq	%rbx, %rbx
	sete	%al
	orb	%r14b, %al
	cmpb	$1, %al
	jne	LBB0_20
## %bb.17:
	testl	%r13d, %r13d
	jle	LBB0_20
## %bb.18:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rsi
	movq	%r12, %rdi
	callq	_uncore_put_event_constraint
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_19
LBB0_20:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	xorl	%ecx, %ecx
	testb	%r14b, %r14b
	cmovel	%ecx, %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_22
## %bb.21:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_UNCORE_PMC_IDX_MAX,4,2         ## @UNCORE_PMC_IDX_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_uncore_assign_events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uncore_assign_events
_uncore_assign_events:                  ; @uncore_assign_events
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x28, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x20, _UNCORE_PMC_IDX_MAX@GOTPAGE
Lloh4:
	ldr	x20, [x20, _UNCORE_PMC_IDX_MAX@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_BITS_TO_LONGS
	mov	w8, w0
	lsl	x8, x8, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x23, x9, x8
	mov	sp, x23
	ldr	w1, [x20]
	lsl	x8, x1, #3
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x22, x9, x8
	mov	sp, x22
	mov	x0, x23
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_bitmap_zero
	ldr	w24, [x20]
	mov	w27, w28
	cmp	w28, #1
	b.lt	LBB0_10
; %bb.1:
	stur	w28, [x29, #-92]                ; 4-byte Folded Spill
	mov	x28, #0
	mov	w25, #0
	lsl	x20, x27, #3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x1, [x8, x28]
	mov	x0, x19
	bl	_uncore_get_event_constraint
	mov	x26, x0
	str	x0, [x22, x28]
	ldr	w1, [x0, #8]
	mov	x0, x24
	bl	_min
	mov	x24, x0
	ldr	w1, [x26, #8]
	mov	x0, x25
	bl	_max
	mov	x25, x0
	add	x28, x28, #8
	cmp	x20, x28
	b.ne	LBB0_2
; %bb.3:
	mov	x26, #0
	ldur	w28, [x29, #-92]                ; 4-byte Folded Reload
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x26, x26, #1
	cmp	x27, x26
	b.eq	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x20, [x8, x26, lsl #3]
	ldr	w0, [x20]
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22, x26, lsl #3]
	ldr	x1, [x8]
	bl	_test_bit
	cbz	x0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20]
	mov	x1, x23
	bl	_test_bit
	cbnz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20]
	mov	x1, x23
	bl	___set_bit
	cbz	x21, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	str	w8, [x21, x26, lsl #2]
	b	LBB0_4
LBB0_10:
	mov	w25, #0
	mov	w26, #0
LBB0_11:
	cmp	w26, w28
	b.ne	LBB0_13
LBB0_12:
	mov	w20, #0
	b	LBB0_14
LBB0_13:
	mov	x0, x22
	mov	x1, x28
	mov	x2, x24
	mov	x3, x25
	mov	x4, x21
	bl	_perf_assign_events
	cmp	w0, #0
	cset	w20, ne
LBB0_14:
	cmp	x21, #0
	cset	w8, eq
	orr	w8, w8, w20
	cmp	w8, #1
	b.ne	LBB0_18
; %bb.15:
	cmp	w28, #1
	b.lt	LBB0_18
; %bb.16:
	mov	x21, #0
	lsl	x22, x27, #3
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x1, [x8, x21]
	mov	x0, x19
	bl	_uncore_put_event_constraint
	add	x21, x21, #8
	cmp	x22, x21
	b.ne	LBB0_17
LBB0_18:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w20, #0
	csneg	w0, wzr, w8, eq
	ldur	x8, [x29, #-88]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_UNCORE_PMC_IDX_MAX,4,2         ; @UNCORE_PMC_IDX_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_uncore_assign_events
.subsections_via_symbols
