	.file	"extr_amd_iommu.c_amd_iommu_device_info.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	amd_iommu_device_info
	.type	amd_iommu_device_info, @function
amd_iommu_device_info:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L27
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	test	rsi, rsi
	je	.L30
	xor	eax, eax
	mov	rbp, rdi
	call	amd_iommu_v2_supported@PLT
	test	eax, eax
	je	.L30
	xor	esi, esi
	mov	edx, 16
	mov	rdi, rbx
	call	memset@PLT
	xor	eax, eax
	call	pci_ats_disabled@PLT
	test	eax, eax
	je	.L33
.L7:
	mov	esi, DWORD PTR PCI_EXT_CAP_ID_PRI[rip]
	mov	rdi, rbp
	call	pci_find_ext_capability@PLT
	test	eax, eax
	je	.L9
	mov	eax, DWORD PTR AMD_IOMMU_DEVICE_FLAG_PRI_SUP[rip]
	or	DWORD PTR [rbx], eax
.L9:
	mov	esi, DWORD PTR PCI_EXT_CAP_ID_PASID[rip]
	mov	rdi, rbp
	call	pci_find_ext_capability@PLT
	test	eax, eax
	jne	.L10
.L31:
	xor	eax, eax
.L34:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	mov	esi, DWORD PTR PCI_EXT_CAP_ID_ATS[rip]
	mov	rdi, rbp
	call	pci_find_ext_capability@PLT
	test	eax, eax
	je	.L7
	mov	eax, DWORD PTR AMD_IOMMU_DEVICE_FLAG_ATS_SUP[rip]
	or	DWORD PTR [rbx], eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	mov	eax, DWORD PTR amd_iommu_max_glx_val[rip]
	mov	edi, 1
	mov	esi, 1048576
	lea	ecx, 9[rax+rax*8]
	sal	edi, cl
	call	min@PLT
	mov	rdi, rbp
	mov	r12, rax
	mov	eax, DWORD PTR AMD_IOMMU_DEVICE_FLAG_PASID_SUP[rip]
	or	DWORD PTR [rbx], eax
	call	pci_max_pasids@PLT
	mov	esi, r12d
	mov	edi, eax
	call	min@PLT
	mov	rdi, rbp
	mov	QWORD PTR 8[rbx], rax
	call	pci_pasid_features@PLT
	test	DWORD PTR PCI_PASID_CAP_EXEC[rip], eax
	je	.L11
	mov	edx, DWORD PTR AMD_IOMMU_DEVICE_FLAG_EXEC_SUP[rip]
	or	DWORD PTR [rbx], edx
.L11:
	test	DWORD PTR PCI_PASID_CAP_PRIV[rip], eax
	je	.L31
	mov	eax, DWORD PTR AMD_IOMMU_DEVICE_FLAG_PRIV_SUP[rip]
	or	DWORD PTR [rbx], eax
	xor	eax, eax
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	amd_iommu_device_info, .-amd_iommu_device_info
	.comm	amd_iommu_max_glx_val,4,4
	.comm	PCI_PASID_CAP_PRIV,4,4
	.comm	PCI_PASID_CAP_EXEC,4,4
	.comm	PCI_EXT_CAP_ID_PRI,4,4
	.comm	PCI_EXT_CAP_ID_PASID,4,4
	.comm	PCI_EXT_CAP_ID_ATS,4,4
	.comm	EINVAL,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_PRI_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_PRIV_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_PASID_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_EXEC_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_ATS_SUP,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_amd_iommu.c_amd_iommu_device_info.c"
	.text
	.align	2
	.global	amd_iommu_device_info
	.syntax unified
	.arm
	.fpu softvfp
	.type	amd_iommu_device_info, %function
amd_iommu_device_info:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	clz	r3, r1
	cmp	r0, #0
	lsr	r3, r3, #5
	push	{r4, r5, r6, lr}
	movne	r4, r3
	moveq	r4, #1
	cmp	r4, #0
	beq	.L2
