	.file	"extr_tlb.c_choose_new_asid.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	choose_new_asid, @function
choose_new_asid:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR X86_FEATURE_PCID[rip]
	call	static_cpu_has@PLT
	test	eax, eax
	jne	.L2
	mov	QWORD PTR [r12], 0
	mov	DWORD PTR 0[r13], 1
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR cpu_tlbstate[rip+16]
	call	this_cpu_read@PLT
	test	rax, rax
	jne	.L15
.L4:
	cmp	QWORD PTR TLB_NR_DYN_ASIDS[rip], 0
	je	.L5
	xor	ebx, ebx
.L7:
	mov	rax, QWORD PTR cpu_tlbstate[rip+8]
	lea	r15, 0[0+rbx*8]
	mov	edi, DWORD PTR 4[rax+r15]
	call	this_cpu_read@PLT
	cmp	rax, QWORD PTR 0[rbp]
	je	.L6
	add	rbx, 1
	cmp	QWORD PTR TLB_NR_DYN_ASIDS[rip], rbx
	ja	.L7
.L5:
	mov	edi, DWORD PTR cpu_tlbstate[rip]
	mov	esi, 1
	call	this_cpu_add_return@PLT
	sub	rax, 1
	mov	QWORD PTR [r12], rax
	cmp	rax, QWORD PTR TLB_NR_DYN_ASIDS[rip]
	jnb	.L16
.L8:
	mov	DWORD PTR 0[r13], 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR cpu_tlbstate[rip+8]
	mov	QWORD PTR [r12], rbx
	mov	edi, DWORD PTR [rax+r15]
	call	this_cpu_read@PLT
	cmp	rax, r14
	setl	al
	movzx	eax, al
	mov	DWORD PTR 0[r13], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xor	eax, eax
	call	clear_asid_other@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L16:
	mov	QWORD PTR [r12], 0
	mov	edi, DWORD PTR cpu_tlbstate[rip]
	mov	esi, 1
	call	this_cpu_write@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	choose_new_asid, .-choose_new_asid
	.comm	cpu_tlbstate,24,16
	.comm	X86_FEATURE_PCID,4,4
	.comm	TLB_NR_DYN_ASIDS,8,8
	.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_tlb.c_choose_new_asid.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	choose_new_asid, %function
choose_new_asid:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	ip, .L20
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	ldr	r0, [ip]
	mov	r8, r1
	mov	r6, r2
	mov	r7, r3
	bl	static_cpu_has
	cmp	r0, #0
	bne	.L2
	mov	r3, #1
	str	r0, [r6]
	str	r3, [r7]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r10, .L20+4
	ldr	r0, [r10, #8]
	bl	this_cpu_read
	cmp	r0, #0
	bne	.L18
.L4:
	ldr	fp, .L20+8
	ldr	r3, [fp]
	cmp	r3, #0
	beq	.L5
	mov	r4, #0
.L7:
	ldr	ip, [r10, #4]
	lsl	r9, r4, #3
	add	ip, ip, r4, lsl #3
	ldr	r0, [ip, #4]
	bl	this_cpu_read
	ldr	r3, [r5]
	cmp	r0, r3
	beq	.L6
	ldr	r3, [fp]
	add	r4, r4, #1
	cmp	r3, r4
	bhi	.L7
.L5:
	mov	r1, #1
	ldr	r0, [r10]
	bl	this_cpu_add_return
	sub	r0, r0, #1
	str	r0, [r6]
	ldr	r3, [fp]
	cmp	r0, r3
	bcs	.L19
.L8:
	mov	r3, #1
	str	r3, [r7]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	ldr	r3, [r10, #4]
	str	r4, [r6]
	ldr	r0, [r3, r9]
	bl	this_cpu_read
	cmp	r0, r8
	movge	r8, #0
	movlt	r8, #1
	str	r8, [r7]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	bl	clear_asid_other
	b	.L4
.L19:
	mov	r3, #0
	ldr	r0, [r10]
	mov	r1, #1
	str	r3, [r6]
	bl	this_cpu_write
	b	.L8
.L21:
	.align	2
.L20:
	.word	X86_FEATURE_PCID
	.word	cpu_tlbstate
	.word	TLB_NR_DYN_ASIDS
	.size	choose_new_asid, .-choose_new_asid
	.comm	cpu_tlbstate,12,4
	.comm	X86_FEATURE_PCID,4,4
	.comm	TLB_NR_DYN_ASIDS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
