	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath5k_desc_alloc
_ath5k_desc_alloc:                      ## @ath5k_desc_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_ATH_TXBUF@GOTPCREL(%rip), %r12
	movq	_ATH_RXBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	(%r12), %eax
	movq	_ATH_BCBUF@GOTPCREL(%rip), %rbx
	addl	(%rbx), %eax
	leal	4(,%rax,4), %esi
	movl	%esi, (%rdi)
	movl	24(%rdi), %edi
	leaq	4(%r14), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movl	(%r14), %r8d
	movl	4(%r14), %r13d
	movq	_ATH5K_DEBUG_ANY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%r13d, %r9
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	_ATH5K_DBG
	movl	(%r12), %eax
	movq	_ATH_RXBUF@GOTPCREL(%rip), %r12
	addl	(%r12), %eax
	movl	(%rbx), %ecx
	leal	(%rcx,%rax), %edi
	incl	%edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %rbx
	movq	%rax, 40(%r14)
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	addq	$36, %r14
	movq	%r14, %rdi
	callq	_INIT_LIST_HEAD
	cmpl	$0, (%r12)
	je	LBB0_8
## %bb.6:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, 8(%rbx)
	movl	%r13d, (%rbx)
	leaq	4(%rbx), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_list_add_tail
	incl	%r14d
	addq	$16, %rbx
	addq	$4, %r15
	addl	$4, %r13d
	cmpl	(%r12), %r14d
	jb	LBB0_7
LBB0_8:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	leaq	32(%r14), %r12
	movq	%r12, %rdi
	callq	_INIT_LIST_HEAD
	movq	_ATH_TXBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, 8(%rbx)
	movl	%r13d, (%rbx)
	leaq	4(%rbx), %rdi
	movq	%r12, %rsi
	callq	_list_add_tail
	incl	%r14d
	addq	$16, %rbx
	addq	$4, %r15
	addl	$4, %r13d
	movq	_ATH_TXBUF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jb	LBB0_10
LBB0_11:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	addq	$28, %r12
	movq	%r12, %rdi
	callq	_INIT_LIST_HEAD
	movq	_ATH_BCBUF@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_14
## %bb.12:
	addq	$4, %rbx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, 4(%rbx)
	movl	%r13d, -4(%rbx)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_list_add_tail
	incl	%r14d
	addq	$4, %r15
	addl	$4, %r13d
	addq	$16, %rbx
	movq	_ATH_BCBUF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jb	LBB0_13
LBB0_14:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_ATH5K_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_ATH5K_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	24(%r14), %edi
	movq	16(%r14), %rdx
	movl	(%r14), %esi
	movl	4(%r14), %ecx
	callq	_dma_free_coherent
LBB0_4:
	negl	%ebx
	movq	$0, 16(%r14)
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH_TXBUF,4,2                  ## @ATH_TXBUF
	.comm	_ATH_RXBUF,4,2                  ## @ATH_RXBUF
	.comm	_ATH_BCBUF,4,2                  ## @ATH_BCBUF
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't allocate descriptors\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ATH5K_DEBUG_ANY,4,2            ## @ATH5K_DEBUG_ANY
L_.str.1:                               ## @.str.1
	.asciz	"DMA map: %p (%zu) -> %llx\n"

L_.str.2:                               ## @.str.2
	.asciz	"can't allocate bufptr\n"

	.no_dead_strip	_ath5k_desc_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath5k_desc_alloc
