	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_pasid_alloc             ## -- Begin function amdgpu_pasid_alloc
	.p2align	4, 0x90
_amdgpu_pasid_alloc:                    ## @amdgpu_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	$31, %esi
	callq	_min
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %ebx
	decl	%ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r12
	movq	_amdgpu_pasid_ida@GOTPCREL(%rip), %r15
	movq	_ENOSPC@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %esi
	movl	%ebx, %ecx
	shll	%cl, %esi
	leal	1(%rbx), %ecx
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movl	(%r12), %ecx
	movq	%r15, %rdi
	callq	_ida_simple_get
	movl	%eax, %r14d
	subl	$1, %ebx
	setb	%al
	movl	%r14d, %ecx
	addl	(%r13), %ecx
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testb	%al, %al
	je	LBB0_2
LBB0_4:
	testl	%r14d, %r14d
	js	LBB0_6
## %bb.5:
	movl	%r14d, %edi
	callq	_trace_amdgpu_pasid_allocated
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_amdgpu_pasid_ida,4,2           ## @amdgpu_pasid_ida
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOSPC,4,2                     ## @ENOSPC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_pasid_alloc             ; -- Begin function amdgpu_pasid_alloc
	.p2align	2
_amdgpu_pasid_alloc:                    ; @amdgpu_pasid_alloc
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	mov	w1, #31
	bl	_min
	cbz	w0, LBB0_6
; %bb.1:
	sub	w21, w0, #1
	mov	w22, #1
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	adrp	x20, _amdgpu_pasid_ida@GOTPAGE
Lloh6:
	ldr	x20, [x20, _amdgpu_pasid_ida@GOTPAGEOFF]
Lloh7:
	adrp	x24, _ENOSPC@GOTPAGE
Lloh8:
	ldr	x24, [x24, _ENOSPC@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w21, #1
	lsl	w1, w22, w21
	lsl	w2, w22, w8
	ldr	w3, [x23]
	mov	x0, x20
	bl	_ida_simple_get
	ldr	w8, [x24]
	cmn	w0, w8
	ccmp	w21, #0, #4, eq
	sub	w21, w21, #1
	b.ne	LBB0_2
; %bb.3:
	mov	x19, x0
	tbnz	w19, #31, LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_trace_amdgpu_pasid_allocated
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	neg	w19, w19
	tbz	w19, #31, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_amdgpu_pasid_ida,4,2           ; @amdgpu_pasid_ida
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOSPC,4,2                     ; @ENOSPC
.subsections_via_symbols
