	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_qp_get_next_send_wqe     ## -- Begin function i40iw_qp_get_next_send_wqe
	.p2align	4, 0x90
_i40iw_qp_get_next_send_wqe:            ## @i40iw_qp_get_next_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r12
	movl	24(%rdi), %edi
	callq	_I40IW_RING_GETCURRENT_HEAD
	movq	%rax, (%r13)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	xorl	%ecx, %ecx
	cmpl	$0, (%r12)
	sete	%cl
	movl	%ecx, (%r12)
LBB0_2:
	movq	16(%r12), %rcx
	movq	(%rcx,%rax,8), %rdx
	andl	$127, %edx
	leaq	(%rdx,%r15), %rsi
	movq	_I40IW_QP_WQE_MAX_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rsi
	jle	LBB0_9
## %bb.3:
	subq	%rdx, %rcx
	movq	_I40IW_QP_WQE_MIN_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rcx, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:
	movq	%rcx, %rax
	cqto
	idivq	%rsi
	movq	%rax, %rbx
	testq	%rbx, %rbx
	jle	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_i40iw_nop_1
	movl	24(%r12), %edi
	xorl	%esi, %esi
	callq	_I40IW_RING_MOVE_HEAD
	decq	%rbx
	jne	LBB0_7
LBB0_8:
	movl	24(%r12), %edi
	callq	_I40IW_RING_GETCURRENT_HEAD
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_12
LBB0_9:
	andl	$3, %eax
	cmpl	$1, %eax
	jne	LBB0_13
## %bb.10:
	movq	_I40IW_WQE_SIZE_64@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jne	LBB0_13
## %bb.11:
	movq	%r12, %rdi
	callq	_i40iw_nop_1
	movl	24(%r12), %edi
	xorl	%esi, %esi
	callq	_I40IW_RING_MOVE_HEAD
	movl	24(%r12), %edi
	callq	_I40IW_RING_GETCURRENT_HEAD
	movq	%rax, (%r13)
	testq	%rax, %rax
	jne	LBB0_13
LBB0_12:
	xorl	%eax, %eax
	cmpl	$0, (%r12)
	sete	%al
	movl	%eax, (%r12)
LBB0_13:
	movl	24(%r12), %edi
	movq	_I40IW_QP_WQE_MIN_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_14
## %bb.15:
	movq	%r15, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	jmp	LBB0_16
LBB0_14:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %esi
LBB0_16:
	xorl	%edx, %edx
	callq	_I40IW_RING_MOVE_HEAD_BY_COUNT
	movq	16(%r12), %rax
	movq	(%r13), %rcx
	movq	(%rax,%rcx,8), %r14
	movl	24(%r12), %edi
	callq	_I40IW_RING_GETCURRENT_HEAD
	movl	%eax, %ecx
	notl	%ecx
	testb	$1, %cl
	jne	LBB0_19
## %bb.17:
	movq	16(%r12), %rcx
	movq	(%rcx,%rax,8), %rbx
	movq	24(%rbx), %rdi
	movq	_I40IWQPSQ_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_RS_64
	xorl	%edi, %edi
	cmpl	$0, (%r12)
	sete	%dil
	cmpl	%edi, %eax
	je	LBB0_19
## %bb.18:
	movq	_I40IWQPSQ_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movq	%rax, 24(%rbx)
LBB0_19:
	movq	8(%r12), %rax
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, (%rax,%rcx,8)
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 8(%rax,%rcx,8)
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	%r15, 16(%rax,%rcx,8)
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %ebx
	testq	%rbx, %rbx
	jg	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_QP_WQE_MAX_SIZE,8,3      ## @I40IW_QP_WQE_MAX_SIZE
	.comm	_I40IW_QP_WQE_MIN_SIZE,8,3      ## @I40IW_QP_WQE_MIN_SIZE
	.comm	_I40IW_WQE_SIZE_64,8,3          ## @I40IW_WQE_SIZE_64
	.comm	_I40IWQPSQ_VALID,4,2            ## @I40IWQPSQ_VALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_qp_get_next_send_wqe     ; -- Begin function i40iw_qp_get_next_send_wqe
	.p2align	2
