	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wil_rx_init_edma
_wil_rx_init_edma:                      ## @wil_rx_init_edma
	.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
	movl	$1, %r14d
	movl	%esi, %ecx
	shll	%cl, %r14d
	movq	%rdi, %r13
	cmpq	$0, 32(%rdi)
	je	LBB0_3
## %bb.1:
	cmpl	$0, 28(%r13)
	je	LBB0_2
LBB0_3:
	movl	(%r13), %ecx
	cmpl	%esi, %ecx
	jg	LBB0_5
## %bb.4:
	incl	%esi
	movl	%esi, (%r13)
	movl	%esi, %ecx
LBB0_5:
	cmpl	%r14d, 4(%r13)
	jg	LBB0_7
## %bb.6:
	leal	512(%r14), %eax
	movl	%eax, 4(%r13)
LBB0_7:
	movq	_WIL_SRING_SIZE_ORDER_MIN@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jl	LBB0_9
## %bb.8:
	movq	_WIL_SRING_SIZE_ORDER_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jle	LBB0_10
LBB0_9:
	movq	_WIL_RX_SRING_SIZE_ORDER_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r13)
LBB0_10:
	movl	$1, %r15d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r15d
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %r8d
	movq	%r13, %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movq	%r13, %rdi
	callq	_wil_rx_buf_len_init_edma
	movl	8(%r13), %edx
	movq	_WIL6210_MAX_STATUS_RINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	LBB0_12
## %bb.11:
	decl	%eax
	movl	%eax, 8(%r13)
	movl	%eax, %edx
LBB0_12:
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movl	24(%r13), %esi
	movq	%r13, %rdi
	callq	_wil_wmi_cfg_def_rx_offload
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_31
## %bb.13:
	cmpl	$0, 8(%r13)
	jle	LBB0_20
## %bb.14:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_wil_find_free_sring
	testl	%eax, %eax
	js	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	$4, %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_wil_init_rx_sring
	testl	%eax, %eax
	jne	LBB0_19
## %bb.15:                              ##   in Loop: Header=BB0_16 Depth=1
	incl	%ebx
	cmpl	8(%r13), %ebx
	jl	LBB0_16
LBB0_20:
	movq	_WIL_DEFAULT_RX_STATUS_RING_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_wil_init_rx_desc_ring
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_28
## %bb.21:
	movl	4(%r13), %edx
	cmpl	%r15d, %edx
	jl	LBB0_23
## %bb.22:
	leal	-1(%r15), %r14d
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	callq	_wil_info
	movl	%r14d, 4(%r13)
	movl	%r14d, %edx
LBB0_23:
	movq	%r13, %rdi
	movl	%edx, %esi
	callq	_wil_init_rx_buff_arr
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.24:
	movq	%r13, %rdi
	callq	_wil_rx_refill_edma
	testl	%eax, %eax
	je	LBB0_25
## %bb.26:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_wil_free_rx_buff_arr
LBB0_27:
	leaq	40(%r13), %rsi
	movq	%r13, %rdi
	callq	_wil_ring_free_edma
	cmpl	$0, 8(%r13)
	jg	LBB0_29
	jmp	LBB0_31
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_wil_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_31
LBB0_17:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_28:
	cmpl	$0, 8(%r13)
	jle	LBB0_31
LBB0_29:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rsi
	addq	%r14, %rsi
	movq	%r13, %rdi
	callq	_wil_sring_free
	incq	%rbx
	movslq	8(%r13), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_30
LBB0_31:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	%eax, %r12d
	cmpl	$0, 8(%r13)
	jg	LBB0_29
	jmp	LBB0_31
LBB0_25:
	xorl	%r12d, %r12d
	jmp	LBB0_31
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"compressed RX status cannot be used with SW reorder\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WIL_SRING_SIZE_ORDER_MIN,4,2   ## @WIL_SRING_SIZE_ORDER_MIN
	.comm	_WIL_SRING_SIZE_ORDER_MAX,4,2   ## @WIL_SRING_SIZE_ORDER_MAX
	.comm	_WIL_RX_SRING_SIZE_ORDER_DEFAULT,4,2 ## @WIL_RX_SRING_SIZE_ORDER_DEFAULT
L_.str.1:                               ## @.str.1
	.asciz	"rx_init, desc_ring_size=%u, status_ring_size=%u, elem_size=%zu\n"

	.comm	_WIL6210_MAX_STATUS_RINGS,4,2   ## @WIL6210_MAX_STATUS_RINGS
L_.str.2:                               ## @.str.2
	.asciz	"rx_init: allocate %d status rings\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_WIL_DEFAULT_RX_STATUS_RING_ID,4,2 ## @WIL_DEFAULT_RX_STATUS_RING_ID
L_.str.3:                               ## @.str.3
	.asciz	"rx_buff_id_count %d exceeds sring_size %d. set it to %d\n"

	.no_dead_strip	_wil_rx_init_edma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wil_rx_init_edma
_wil_rx_init_edma:                      ; @wil_rx_init_edma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x19, #28]
	cbz	w8, LBB0_23
LBB0_2:
	mov	w8, #1
	lsl	w20, w8, w1
	ldr	w8, [x19]
	cmp	w8, w1
	b.gt	LBB0_4
