	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5_calc_send_wqe
_mlx5_calc_send_wqe:                    ## @mlx5_calc_send_wqe
	.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	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	16(%rsi), %edi
	callq	_sq_overhead
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movl	8(%r15), %edi
	testl	%edi, %edi
	je	LBB0_2
## %bb.3:
	addl	$4, %edi
	movl	$16, %esi
	callq	_align
	movl	%eax, %r13d
	addl	%ebx, %r13d
	jmp	LBB0_4
LBB0_2:
	xorl	%r13d, %r13d
LBB0_4:
	movq	_IBV_QP_INIT_ATTR_MAX_TSO_HEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:
	movl	4(%r15), %edi
	movl	$16, %esi
	callq	_align
	addl	%ebx, %eax
	movl	4(%r15), %ecx
	movl	%ecx, (%r12)
	movl	%eax, %ebx
LBB0_6:
	movl	(%r14), %ecx
	subl	%ebx, %ecx
	sarl	$2, %ecx
	movl	12(%r15), %eax
	cmpl	%ecx, %eax
	jg	LBB0_7
## %bb.9:
	leal	(%rbx,%rax,4), %edi
	movl	%r13d, %esi
	callq	_max_int
	cmpl	(%r14), %eax
	jle	LBB0_10
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_MLX5_SEND_WQE_BB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_align                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IBV_QP_INIT_ATTR_MAX_TSO_HEADER,4,2 ## @IBV_QP_INIT_ATTR_MAX_TSO_HEADER
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX5_SEND_WQE_BB,4,2           ## @MLX5_SEND_WQE_BB
	.no_dead_strip	_mlx5_calc_send_wqe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx5_calc_send_wqe
_mlx5_calc_send_wqe:                    ; @mlx5_calc_send_wqe
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x1, #16]
	bl	_sq_overhead
	mov	x20, x0
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	w8, [x21, #8]
	cbz	w8, LBB0_3
; %bb.2:
	add	w0, w8, #4
	mov	w1, #16
	bl	_align
	add	w23, w0, w20
	b	LBB0_4
LBB0_3:
	mov	w23, #0
LBB0_4:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _IBV_QP_INIT_ATTR_MAX_TSO_HEADER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IBV_QP_INIT_ATTR_MAX_TSO_HEADER@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w0, [x21, #4]
	mov	w1, #16
	bl	_align
	add	w20, w0, w20
	ldr	w8, [x21, #4]
	str	w8, [x22]
LBB0_6:
	ldr	w8, [x19]
	sub	w9, w8, w20
	ldr	w8, [x21, #12]
	cmp	w8, w9, asr #2
	b.gt	LBB0_8
; %bb.7:
	add	w0, w20, w8, lsl #2
	mov	x1, x23
	bl	_max_int
	ldr	w8, [x19]
	cmp	w0, w8
	b.le	LBB0_10
LBB0_8:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	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_10:
Lloh6:
	adrp	x8, _MLX5_SEND_WQE_BB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX5_SEND_WQE_BB@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	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
	b	_align
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_IBV_QP_INIT_ATTR_MAX_TSO_HEADER,4,2 ; @IBV_QP_INIT_ATTR_MAX_TSO_HEADER
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX5_SEND_WQE_BB,4,2           ; @MLX5_SEND_WQE_BB
	.no_dead_strip	_mlx5_calc_send_wqe
.subsections_via_symbols
