	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function assign_afu_pasid
_assign_afu_pasid:                      ## @assign_afu_pasid
	.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	%rdi, %rbx
	movq	32(%rdi), %r12
	movl	8(%r12), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movb	16(%rbx), %cl
	movl	$1, %r15d
	shll	%cl, %r15d
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_ocxl_pasid_afu_alloc
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%r13d, %edx
	addq	(%r12), %rdx
	movq	%rdx, 8(%rbx)
	movl	$0, 24(%rbx)
	movl	%r15d, (%rbx)
	movl	16(%rbx), %ecx
	movl	20(%rbx), %esi
	movq	%r14, %rdi
	callq	_ocxl_config_set_afu_pasid
	movq	8(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %ecx
	callq	_dev_dbg
	xorl	%r13d, %r13d
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	movl	%r13d, %ecx
	callq	_dev_err
LBB0_3:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't allocate %d PASIDs for AFU: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"PASID base=%d, enabled=%d\n"

	.no_dead_strip	_assign_afu_pasid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function assign_afu_pasid
_assign_afu_pasid:                      ; @assign_afu_pasid
	.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
	mov	x20, x0
	ldr	x22, [x0, #32]
	ldr	w0, [x22, #8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w8, [x20, #16]
	mov	w9, #1
	lsl	w21, w9, w8
	mov	x0, x22
	mov	x1, x21
	bl	_ocxl_pasid_afu_alloc
	mov	x23, x0
	tbnz	w0, #31, LBB0_2
; %bb.1:
	ldr	x8, [x22]
	add	x2, x8, w23, uxtw
	str	x2, [x20, #8]
	str	wzr, [x20, #24]
	str	w21, [x20]
	ldp	w3, w1, [x20, #16]
	mov	x0, x19
	bl	_ocxl_config_set_afu_pasid
	ldr	x2, [x20, #8]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x21
	bl	_dev_dbg
	mov	w23, #0
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x23
	bl	_dev_err
LBB0_3:
	mov	x0, x23
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't allocate %d PASIDs for AFU: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"PASID base=%d, enabled=%d\n"

	.no_dead_strip	_assign_afu_pasid
.subsections_via_symbols