.L25:
	ldr	r3, .L28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L2:
	mov	r6, r0
	mov	r5, r1
	bl	amd_iommu_v2_supported
	cmp	r0, #0
	beq	.L25
	mov	r1, r4
	mov	r2, #8
	mov	r0, r5
	bl	memset
	bl	pci_ats_disabled
	cmp	r0, #0
	beq	.L27
.L6:
	ldr	r3, .L28+4
	mov	r0, r6
	ldr	r1, [r3]
	bl	pci_find_ext_capability
	cmp	r0, #0
	ldrne	r2, .L28+8
	ldrne	r3, [r5]
	ldrne	r2, [r2]
	mov	r0, r6
	orrne	r3, r3, r2
	strne	r3, [r5]
	ldr	r3, .L28+12
	ldr	r1, [r3]
	bl	pci_find_ext_capability
	cmp	r0, #0
	bne	.L9
.L11:
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L9:
	mov	r0, #1
	ldr	r3, .L28+16
	mov	r1, #1048576
	ldr	r3, [r3]
	add	r3, r3, r0
	add	r3, r3, r3, lsl #3
	lsl	r0, r0, r3
	bl	min
	mov	r4, r0
	ldr	r2, .L28+20
	ldr	r3, [r5]
	ldr	r2, [r2]
	mov	r0, r6
	orr	r3, r3, r2
	str	r3, [r5]
	bl	pci_max_pasids
	mov	r1, r4
	bl	min
	mov	r3, r0
	mov	r0, r6
	str	r3, [r5, #4]
	bl	pci_pasid_features
	ldr	r3, .L28+24
	ldr	r3, [r3]
	tst	r0, r3
	ldrne	r2, .L28+28
	ldrne	r3, [r5]
	ldrne	r2, [r2]
	orrne	r3, r3, r2
	strne	r3, [r5]
	ldr	r3, .L28+32
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L11
	ldr	r2, .L28+36
	ldr	r3, [r5]
	ldr	r2, [r2]
	mov	r0, #0
	orr	r3, r3, r2
	str	r3, [r5]
	pop	{r4, r5, r6, pc}
.L27:
	ldr	r3, .L28+40
	mov	r0, r6
	ldr	r1, [r3]
	bl	pci_find_ext_capability
	cmp	r0, #0
	ldrne	r2, .L28+44
	ldrne	r3, [r5]
	ldrne	r2, [r2]
	orrne	r3, r3, r2
	strne	r3, [r5]
	b	.L6
.L29:
	.align	2
.L28:
	.word	EINVAL
	.word	PCI_EXT_CAP_ID_PRI
	.word	AMD_IOMMU_DEVICE_FLAG_PRI_SUP
	.word	PCI_EXT_CAP_ID_PASID
	.word	amd_iommu_max_glx_val
	.word	AMD_IOMMU_DEVICE_FLAG_PASID_SUP
	.word	PCI_PASID_CAP_EXEC
	.word	AMD_IOMMU_DEVICE_FLAG_EXEC_SUP
	.word	PCI_PASID_CAP_PRIV
	.word	AMD_IOMMU_DEVICE_FLAG_PRIV_SUP
	.word	PCI_EXT_CAP_ID_ATS
	.word	AMD_IOMMU_DEVICE_FLAG_ATS_SUP
	.size	amd_iommu_device_info, .-amd_iommu_device_info
	.comm	amd_iommu_max_glx_val,4,4
	.comm	PCI_PASID_CAP_PRIV,4,4
	.comm	PCI_PASID_CAP_EXEC,4,4
	.comm	PCI_EXT_CAP_ID_PRI,4,4
	.comm	PCI_EXT_CAP_ID_PASID,4,4
	.comm	PCI_EXT_CAP_ID_ATS,4,4
	.comm	EINVAL,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_PRI_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_PRIV_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_PASID_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_EXEC_SUP,4,4
	.comm	AMD_IOMMU_DEVICE_FLAG_ATS_SUP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
