	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_buf_alloc             ## -- Begin function hns_roce_buf_alloc
	.p2align	4, 0x90
_hns_roce_buf_alloc:                    ## @hns_roce_buf_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rcx, %r13
                                        ## kill: def $esi killed $esi def $rsi
	movq	(%rdi), %r15
	movl	$1, %r14d
	movl	$1, %ebx
	movl	%r12d, %ecx
	shll	%cl, %ebx
	cmpl	%edx, %esi
	jle	LBB0_7
## %bb.1:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	leal	(%rsi,%rbx), %eax
	decl	%eax
	cltd
	idivl	%ebx
	movl	%eax, (%r13)
	movl	%eax, 4(%r13)
	movl	%r12d, 8(%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$16, %esi
	callq	_kcalloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	cmpl	$0, (%r13)
	jle	LBB0_12
## %bb.3:
	movl	$8, %r14d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	leaq	-44(%rbp), %rdx
	callq	_dma_alloc_coherent
	movq	16(%r13), %rcx
	movq	%rax, (%rcx,%r14)
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %eax
	movl	%eax, -8(%rcx,%r14)
	incq	%r12
	movslq	(%r13), %rax
	addq	$16, %r14
	cmpq	%rax, %r12
	jl	LBB0_4
LBB0_12:
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_7:
	movl	$1, (%r13)
	movl	%esi, %edi
	movq	%rsi, %rbx
	callq	_get_order
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	%r12d, %edx
	subl	(%rcx), %edx
	movl	%eax, %ecx
	subl	%edx, %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	cmpl	%edx, %eax
	cmovlel	%r14d, %esi
	movl	%esi, 4(%r13)
	movl	%r12d, 8(%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movl	-44(%rbp), %edx
	movl	%edx, 24(%r13)
	movl	8(%r13), %ecx
	movl	$-1, %esi
	shll	%cl, %esi
	notl	%esi
	xorl	%eax, %eax
	testl	%esi, %edx
	je	LBB0_15
## %bb.9:
	movl	4(%r13), %esi
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	decl	%ecx
	movl	$-1, %edi
	shll	%cl, %edi
	addl	%esi, %esi
	notl	%edi
	testl	%edi, %edx
	jne	LBB0_10
## %bb.11:
	movl	%ecx, 8(%r13)
	movl	%esi, 4(%r13)
	jmp	LBB0_15
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r13, %rdx
	callq	_hns_roce_buf_free
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.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_alloc             ; -- Begin function hns_roce_buf_alloc
	.p2align	2
_hns_roce_buf_alloc:                    ; @hns_roce_buf_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x4
	mov	x19, x3
	mov	x20, x1
	ldr	x21, [x0]
	mov	w23, #1
	cmp	w1, w2
	b.le	LBB0_6
; %bb.1:
	mov	x22, x0
	lsl	w23, w23, w24
	add	w8, w20, w23
	sub	w8, w8, #1
	sdiv	w0, w8, w23
	stp	w0, w0, [x19]
	str	w24, [x19, #8]
Lloh0:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	w1, #16
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_13
; %bb.2:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.3:
	mov	x25, #0
	mov	x26, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x24]
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x23
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #16]
	add	x9, x8, x25
	str	x0, [x9, #8]
	cbz	x0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [sp, #12]
	str	w9, [x8, x25]
	add	x26, x26, #1
	ldrsw	x8, [x19]
	add	x25, x25, #16
	cmp	x26, x8
	b.lt	LBB0_4
	b	LBB0_11
LBB0_6:
	str	w23, [x19]
	mov	x0, x20
	bl	_get_order
Lloh2:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	sub	w8, w24, w8
	subs	w8, w0, w8
	lsl	w8, w23, w8
	csinc	w8, w8, wzr, gt
	stp	w8, w24, [x19, #4]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x20
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	cbz	x0, LBB0_13
; %bb.7:
	ldr	w8, [sp, #12]
	str	w8, [x19, #24]
	ldr	w9, [x19, #8]
	mov	w10, #-1
	lsl	w11, w10, w9
	bics	wzr, w8, w11
	b.eq	LBB0_11
; %bb.8:
	ldr	w11, [x19, #4]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w9, #1
	lsl	w11, w11, #1
	lsl	w12, w10, w9
	bics	wzr, w8, w12
	b.ne	LBB0_9
; %bb.10:
	mov	w0, #0
	stp	w11, w9, [x19, #4]
	b	LBB0_14
LBB0_11:
	mov	w0, #0
	b	LBB0_14
LBB0_12:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_hns_roce_buf_free
LBB0_13:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
