	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_get_dma_mr            ## -- Begin function hns_roce_get_dma_mr
	.p2align	4, 0x90
_hns_roce_get_dma_mr:                   ## @hns_roce_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	_MR_TYPE_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movl	(%r14), %edi
	callq	_to_hr_dev
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_to_hr_pd
	movl	(%rax), %esi
	movq	%rbx, (%rsp)
	movl	%r12d, %edi
	xorl	%edx, %edx
	movq	$-1, %rcx
	movl	%r15d, %r8d
	xorl	%r9d, %r9d
	callq	_hns_roce_mr_alloc
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movl	(%r14), %edi
	callq	_to_hr_dev
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_hns_roce_mr_enable
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r15d
	movl	(%r14), %edi
	callq	_to_hr_dev
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_hns_roce_mr_free
LBB0_6:
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r15d, %edi
	jmp	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
LBB0_2:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_7:
	movl	16(%rbx), %eax
	movl	%eax, (%rbx)
	movl	%eax, 4(%rbx)
	movq	$0, 8(%rbx)
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MR_TYPE_DMA,4,2                ## @MR_TYPE_DMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_get_dma_mr            ; -- Begin function hns_roce_get_dma_mr
	.p2align	2
_hns_roce_get_dma_mr:                   ; @hns_roce_get_dma_mr
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _MR_TYPE_DMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MR_TYPE_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #20]
	ldr	w0, [x20]
	bl	_to_hr_dev
	mov	x22, x0
	mov	x0, x20
	bl	_to_hr_pd
	ldr	w1, [x0]
	mov	x0, x22
	mov	w2, #0
	mov	x3, #-1
	mov	x4, x21
	mov	w5, #0
	mov	x6, x19
	bl	_hns_roce_mr_alloc
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.2:
	ldr	w0, [x20]
	bl	_to_hr_dev
	mov	x1, x19
	bl	_hns_roce_mr_enable
	cbz	w0, LBB0_7
; %bb.3:
	mov	x21, x0
	ldr	w0, [x20]
	bl	_to_hr_dev
	mov	x1, x19
	bl	_hns_roce_mr_free
LBB0_4:
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_7:
	ldr	w8, [x19, #16]
	stp	w8, w8, [x19]
	str	xzr, [x19, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MR_TYPE_DMA,4,2                ; @MR_TYPE_DMA
.subsections_via_symbols
