	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_sq_size
_calc_sq_size:                          ## @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
	subq	$24, %rsp
	.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_1
## %bb.2:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_calc_send_wqe
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_mlx5_ib_dbg
	testl	%ebx, %ebx
	js	LBB0_11
## %bb.3:
	movl	(%r14), %edi
	movq	_max_wqe_sz_sq@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_MLX5_CAP_GEN
	cmpl	%eax, %ebx
	jle	LBB0_6
## %bb.4:
	movl	(%r14), %edi
	movl	(%r13), %esi
	callq	_MLX5_CAP_GEN
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_mlx5_ib_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_6:
	movq	%r12, %rdi
	callq	_sq_overhead
	movl	%ebx, %ecx
	subl	%eax, %ecx
	addl	$-4, %ecx
	movl	%ecx, (%r15)
	movl	%ecx, 4(%r12)
	movl	(%r12), %edi
	imull	%ebx, %edi
	callq	_roundup_pow_of_two
	movq	_MLX5_SEND_WQE_BB@GOTPCREL(%rip), %rcx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cltd
	idivl	(%rcx)
	movl	%eax, %r13d
	movl	%eax, 4(%r15)
	movl	(%r14), %edi
	movq	_log_max_qp_sz@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MLX5_CAP_GEN
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	cmpl	%edx, %r13d
	jle	LBB0_8
## %bb.7:
	movl	(%r12), %r12d
	movq	_MLX5_SEND_WQE_BB@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	4(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	(%r14), %edi
	movl	$1, %r15d
	movq	_log_max_qp_sz@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MLX5_CAP_GEN
	movl	%eax, %ecx
	shll	%cl, %r15d
	movl	%r15d, (%rsp)
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	movl	%r13d, %r8d
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_mlx5_ib_dbg
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_5:
	subl	(%rax), %r15d
	movl	%r15d, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_MLX5_SEND_WQE_BB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ilog2
	movl	%eax, 16(%r15)
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_get_send_sge
	movl	%eax, 12(%r15)
	cmpl	8(%r12), %eax
	jge	LBB0_10
## %bb.9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_10:
	movl	%eax, 8(%r12)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %eax
	cltd
	idivl	%ebx
	movl	%eax, 8(%r15)
	movl	%eax, (%r12)
	movl	%ecx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wqe_size %d\n"

	.comm	_max_wqe_sz_sq,4,2              ## @max_wqe_sz_sq
L_.str.1:                               ## @.str.1
	.asciz	"wqe_size(%d) > max_sq_desc_sz(%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MLX5_SEND_WQE_BB,4,2           ## @MLX5_SEND_WQE_BB
	.comm	_log_max_qp_sz,4,2              ## @log_max_qp_sz
L_.str.2:                               ## @.str.2
	.asciz	"send queue size (%d * %d / %d -> %d) exceeds limits(%d)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_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 calc_sq_size
_calc_sq_size:                          ; @calc_sq_size
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	ldr	w8, [x1]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	mov	x0, x1
	bl	_calc_send_wqe
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_mlx5_ib_dbg
	tbnz	w19, #31, LBB0_10
; %bb.2:
	ldr	w0, [x20]
Lloh2:
	adrp	x23, _max_wqe_sz_sq@GOTPAGE
Lloh3:
	ldr	x23, [x23, _max_wqe_sz_sq@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_MLX5_CAP_GEN
	cmp	w19, w0
	b.le	LBB0_5
; %bb.3:
	ldr	w0, [x20]
	ldr	w1, [x23]
	bl	_MLX5_CAP_GEN
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_mlx5_ib_dbg
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	mov	w19, #0
	b	LBB0_10
LBB0_5:
	mov	x0, x22
	bl	_sq_overhead
	sub	w8, w19, w0
	sub	w8, w8, #4
	str	w8, [x21]
	str	w8, [x22, #4]
	ldr	w8, [x22]
	mul	w0, w8, w19
	bl	_roundup_pow_of_two
	mov	x23, x0
Lloh8:
	adrp	x24, _MLX5_SEND_WQE_BB@GOTPAGE
Lloh9:
	ldr	x24, [x24, _MLX5_SEND_WQE_BB@GOTPAGEOFF]
	ldr	w8, [x24]
	sdiv	w27, w0, w8
	str	w27, [x21, #4]
	ldr	w0, [x20]
Lloh10:
	adrp	x26, _log_max_qp_sz@GOTPAGE
Lloh11:
	ldr	x26, [x26, _log_max_qp_sz@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_MLX5_CAP_GEN
	mov	w25, #1
	lsl	w8, w25, w0
	cmp	w27, w8
	b.le	LBB0_7
; %bb.6:
	ldr	w22, [x22]
	ldr	w0, [x20]
	ldr	w1, [x26]
	ldr	w23, [x24]
	ldr	w21, [x21, #4]
	bl	_MLX5_CAP_GEN
	lsl	w8, w25, w0
	stp	x21, x8, [sp, #16]
	stp	x19, x23, [sp]
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_mlx5_ib_dbg
	b	LBB0_8
LBB0_7:
	ldr	w0, [x24]
	bl	_ilog2
	str	w0, [x21, #16]
	mov	x0, x22
	mov	x1, x19
	bl	_get_send_sge
	str	w0, [x21, #12]
	ldr	w8, [x22, #8]
	cmp	w0, w8
	b.ge	LBB0_11
LBB0_8:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_11:
	str	w0, [x22, #8]
	sdiv	w8, w23, w19
	str	w8, [x21, #8]
	str	w8, [x22]
	mov	x19, x23
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wqe_size %d\n"

	.comm	_max_wqe_sz_sq,4,2              ; @max_wqe_sz_sq
l_.str.1:                               ; @.str.1
	.asciz	"wqe_size(%d) > max_sq_desc_sz(%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MLX5_SEND_WQE_BB,4,2           ; @MLX5_SEND_WQE_BB
	.comm	_log_max_qp_sz,4,2              ; @log_max_qp_sz
l_.str.2:                               ; @.str.2
	.asciz	"send queue size (%d * %d / %d -> %d) exceeds limits(%d)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_calc_sq_size
.subsections_via_symbols
