	.file	"extr_uncore.c_uncore_assign_events.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	uncore_assign_events, @function
uncore_assign_events:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rdi
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	DWORD PTR -100[rbp], edx
	mov	edi, DWORD PTR UNCORE_PMC_IDX_MAX[rip]
	mov	QWORD PTR -88[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	BITS_TO_LONGS@PLT
	mov	rcx, rsp
	cdqe
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L44:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L44
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L45
.L4:
	mov	esi, DWORD PTR UNCORE_PMC_IDX_MAX[rip]
	mov	r15, rsp
	mov	rdi, r15
	call	bitmap_zero@PLT
	mov	eax, DWORD PTR UNCORE_PMC_IDX_MAX[rip]
	mov	DWORD PTR -80[rbp], eax
	mov	eax, DWORD PTR -100[rbp]
	test	eax, eax
	jle	.L18
	sub	eax, 1
	xor	ebx, ebx
	xor	r12d, r12d
	mov	QWORD PTR -96[rbp], rax
	lea	rax, 8[0+rax*8]
	mov	QWORD PTR -72[rbp], rax
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR 0[r13]
	mov	rdi, r13
	mov	rsi, QWORD PTR [rax+rbx]
	call	uncore_get_event_constraint@PLT
	mov	edi, DWORD PTR -80[rbp]
	mov	r14, rax
	mov	rax, QWORD PTR 8[r13]
	mov	esi, DWORD PTR 8[r14]
	mov	QWORD PTR [rax+rbx], r14
	add	rbx, 8
	call	min@PLT
	mov	esi, DWORD PTR 8[r14]
	mov	edi, r12d
	mov	DWORD PTR -80[rbp], eax
	call	max@PLT
	mov	r12d, eax
	cmp	QWORD PTR -72[rbp], rbx
	jne	.L6
	xor	r14d, r14d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L46:
	mov	rsi, QWORD PTR [rax]
	call	test_bit@PLT
	test	rax, rax
	je	.L5
	mov	edi, DWORD PTR [rbx]
	mov	rsi, r15
	call	test_bit@PLT
	test	rax, rax
	jne	.L5
	mov	edi, DWORD PTR [rbx]
	mov	rsi, r15
	call	__set_bit@PLT
	mov	rcx, QWORD PTR -88[rbp]
	test	rcx, rcx
	je	.L7
	mov	eax, DWORD PTR [rbx]
	mov	DWORD PTR [rcx+r14*4], eax
.L7:
	mov	eax, DWORD PTR -76[rbp]
	add	eax, 1
	mov	DWORD PTR -72[rbp], eax
	lea	rax, 1[r14]
	cmp	r14, QWORD PTR -96[rbp]
	je	.L5
	mov	r14, rax
.L8:
	mov	rax, QWORD PTR 0[r13]
	mov	DWORD PTR -76[rbp], r14d
	mov	DWORD PTR -72[rbp], r14d
	mov	rbx, QWORD PTR [rax+r14*8]
	mov	rax, QWORD PTR 8[r13]
	mov	edi, DWORD PTR [rbx]
	mov	rax, QWORD PTR [rax+r14*8]
	cmp	edi, -1
	jne	.L46
.L5:
	mov	edx, DWORD PTR -72[rbp]
	cmp	DWORD PTR -100[rbp], edx
	jne	.L9
	cmp	QWORD PTR -88[rbp], 0
	jne	.L13
	mov	edx, DWORD PTR -100[rbp]
	xor	r12d, r12d
	test	edx, edx
	je	.L13
.L12:
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rax, QWORD PTR 0[r13]
	mov	rdi, r13
	mov	rsi, QWORD PTR [rax+rbx*8]
	add	rbx, 1
	call	uncore_put_event_constraint@PLT
	cmp	DWORD PTR -100[rbp], ebx
	jg	.L16
.L15:
	test	r12d, r12d
	je	.L13
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rdx, QWORD PTR -56[rbp]
	xor	rdx, QWORD PTR fs:40
	jne	.L47
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	rbx, QWORD PTR -88[rbp]
	mov	esi, DWORD PTR -100[rbp]
	mov	ecx, r12d
	mov	rdi, QWORD PTR 8[r13]
	mov	edx, DWORD PTR -80[rbp]
	mov	r9, rbx
	mov	r8d, esi
	call	perf_assign_events@PLT
	mov	r12d, eax
	test	rbx, rbx
	je	.L21
	test	eax, eax
	jne	.L21
.L13:
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	eax, DWORD PTR -100[rbp]
	test	eax, eax
	jg	.L12
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L45:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L18:
	mov	DWORD PTR -72[rbp], 0
	xor	r12d, r12d
	jmp	.L5
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	uncore_assign_events, .-uncore_assign_events
	.comm	UNCORE_PMC_IDX_MAX,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_uncore.c_uncore_assign_events.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	uncore_assign_events, %function
uncore_assign_events:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r4, .L43
	ldr	r3, .L43+4
	str	r1, [fp, #-52]
	str	r2, [fp, #-48]
	mov	r5, r0
	ldr	r0, [r4]
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	BITS_TO_LONGS
	lsl	r3, r0, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	add	r10, sp, #8
	mov	r0, r10
	ldr	r1, [r4]
	bl	bitmap_zero
	cmp	r6, #0
	ldr	r8, [r4]
	ble	.L14
	mov	r6, #0
	mov	r7, r6
.L3:
	ldr	r3, [r5]
	mov	r0, r5
	ldr	r1, [r3, r6, lsl #2]
	bl	uncore_get_event_constraint
	mov	r4, r0
	ldr	r3, [r5, #4]
	mov	r0, r8
	str	r4, [r3, r6, lsl #2]
	ldr	r1, [r4, #4]
	bl	min
	ldr	r1, [r4, #4]
	mov	r8, r0
	mov	r0, r7
	bl	max
	ldr	r3, [fp, #-48]
	mov	r9, r6
	add	r6, r6, #1
	cmp	r3, r6
	mov	r7, r0
	bne	.L3
	mov	r4, #0
	b	.L5
.L40:
	ldr	r1, [r3]
	bl	test_bit
	cmp	r0, #0
	beq	.L2
	mov	r1, r10
	ldr	r0, [r6]
	bl	test_bit
	subs	r3, r0, #0
	str	r3, [fp, #-56]
	bne	.L2
	mov	r1, r10
	ldr	r0, [r6]
	bl	__set_bit
	ldr	r2, [fp, #-52]
	cmp	r2, #0
	ldrne	r3, [r6]
	strne	r3, [r2, r4, lsl #2]
	cmp	r9, r4
	add	r4, r4, #1
	beq	.L39
.L5:
	ldm	r5, {r2, r3}
	ldr	r6, [r2, r4, lsl #2]
	ldr	r3, [r3, r4, lsl #2]
	ldr	r0, [r6]
	cmn	r0, #1
	bne	.L40
.L2:
	ldr	r3, [fp, #-48]
	cmp	r3, r4
	beq	.L41
.L8:
	ldr	r6, [fp, #-52]
	ldr	r4, [fp, #-48]
	str	r6, [sp, #4]
	str	r4, [sp]
	mov	r1, r4
	mov	r3, r7
	mov	r2, r8
	ldr	r0, [r5, #4]
	bl	perf_assign_events
	subs	r1, r0, #0
	movne	r1, #1
	cmp	r6, #0
	moveq	r1, #1
	cmp	r1, #0
	str	r0, [fp, #-56]
	beq	.L7
	cmp	r4, #0
	ble	.L11
.L6:
	mov	r4, #0
.L12:
	ldr	r3, [r5]
	mov	r0, r5
	ldr	r1, [r3, r4, lsl #2]
	bl	uncore_put_event_constraint
	ldr	r3, [fp, #-48]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L12
.L11:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L43+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L43+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L42
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L41:
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	ble	.L7
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-56]
	b	.L6
.L39:
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	beq	.L6
.L7:
	mov	r0, #0
	b	.L1
.L14:
	mov	r7, #0
	mov	r4, r7
	ldr	r3, [fp, #-48]
	cmp	r3, r4
	bne	.L8
	b	.L41
.L42:
	bl	__stack_chk_fail
.L44:
	.align	2
.L43:
	.word	UNCORE_PMC_IDX_MAX
	.word	.LC0
	.word	EINVAL
	.size	uncore_assign_events, .-uncore_assign_events
	.comm	UNCORE_PMC_IDX_MAX,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
