	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5_calc_sq_size
_mlx5_calc_sq_size:                     ## @mlx5_calc_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
	cmpl	$0, (%rsi)
	je	LBB0_5
## %bb.1:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	callq	_mlx5_calc_send_wqe
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	cmpl	(%r13), %ebx
	jg	LBB0_8
## %bb.3:
	movl	12(%r12), %edi
	callq	_sq_overhead
	movl	%ebx, %ecx
	subl	%eax, %ecx
	addl	$-4, %ecx
	movl	%ecx, (%r15)
	movl	%ecx, 4(%r12)
	movl	(%r12), %edi
	movl	$2147483647, %eax               ## imm = 0x7FFFFFFF
	xorl	%edx, %edx
	idivl	(%r13)
	cmpl	%eax, %edi
	jle	LBB0_7
## %bb.4:
	movq	_MLX5_DBG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%ebx, %ebx
	callq	_mlx5_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_6:
	movq	_MLX5_DBG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_mlx5_dbg
	jmp	LBB0_10
LBB0_7:
	imull	%ebx, %edi
	callq	_mlx5_round_up_power_of_two
	movl	%eax, %ecx
	movq	_MLX5_SEND_WQE_BB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, 4(%r15)
	cmpl	4(%r13), %eax
	jle	LBB0_11
LBB0_8:
	movq	_MLX5_DBG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_mlx5_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%ecx, %r14d
	callq	_mlx5_ilog2
	movl	%eax, 16(%r15)
	movl	8(%r12), %eax
	movl	%eax, 12(%r15)
	movl	%r14d, %eax
	cltd
	idivl	%ebx
	movl	%eax, 8(%r15)
	movl	%r14d, %ebx
	jmp	LBB0_10
	.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_sq_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_sq_size
_mlx5_calc_sq_size:                     ; @mlx5_calc_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	w8, [x1]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	ldr	x20, [x0, #8]
	bl	_mlx5_calc_send_wqe
	mov	x19, x0
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	w8, [x23]
	cmp	w19, w8
	b.gt	LBB0_5
; %bb.3:
	ldr	w0, [x22, #12]
	bl	_sq_overhead
	sub	w8, w19, w0
	sub	w8, w8, #4
	str	w8, [x21]
	str	w8, [x22, #4]
	ldr	w8, [x22]
	ldr	w9, [x23]
	mov	w10, #2147483647
	sdiv	w9, w10, w9
	cmp	w8, w9
	b.gt	LBB0_5
; %bb.4:
	mul	w0, w8, w19
	bl	_mlx5_round_up_power_of_two
	mov	x24, x0
Lloh0:
	adrp	x8, _MLX5_SEND_WQE_BB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX5_SEND_WQE_BB@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	sdiv	w8, w24, w0
	str	w8, [x21, #4]
	ldr	w9, [x23, #4]
	cmp	w8, w9
	b.le	LBB0_9
LBB0_5:
Lloh3:
	adrp	x8, _MLX5_DBG_QP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLX5_DBG_QP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx5_dbg
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_6:
	mov	w19, #0
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _MLX5_DBG_QP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MLX5_DBG_QP@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx5_dbg
LBB0_8:
	mov	x0, x19
	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_9:
	bl	_mlx5_ilog2
	str	w0, [x21, #16]
	ldr	w8, [x22, #8]
	sdiv	w9, w24, w19
	stp	w9, w8, [x21, #8]
	mov	x19, x24
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.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_sq_size
.subsections_via_symbols
