	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_set_kernel_sq_size
_hns_roce_set_kernel_sq_size:           ## @hns_roce_set_kernel_sq_size
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	40(%rdi), %r12
	movq	(%rsi), %rax
	cmpq	(%rdi), %rax
	jg	LBB0_3
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	8(%rsi), %rax
	cmpq	8(%rdi), %rax
	jg	LBB0_3
## %bb.2:
	movq	16(%r15), %rax
	cmpq	16(%r13), %rax
	jle	LBB0_6
LBB0_3:
	leaq	L_.str(%rip), %rsi
LBB0_4:
	movq	%r12, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%rdx, %r14
	movl	36(%r13), %edi
	callq	_ilog2
	movl	%eax, 8(%r14)
	movq	24(%r13), %rsi
	movq	(%r15), %rdi
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.7:
	callq	_max
	movq	%rax, %rdi
LBB0_8:
	callq	_roundup_pow_of_two
	movl	%eax, 12(%r14)
	cltq
	cmpq	(%r13), %rax
	jle	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_10:
	movq	8(%r15), %rsi
	movl	$1, %edi
	callq	_max
	cmpq	$2, 8(%r13)
	jg	LBB0_12
## %bb.11:
	movq	%rax, %rdi
	callq	_roundup_pow_of_two
LBB0_12:
	movq	%rax, 16(%r14)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_set_extend_sge_param
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_5
LBB0_14:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	32(%r13), %ecx
	movl	$1, %r12d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	movslq	%r12d, %rsi
	movq	$0, 32(%r14)
	movl	12(%r14), %edi
	movb	8(%r14), %cl
	shll	%cl, %edi
	movq	%rsi, %rbx
	callq	_HNS_ROCE_ALOGN_UP
	movl	%eax, %edx
	cmpq	$3, 8(%r13)
	jl	LBB0_19
## %bb.15:
	movslq	52(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.16:
	movb	56(%r14), %cl
	movl	$1, %edi
	shll	%cl, %edi
	movslq	%edi, %rcx
	movq	%rbx, %r13
	movq	%rbx, %rax
	orq	%rcx, %rax
	movl	%edx, %ebx
	shrq	$32, %rax
	je	LBB0_20
## %bb.17:
	movq	%r13, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdi
	jmp	LBB0_21
LBB0_19:
	movq	%rbx, %r13
	jmp	LBB0_22
LBB0_20:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %edi
LBB0_21:
	callq	_max
	movl	%eax, 52(%r14)
	movl	%ebx, 60(%r14)
	movb	56(%r14), %cl
	shll	%cl, %eax
	movl	%eax, %edi
	movq	%r13, %rsi
	callq	_HNS_ROCE_ALOGN_UP
	movl	%ebx, %edx
	addl	%eax, %edx
LBB0_22:
	movl	%edx, 40(%r14)
	movl	44(%r14), %edi
	movb	48(%r14), %cl
	shll	%cl, %edi
	movq	%r13, %rsi
	movl	%edx, %ebx
	callq	_HNS_ROCE_ALOGN_UP
	addl	%ebx, %eax
	movl	%eax, (%r14)
	movslq	12(%r14), %rax
	movq	%rax, 24(%r14)
	movq	%rax, (%r15)
	movq	16(%r14), %rax
	movq	%rax, 8(%r15)
	movq	$0, 16(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SQ WR or sge or inline data error!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"while setting kernel sq size, sq.wqe_cnt too large\n"

L_.str.2:                               ## @.str.2
	.asciz	"set extend sge parameters fail\n"

	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_hns_roce_set_kernel_sq_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_set_kernel_sq_size
_hns_roce_set_kernel_sq_size:           ; @hns_roce_set_kernel_sq_size
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x22, [x0, #40]
	ldr	x8, [x1]
	ldr	x9, [x0]
	cmp	x8, x9
	b.gt	LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x21, x0
	ldr	x8, [x1, #8]
	ldr	x9, [x0, #8]
	cmp	x8, x9
	b.gt	LBB0_3
; %bb.2:
	ldr	x8, [x19, #16]
	ldr	x9, [x21, #16]
	cmp	x8, x9
	b.le	LBB0_6
LBB0_3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x22
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_5:
	mov	x0, x24
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	x20, x2
	ldr	w0, [x21, #36]
	bl	_ilog2
	str	w0, [x20, #8]
	ldr	x1, [x21, #24]
	ldr	x0, [x19]
	cbz	x1, LBB0_8
; %bb.7:
	bl	_max
LBB0_8:
	bl	_roundup_pow_of_two
	str	w0, [x20, #12]
	ldr	x8, [x21]
	cmp	x8, w0, sxtw
	b.ge	LBB0_10
; %bb.9:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_10:
	ldr	x1, [x19, #8]
	mov	w0, #1
	bl	_max
	ldr	x8, [x21, #8]
	cmp	x8, #2
	b.gt	LBB0_12
; %bb.11:
	bl	_roundup_pow_of_two
LBB0_12:
	str	x0, [x20, #16]
	mov	x0, x21
	mov	x1, x20
	bl	_set_extend_sge_param
	cbz	w0, LBB0_14
; %bb.13:
	mov	x24, x0
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_5
LBB0_14:
	ldr	w8, [x21, #32]
Lloh9:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	add	w8, w9, w8
	mov	w9, #1
	lsl	w8, w9, w8
	sxtw	x22, w8
	str	xzr, [x20, #32]
	ldp	w9, w8, [x20, #8]
	lsl	w0, w8, w9
	mov	x1, x22
	bl	_HNS_ROCE_ALOGN_UP
	mov	x23, x0
	ldr	x8, [x21, #8]
	cmp	x8, #3
	b.lt	LBB0_17
; %bb.15:
	ldrsw	x1, [x20, #52]
	cbz	w1, LBB0_17
; %bb.16:
	ldr	w8, [x20, #56]
	mov	w9, #1
	lsl	w8, w9, w8
	sxtw	x8, w8
	sdiv	x0, x22, x8
	bl	_max
	str	w0, [x20, #52]
	str	w23, [x20, #60]
	ldr	w8, [x20, #56]
	lsl	w0, w0, w8
	mov	x1, x22
	bl	_HNS_ROCE_ALOGN_UP
	add	w23, w0, w23
LBB0_17:
	str	w23, [x20, #40]
	ldp	w8, w9, [x20, #44]
	lsl	w0, w8, w9
	mov	x1, x22
	bl	_HNS_ROCE_ALOGN_UP
	mov	w24, #0
	add	w8, w0, w23
	str	w8, [x20]
	ldrsw	x8, [x20, #12]
	str	x8, [x20, #24]
	ldr	x9, [x20, #16]
	stp	x8, x9, [x19]
	str	xzr, [x19, #16]
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SQ WR or sge or inline data error!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"while setting kernel sq size, sq.wqe_cnt too large\n"

l_.str.2:                               ; @.str.2
	.asciz	"set extend sge parameters fail\n"

	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_hns_roce_set_kernel_sq_size
.subsections_via_symbols
