	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wil_vring_alloc
_wil_vring_alloc:                       ## @wil_vring_alloc
	.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, %r12
	movq	%rdi, %r14
	callq	_wil_to_dev
	movq	%rax, %rbx
	movslq	(%r12), %r13
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movl	$1, %edi
	callq	_BUILD_BUG_ON
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r12)
	movl	(%r12), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	shlq	$2, %r13
	cmpl	$33, (%r14)
	jl	LBB0_4
## %bb.3:
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
LBB0_4:
	leaq	16(%r12), %rax
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%rax, %r13
	movq	%rax, %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	(%r14), %edi
	cmpl	$33, %edi
	jl	LBB0_8
## %bb.7:
	callq	_DMA_BIT_MASK
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
LBB0_8:
	movslq	(%r12), %rdx
	movq	24(%r12), %rcx
	testq	%rdx, %rdx
	je	LBB0_16
## %bb.9:
	leaq	-1(%rdx), %rsi
	movl	%edx, %r8d
	andl	$3, %r8d
	cmpq	$3, %rsi
	jae	LBB0_11
## %bb.10:
	xorl	%esi, %esi
	jmp	LBB0_13
LBB0_1:
	movq	$0, 24(%r12)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_17
LBB0_5:
	movq	8(%r12), %rdi
	callq	_kfree
	movq	$0, 8(%r12)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_17
LBB0_11:
	movq	%rdx, %rdi
	andq	$-4, %rdi
	xorl	%esi, %esi
	movq	_TX_DMA_STATUS_DU@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	%eax, (%rcx,%rsi,4)
	movl	(%rbx), %eax
	movl	%eax, 4(%rcx,%rsi,4)
	movl	(%rbx), %eax
	movl	%eax, 8(%rcx,%rsi,4)
	movl	(%rbx), %eax
	movl	%eax, 12(%rcx,%rsi,4)
	addq	$4, %rsi
	cmpq	%rsi, %rdi
	jne	LBB0_12
LBB0_13:
	testq	%r8, %r8
	je	LBB0_16
## %bb.14:
	leaq	(%rcx,%rsi,4), %rsi
	xorl	%edi, %edi
	movq	_TX_DMA_STATUS_DU@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	%eax, (%rsi,%rdi,4)
	incq	%rdi
	cmpq	%rdi, %r8
	jne	LBB0_15
LBB0_16:
	movq	8(%r12), %r9
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	movq	%r13, %r8
	xorl	%eax, %eax
	callq	_wil_dbg_misc
LBB0_17:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vring_alloc:\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TX_DMA_STATUS_DU,4,2           ## @TX_DMA_STATUS_DU
L_.str.1:                               ## @.str.1
	.asciz	"vring[%d] 0x%p:%pad 0x%p\n"

	.no_dead_strip	_wil_vring_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wil_vring_alloc
_wil_vring_alloc:                       ; @wil_vring_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
	bl	_wil_to_dev
	mov	x21, x0
	ldrsw	x22, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_wil_dbg_misc
	mov	w0, #1
	bl	_BUILD_BUG_ON
	stp	xzr, xzr, [x19, #32]
	ldr	w0, [x19]
Lloh2:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_10
; %bb.1:
	lsl	x23, x22, #2
	ldr	w8, [x20]
	cmp	w8, #33
	b.lt	LBB0_3
; %bb.2:
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x21
	bl	_dma_set_mask_and_coherent
LBB0_3:
	add	x22, x19, #16
	ldr	w3, [x24]
	mov	x0, x21
	mov	x1, x23
	mov	x2, x22
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_11
; %bb.4:
	ldr	w0, [x20]
	cmp	w0, #33
	b.lt	LBB0_6
; %bb.5:
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x21
	bl	_dma_set_mask_and_coherent
LBB0_6:
	ldrsw	x8, [x19]
	ldr	x9, [x19, #24]
	cbz	w8, LBB0_9
; %bb.7:
Lloh4:
	adrp	x10, _TX_DMA_STATUS_DU@GOTPAGE
Lloh5:
	ldr	x10, [x10, _TX_DMA_STATUS_DU@GOTPAGEOFF]
	mov	x11, x9
	mov	x12, x8
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x10]
	str	w13, [x11], #4
	subs	x12, x12, #1
	b.ne	LBB0_8
LBB0_9:
	ldr	x10, [x19, #8]
	stp	x22, x10, [sp, #16]
	stp	x8, x9, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_wil_dbg_misc
	mov	w0, #0
	b	LBB0_13
LBB0_10:
	str	xzr, [x19, #24]
	b	LBB0_12
LBB0_11:
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
LBB0_12:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vring_alloc:\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TX_DMA_STATUS_DU,4,2           ; @TX_DMA_STATUS_DU
l_.str.1:                               ; @.str.1
	.asciz	"vring[%d] 0x%p:%pad 0x%p\n"

	.no_dead_strip	_wil_vring_alloc
.subsections_via_symbols