_i40iw_qp_get_next_send_wqe:            ; @i40iw_qp_get_next_send_wqe
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x4
	mov	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x23, x0
	ldr	w0, [x0, #24]
	bl	_I40IW_RING_GETCURRENT_HEAD
	str	x0, [x21]
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x23]
	cmp	w8, #0
	cset	w8, eq
	str	w8, [x23]
LBB0_2:
	ldr	x8, [x23, #16]
	ldr	x8, [x8, x0, lsl #3]
Lloh0:
	adrp	x9, _I40IW_QP_WQE_MAX_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I40IW_QP_WQE_MAX_SIZE@GOTPAGEOFF]
	and	x8, x8, #0x7f
Lloh2:
	ldr	x9, [x9]
	add	x10, x8, x19
	cmp	x10, x9
Lloh3:
	adrp	x24, _I40IW_QP_WQE_MIN_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _I40IW_QP_WQE_MIN_SIZE@GOTPAGEOFF]
	b.le	LBB0_6
; %bb.3:
	sub	x8, x9, x8
	ldr	x9, [x24]
	sdiv	x25, x8, x9
	cmp	x25, #1
	b.lt	LBB0_5
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_i40iw_nop_1
	ldr	w0, [x23, #24]
	mov	w1, #0
	bl	_I40IW_RING_MOVE_HEAD
	subs	x25, x25, #1
	b.ne	LBB0_4
LBB0_5:
	ldr	w0, [x23, #24]
	bl	_I40IW_RING_GETCURRENT_HEAD
	str	x0, [x21]
	cbz	x0, LBB0_8
LBB0_6:
	and	x8, x0, #0x3
Lloh5:
	adrp	x9, _I40IW_WQE_SIZE_64@GOTPAGE
Lloh6:
	ldr	x9, [x9, _I40IW_WQE_SIZE_64@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, #1
	ccmp	x9, x19, #0, eq
	b.ne	LBB0_9
; %bb.7:
	mov	x0, x23
	bl	_i40iw_nop_1
	ldr	w0, [x23, #24]
	mov	w1, #0
	bl	_I40IW_RING_MOVE_HEAD
	ldr	w0, [x23, #24]
	bl	_I40IW_RING_GETCURRENT_HEAD
	str	x0, [x21]
	cbnz	x0, LBB0_9
LBB0_8:
	ldr	w8, [x23]
	cmp	w8, #0
	cset	w8, eq
	str	w8, [x23]
LBB0_9:
	ldr	w0, [x23, #24]
	ldr	x8, [x24]
	sdiv	x1, x19, x8
	mov	w2, #0
	bl	_I40IW_RING_MOVE_HEAD_BY_COUNT
	ldr	x8, [x23, #16]
	ldr	x9, [x21]
	ldr	x24, [x8, x9, lsl #3]
	ldr	w0, [x23, #24]
	bl	_I40IW_RING_GETCURRENT_HEAD
	tbz	w0, #0, LBB0_12
; %bb.10:
	ldr	x8, [x23, #16]
	ldr	x25, [x8, x0, lsl #3]
	ldr	x0, [x25, #24]
Lloh8:
	adrp	x26, _I40IWQPSQ_VALID@GOTPAGE
Lloh9:
	ldr	x26, [x26, _I40IWQPSQ_VALID@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_RS_64
	mov	x8, x0
	ldr	w9, [x23]
	cmp	w9, #0
	cset	w0, eq
	cmp	w8, w0
	b.eq	LBB0_12
; %bb.11:
	ldr	w1, [x26]
	bl	_LS_64
	str	x0, [x25, #24]
LBB0_12:
	ldr	x8, [x23, #8]
	ldr	x9, [x21]
	mov	w10, #24
	mul	x9, x9, x10
	str	x22, [x8, x9]
	ldr	x9, [x21]
	madd	x9, x9, x10, x8
	str	x20, [x9, #8]
	ldr	x9, [x21]
	madd	x8, x9, x10, x8
	str	x19, [x8, #16]
	mov	x0, x24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_QP_WQE_MAX_SIZE,8,3      ; @I40IW_QP_WQE_MAX_SIZE
	.comm	_I40IW_QP_WQE_MIN_SIZE,8,3      ; @I40IW_QP_WQE_MIN_SIZE
	.comm	_I40IW_WQE_SIZE_64,8,3          ; @I40IW_WQE_SIZE_64
	.comm	_I40IWQPSQ_VALID,4,2            ; @I40IWQPSQ_VALID
.subsections_via_symbols