_ath5k_desc_alloc:                      ; @ath5k_desc_alloc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x25, _ATH_TXBUF@GOTPAGE
Lloh1:
	ldr	x25, [x25, _ATH_TXBUF@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh2:
	adrp	x26, _ATH_RXBUF@GOTPAGE
Lloh3:
	ldr	x26, [x26, _ATH_RXBUF@GOTPAGEOFF]
Lloh4:
	adrp	x23, _ATH_BCBUF@GOTPAGE
Lloh5:
	ldr	x23, [x23, _ATH_BCBUF@GOTPAGEOFF]
	ldr	w9, [x26]
	ldr	w10, [x23]
	add	w8, w9, w8
	add	w8, w8, w10
	lsl	w8, w8, #2
	add	w1, w8, #4
	str	w1, [x0]
	ldr	w0, [x0, #24]
	add	x2, x19, #4
Lloh6:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	bl	_dma_alloc_coherent
	str	x0, [x19, #16]
	cbz	x0, LBB0_12
; %bb.1:
	mov	x20, x0
Lloh8:
	adrp	x8, _ATH5K_DEBUG_ANY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATH5K_DEBUG_ANY@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldp	w4, w24, [x19]
	sxtw	x5, w24
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_ATH5K_DBG
	ldr	w8, [x25]
	ldr	w9, [x26]
	ldr	w10, [x23]
	add	w8, w8, w9
	add	w8, w8, w10
	add	w0, w8, #1
	ldr	w2, [x21]
	mov	w1, #16
	bl	_kcalloc
	cbz	x0, LBB0_13
; %bb.2:
	mov	x21, x0
	str	x0, [x19, #40]
	add	x22, x19, #36
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	ldr	w8, [x26]
	cbz	w8, LBB0_5
; %bb.3:
	mov	w27, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	x20, [x21, #8]
	str	w24, [x21]
	add	x0, x21, #4
	mov	x1, x22
	bl	_list_add_tail
	add	w27, w27, #1
	add	x21, x21, #16
	add	x20, x20, #4
	add	w24, w24, #4
	ldr	w8, [x26]
	cmp	w27, w8
	b.lo	LBB0_4
LBB0_5:
	add	x22, x19, #32
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	ldr	w8, [x25]
	str	w8, [x19, #8]
	cbz	w8, LBB0_8
; %bb.6:
	mov	w26, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	str	x20, [x21, #8]
	str	w24, [x21]
	add	x0, x21, #4
	mov	x1, x22
	bl	_list_add_tail
	add	w26, w26, #1
	add	x21, x21, #16
	add	x20, x20, #4
	add	w24, w24, #4
	ldr	w8, [x25]
	cmp	w26, w8
	b.lo	LBB0_7
LBB0_8:
	add	x19, x19, #28
	mov	x0, x19
	bl	_INIT_LIST_HEAD
	ldr	w8, [x23]
	cbz	w8, LBB0_11
; %bb.9:
	mov	w22, #0
	add	x21, x21, #4
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	stur	x20, [x21, #4]
	stur	w24, [x21, #-4]
	mov	x0, x21
	mov	x1, x19
	bl	_list_add_tail
	add	w22, w22, #1
	add	x20, x20, #4
	add	w24, w24, #4
	ldr	w8, [x23]
	add	x21, x21, #16
	cmp	w22, w8
	b.lo	LBB0_10
LBB0_11:
	mov	w0, #0
	b	LBB0_15
LBB0_12:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ATH5K_ERR
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
	b	LBB0_14
LBB0_13:
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ATH5K_ERR
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w20, [x8]
	ldr	w0, [x19, #24]
	ldr	x2, [x19, #16]
	ldp	w1, w3, [x19]
	bl	_dma_free_coherent
LBB0_14:
	neg	w0, w20
	str	xzr, [x19, #16]
LBB0_15:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH_TXBUF,4,2                  ; @ATH_TXBUF
	.comm	_ATH_RXBUF,4,2                  ; @ATH_RXBUF
	.comm	_ATH_BCBUF,4,2                  ; @ATH_BCBUF
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't allocate descriptors\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ATH5K_DEBUG_ANY,4,2            ; @ATH5K_DEBUG_ANY
l_.str.1:                               ; @.str.1
	.asciz	"DMA map: %p (%zu) -> %llx\n"

l_.str.2:                               ; @.str.2
	.asciz	"can't allocate bufptr\n"

	.no_dead_strip	_ath5k_desc_alloc
.subsections_via_symbols
