	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function hclge_only_alloc_priv_buff
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_hclge_only_alloc_priv_buff:            ## @hclge_only_alloc_priv_buff
	.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
	movq	%rdi, %r12
	movl	(%rdi), %r15d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	callq	_hclge_get_tx_buff_alloced
	subl	%eax, %r15d
	movq	%r12, %rdi
	callq	_hclge_get_tc_num
	movl	%eax, %ecx
	movl	4(%r12), %esi
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r15d
LBB0_2:
	sarl	%esi
	movq	_NEED_RESERVE_TC_NUM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jg	LBB0_4
## %bb.3:
	movq	_BUF_RESERVE_PERCENT@GOTPCREL(%rip), %rax
	imull	(%rax), %r15d
	movq	_BUF_MAX_PERCENT@GOTPCREL(%rip), %rcx
	movl	%r15d, %eax
	cltd
	idivl	(%rcx)
	movl	%eax, %r15d
LBB0_4:
	movl	8(%r12), %eax
	leal	(%rsi,%rsi,4), %ecx
	leal	(%rax,%rcx), %edi
	addl	$15360, %edi                    ## imm = 0x3C00
	movq	_HCLGE_BUF_SIZE_UNIT@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_round_up
	movl	%eax, %ebx
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	_round_down
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	%ebx, %ecx
	jl	LBB0_11
## %bb.5:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_HCLGE_MAX_TC_NUM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_10
## %bb.6:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movq	_HCLGE_MAX_TC_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$16, %r13
	cmpq	%rax, %rbx
	jae	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r14
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14,%r13)
	movl	12(%r12), %r15d
	movl	%ebx, %edi
	callq	_BIT
	testl	%r15d, %eax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, (%r14,%r13)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%r14,%r13)
	subl	8(%r12), %eax
	movl	%eax, 12(%r14,%r13)
	addl	$-6144, %eax                    ## imm = 0xE800
	movl	%eax, 8(%r14,%r13)
	jmp	LBB0_9
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	$0, (%rax)
	movl	$1, %eax
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NEED_RESERVE_TC_NUM,4,2        ## @NEED_RESERVE_TC_NUM
	.comm	_BUF_RESERVE_PERCENT,4,2        ## @BUF_RESERVE_PERCENT
	.comm	_BUF_MAX_PERCENT,4,2            ## @BUF_MAX_PERCENT
	.comm	_HCLGE_BUF_SIZE_UNIT,4,2        ## @HCLGE_BUF_SIZE_UNIT
	.comm	_HCLGE_MAX_TC_NUM,4,2           ## @HCLGE_MAX_TC_NUM
	.comm	_COMPENSATE_BUFFER,4,2          ## @COMPENSATE_BUFFER
	.comm	_COMPENSATE_HALF_MPS_NUM,4,2    ## @COMPENSATE_HALF_MPS_NUM
	.comm	_PRIV_WL_GAP,4,2                ## @PRIV_WL_GAP
	.no_dead_strip	_hclge_only_alloc_priv_buff
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hclge_only_alloc_priv_buff
_hclge_only_alloc_priv_buff:            ; @hclge_only_alloc_priv_buff
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	ldr	w21, [x0]
	mov	x0, x1
	bl	_hclge_get_tx_buff_alloced
	sub	w21, w21, w0
	mov	x0, x20
	bl	_hclge_get_tc_num
	ldr	w8, [x20, #4]
	asr	w8, w8, #1
	sdiv	w9, w21, w0
	cmp	w0, #0
	csel	w21, w21, w9, eq
Lloh0:
	adrp	x9, _NEED_RESERVE_TC_NUM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NEED_RESERVE_TC_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w0, w9
	b.gt	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _BUF_RESERVE_PERCENT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BUF_RESERVE_PERCENT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	mul	w9, w9, w21
Lloh6:
	adrp	x10, _BUF_MAX_PERCENT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BUF_MAX_PERCENT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	sdiv	w21, w9, w10
LBB0_2:
	ldr	w9, [x20, #8]
	add	w8, w8, w8, lsl #2
	mov	w10, #15360
	add	w8, w8, w9
	add	w0, w8, w10
Lloh9:
	adrp	x23, _HCLGE_BUF_SIZE_UNIT@GOTPAGE
Lloh10:
	ldr	x23, [x23, _HCLGE_BUF_SIZE_UNIT@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_round_up
	mov	x22, x0
	ldr	w1, [x23]
	mov	x0, x21
	bl	_round_down
	cmp	w0, w22
	b.ge	LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_10
LBB0_4:
Lloh11:
	adrp	x23, _HCLGE_MAX_TC_NUM@GOTPAGE
Lloh12:
	ldr	x23, [x23, _HCLGE_MAX_TC_NUM@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_9
; %bb.5:
	mov	x21, x0
	mov	x24, #0
	mov	x22, #0
	mov	w25, #1
	mov	w26, #-6144
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	ldr	w8, [x23]
	add	x24, x24, #16
	cmp	x22, x8
	b.hs	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x27, x8, x24
	stp	xzr, xzr, [x27]
	ldr	w28, [x20, #12]
	mov	x0, x22
	bl	_BIT
	tst	w0, w28
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	stp	w25, w21, [x27]
	ldr	w8, [x20, #8]
	sub	w8, w21, w8
	add	w9, w8, w26
	stp	w9, w8, [x27, #8]
	b	LBB0_6
LBB0_9:
	str	xzr, [x19]
	mov	w0, #1
LBB0_10:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_NEED_RESERVE_TC_NUM,4,2        ; @NEED_RESERVE_TC_NUM
	.comm	_BUF_RESERVE_PERCENT,4,2        ; @BUF_RESERVE_PERCENT
	.comm	_BUF_MAX_PERCENT,4,2            ; @BUF_MAX_PERCENT
	.comm	_HCLGE_BUF_SIZE_UNIT,4,2        ; @HCLGE_BUF_SIZE_UNIT
	.comm	_HCLGE_MAX_TC_NUM,4,2           ; @HCLGE_MAX_TC_NUM
	.comm	_COMPENSATE_BUFFER,4,2          ; @COMPENSATE_BUFFER
	.comm	_COMPENSATE_HALF_MPS_NUM,4,2    ; @COMPENSATE_HALF_MPS_NUM
	.comm	_PRIV_WL_GAP,4,2                ; @PRIV_WL_GAP
	.no_dead_strip	_hclge_only_alloc_priv_buff
.subsections_via_symbols
