	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_pasid_alloc                ## -- Begin function kfd_pasid_alloc
	.p2align	4, 0x90
_kfd_pasid_alloc:                       ## @kfd_pasid_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_kfd2kgd@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	jne	LBB0_8
## %bb.1:
	movq	$0, -40(%rbp)
	xorl	%r14d, %r14d
	leaq	-40(%rbp), %rsi
	xorl	%edi, %edi
	callq	_kfd_topology_enum_kfd_devices
	testq	%rax, %rax
	je	LBB0_2
LBB0_7:
	cmpq	$0, (%r12)
	jne	LBB0_8
	jmp	LBB0_9
LBB0_2:
	movl	$1, %ebx
	leaq	-40(%rbp), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	movq	%r15, %rsi
	callq	_kfd_topology_enum_kfd_devices
	incl	%ebx
	testq	%rax, %rax
	jne	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rax, (%r12)
LBB0_8:
	movq	_pasid_bits@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_amdgpu_pasid_alloc
	xorl	%r14d, %r14d
	testl	%eax, %eax
	cmovgl	%eax, %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kfd2kgd,8,3                    ## @kfd2kgd
	.comm	_pasid_bits,4,2                 ## @pasid_bits
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_pasid_alloc                ; -- Begin function kfd_pasid_alloc
	.p2align	2
_kfd_pasid_alloc:                       ; @kfd_pasid_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x20, _kfd2kgd@GOTPAGE
Lloh1:
	ldr	x20, [x20, _kfd2kgd@GOTPAGEOFF]
	ldr	x8, [x20]
	cbnz	x8, LBB0_9
; %bb.1:
	str	xzr, [sp, #8]
	add	x1, sp, #8
	mov	w0, #0
	bl	_kfd_topology_enum_kfd_devices
	cbz	x0, LBB0_4
LBB0_2:
	ldr	x8, [x20]
	cbnz	x8, LBB0_9
; %bb.3:
	mov	w0, #0
	b	LBB0_10
LBB0_4:
	mov	w19, #1
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x1, sp, #8
	mov	x0, x19
	bl	_kfd_topology_enum_kfd_devices
	add	w19, w19, #1
	cbnz	x0, LBB0_2
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.8:
	str	x8, [x20]
LBB0_9:
Lloh2:
	adrp	x8, _pasid_bits@GOTPAGE
Lloh3:
	ldr	x8, [x8, _pasid_bits@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_amdgpu_pasid_alloc
	cmp	w0, #0
	csel	w0, w0, wzr, gt
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_kfd2kgd,8,3                    ; @kfd2kgd
	.comm	_pasid_bits,4,2                 ; @pasid_bits
.subsections_via_symbols
