	.file	"extr_sys_regs.c_read_id_reg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	read_id_reg, @function
read_id_reg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r9, QWORD PTR 24[rsi]
	mov	rcx, QWORD PTR 8[rsi]
	mov	rdx, QWORD PTR 16[rsi]
	mov	rdi, QWORD PTR 32[rsi]
	mov	r8, QWORD PTR [rsi]
	mov	rsi, r9
	call	sys_reg@PLT
	mov	rbx, rax
	test	ebp, ebp
	je	.L9
	cmp	QWORD PTR SYS_ID_AA64PFR0_EL1[rip], rbx
	je	.L10
.L3:
	cmp	QWORD PTR SYS_ID_AA64ISAR1_EL1[rip], rbx
	je	.L11
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	rdi, rax
	call	read_sanitised_ftr_reg@PLT
	cmp	QWORD PTR SYS_ID_AA64PFR0_EL1[rip], rbx
	mov	r13d, eax
	jne	.L3
.L10:
	mov	rdi, r12
	call	vcpu_has_sve@PLT
	test	eax, eax
	jne	.L3
	mov	ecx, DWORD PTR ID_AA64PFR0_SVE_SHIFT[rip]
	mov	eax, 15
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	sal	rax, cl
	pop	r12
	.cfi_def_cfa_offset 16
	not	eax
	and	r13d, eax
	mov	eax, r13d
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rdi, r12
	call	vcpu_has_ptrauth@PLT
	test	eax, eax
	jne	.L1
	mov	edx, 15
	mov	ecx, DWORD PTR ID_AA64ISAR1_APA_SHIFT[rip]
	mov	rax, rdx
	mov	rbx, rdx
	sal	rax, cl
	mov	ecx, DWORD PTR ID_AA64ISAR1_API_SHIFT[rip]
	sal	rbx, cl
	mov	ecx, DWORD PTR ID_AA64ISAR1_GPA_SHIFT[rip]
	or	eax, ebx
	mov	rbx, rdx
	sal	rbx, cl
	mov	ecx, DWORD PTR ID_AA64ISAR1_GPI_SHIFT[rip]
	or	eax, ebx
	sal	rdx, cl
	or	eax, edx
	not	eax
	and	r13d, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	read_id_reg, .-read_id_reg
	.comm	SYS_ID_AA64PFR0_EL1,8,8
	.comm	SYS_ID_AA64ISAR1_EL1,8,8
	.comm	ID_AA64PFR0_SVE_SHIFT,4,4
	.comm	ID_AA64ISAR1_GPI_SHIFT,4,4
	.comm	ID_AA64ISAR1_GPA_SHIFT,4,4
	.comm	ID_AA64ISAR1_API_SHIFT,4,4
	.comm	ID_AA64ISAR1_APA_SHIFT,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_sys_regs.c_read_id_reg.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_id_reg, %function
read_id_reg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r1
	push	{r4, r5, r6, lr}
	ldr	r3, [r1]
	sub	sp, sp, #8
	str	r3, [sp]
	mov	r4, r2
	ldr	r3, [r1, #4]
	ldr	r2, [r1, #8]
	mov	r6, r0
	ldr	r1, [r1, #12]
	ldr	r0, [ip, #16]
	bl	sys_reg
	cmp	r4, #0
	movne	r5, #0
	mov	r4, r0
	beq	.L8
	ldr	r3, .L11
	ldr	r3, [r3]
	cmp	r3, r4
	beq	.L9
.L3:
	ldr	r3, .L11+4
	ldr	r3, [r3]
	cmp	r3, r4
	beq	.L10
.L1:
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L8:
	bl	read_sanitised_ftr_reg
	ldr	r3, .L11
	mov	r5, r0
	ldr	r3, [r3]
	cmp	r3, r4
	bne	.L3
.L9:
	mov	r0, r6
	bl	vcpu_has_sve
	cmp	r0, #0
	bne	.L3
	mov	r2, #15
	ldr	r3, .L11+8
	ldr	r3, [r3]
	bic	r5, r5, r2, lsl r3
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L10:
	mov	r0, r6
	bl	vcpu_has_ptrauth
	cmp	r0, #0
	bne	.L1
	mov	r2, #15
	ldr	r3, .L11+12
	ldr	r1, .L11+16
	ldr	r3, [r3]
	ldr	r0, .L11+20
	ldr	ip, [r1]
	ldr	r1, .L11+24
	ldr	r0, [r0]
	lsl	r3, r2, r3
	ldr	r1, [r1]
	orr	r3, r3, r2, lsl ip
	orr	r3, r3, r2, lsl r0
	orr	r3, r3, r2, lsl r1
	bic	r5, r5, r3
	b	.L1
.L12:
	.align	2
.L11:
	.word	SYS_ID_AA64PFR0_EL1
	.word	SYS_ID_AA64ISAR1_EL1
	.word	ID_AA64PFR0_SVE_SHIFT
	.word	ID_AA64ISAR1_API_SHIFT
	.word	ID_AA64ISAR1_APA_SHIFT
	.word	ID_AA64ISAR1_GPA_SHIFT
	.word	ID_AA64ISAR1_GPI_SHIFT
	.size	read_id_reg, .-read_id_reg
	.comm	SYS_ID_AA64PFR0_EL1,4,4
	.comm	SYS_ID_AA64ISAR1_EL1,4,4
	.comm	ID_AA64PFR0_SVE_SHIFT,4,4
	.comm	ID_AA64ISAR1_GPI_SHIFT,4,4
	.comm	ID_AA64ISAR1_GPA_SHIFT,4,4
	.comm	ID_AA64ISAR1_API_SHIFT,4,4
	.comm	ID_AA64ISAR1_APA_SHIFT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
