	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i40iw_sc_alloc_stag
_i40iw_sc_alloc_stag:                   ## @i40iw_sc_alloc_stag
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movl	(%rsi), %ebx
	movq	_I40IW_PAGE_SIZE_2M@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_I40IW_PAGE_SIZE_4K@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, %esi
	callq	_i40iw_sc_cqp_get_next_send_wqe
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	cmpl	$2097152, %ebx                  ## imm = 0x200000
	cmovel	%r15d, %r14d
	movl	4(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_PDID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movl	%eax, %ebx
	movl	8(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_STAGLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	orl	%eax, %ebx
	movq	%r13, %rdi
	movl	$8, %esi
	movl	%ebx, %edx
	callq	_set_64bit_val
	movl	12(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_IDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movq	%r13, %rdi
	movl	$16, %esi
	movl	%eax, %edx
	callq	_set_64bit_val
	movl	16(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_HMCFNIDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movq	%r13, %rdi
	movl	$40, %esi
	movl	%eax, %edx
	callq	_set_64bit_val
	movq	_I40IW_CQP_OP_ALLOC_STAG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_I40IW_CQPSQ_OPCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movl	%eax, %ebx
	movq	_I40IW_CQPSQ_STAG_MR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edi
	callq	_LS_64
	orl	%eax, %ebx
	movl	20(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_ARIGHTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movl	%eax, %r15d
	movl	24(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_LPBLSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	orl	%eax, %r15d
	orl	%ebx, %r15d
	movq	_I40IW_CQPSQ_STAG_HPAGESIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_LS_64
	orl	%eax, %r15d
	movl	28(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_REMACCENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	movl	%eax, %ebx
	movl	32(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_USEHMCFNIDX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	orl	%eax, %ebx
	movl	36(%r12), %edi
	movq	_I40IW_CQPSQ_STAG_USEPFRID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	orl	%eax, %ebx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %edi
	movq	_I40IW_CQPSQ_WQEVALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LS_64
	orl	%eax, %ebx
	orl	%r15d, %ebx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_i40iw_insert_wqe_hdr
	movq	_I40IW_DEBUG_WQE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_I40IW_CQP_WQE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	shll	$3, %r8d
	leaq	L_.str(%rip), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	_i40iw_debug_buf
	xorl	%ebx, %ebx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_i40iw_sc_cqp_post_sq
	jmp	LBB0_4
LBB0_1:
	movq	_I40IW_ERR_RING_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_PAGE_SIZE_2M,4,2         ## @I40IW_PAGE_SIZE_2M
	.comm	_I40IW_PAGE_SIZE_4K,4,2         ## @I40IW_PAGE_SIZE_4K
	.comm	_I40IW_ERR_RING_FULL,4,2        ## @I40IW_ERR_RING_FULL
	.comm	_I40IW_CQPSQ_STAG_PDID,4,2      ## @I40IW_CQPSQ_STAG_PDID
	.comm	_I40IW_CQPSQ_STAG_STAGLEN,4,2   ## @I40IW_CQPSQ_STAG_STAGLEN
	.comm	_I40IW_CQPSQ_STAG_IDX,4,2       ## @I40IW_CQPSQ_STAG_IDX
	.comm	_I40IW_CQPSQ_STAG_HMCFNIDX,4,2  ## @I40IW_CQPSQ_STAG_HMCFNIDX
	.comm	_I40IW_CQP_OP_ALLOC_STAG,4,2    ## @I40IW_CQP_OP_ALLOC_STAG
	.comm	_I40IW_CQPSQ_OPCODE,4,2         ## @I40IW_CQPSQ_OPCODE
	.comm	_I40IW_CQPSQ_STAG_MR,4,2        ## @I40IW_CQPSQ_STAG_MR
	.comm	_I40IW_CQPSQ_STAG_ARIGHTS,4,2   ## @I40IW_CQPSQ_STAG_ARIGHTS
	.comm	_I40IW_CQPSQ_STAG_LPBLSIZE,4,2  ## @I40IW_CQPSQ_STAG_LPBLSIZE
	.comm	_I40IW_CQPSQ_STAG_HPAGESIZE,4,2 ## @I40IW_CQPSQ_STAG_HPAGESIZE
	.comm	_I40IW_CQPSQ_STAG_REMACCENABLED,4,2 ## @I40IW_CQPSQ_STAG_REMACCENABLED
	.comm	_I40IW_CQPSQ_STAG_USEHMCFNIDX,4,2 ## @I40IW_CQPSQ_STAG_USEHMCFNIDX
	.comm	_I40IW_CQPSQ_STAG_USEPFRID,4,2  ## @I40IW_CQPSQ_STAG_USEPFRID
	.comm	_I40IW_CQPSQ_WQEVALID,4,2       ## @I40IW_CQPSQ_WQEVALID
	.comm	_I40IW_DEBUG_WQE,4,2            ## @I40IW_DEBUG_WQE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ALLOC_STAG WQE"

	.comm	_I40IW_CQP_WQE_SIZE,4,2         ## @I40IW_CQP_WQE_SIZE
	.no_dead_strip	_i40iw_sc_alloc_stag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i40iw_sc_alloc_stag
_i40iw_sc_alloc_stag:                   ; @i40iw_sc_alloc_stag
	.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	x19, x3
	mov	x23, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _I40IW_PAGE_SIZE_2M@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I40IW_PAGE_SIZE_2M@GOTPAGEOFF]
	ldr	w25, [x1]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x8, _I40IW_PAGE_SIZE_4K@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I40IW_PAGE_SIZE_4K@GOTPAGEOFF]
Lloh5:
	ldr	w26, [x8]
	ldr	x20, [x0]
	mov	x0, x20
	mov	x1, x2
	bl	_i40iw_sc_cqp_get_next_send_wqe
	cbz	x0, LBB0_4
; %bb.1:
	mov	x22, x0
	cmp	w25, #512, lsl #12              ; =2097152
	csel	w24, w24, w26, eq
	ldr	w0, [x23, #4]
Lloh6:
	adrp	x8, _I40IW_CQPSQ_STAG_PDID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_PDID@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_LS_64
	mov	x25, x0
	ldr	w0, [x23, #8]
Lloh9:
	adrp	x8, _I40IW_CQPSQ_STAG_STAGLEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_STAGLEN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w2, w0, w25
	mov	x0, x22
	mov	w1, #8
	bl	_set_64bit_val
	ldr	w0, [x23, #12]
Lloh12:
	adrp	x8, _I40IW_CQPSQ_STAG_IDX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_IDX@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_LS_64
	mov	x2, x0
	mov	x0, x22
	mov	w1, #16
	bl	_set_64bit_val
	ldr	w0, [x23, #16]
Lloh15:
	adrp	x8, _I40IW_CQPSQ_STAG_HMCFNIDX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_HMCFNIDX@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_LS_64
	mov	x2, x0
	mov	x0, x22
	mov	w1, #40
	bl	_set_64bit_val
Lloh18:
	adrp	x8, _I40IW_CQP_OP_ALLOC_STAG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _I40IW_CQP_OP_ALLOC_STAG@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _I40IW_CQPSQ_OPCODE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I40IW_CQPSQ_OPCODE@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_LS_64
	mov	x25, x0
Lloh24:
	adrp	x8, _I40IW_CQPSQ_STAG_MR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_MR@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	w0, #1
	bl	_LS_64
	orr	w25, w0, w25
	ldr	w0, [x23, #20]
Lloh27:
	adrp	x8, _I40IW_CQPSQ_STAG_ARIGHTS@GOTPAGE
Lloh28:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_ARIGHTS@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w25, w25, w0
	ldr	w0, [x23, #24]
Lloh30:
	adrp	x8, _I40IW_CQPSQ_STAG_LPBLSIZE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_LPBLSIZE@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w25, w25, w0
Lloh33:
	adrp	x8, _I40IW_CQPSQ_STAG_HPAGESIZE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_HPAGESIZE@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_LS_64
	orr	w24, w25, w0
	ldr	w0, [x23, #28]
Lloh36:
	adrp	x8, _I40IW_CQPSQ_STAG_REMACCENABLED@GOTPAGE
Lloh37:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_REMACCENABLED@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w24, w24, w0
	ldr	w0, [x23, #32]
Lloh39:
	adrp	x8, _I40IW_CQPSQ_STAG_USEHMCFNIDX@GOTPAGE
Lloh40:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_USEHMCFNIDX@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w24, w24, w0
	ldr	w0, [x23, #36]
Lloh42:
	adrp	x8, _I40IW_CQPSQ_STAG_USEPFRID@GOTPAGE
Lloh43:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_USEPFRID@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w23, w24, w0
	ldr	w0, [x20]
Lloh45:
	adrp	x8, _I40IW_CQPSQ_WQEVALID@GOTPAGE
Lloh46:
	ldr	x8, [x8, _I40IW_CQPSQ_WQEVALID@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	bl	_LS_64
	orr	w1, w23, w0
	mov	x0, x22
	bl	_i40iw_insert_wqe_hdr
Lloh48:
	adrp	x8, _I40IW_DEBUG_WQE@GOTPAGE
Lloh49:
	ldr	x8, [x8, _I40IW_DEBUG_WQE@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
Lloh51:
	adrp	x8, _I40IW_CQP_WQE_SIZE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _I40IW_CQP_WQE_SIZE@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	lsl	w4, w8, #3
Lloh54:
	adrp	x2, l_.str@PAGE
Lloh55:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	x3, x22
	bl	_i40iw_debug_buf
	cbz	w19, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_i40iw_sc_cqp_post_sq
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh56:
	adrp	x8, _I40IW_ERR_RING_FULL@GOTPAGE
Lloh57:
	ldr	x8, [x8, _I40IW_ERR_RING_FULL@GOTPAGEOFF]
Lloh58:
	ldr	w0, [x8]
LBB0_5:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_PAGE_SIZE_2M,4,2         ; @I40IW_PAGE_SIZE_2M
	.comm	_I40IW_PAGE_SIZE_4K,4,2         ; @I40IW_PAGE_SIZE_4K
	.comm	_I40IW_ERR_RING_FULL,4,2        ; @I40IW_ERR_RING_FULL
	.comm	_I40IW_CQPSQ_STAG_PDID,4,2      ; @I40IW_CQPSQ_STAG_PDID
	.comm	_I40IW_CQPSQ_STAG_STAGLEN,4,2   ; @I40IW_CQPSQ_STAG_STAGLEN
	.comm	_I40IW_CQPSQ_STAG_IDX,4,2       ; @I40IW_CQPSQ_STAG_IDX
	.comm	_I40IW_CQPSQ_STAG_HMCFNIDX,4,2  ; @I40IW_CQPSQ_STAG_HMCFNIDX
	.comm	_I40IW_CQP_OP_ALLOC_STAG,4,2    ; @I40IW_CQP_OP_ALLOC_STAG
	.comm	_I40IW_CQPSQ_OPCODE,4,2         ; @I40IW_CQPSQ_OPCODE
	.comm	_I40IW_CQPSQ_STAG_MR,4,2        ; @I40IW_CQPSQ_STAG_MR
	.comm	_I40IW_CQPSQ_STAG_ARIGHTS,4,2   ; @I40IW_CQPSQ_STAG_ARIGHTS
	.comm	_I40IW_CQPSQ_STAG_LPBLSIZE,4,2  ; @I40IW_CQPSQ_STAG_LPBLSIZE
	.comm	_I40IW_CQPSQ_STAG_HPAGESIZE,4,2 ; @I40IW_CQPSQ_STAG_HPAGESIZE
	.comm	_I40IW_CQPSQ_STAG_REMACCENABLED,4,2 ; @I40IW_CQPSQ_STAG_REMACCENABLED
	.comm	_I40IW_CQPSQ_STAG_USEHMCFNIDX,4,2 ; @I40IW_CQPSQ_STAG_USEHMCFNIDX
	.comm	_I40IW_CQPSQ_STAG_USEPFRID,4,2  ; @I40IW_CQPSQ_STAG_USEPFRID
	.comm	_I40IW_CQPSQ_WQEVALID,4,2       ; @I40IW_CQPSQ_WQEVALID
	.comm	_I40IW_DEBUG_WQE,4,2            ; @I40IW_DEBUG_WQE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ALLOC_STAG WQE"

	.comm	_I40IW_CQP_WQE_SIZE,4,2         ; @I40IW_CQP_WQE_SIZE
	.no_dead_strip	_i40iw_sc_alloc_stag
.subsections_via_symbols
