	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function wil_pmc_alloc
LCPI0_0:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
LCPI0_1:
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
LCPI0_2:
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	8                               ## 0x8
LCPI0_3:
	.long	12                              ## 0xc
	.long	12                              ## 0xc
	.long	12                              ## 0xc
	.long	12                              ## 0xc
LCPI0_4:
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_wil_pmc_alloc
	.p2align	4, 0x90
_wil_pmc_alloc:                         ## @wil_pmc_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
	subq	$184, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	leaq	8(%rdi), %r15
	callq	_wil_to_dev
	movq	%rax, %r13
	movl	4(%rbx), %edi
	callq	_ndev_to_vif
	movq	%rax, %r12
	pxor	%xmm0, %xmm0
	movdqa	%xmm0, -128(%rbp)
	movq	$0, -112(%rbp)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_wil_is_pmc_allocated
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_wil_err
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_10
LBB0_2:
	movq	%rbx, %r15
	movq	%r12, -192(%rbp)                ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movl	%r14d, %ebx
	jle	LBB0_6
## %bb.3:
	testl	%r13d, %r13d
	jle	LBB0_6
## %bb.4:
	movq	_WIL_RING_SIZE_ORDER_MAX@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	cmpl	%ebx, %eax
	jge	LBB0_12
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	jmp	LBB0_8
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%r13d, %ecx
LBB0_8:
	xorl	%eax, %eax
	callq	_wil_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_9:
	movq	%r15, %rbx
LBB0_10:
	negl	%ecx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, 16(%rax)
