	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_buf_write_mtt         ## -- Begin function hns_roce_buf_write_mtt
	.p2align	4, 0x90
_hns_roce_buf_write_mtt:                ## @hns_roce_buf_write_mtt
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdx), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$8, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %r12
	cmpq	$0, (%rbx)
	je	LBB0_2
## %bb.5:
	movl	8(%rbx), %eax
	xorl	%edx, %edx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	24(%rbx), %rcx
	movq	(%rcx,%rdx,8), %rsi
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%rsi, (%r12,%rdx,8)
	incq	%rdx
	movq	(%rbx), %rcx
	cmpq	%rcx, %rdx
	jae	LBB0_10
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movzbl	16(%rbx), %ecx
	movq	%rdx, %rsi
	shlq	%cl, %rsi
	addq	32(%rbx), %rsi
	jmp	LBB0_9
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_2:
	xorl	%ecx, %ecx
LBB0_10:
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	movq	%r12, %r8
	callq	_hns_roce_write_mtt
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	movl	%ebx, %eax
LBB0_4:
	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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_buf_write_mtt         ; -- Begin function hns_roce_buf_write_mtt
	.p2align	2
_hns_roce_buf_write_mtt:                ; @hns_roce_buf_write_mtt
	.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	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x0, [x2]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #8
	bl	_kmalloc_array
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x0
	ldr	x8, [x22]
	cbz	x8, LBB0_8
; %bb.2:
	mov	x8, #0
	ldr	w9, [x22, #8]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x22, #24]
	ldr	x10, [x10, x8, lsl #3]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	x10, [x21, x8, lsl #3]
	add	x8, x8, #1
	ldr	x3, [x22]
	cmp	x8, x3
	b.hs	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, #1
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x22, #32]
	ldr	x11, [x22, #16]
	lsl	x11, x8, x11
	add	x10, x11, x10
	b	LBB0_4
LBB0_7:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
	mov	x3, #0
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	mov	x4, x21
	bl	_hns_roce_write_mtt
	mov	x19, x0
	mov	x0, x21
	bl	_kfree
	mov	x0, x19
LBB0_10:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
