	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5_calc_rq_size
_mlx5_calc_rq_size:                     ## @mlx5_calc_rq_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	(%rsi), %rax
	xorl	%r13d, %r13d
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rdi, %r15
	movq	16(%rdi), %r12
	cmpq	(%rdi), %rax
	jg	LBB0_2
## %bb.3:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%r15, %rdi
	callq	_mlx5_calc_rcv_wqe
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	cmpl	8(%r15), %eax
	jle	LBB0_5
LBB0_2:
	movq	_MLX5_DBG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_mlx5_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_8:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rax, %r15
	movq	(%rbx), %rdi
	callq	_mlx5_round_up_power_of_two
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	imull	%r15d, %eax
	movq	_MLX5_SEND_WQE_BB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %r13d
	cltd
	idivl	%r15d
	movl	%eax, %ebx
	movl	%eax, (%r14)
	movl	%r15d, %edi
	callq	_mlx5_ilog2
	movl	%eax, 4(%r14)
	movl	%ebx, %edi
	callq	_mlx5_ilog2
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	movl	%edx, 8(%r14)
	xorl	%eax, %eax
	cmpq	$0, 16(%r14)
	sete	%al
	leal	(%r15,%rax,4), %eax
	addl	$-4, %eax
	sarl	$2, %eax
	movl	%eax, 12(%r14)
	jmp	LBB0_8
LBB0_7:
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX5_DBG_QP,4,2                ## @MLX5_DBG_QP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX5_SEND_WQE_BB,4,2           ## @MLX5_SEND_WQE_BB
	.no_dead_strip	_mlx5_calc_rq_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx5_calc_rq_size
_mlx5_calc_rq_size:                     ; @mlx5_calc_rq_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	x8, [x1]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x23, x0
	ldr	x21, [x0, #16]
	ldr	x9, [x0]
	cmp	x8, x9
	b.gt	LBB0_4
; %bb.2:
	mov	x19, x2
	mov	x22, x1
	mov	x0, x23
	bl	_mlx5_calc_rcv_wqe
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x20, x0
	ldr	w8, [x23, #8]
	cmp	w0, w8
	b.le	LBB0_7
LBB0_4:
Lloh0:
	adrp	x8, _MLX5_DBG_QP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_DBG_QP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_mlx5_dbg
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_5:
	mov	w21, #0
LBB0_6:
	mov	x0, x21
	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_7:
	ldr	x0, [x22]
	bl	_mlx5_round_up_power_of_two
	cbz	w20, LBB0_9
; %bb.8:
	mul	w0, w0, w20
Lloh8:
	adrp	x8, _MLX5_SEND_WQE_BB@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MLX5_SEND_WQE_BB@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_max
	mov	x21, x0
	sdiv	w22, w0, w20
	str	w22, [x19]
	mov	x0, x20
	bl	_mlx5_ilog2
	str	w0, [x19, #4]
	mov	x0, x22
	bl	_mlx5_ilog2
	mov	w8, #1
	lsl	w8, w8, w0
	ldr	x9, [x19, #16]
	cmp	x9, #0
	mov	w9, #-4
	csel	w9, wzr, w9, eq
	add	w9, w9, w20
	asr	w9, w9, #2
	stp	w8, w9, [x19, #8]
	b	LBB0_6
LBB0_9:
	mov	w21, #0
	stp	xzr, xzr, [x19]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX5_DBG_QP,4,2                ; @MLX5_DBG_QP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX5_SEND_WQE_BB,4,2           ; @MLX5_SEND_WQE_BB
	.no_dead_strip	_mlx5_calc_rq_size
.subsections_via_symbols