LBB0_11:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	addq	$184, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%r13d
	cmpl	%ebx, %eax
	jge	LBB0_14
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_7
LBB0_14:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	%ebx, 8(%r14)
	movl	%r13d, 12(%r14)
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_41
## %bb.15:
	leaq	L_.str.6(%rip), %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	cmpl	$33, (%r14)
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jl	LBB0_17
## %bb.16:
	movl	$32, %edi
	callq	_DMA_BIT_MASK
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
LBB0_17:
	movl	%ebx, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	(,%rax,8), %rax
	movl	%ebx, -64(%rbp)                 ## 4-byte Spill
	leaq	(%rax,%rax,4), %r12
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	40(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	callq	_dma_alloc_coherent
	movq	%rax, 32(%rbx)
	movl	(%rbx), %edi
	cmpl	$33, %edi
	jl	LBB0_19
## %bb.18:
	callq	_DMA_BIT_MASK
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	32(%rax), %rax
LBB0_19:
	movq	%r12, (%rsp)
	leaq	L_.str.7(%rip), %rsi
	movl	$40, %r8d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%rax, %rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	-64(%rbp), %r9d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_42
## %bb.20:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -136(%rbp)                ## 8-byte Spill
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	shrl	$2, %r13d
	cmpl	$2, %r13d
	movl	$1, %ecx
	cmovael	%r13d, %ecx
	movl	%ecx, %eax
	andl	$-8, %eax
	movq	%rax, -168(%rbp)                ## 8-byte Spill
	addq	$-8, %rax
	movq	%rax, -160(%rbp)                ## 8-byte Spill
	movq	%rax, %rdx
	shrq	$3, %rdx
	incq	%rdx
	movq	%rdx, %rax
	movq	%rdx, -152(%rbp)                ## 8-byte Spill
	andq	$-2, %rdx
	movq	%rdx, -144(%rbp)                ## 8-byte Spill
	movq	%rcx, -184(%rbp)                ## 8-byte Spill
                                        ## kill: def $ecx killed $ecx killed $rcx def $rcx
	andl	$3, %ecx
	movq	%rcx, -176(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	_PCM_DATA_INVALID_DW_VAL@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_21:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_30 Depth 2
                                        ##     Child Loop BB0_36 Depth 2
                                        ##     Child Loop BB0_38 Depth 2
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	24(%r14), %rax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	shlq	$4, %r15
	leaq	(%rax,%r15), %rdx
	addq	$8, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_dma_alloc_coherent
	movq	24(%r14), %rcx
	movq	%rax, (%rcx,%r15)
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_43
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %r8
	cmpl	$4, %ebx
	movq	-184(%rbp), %rbx                ## 8-byte Reload
	jb	LBB0_39
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	(%r8,%r15), %rcx
	cmpl	$8, %ebx
	jb	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_21 Depth=1
	leaq	4(%r13), %rdx
	cmpq	%rdx, %rcx
	jae	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_21 Depth=1
	leaq	(%rcx,%rbx,4), %rdx
	cmpq	%r13, %rdx
	jbe	LBB0_28
LBB0_24:                                ##   in Loop: Header=BB0_21 Depth=1
	xorl	%edx, %edx
LBB0_35:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	%rdx, %rsi
	notq	%rsi
	addq	%rbx, %rsi
	movq	-176(%rbp), %rdi                ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_37
	.p2align	4, 0x90
LBB0_36:                                ##   Parent Loop BB0_21 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %eax
	orl	%edx, %eax
	movl	%eax, (%rcx,%rdx,4)
	incq	%rdx
	decq	%rdi
	jne	LBB0_36
LBB0_37:                                ##   in Loop: Header=BB0_21 Depth=1
	cmpq	$3, %rsi
	jb	LBB0_39
	.p2align	4, 0x90
LBB0_38:                                ##   Parent Loop BB0_21 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %eax
	orl	%edx, %eax
	movl	%eax, (%rcx,%rdx,4)
	leal	1(%rdx), %eax
	orl	(%r13), %eax
	movl	%eax, 4(%rcx,%rdx,4)
	leal	2(%rdx), %eax
	orl	(%r13), %eax
	movl	%eax, 8(%rcx,%rdx,4)
	leal	3(%rdx), %eax
	orl	(%r13), %eax
	movl	%eax, 12(%rcx,%rdx,4)
	addq	$4, %rdx
	cmpq	%rbx, %rdx
	jne	LBB0_38
	jmp	LBB0_39
LBB0_28:                                ##   in Loop: Header=BB0_21 Depth=1
	cmpq	$0, -160(%rbp)                  ## 8-byte Folded Reload
	movdqa	LCPI0_1(%rip), %xmm4            ## xmm4 = [4,4,4,4]
	movdqa	LCPI0_2(%rip), %xmm5            ## xmm5 = [8,8,8,8]
	movdqa	LCPI0_3(%rip), %xmm6            ## xmm6 = [12,12,12,12]
	movdqa	LCPI0_4(%rip), %xmm7            ## xmm7 = [16,16,16,16]
	je	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_21 Depth=1
	movd	(%r13), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm1                ## xmm1 = xmm0[0,0,0,0]
	movq	-144(%rbp), %rsi                ## 8-byte Reload
	xorl	%edx, %edx
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,1,2,3]
	.p2align	4, 0x90
LBB0_30:                                ##   Parent Loop BB0_21 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqa	%xmm0, %xmm2
	paddd	%xmm4, %xmm2
	movdqa	%xmm1, %xmm3
	por	%xmm0, %xmm3
	por	%xmm1, %xmm2
	movdqu	%xmm3, (%rcx,%rdx,4)
	movdqu	%xmm2, 16(%rcx,%rdx,4)
	movdqa	%xmm0, %xmm2
	paddd	%xmm5, %xmm2
	movdqa	%xmm0, %xmm3
	paddd	%xmm6, %xmm3
	por	%xmm1, %xmm2
	por	%xmm1, %xmm3
	movdqu	%xmm2, 32(%rcx,%rdx,4)
	movdqu	%xmm3, 48(%rcx,%rdx,4)
	addq	$16, %rdx
	paddd	%xmm7, %xmm0
	addq	$-2, %rsi
	jne	LBB0_30
	jmp	LBB0_32
LBB0_31:                                ##   in Loop: Header=BB0_21 Depth=1
	xorl	%edx, %edx
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,1,2,3]
LBB0_32:                                ##   in Loop: Header=BB0_21 Depth=1
	testb	$1, -152(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_34
## %bb.33:                              ##   in Loop: Header=BB0_21 Depth=1
	movd	(%r13), %xmm1                   ## xmm1 = mem[0],zero,zero,zero
	pshufd	$0, %xmm1, %xmm1                ## xmm1 = xmm1[0,0,0,0]
	movdqa	%xmm1, %xmm2
	por	%xmm0, %xmm2
	paddd	%xmm4, %xmm0
	por	%xmm1, %xmm0
	movdqu	%xmm2, (%rcx,%rdx,4)
	movdqu	%xmm0, 16(%rcx,%rdx,4)
LBB0_34:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	-168(%rbp), %rax                ## 8-byte Reload
	movq	%rax, %rdx
	cmpq	%rbx, %rax
	jne	LBB0_35
	.p2align	4, 0x90
LBB0_39:                                ##   in Loop: Header=BB0_21 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rax,4), %r14
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%r14,8), %rax
	movq	%rax, -208(%rbp)                ## 8-byte Spill
	movl	8(%r8,%r15), %edi
	callq	_lower_32_bits
	movl	%eax, %edi
	callq	_cpu_to_le32
	movl	%eax, -84(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	24(%rbx), %rax
	movl	8(%rax,%r15), %edi
	callq	_upper_32_bits
	movl	%eax, %edi
	callq	_cpu_to_le16
	movq	%rax, -200(%rbp)                ## 8-byte Spill
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le16
	movq	%rax, %r15
	movl	$9, %edi
	callq	_BIT
	movq	_RX_DMA_D0_CMD_DMA_IT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	-208(%rbp), %rcx                ## 8-byte Reload
	movl	%eax, (%rcx)
	movl	$0, 4(%rcx)
	movq	%r15, 8(%r12,%r14,8)
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	$0, 16(%r12,%r14,8)
	movq	-200(%rbp), %rax                ## 8-byte Reload
	movq	%rax, 24(%r12,%r14,8)
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 32(%r12,%r14,8)
	movl	$0, 36(%rcx)
	incq	%r15
	cmpq	-104(%rbp), %r15                ## 8-byte Folded Reload
	je	LBB0_44
## %bb.40:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	32(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_21
LBB0_41:
	leaq	L_.str.5(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_wil_err
	jmp	LBB0_51
LBB0_42:
	leaq	L_.str.8(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_wil_err
	jmp	LBB0_50
LBB0_43:
	leaq	L_.str.9(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_wil_err
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_46
LBB0_44:
	leaq	L_.str.10(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movq	_WMI_PMC_ALLOCATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -112(%rbp)
	movl	8(%rbx), %edi
	callq	_cpu_to_le16
	movq	%rax, -120(%rbp)
	movl	40(%rbx), %edi
	callq	_cpu_to_le64
	movl	%eax, -128(%rbp)
	leaq	L_.str.11(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_wil_dbg_misc
	movq	_WMI_PMC_CMDID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-192(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %edx
	leaq	-128(%rbp), %rcx
	movq	%rbx, %rdi
	movl	$24, %r8d
	callq	_wmi_send
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_11
## %bb.45:
	movq	%rbx, %r15
	leaq	L_.str.12(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_wil_err
LBB0_46:
	leaq	L_.str.13(%rip), %rsi
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_wil_err
	movq	24(%r14), %rax
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-136(%rbp), %r13                ## 8-byte Reload
	movq	-104(%rbp), %r12                ## 8-byte Reload
	.p2align	4, 0x90
LBB0_47:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_49
## %bb.48:                              ##   in Loop: Header=BB0_47 Depth=1
	movl	8(%rax,%rbx), %ecx
	movq	%r14, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_dma_free_coherent
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	24(%rax), %rax
	movq	$0, (%rax,%rbx)
	addq	$16, %rbx
	decq	%r12
	jne	LBB0_47
LBB0_49:
	leaq	L_.str.14(%rip), %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_wil_err
	movq	32(%rbx), %rdx
	movl	40(%rbx), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_dma_free_coherent
	movq	$0, 32(%rbx)
LBB0_50:
	leaq	L_.str.15(%rip), %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_wil_err
	movq	24(%rbx), %rdi
	callq	_kfree
	movq	$0, 24(%rbx)
LBB0_51:
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ERROR pmc is already allocated\n"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid params num_descriptors(%d), descriptor_size(%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WIL_RING_SIZE_ORDER_MAX,4,2    ## @WIL_RING_SIZE_ORDER_MAX
L_.str.2:                               ## @.str.2
	.asciz	"num_descriptors(%d) exceeds max ring size %d\n"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
L_.str.3:                               ## @.str.3
	.asciz	"Overflow in num_descriptors(%d)*descriptor_size(%d)\n"

L_.str.4:                               ## @.str.4
	.asciz	"pmc_alloc: %d descriptors x %d bytes each\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.5:                               ## @.str.5
	.asciz	"ERROR allocating pmc skb list\n"

L_.str.6:                               ## @.str.6
	.asciz	"pmc_alloc: allocated descriptors info list %p\n"

L_.str.7:                               ## @.str.7
	.asciz	"pmc_alloc: allocated pring %p => %pad. %zd x %d = total %zd bytes\n"

L_.str.8:                               ## @.str.8
	.asciz	"ERROR allocating pmc pring\n"

L_.str.9:                               ## @.str.9
	.asciz	"ERROR allocating pmc descriptor %d"

	.comm	_PCM_DATA_INVALID_DW_VAL,4,2    ## @PCM_DATA_INVALID_DW_VAL
	.comm	_RX_DMA_D0_CMD_DMA_IT,4,2       ## @RX_DMA_D0_CMD_DMA_IT
L_.str.10:                              ## @.str.10
	.asciz	"pmc_alloc: allocated successfully\n"

	.comm	_WMI_PMC_ALLOCATE,4,2           ## @WMI_PMC_ALLOCATE
L_.str.11:                              ## @.str.11
	.asciz	"pmc_alloc: send WMI_PMC_CMD with ALLOCATE op\n"

	.comm	_WMI_PMC_CMDID,4,2              ## @WMI_PMC_CMDID
L_.str.12:                              ## @.str.12
	.asciz	"WMI_PMC_CMD with ALLOCATE op failed with status %d"

L_.str.13:                              ## @.str.13
	.asciz	"exit on error: Releasing skbs...\n"

L_.str.14:                              ## @.str.14
	.asciz	"exit on error: Releasing pring...\n"

L_.str.15:                              ## @.str.15
	.asciz	"exit on error: Releasing descriptors info list...\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function wil_pmc_alloc
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_wil_pmc_alloc
	.p2align	2
_wil_pmc_alloc:                         ; @wil_pmc_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x28, x27, [sp, #144]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #160]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #176]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x25, x1
	mov	x19, x0
	add	x24, x0, #8
	bl	_wil_to_dev
	mov	x27, x0
	ldr	w0, [x19, #4]
	bl	_ndev_to_vif
	mov	x20, x0
	stp	xzr, xzr, [x29, #-104]
	stur	xzr, [x29, #-88]
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	add	x23, x19, #20
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x24
	bl	_wil_is_pmc_allocated
	cbz	x0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_wil_err
	b	LBB0_9
LBB0_3:
	cmp	w25, #1
	b.lt	LBB0_7
; %bb.4:
	cmp	w21, #0
	b.le	LBB0_7
; %bb.5:
Lloh5:
	adrp	x8, _WIL_RING_SIZE_ORDER_MAX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WIL_RING_SIZE_ORDER_MAX@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	cmp	w8, w25
	b.ge	LBB0_11
; %bb.6:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x8, [sp]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_7:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x21, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_wil_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
LBB0_9:
	neg	w8, w22
	str	w8, [x19, #16]
LBB0_10:
	mov	x0, x23
	bl	_mutex_unlock
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #160]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_11:
Lloh15:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	sdiv	w8, w8, w21
	cmp	w8, w25
	b.ge	LBB0_13
; %bb.12:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x21, [sp]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_13:
	stp	w25, w21, [x19, #8]
	mov	x8, x21
	mov	x9, x25
	stp	x9, x8, [sp]
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_misc
Lloh22:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x25
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_32
; %bb.14:
	str	x0, [sp]
Lloh25:
	adrp	x1, l_.str.6@PAGE
Lloh26:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_misc
	ldr	w8, [x19]
	cmp	w8, #33
	b.lt	LBB0_16
; %bb.15:
	mov	w0, #32
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x27
	bl	_dma_set_mask_and_coherent
LBB0_16:
	mov	w8, w25
	str	x8, [sp, #104]                  ; 8-byte Folded Spill
	add	x8, x8, w25, uxtw #2
	lsl	x24, x8, #3
	add	x26, x19, #40
Lloh27:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	x0, x27
	mov	x1, x24
	mov	x2, x26
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	ldr	w8, [x19]
	cmp	w8, #33
	b.lt	LBB0_18
; %bb.17:
	mov	x0, x8
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x27
	bl	_dma_set_mask_and_coherent
	ldr	x0, [x19, #32]
LBB0_18:
	stp	x25, x24, [sp, #24]
	mov	w8, #40
	stp	x26, x8, [sp, #8]
	str	x0, [sp]
Lloh30:
	adrp	x1, l_.str.7@PAGE
Lloh31:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_misc
	ldr	x25, [x19, #32]
	cbz	x25, LBB0_33
; %bb.19:
	stp	x20, x24, [sp, #48]             ; 16-byte Folded Spill
	str	x23, [sp, #72]                  ; 8-byte Folded Spill
	str	w22, [sp, #68]                  ; 4-byte Folded Spill
	mov	x23, #0
	lsr	w8, w21, #2
	cmp	w8, #1
	csinc	w22, w8, wzr, hi
	and	x8, x22, #0x3ffffff0
	str	x8, [sp, #96]                   ; 8-byte Folded Spill
Lloh32:
	adrp	x28, _PCM_DATA_INVALID_DW_VAL@GOTPAGE
Lloh33:
	ldr	x28, [x28, _PCM_DATA_INVALID_DW_VAL@GOTPAGEOFF]
Lloh34:
	adrp	x8, lCPI0_0@PAGE
Lloh35:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	str	q0, [sp, #80]                   ; 16-byte Folded Spill
	str	x21, [sp, #112]                 ; 8-byte Folded Spill
LBB0_20:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_26 Depth 2
                                        ;     Child Loop BB0_29 Depth 2
	ldr	x8, [x19, #24]
	lsl	x26, x23, #4
	add	x8, x8, x26
	add	x2, x8, #8
Lloh36:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh38:
	ldr	w3, [x8]
	mov	x0, x27
	mov	x1, x21
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #24]
	str	x0, [x8, x26]
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_34
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #24]
	cmp	w21, #4
	b.lo	LBB0_30
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x9, [x8, x26]
	cmp	w22, #16
	b.hs	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	x10, #0
	b	LBB0_29
LBB0_24:                                ;   in Loop: Header=BB0_20 Depth=1
	add	x10, x9, x22, lsl #2
	add	x11, x28, #4
	cmp	x9, x11
	ccmp	x10, x28, #0, lo
	b.hi	LBB0_28
; %bb.25:                               ;   in Loop: Header=BB0_20 Depth=1
	ld1r.4s	{ v0 }, [x28]
	add	x10, x9, #32
	ldr	x11, [sp, #96]                  ; 8-byte Folded Reload
	ldr	q1, [sp, #80]                   ; 16-byte Folded Reload
	movi.4s	v6, #4
	movi.4s	v7, #8
	movi.4s	v16, #12
	movi.4s	v17, #16
LBB0_26:                                ;   Parent Loop BB0_20 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add.4s	v2, v1, v6
	add.4s	v3, v1, v7
	add.4s	v4, v1, v16
	orr.16b	v5, v0, v1
	orr.16b	v2, v0, v2
	orr.16b	v3, v0, v3
	orr.16b	v4, v0, v4
	stp	q5, q2, [x10, #-32]
	stp	q3, q4, [x10], #64
	add.4s	v1, v1, v17
	subs	x11, x11, #16
	b.ne	LBB0_26
; %bb.27:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x11, [sp, #96]                  ; 8-byte Folded Reload
	mov	x10, x11
	cmp	x11, x22
	b.ne	LBB0_29
	b	LBB0_30
LBB0_28:                                ;   in Loop: Header=BB0_20 Depth=1
	mov	x10, #0
LBB0_29:                                ;   Parent Loop BB0_20 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x28]
	orr	w11, w11, w10
	str	w11, [x9, x10, lsl #2]
	add	x10, x10, #1
	cmp	x22, x10
	b.ne	LBB0_29
LBB0_30:                                ;   in Loop: Header=BB0_20 Depth=1
	mov	x20, x27
	mov	w9, #40
	madd	x24, x23, x9, x25
	add	x8, x8, x26
	ldr	w0, [x8, #8]
	bl	_lower_32_bits
	bl	_cpu_to_le32
	mov	x21, x0
	ldr	x8, [x19, #24]
	add	x8, x8, x26
	ldr	w0, [x8, #8]
	bl	_upper_32_bits
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_cpu_to_le16
	mov	x26, x0
	ldr	x0, [sp, #112]                  ; 8-byte Folded Reload
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_cpu_to_le16
	mov	x27, x0
	mov	w0, #9
	bl	_BIT
Lloh39:
	adrp	x8, _RX_DMA_D0_CMD_DMA_IT@GOTPAGE
Lloh40:
	ldr	x8, [x8, _RX_DMA_D0_CMD_DMA_IT@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	orr	w8, w8, w0
	stp	w8, wzr, [x24]
	mov	w8, #40
	madd	x8, x23, x8, x25
	stp	x27, xzr, [x8, #8]
	str	x26, [x8, #24]
	str	w21, [x8, #32]
	str	wzr, [x24, #36]
	add	x23, x23, #1
	ldr	x24, [sp, #104]                 ; 8-byte Folded Reload
	cmp	x23, x24
	b.eq	LBB0_35
; %bb.31:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x25, [x19, #32]
	mov	x27, x20
	ldr	x21, [sp, #112]                 ; 8-byte Folded Reload
	b	LBB0_20
LBB0_32:
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_2
LBB0_33:
Lloh44:
	adrp	x1, l_.str.8@PAGE
Lloh45:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x19
	bl	_wil_err
	b	LBB0_41
LBB0_34:
	str	x23, [sp]
Lloh46:
	adrp	x1, l_.str.9@PAGE
Lloh47:
	add	x1, x1, l_.str.9@PAGEOFF
	mov	x0, x19
	bl	_wil_err
	ldr	x23, [sp, #72]                  ; 8-byte Folded Reload
	ldr	x24, [sp, #104]                 ; 8-byte Folded Reload
	b	LBB0_37
LBB0_35:
Lloh48:
	adrp	x1, l_.str.10@PAGE
Lloh49:
	add	x1, x1, l_.str.10@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_misc
Lloh50:
	adrp	x8, _WMI_PMC_ALLOCATE@GOTPAGE
Lloh51:
	ldr	x8, [x8, _WMI_PMC_ALLOCATE@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	stur	w8, [x29, #-88]
	ldr	w0, [x19, #8]
	bl	_cpu_to_le16
	stur	x0, [x29, #-96]
	ldr	w0, [x19, #40]
	bl	_cpu_to_le64
	stur	w0, [x29, #-104]
Lloh53:
	adrp	x1, l_.str.11@PAGE
Lloh54:
	add	x1, x1, l_.str.11@PAGEOFF
	mov	x0, x19
	bl	_wil_dbg_misc
Lloh55:
	adrp	x8, _WMI_PMC_CMDID@GOTPAGE
Lloh56:
	ldr	x8, [x8, _WMI_PMC_CMDID@GOTPAGEOFF]
Lloh57:
	ldr	w1, [x8]
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	ldr	w2, [x8]
	sub	x3, x29, #104
	mov	x0, x19
	mov	w4, #24
	bl	_wmi_send
                                        ; kill: def $w0 killed $w0 def $x0
	str	w0, [x19, #16]
	ldr	x23, [sp, #72]                  ; 8-byte Folded Reload
	cbz	w0, LBB0_10
; %bb.36:
	str	x0, [sp]
Lloh58:
	adrp	x1, l_.str.12@PAGE
Lloh59:
	add	x1, x1, l_.str.12@PAGEOFF
	mov	x0, x19
	bl	_wil_err
	mov	x27, x20
	ldr	x21, [sp, #112]                 ; 8-byte Folded Reload
LBB0_37:
Lloh60:
	adrp	x1, l_.str.13@PAGE
Lloh61:
	add	x1, x1, l_.str.13@PAGEOFF
	mov	x0, x19
	bl	_wil_err
	mov	x22, #0
	ldr	x8, [x19, #24]
	ldr	x20, [sp, #56]                  ; 8-byte Folded Reload
LBB0_38:                                ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x8, x22]
	cbz	x2, LBB0_40
; %bb.39:                               ;   in Loop: Header=BB0_38 Depth=1
	add	x8, x8, x22
	ldr	w3, [x8, #8]
	mov	x0, x27
	mov	x1, x21
	bl	_dma_free_coherent
	ldr	x8, [x19, #24]
	str	xzr, [x8, x22]
	add	x22, x22, #16
	subs	x24, x24, #1
	b.ne	LBB0_38
LBB0_40:
Lloh62:
	adrp	x1, l_.str.14@PAGE
Lloh63:
	add	x1, x1, l_.str.14@PAGEOFF
	mov	x0, x19
	bl	_wil_err
	ldr	x2, [x19, #32]
	ldr	w3, [x19, #40]
	mov	x0, x27
	mov	x1, x20
	bl	_dma_free_coherent
	str	xzr, [x19, #32]
	ldr	w22, [sp, #68]                  ; 4-byte Folded Reload
LBB0_41:
Lloh64:
	adrp	x1, l_.str.15@PAGE
Lloh65:
	add	x1, x1, l_.str.15@PAGEOFF
	mov	x0, x19
	bl	_wil_err
	ldr	x0, [x19, #24]
	bl	_kfree
	str	xzr, [x19, #24]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdr	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpAdd	Lloh60, Lloh61
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpAdd	Lloh64, Lloh65
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ERROR pmc is already allocated\n"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid params num_descriptors(%d), descriptor_size(%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WIL_RING_SIZE_ORDER_MAX,4,2    ; @WIL_RING_SIZE_ORDER_MAX
l_.str.2:                               ; @.str.2
	.asciz	"num_descriptors(%d) exceeds max ring size %d\n"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
l_.str.3:                               ; @.str.3
	.asciz	"Overflow in num_descriptors(%d)*descriptor_size(%d)\n"

l_.str.4:                               ; @.str.4
	.asciz	"pmc_alloc: %d descriptors x %d bytes each\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.5:                               ; @.str.5
	.asciz	"ERROR allocating pmc skb list\n"

l_.str.6:                               ; @.str.6
	.asciz	"pmc_alloc: allocated descriptors info list %p\n"

l_.str.7:                               ; @.str.7
	.asciz	"pmc_alloc: allocated pring %p => %pad. %zd x %d = total %zd bytes\n"

l_.str.8:                               ; @.str.8
	.asciz	"ERROR allocating pmc pring\n"

l_.str.9:                               ; @.str.9
	.asciz	"ERROR allocating pmc descriptor %d"

	.comm	_PCM_DATA_INVALID_DW_VAL,4,2    ; @PCM_DATA_INVALID_DW_VAL
	.comm	_RX_DMA_D0_CMD_DMA_IT,4,2       ; @RX_DMA_D0_CMD_DMA_IT
l_.str.10:                              ; @.str.10
	.asciz	"pmc_alloc: allocated successfully\n"

	.comm	_WMI_PMC_ALLOCATE,4,2           ; @WMI_PMC_ALLOCATE
l_.str.11:                              ; @.str.11
	.asciz	"pmc_alloc: send WMI_PMC_CMD with ALLOCATE op\n"

	.comm	_WMI_PMC_CMDID,4,2              ; @WMI_PMC_CMDID
l_.str.12:                              ; @.str.12
	.asciz	"WMI_PMC_CMD with ALLOCATE op failed with status %d"

l_.str.13:                              ; @.str.13
	.asciz	"exit on error: Releasing skbs...\n"

l_.str.14:                              ; @.str.14
	.asciz	"exit on error: Releasing pring...\n"

l_.str.15:                              ; @.str.15
	.asciz	"exit on error: Releasing descriptors info list...\n"

.subsections_via_symbols
