	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wl1271_tx_allocate
_wl1271_tx_allocate:                    ## @wl1271_tx_allocate
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdx), %r12
	leaq	(%rcx,%r12), %rax
	xorl	%r15d, %r15d
	addq	%r8, %rax
	addq	$4, %rax
	cmpq	(%rdi), %rax
	jle	LBB0_2
## %bb.1:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_12
LBB0_2:
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rdi, %rbx
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movl	16(%rbp), %esi
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	callq	_wlcore_hw_get_spare_blocks
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_wl1271_alloc_tx_id
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addq	%r12, %r14
	addq	$4, %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_wlcore_hw_calc_tx_blocks
	cmpq	8(%rbx), %rax
	jle	LBB0_5
## %bb.11:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_wl1271_free_tx_id
	jmp	LBB0_12
LBB0_3:
	movl	%eax, %r15d
	jmp	LBB0_12
LBB0_5:
	movq	%rax, %r12
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	subq	(%r13), %r14
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_skb_push
	movq	%rax, %r14
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	%r12, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_wlcore_hw_set_tx_desc_blocks
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r14)
	subq	%r12, 8(%rbx)
	movq	16(%rbx), %rax
	movq	%r12, %rcx
	addq	%rax, %rcx
	movq	%rcx, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_WL1271_FLAG_REINIT_TX_WDOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	48(%rbx), %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_8
LBB0_7:
	movq	%rbx, %rdi
	callq	_wl12xx_rearm_tx_watchdog_locked
LBB0_8:
	movq	%r13, %rdi
	callq	_skb_get_queue_mapping
	movl	%eax, %edi
	callq	_wl1271_tx_get_queue
	movq	40(%rbx), %rcx
	cltq
	incl	(%rcx,%rax,4)
	movl	32(%rbx), %esi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	24(%rbx), %rax
	incl	(%rax,%r14,4)
LBB0_10:
	movq	_DEBUG_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%r12, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_wl1271_debug
	xorl	%r15d, %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_WL1271_FLAG_REINIT_TX_WDOG,4,2 ## @WL1271_FLAG_REINIT_TX_WDOG
	.comm	_DEBUG_TX,4,2                   ## @DEBUG_TX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tx_allocate: size: %d, blocks: %d, id: %d"

	.no_dead_strip	_wl1271_tx_allocate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wl1271_tx_allocate
_wl1271_tx_allocate:                    ; @wl1271_tx_allocate
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x2]
	add	x8, x3, x8
	add	x19, x8, #4
	ldr	x8, [x0]
	add	x9, x19, x4
	cmp	x9, x8
	b.le	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_2:
	mov	x22, x5
	mov	x24, x2
	mov	x21, x0
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w26, [x8]
	mov	x1, x6
	bl	_wlcore_hw_get_spare_blocks
	mov	x25, x0
	mov	x0, x21
	mov	x1, x24
	bl	_wl1271_alloc_tx_id
	mov	x20, x0
	tbnz	w0, #31, LBB0_11
; %bb.3:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x25
	bl	_wlcore_hw_calc_tx_blocks
	ldr	x8, [x21, #8]
	cmp	x0, x8
	b.le	LBB0_5
; %bb.4:
	neg	w19, w26
	mov	x0, x21
	mov	x1, x20
	bl	_wl1271_free_tx_id
	mov	x20, x19
	b	LBB0_11
LBB0_5:
	mov	x23, x0
	ldr	x8, [x24]
	sub	x1, x19, x8
	mov	x0, x24
	bl	_skb_push
	mov	x26, x0
	mov	x0, x21
	mov	x1, x26
	mov	x2, x23
	mov	x3, x25
	bl	_wlcore_hw_set_tx_desc_blocks
	str	w20, [x26]
	ldp	x8, x9, [x21, #8]
	sub	x8, x8, x23
	add	x10, x9, x23
	stp	x8, x10, [x21, #8]
	cbz	x9, LBB0_7
; %bb.6:
Lloh6:
	adrp	x8, _WL1271_FLAG_REINIT_TX_WDOG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WL1271_FLAG_REINIT_TX_WDOG@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	add	x1, x21, #48
	bl	_test_and_clear_bit
	cbz	x0, LBB0_8
LBB0_7:
	mov	x0, x21
	bl	_wl12xx_rearm_tx_watchdog_locked
LBB0_8:
	mov	x0, x24
	bl	_skb_get_queue_mapping
	bl	_wl1271_tx_get_queue
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x21, #40]
	sbfiz	x9, x0, #2, #32
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	ldr	w1, [x21, #32]
	mov	x0, x22
	bl	_test_bit
	cbz	x0, LBB0_10
; %bb.9:
	ldr	x8, [x21, #24]
	lsl	x9, x22, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
LBB0_10:
Lloh9:
	adrp	x8, _DEBUG_TX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEBUG_TX@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x23
	mov	x4, x20
	bl	_wl1271_debug
	mov	w20, #0
LBB0_11:
	mov	x0, x20
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_WL1271_FLAG_REINIT_TX_WDOG,4,2 ; @WL1271_FLAG_REINIT_TX_WDOG
	.comm	_DEBUG_TX,4,2                   ; @DEBUG_TX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tx_allocate: size: %d, blocks: %d, id: %d"

	.no_dead_strip	_wl1271_tx_allocate
.subsections_via_symbols
