	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i40iw_hw_alloc_stag
_i40iw_hw_alloc_stag:                   ## @i40iw_hw_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	8(%rsi), %edi
	callq	_to_iwpd
	movq	%rax, %r13
	leaq	4(%r14), %rdi
	movl	$1, %esi
	callq	_i40iw_get_cqp_request
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	addq	$24, %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	movl	$20, %edx
	callq	_memset
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movl	(%r15), %eax
	movq	_I40IW_CQPSQ_STAG_IDX_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, 24(%rbx)
	movl	(%r13), %eax
	movl	%eax, 36(%rbx)
	movl	4(%r15), %eax
	movl	%eax, 32(%rbx)
	movl	$1, 28(%rbx)
	movq	_OP_ALLOC_STAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movl	$1, (%rbx)
	movq	%r14, 16(%rbx)
	movq	%rbx, 8(%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_i40iw_handle_cqp_op
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	leaq	L_.str(%rip), %rdi
	callq	_i40iw_pr_err
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_4:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_I40IW_CQPSQ_STAG_IDX_SHIFT,4,2 ## @I40IW_CQPSQ_STAG_IDX_SHIFT
	.comm	_OP_ALLOC_STAG,4,2              ## @OP_ALLOC_STAG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CQP-OP MR Reg fail"

	.no_dead_strip	_i40iw_hw_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_hw_alloc_stag
_i40iw_hw_alloc_stag:                   ; @i40iw_hw_alloc_stag
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x1, #8]
	bl	_to_iwpd
	mov	x22, x0
	add	x0, x19, #4
	mov	w23, #1
	mov	w1, #1
	bl	_i40iw_get_cqp_request
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	add	x0, x0, #24
	mov	w1, #0
	mov	w2, #20
	bl	_memset
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x21, #40]
Lloh3:
	adrp	x8, _I40IW_CQPSQ_STAG_IDX_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I40IW_CQPSQ_STAG_IDX_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldp	w9, w10, [x20]
	asr	w8, w9, w8
	ldr	w9, [x22]
	stp	w10, w9, [x21, #32]
Lloh6:
	adrp	x9, _OP_ALLOC_STAG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _OP_ALLOC_STAG@GOTPAGEOFF]
	stp	w8, w23, [x21, #24]
Lloh8:
	ldr	w8, [x9]
	str	w8, [x21, #48]
	str	w23, [x21]
	stp	x21, x19, [x21, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_i40iw_handle_cqp_op
	cbz	w0, LBB0_4
; %bb.2:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w19, w8
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_i40iw_pr_err
	b	LBB0_5
LBB0_3:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_5
LBB0_4:
	mov	w19, #0
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_I40IW_CQPSQ_STAG_IDX_SHIFT,4,2 ; @I40IW_CQPSQ_STAG_IDX_SHIFT
	.comm	_OP_ALLOC_STAG,4,2              ; @OP_ALLOC_STAG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CQP-OP MR Reg fail"

	.no_dead_strip	_i40iw_hw_alloc_stag
.subsections_via_symbols
