	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_get_dma_mr              ## -- Begin function pvrdma_get_dma_mr
	.p2align	4, 0x90
_pvrdma_get_dma_mr:                     ## @pvrdma_get_dma_mr
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	movl	(%rdi), %edi
	callq	_to_vdev
	movq	%rax, %r15
	movq	_IB_ACCESS_LOCAL_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%ebx, %eax
	je	LBB0_2
## %bb.1:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_warn
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$12, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r14
	leaq	-72(%rbp), %r13
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_PVRDMA_CMD_CREATE_MR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	%r12, %rdi
	callq	_to_vpd
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	%ebx, -72(%rbp)
	movq	_PVRDMA_MR_FLAG_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movq	_PVRDMA_CMD_CREATE_MR_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_pvrdma_cmd_post
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	-48(%rbp), %eax
	movl	%eax, 8(%r14)
	movl	-52(%rbp), %eax
	movl	%eax, 4(%r14)
	movl	-56(%rbp), %eax
	movl	%eax, (%r14)
	jmp	LBB0_8
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movl	%eax, %ebx
	movq	(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	movq	%r14, %rdi
	callq	_kfree
	movl	%ebx, %edi
	callq	_ERR_PTR
	movq	%rax, %r14
LBB0_8:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ## @IB_ACCESS_LOCAL_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported dma mr access flags %#x\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PVRDMA_CMD_CREATE_MR,4,2       ## @PVRDMA_CMD_CREATE_MR
	.comm	_PVRDMA_MR_FLAG_DMA,4,2         ## @PVRDMA_MR_FLAG_DMA
	.comm	_PVRDMA_CMD_CREATE_MR_RESP,4,2  ## @PVRDMA_CMD_CREATE_MR_RESP
L_.str.1:                               ## @.str.1
	.asciz	"could not get DMA mem region, error: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_get_dma_mr              ; -- Begin function pvrdma_get_dma_mr
	.p2align	2
_pvrdma_get_dma_mr:                     ; @pvrdma_get_dma_mr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x1
	mov	x22, x0
	ldr	w0, [x0]
	bl	_to_vdev
	mov	x20, x0
Lloh0:
	adrp	x8, _IB_ACCESS_LOCAL_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_ACCESS_LOCAL_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bics	wzr, w21, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	x0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
Lloh5:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_ERR_PTR
LBB0_3:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #12
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x19, x0
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh10:
	adrp	x8, _PVRDMA_CMD_CREATE_MR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PVRDMA_CMD_CREATE_MR@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [sp, #28]
	mov	x0, x22
	bl	_to_vpd
	ldr	w8, [x0]
	str	w8, [sp, #24]
Lloh13:
	adrp	x8, _PVRDMA_MR_FLAG_DMA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PVRDMA_MR_FLAG_DMA@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	stp	w21, w8, [sp, #16]
Lloh16:
	adrp	x8, _PVRDMA_CMD_CREATE_MR_RESP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PVRDMA_CMD_CREATE_MR_RESP@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	add	x1, sp, #16
	mov	x2, sp
	mov	x0, x20
	bl	_pvrdma_cmd_post
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	w8, [sp, #8]
	str	w8, [x19, #8]
	ldr	d0, [sp]
	str	d0, [x19]
	b	LBB0_8
LBB0_6:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_7:
	mov	x21, x0
	ldr	x0, [x20]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
	bl	_ERR_PTR
	mov	x19, x0
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_ACCESS_LOCAL_WRITE,4,2      ; @IB_ACCESS_LOCAL_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported dma mr access flags %#x\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PVRDMA_CMD_CREATE_MR,4,2       ; @PVRDMA_CMD_CREATE_MR
	.comm	_PVRDMA_MR_FLAG_DMA,4,2         ; @PVRDMA_MR_FLAG_DMA
	.comm	_PVRDMA_CMD_CREATE_MR_RESP,4,2  ; @PVRDMA_CMD_CREATE_MR_RESP
l_.str.1:                               ; @.str.1
	.asciz	"could not get DMA mem region, error: %d\n"

.subsections_via_symbols
