	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i40iw_create_stag
_i40iw_create_stag:                     ## @i40iw_create_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	$0, -36(%rbp)
	leaq	-40(%rbp), %rdi
	movl	$4, %esi
	callq	_get_random_bytes
	movl	-40(%rbp), %r15d
	movl	(%r14), %r12d
	movl	4(%r14), %ebx
	movl	%r12d, %eax
	andl	%r15d, %eax
	sarl	$8, %eax
	cltd
	idivl	%ebx
	movl	%edx, -44(%rbp)
	movl	8(%r14), %esi
	leaq	-36(%rbp), %rcx
	leaq	-44(%rbp), %r8
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_i40iw_alloc_resource
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	-36(%rbp), %ebx
	movq	_I40IW_CQPSQ_STAG_IDX_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	notl	%r12d
	andl	%r15d, %r12d
	orl	%r12d, %ebx
	addl	%r15d, %ebx
	movq	%r14, %rdi
	callq	_i40iw_add_devusecount
LBB0_2:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_CQPSQ_STAG_IDX_SHIFT,4,2 ## @I40IW_CQPSQ_STAG_IDX_SHIFT
	.no_dead_strip	_i40iw_create_stag
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i40iw_create_stag
_i40iw_create_stag:                     ; @i40iw_create_stag
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	str	wzr, [sp, #12]
	add	x0, sp, #4
	mov	w1, #4
	bl	_get_random_bytes
	ldr	w21, [sp, #4]
	ldp	w22, w2, [x19]
	and	w8, w22, w21
	asr	w8, w8, #8
	sdiv	w9, w8, w2
	msub	w8, w9, w2, w8
	str	w8, [sp, #8]
	ldr	w1, [x19, #8]
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x0, x19
	bl	_i40iw_alloc_resource
	mov	w20, #0
	cbnz	w0, LBB0_2
; %bb.1:
	bic	w8, w21, w22
	ldr	w9, [sp, #12]
Lloh0:
	adrp	x10, _I40IW_CQPSQ_STAG_IDX_SHIFT@GOTPAGE
Lloh1:
	ldr	x10, [x10, _I40IW_CQPSQ_STAG_IDX_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	add	w20, w8, w21
	mov	x0, x19
	bl	_i40iw_add_devusecount
LBB0_2:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_CQPSQ_STAG_IDX_SHIFT,4,2 ; @I40IW_CQPSQ_STAG_IDX_SHIFT
	.no_dead_strip	_i40iw_create_stag
.subsections_via_symbols
