	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_rq_flush                   ## -- Begin function siw_rq_flush
	.p2align	4, 0x90
_siw_rq_flush:                          ## @siw_rq_flush
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	48(%rdi), %rax
	movq	_SIW_WR_IDLE@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	je	LBB0_8
## %bb.1:
	leaq	48(%r15), %r14
	movq	%r14, %rdi
	callq	_rx_type
	movq	48(%r15), %rcx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_siw_dbg_qp
	movq	%r14, %rdi
	callq	_rx_type
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_siw_wqe_put_mem
	movq	%r14, %rdi
	callq	_rx_type
	movq	_SIW_OP_RECEIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	leaq	64(%r15), %rsi
	movl	60(%r15), %edx
	movq	_SIW_WC_WR_FLUSH_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_siw_rqe_complete
	jmp	LBB0_7
LBB0_3:
	movq	%r14, %rdi
	callq	_rx_type
	movq	_SIW_OP_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_rx_type
	movq	_SIW_OP_READ_RESPONSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	_rx_type
	movq	_SIW_OP_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	leaq	56(%r15), %rsi
	movq	_SIW_WC_WR_FLUSH_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_siw_sqe_complete
LBB0_7:
	movq	(%r12), %rax
	movq	%rax, (%r14)
LBB0_8:
	cmpq	%rax, 24(%r15)
	je	LBB0_10
## %bb.9:
	leaq	24(%r15), %rbx
	movq	%rbx, %rdi
	callq	_rx_type
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_siw_wqe_put_mem
	movq	(%r12), %rax
	movq	%rax, (%rbx)
LBB0_10:
	movl	8(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_18
## %bb.11:
	movq	(%r15), %rax
	movq	_SIW_WC_WR_FLUSH_ERR@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %r12
	movslq	%ecx, %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%edx, %edx
	divq	%rsi
	movq	%rdx, %rbx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_12 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %ebx
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	(%r12,%rbx,4), %edi
	callq	_READ_ONCE
	testl	%eax, %eax
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	leaq	(%r12,%rbx,4), %rbx
	movl	(%r14), %r8d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_siw_rqe_complete
	testq	%rax, %rax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_WRITE_ONCE
	movq	(%r15), %rax
	incq	%rax
	movq	%rax, (%r15)
	movl	8(%r15), %ecx
	testl	%ecx, %ecx
	jne	LBB0_12
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIW_WR_IDLE,8,3                ## @SIW_WR_IDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"flush current rqe, type %d, status %d\n"

	.comm	_SIW_OP_RECEIVE,8,3             ## @SIW_OP_RECEIVE
	.comm	_SIW_WC_WR_FLUSH_ERR,4,2        ## @SIW_WC_WR_FLUSH_ERR
	.comm	_SIW_OP_READ,8,3                ## @SIW_OP_READ
	.comm	_SIW_OP_READ_RESPONSE,8,3       ## @SIW_OP_READ_RESPONSE
	.comm	_SIW_OP_WRITE,8,3               ## @SIW_OP_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_rq_flush                   ; -- Begin function siw_rq_flush
	.p2align	2
_siw_rq_flush:                          ; @siw_rq_flush
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	ldr	x8, [x20, #48]!
Lloh0:
	adrp	x21, _SIW_WR_IDLE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SIW_WR_IDLE@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.1:
	mov	x0, x20
	bl	_rx_type
	mov	x2, x0
	ldr	x3, [x19, #48]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_siw_dbg_qp
	mov	x0, x20
	bl	_rx_type
	mov	x1, x0
	mov	x0, x20
	bl	_siw_wqe_put_mem
	mov	x0, x20
	bl	_rx_type
Lloh4:
	adrp	x8, _SIW_OP_RECEIVE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SIW_OP_RECEIVE@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.2:
	add	x1, x19, #64
	ldr	w2, [x19, #60]
Lloh7:
	adrp	x8, _SIW_WC_WR_FLUSH_ERR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SIW_WC_WR_FLUSH_ERR@GOTPAGEOFF]
Lloh9:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_siw_rqe_complete
	b	LBB0_7
LBB0_3:
	mov	x0, x20
	bl	_rx_type
Lloh10:
	adrp	x8, _SIW_OP_READ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SIW_OP_READ@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_rx_type
Lloh13:
	adrp	x8, _SIW_OP_READ_RESPONSE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SIW_OP_READ_RESPONSE@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_rx_type
Lloh16:
	adrp	x8, _SIW_OP_WRITE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SIW_OP_WRITE@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.6:
	add	x1, x19, #56
Lloh19:
	adrp	x8, _SIW_WC_WR_FLUSH_ERR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SIW_WC_WR_FLUSH_ERR@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_siw_sqe_complete
LBB0_7:
	ldr	x8, [x21]
	str	x8, [x20]
LBB0_8:
	mov	x20, x19
	ldr	x9, [x20, #24]!
	cmp	x9, x8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_rx_type
	mov	x1, x0
	mov	x0, x20
	bl	_siw_wqe_put_mem
	ldr	x8, [x21]
	str	x8, [x20]
LBB0_10:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_15
; %bb.11:
	ldr	x9, [x19]
Lloh22:
	adrp	x21, _SIW_WC_WR_FLUSH_ERR@GOTPAGE
Lloh23:
	ldr	x21, [x21, _SIW_WC_WR_FLUSH_ERR@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19, #16]
	sxtw	x8, w8
	udiv	x11, x9, x8
	msub	x8, x11, x8, x9
	add	x20, x10, x8, lsl #2
	ldr	w0, [x20]
	bl	_READ_ONCE
	cbz	w0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w4, [x21]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	w3, #0
	bl	_siw_rqe_complete
	cbnz	x0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w0, [x20]
	mov	w1, #0
	bl	_WRITE_ONCE
	ldr	x8, [x19]
	add	x9, x8, #1
	str	x9, [x19]
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_12
LBB0_15:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SIW_WR_IDLE,8,3                ; @SIW_WR_IDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"flush current rqe, type %d, status %d\n"

	.comm	_SIW_OP_RECEIVE,8,3             ; @SIW_OP_RECEIVE
	.comm	_SIW_WC_WR_FLUSH_ERR,4,2        ; @SIW_WC_WR_FLUSH_ERR
	.comm	_SIW_OP_READ,8,3                ; @SIW_OP_READ
	.comm	_SIW_OP_READ_RESPONSE,8,3       ; @SIW_OP_READ_RESPONSE
	.comm	_SIW_OP_WRITE,8,3               ; @SIW_OP_WRITE
.subsections_via_symbols
