	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wcn36xx_dxe_allocate_mem_pools ## -- Begin function wcn36xx_dxe_allocate_mem_pools
	.p2align	4, 0x90
_wcn36xx_dxe_allocate_mem_pools:        ## @wcn36xx_dxe_allocate_mem_pools
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_WCN36XX_BD_CHUNK_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movq	%rdi, %rbx
	andl	$-8, %ecx
	addl	$16, %ecx
	movl	%ecx, 32(%rdi)
	movslq	%ecx, %rsi
	movq	_WCN36XX_DXE_CH_DESC_NUMB_TX_H@GOTPCREL(%rip), %rax
	imulq	(%rax), %rsi
	movl	24(%rdi), %edi
	leaq	48(%rbx), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, 40(%rbx)
	movl	(%r14), %eax
	leal	7(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	andl	$-8, %ecx
	addl	$16, %ecx
	movl	%ecx, (%rbx)
	movslq	%ecx, %rsi
	movq	_WCN36XX_DXE_CH_DESC_NUMB_TX_L@GOTPCREL(%rip), %rax
	imulq	(%rax), %rsi
	movl	24(%rbx), %edi
	leaq	16(%rbx), %rdx
	movl	(%r15), %ecx
	callq	_dma_alloc_coherent
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	callq	_wcn36xx_dxe_free_mem_pools
	leaq	L_.str(%rip), %rdi
	callq	_wcn36xx_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WCN36XX_BD_CHUNK_SIZE,4,2      ## @WCN36XX_BD_CHUNK_SIZE
	.comm	_WCN36XX_DXE_CH_DESC_NUMB_TX_H,8,3 ## @WCN36XX_DXE_CH_DESC_NUMB_TX_H
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_WCN36XX_DXE_CH_DESC_NUMB_TX_L,8,3 ## @WCN36XX_DXE_CH_DESC_NUMB_TX_L
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate BD mempool\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wcn36xx_dxe_allocate_mem_pools ; -- Begin function wcn36xx_dxe_allocate_mem_pools
	.p2align	2
_wcn36xx_dxe_allocate_mem_pools:        ; @wcn36xx_dxe_allocate_mem_pools
	.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
Lloh0:
	adrp	x20, _WCN36XX_BD_CHUNK_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _WCN36XX_BD_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w8, [x20]
	negs	w9, w8
	and	w9, w9, #0x7
	and	w10, w8, #0x7
	csneg	w9, w10, w9, mi
	sub	w8, w8, w9
	add	w8, w8, #16
	str	w8, [x0, #32]
	sxtw	x8, w8
Lloh2:
	adrp	x9, _WCN36XX_DXE_CH_DESC_NUMB_TX_H@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WCN36XX_DXE_CH_DESC_NUMB_TX_H@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	mul	x1, x9, x8
	ldr	w0, [x0, #24]
	add	x2, x19, #48
Lloh5:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_3
; %bb.1:
	str	x0, [x19, #40]
	ldr	w8, [x20]
	negs	w9, w8
	and	w9, w9, #0x7
	and	w10, w8, #0x7
	csneg	w9, w10, w9, mi
	sub	w8, w8, w9
	add	w8, w8, #16
	str	w8, [x19]
Lloh7:
	adrp	x9, _WCN36XX_DXE_CH_DESC_NUMB_TX_L@GOTPAGE
Lloh8:
	ldr	x9, [x9, _WCN36XX_DXE_CH_DESC_NUMB_TX_L@GOTPAGEOFF]
	sxtw	x8, w8
Lloh9:
	ldr	x9, [x9]
	mul	x1, x9, x8
	ldr	w0, [x19, #24]
	add	x2, x19, #16
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	cbz	x0, LBB0_3
; %bb.2:
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19, #8]
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_wcn36xx_dxe_free_mem_pools
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_wcn36xx_err
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WCN36XX_BD_CHUNK_SIZE,4,2      ; @WCN36XX_BD_CHUNK_SIZE
	.comm	_WCN36XX_DXE_CH_DESC_NUMB_TX_H,8,3 ; @WCN36XX_DXE_CH_DESC_NUMB_TX_H
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_WCN36XX_DXE_CH_DESC_NUMB_TX_L,8,3 ; @WCN36XX_DXE_CH_DESC_NUMB_TX_L
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate BD mempool\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
