	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_hem_list_request      ## -- Begin function hns_roce_hem_list_request
	.p2align	4, 0x90
_hns_roce_hem_list_request:             ## @hns_roce_hem_list_request
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r8d
	movq	_HNS_ROCE_MAX_BT_REGION@GOTPCREL(%rip), %rax
	cmpl	%ecx, (%rax)
	jge	LBB0_2
## %bb.1:
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r8d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_2:
	movq	%rdx, %r9
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movb	(%rsi), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	_BA_BYTE_LEN@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %ebx
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	testl	%r8d, %r8d
	jle	LBB0_11
## %bb.3:
	leaq	4(%rsi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r15
	cmpq	-72(%rbp), %r15                 ## 8-byte Folded Reload
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	je	LBB0_11
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	(%r9,%r15,8), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	jle	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r15,8), %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	4(%rax,%r15,8), %r13d
	addl	%r13d, -48(%rbp)                ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rsi, %r14
	movq	8(%rsi), %rax
	movl	(%rax,%r15,4), %r8d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	callq	_hem_list_alloc_mid_bt
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=2
	addl	%ebx, %r13d
	cmpl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	movq	%r14, %rsi
	jl	LBB0_8
	jmp	LBB0_10
LBB0_9:
	movl	%eax, %r12d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_14
LBB0_11:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rsi, %r14
	movl	%ebx, %edx
	movq	%r9, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_hem_list_alloc_root_bt
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %r12d
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_14:
	movl	%r12d, %edx
	callq	_dev_err
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_hem_list_release
LBB0_15:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	xorl	%r12d, %r12d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_MAX_BT_REGION,4,2     ## @HNS_ROCE_MAX_BT_REGION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid region region_cnt %d!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BA_BYTE_LEN,4,2                ## @BA_BYTE_LEN
L_.str.1:                               ## @.str.1
	.asciz	"alloc hem trunk fail ret=%d!\n"

L_.str.2:                               ## @.str.2
	.asciz	"alloc hem root fail ret=%d!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hns_roce_hem_list_request      ; -- Begin function hns_roce_hem_list_request
	.p2align	2
_hns_roce_hem_list_request:             ; @hns_roce_hem_list_request
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
Lloh0:
	adrp	x8, _HNS_ROCE_MAX_BT_REGION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HNS_ROCE_MAX_BT_REGION@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w3
	b.ge	LBB0_2
; %bb.1:
	ldr	w0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x3
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_14
LBB0_2:
	mov	x10, x2
	mov	x19, x1
	ldr	w8, [x1]
	mov	w9, #1
	lsl	w8, w9, w8
Lloh8:
	adrp	x9, _BA_BYTE_LEN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BA_BYTE_LEN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	sdiv	w23, w8, w9
	str	w3, [sp, #4]                    ; 4-byte Folded Spill
	cmp	w3, #1
	b.lt	LBB0_11
; %bb.3:
	mov	x28, #0
	add	x24, x19, #4
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	mov	w8, w8
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x28, x28, #1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	cmp	x28, x8
	mov	x10, x21
	b.eq	LBB0_11
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	mov	x21, x10
	add	x26, x10, x28, lsl #3
	ldr	w8, [x26]
	cbz	w8, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w27, [x26, #4]
	add	w22, w27, w8
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #8]
	ldr	w4, [x8, x28, lsl #2]
	mov	x0, x20
	mov	x1, x26
	mov	x2, x23
	mov	x3, x27
	mov	x5, x24
	bl	_hem_list_alloc_mid_bt
	cbnz	w0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	add	w27, w27, w23
	cmp	w27, w22
	b.lt	LBB0_8
	b	LBB0_4
LBB0_10:
	mov	x25, x0
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	mov	x3, x10
	ldr	w4, [sp, #4]                    ; 4-byte Folded Reload
	bl	_hem_list_alloc_root_bt
	mov	x25, x0
	cbz	w0, LBB0_14
; %bb.12:
	ldr	w0, [x20]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_13:
	mov	x2, x25
	bl	_dev_err
	mov	x0, x20
	mov	x1, x19
	bl	_hns_roce_hem_list_release
LBB0_14:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_MAX_BT_REGION,4,2     ; @HNS_ROCE_MAX_BT_REGION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid region region_cnt %d!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BA_BYTE_LEN,4,2                ; @BA_BYTE_LEN
l_.str.1:                               ; @.str.1
	.asciz	"alloc hem trunk fail ret=%d!\n"

l_.str.2:                               ; @.str.2
	.asciz	"alloc hem root fail ret=%d!\n"

.subsections_via_symbols
