	.file	"extr_kfd_pasid.c_kfd_pasid_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	kfd_pasid_alloc
	.type	kfd_pasid_alloc, @function
kfd_pasid_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	QWORD PTR kfd2kgd[rip], 0
	jne	.L2
	mov	QWORD PTR [rsp], 0
	xor	ebx, ebx
	mov	rbp, rsp
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR [rsp]
	test	rax, rax
	je	.L4
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L17
.L4:
	add	ebx, 1
.L3:
	mov	rsi, rbp
	mov	edi, ebx
	call	kfd_topology_enum_kfd_devices@PLT
	test	rax, rax
	je	.L6
	xor	eax, eax
	cmp	QWORD PTR kfd2kgd[rip], 0
	je	.L1
.L2:
	mov	edi, DWORD PTR pasid_bits[rip]
	call	amdgpu_pasid_alloc@PLT
	mov	edx, 0
	test	eax, eax
	cmovs	eax, edx
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L18
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	QWORD PTR kfd2kgd[rip], rax
	jmp	.L2
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	kfd_pasid_alloc, .-kfd_pasid_alloc
	.comm	pasid_bits,4,4
	.comm	kfd2kgd,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_kfd_pasid.c_kfd_pasid_alloc.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	kfd_pasid_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	kfd_pasid_alloc, %function
kfd_pasid_alloc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, lr}
	ldr	r5, .L19
	ldr	r3, .L19+4
	ldr	r4, [r5]
	sub	sp, sp, #12
	cmp	r4, #0
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	streq	r4, [sp]
	beq	.L3
	b	.L2
.L6:
	ldr	r3, [sp]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L17
.L4:
	add	r4, r4, #1
.L3:
	mov	r1, sp
	mov	r0, r4
	bl	kfd_topology_enum_kfd_devices
	cmp	r0, #0
	beq	.L6
	ldr	r0, [r5]
	cmp	r0, #0
	beq	.L1
.L2:
	ldr	r3, .L19+8
	ldr	r0, [r3]
	bl	amdgpu_pasid_alloc
	bic	r0, r0, r0, asr #31
.L1:
	ldr	r3, .L19+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, pc}
.L17:
	str	r3, [r5]
	b	.L2
.L18:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	kfd2kgd
	.word	.LC0
	.word	pasid_bits
	.size	kfd_pasid_alloc, .-kfd_pasid_alloc
	.comm	pasid_bits,4,4
	.comm	kfd2kgd,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