; %bb.3:
	add	w8, w1, #1
	str	w8, [x19]
LBB0_4:
	ldr	w9, [x19, #4]
	cmp	w9, w20
	b.gt	LBB0_6
; %bb.5:
	add	w9, w20, #512
	str	w9, [x19, #4]
LBB0_6:
Lloh0:
	adrp	x9, _WIL_SRING_SIZE_ORDER_MIN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WIL_SRING_SIZE_ORDER_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _WIL_SRING_SIZE_ORDER_MAX@GOTPAGE
Lloh4:
	ldr	x10, [x10, _WIL_SRING_SIZE_ORDER_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #0, ge
	b.le	LBB0_8
; %bb.7:
Lloh6:
	adrp	x8, _WIL_RX_SRING_SIZE_ORDER_DEFAULT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WIL_RX_SRING_SIZE_ORDER_DEFAULT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_8:
	mov	w9, #1
	lsl	w21, w9, w8
	mov	w8, #4
	stp	x21, x8, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_wil_dbg_misc
	mov	x0, x19
	bl	_wil_rx_buf_len_init_edma
	ldr	w2, [x19, #8]
Lloh11:
	adrp	x8, _WIL6210_MAX_STATUS_RINGS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _WIL6210_MAX_STATUS_RINGS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w2, w8
	b.lt	LBB0_10
; %bb.9:
	sub	w2, w8, #1
	str	w2, [x19, #8]
LBB0_10:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_misc
	ldr	w1, [x19, #24]
	mov	x0, x19
	bl	_wil_wmi_cfg_def_rx_offload
	mov	x22, x0
	cbnz	w0, LBB0_29
; %bb.11:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.12:
	mov	w23, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_wil_find_free_sring
	tbnz	w0, #31, LBB0_24
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x3, x0
	mov	x0, x19
	mov	x1, x21
	mov	w2, #4
	bl	_wil_init_rx_sring
	cbnz	w0, LBB0_25
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	w23, w23, #1
	ldr	w8, [x19, #8]
	cmp	w23, w8
	b.lt	LBB0_13
LBB0_16:
Lloh16:
	adrp	x8, _WIL_DEFAULT_RX_STATUS_RING_ID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _WIL_DEFAULT_RX_STATUS_RING_ID@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_wil_init_rx_desc_ring
	mov	x22, x0
	cbnz	w0, LBB0_26
; %bb.17:
	ldr	w2, [x19, #4]
	cmp	w2, w21
	b.lt	LBB0_19
; %bb.18:
	sub	w20, w21, #1
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x3, x21
	mov	x4, x20
	bl	_wil_info
	str	w20, [x19, #4]
	mov	x2, x20
LBB0_19:
	mov	x0, x19
	mov	x1, x2
	bl	_wil_init_rx_buff_arr
	mov	x22, x0
	cbnz	w0, LBB0_22
; %bb.20:
	mov	x0, x19
	bl	_wil_rx_refill_edma
	mov	x22, x0
	cbz	w0, LBB0_29
; %bb.21:
	mov	x0, x19
	bl	_wil_free_rx_buff_arr
LBB0_22:
	add	x1, x19, #40
	mov	x0, x19
	bl	_wil_ring_free_edma
	b	LBB0_26
LBB0_23:
Lloh21:
	adrp	x1, l_.str@PAGE
Lloh22:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_wil_err
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_29
LBB0_24:
Lloh26:
	adrp	x8, _EFAULT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_26
LBB0_25:
	mov	x22, x0
LBB0_26:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_29
; %bb.27:
	mov	x20, #0
	mov	x21, #0
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x1, x8, x20
	mov	x0, x19
	bl	_wil_sring_free
	add	x21, x21, #1
	ldrsw	x8, [x19, #8]
	add	x20, x20, #4
	cmp	x21, x8
	b.lt	LBB0_28
LBB0_29:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"compressed RX status cannot be used with SW reorder\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WIL_SRING_SIZE_ORDER_MIN,4,2   ; @WIL_SRING_SIZE_ORDER_MIN
	.comm	_WIL_SRING_SIZE_ORDER_MAX,4,2   ; @WIL_SRING_SIZE_ORDER_MAX
	.comm	_WIL_RX_SRING_SIZE_ORDER_DEFAULT,4,2 ; @WIL_RX_SRING_SIZE_ORDER_DEFAULT
l_.str.1:                               ; @.str.1
	.asciz	"rx_init, desc_ring_size=%u, status_ring_size=%u, elem_size=%zu\n"

	.comm	_WIL6210_MAX_STATUS_RINGS,4,2   ; @WIL6210_MAX_STATUS_RINGS
l_.str.2:                               ; @.str.2
	.asciz	"rx_init: allocate %d status rings\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_WIL_DEFAULT_RX_STATUS_RING_ID,4,2 ; @WIL_DEFAULT_RX_STATUS_RING_ID
l_.str.3:                               ; @.str.3
	.asciz	"rx_buff_id_count %d exceeds sring_size %d. set it to %d\n"

	.no_dead_strip	_wil_rx_init_edma
.subsections_via_symbols
