	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76u_alloc_tx
_mt76u_alloc_tx:                        ## @mt76u_alloc_tx
	.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	_MT_TXQ_PSD@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	js	LBB0_5
## %bb.1:
	movq	%rdi, %r15
	xorl	%r13d, %r13d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movq	_MT_NUM_TX_ENTRIES@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r15), %rax
	movq	(%rax), %rcx
	movq	%rcx, (%rax,%r14)
	movq	%r12, %r14
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leaq	1(%rdx), %r13
	movq	_MT_TXQ_PSD@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpq	%rcx, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	jge	LBB0_5
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	%r14, %r12
	movq	8(%r15), %rax
	movq	%r13, %r14
	shlq	$4, %r14
	leaq	(%rax,%r14), %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	movq	_IEEE80211_NUM_ACS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %r13
	jge	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edi
	movl	(%rbx), %edx
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r13
	movq	%rax, %rdi
	addq	$20, %rdi
	callq	_spin_lock_init
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_mt76_ac_to_hwq
	movl	%eax, 16(%r13)
	movq	8(%r15), %rax
	movq	%r13, (%rax,%r14)
	movl	(%r15), %edi
	movq	%r12, %r14
	movl	(%r12), %esi
	movl	(%rbx), %ecx
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r14), %ecx
	movl	%ecx, (%r13)
	testl	%ecx, %ecx
	jle	LBB0_4
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_MT_TX_SG_MAX_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_mt76u_urb_alloc
	testl	%eax, %eax
	js	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$4, %esi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jge	LBB0_4
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	leaq	4(%rsi), %r14
	addq	8(%r13), %rsi
	movq	_MT_TX_SG_MAX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_mt76u_urb_alloc
	movq	%r14, %rsi
	movq	%r12, %r14
	testl	%eax, %eax
	jns	LBB0_12
	jmp	LBB0_14
LBB0_5:
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_TXQ_PSD,4,2                 ## @MT_TXQ_PSD
	.comm	_IEEE80211_NUM_ACS,4,2          ## @IEEE80211_NUM_ACS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MT_NUM_TX_ENTRIES,4,2          ## @MT_NUM_TX_ENTRIES
	.comm	_MT_TX_SG_MAX_SIZE,4,2          ## @MT_TX_SG_MAX_SIZE
	.no_dead_strip	_mt76u_alloc_tx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76u_alloc_tx
_mt76u_alloc_tx:                        ; @mt76u_alloc_tx
	.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
Lloh0:
	adrp	x22, _MT_TXQ_PSD@GOTPAGE
Lloh1:
	ldr	x22, [x22, _MT_TXQ_PSD@GOTPAGEOFF]
	ldr	w8, [x22]
	tbnz	w8, #31, LBB0_12
; %bb.1:
	mov	x19, x0
	mov	x20, #0
Lloh2:
	adrp	x23, _IEEE80211_NUM_ACS@GOTPAGE
Lloh3:
	ldr	x23, [x23, _IEEE80211_NUM_ACS@GOTPAGEOFF]
Lloh4:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	adrp	x25, _MT_NUM_TX_ENTRIES@GOTPAGE
Lloh7:
	ldr	x25, [x25, _MT_NUM_TX_ENTRIES@GOTPAGEOFF]
Lloh8:
	adrp	x26, _MT_TX_SG_MAX_SIZE@GOTPAGE
Lloh9:
	ldr	x26, [x26, _MT_TX_SG_MAX_SIZE@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
	lsl	x10, x20, #4
	str	x9, [x8, x10]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x20, #1
	ldrsw	x9, [x22]
	cmp	x20, x9
	mov	x20, x8
	b.ge	LBB0_12
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x8, [x19, #8]
	add	x8, x8, x20, lsl #4
	add	x0, x8, #8
	bl	_INIT_LIST_HEAD
	ldrsw	x8, [x23]
	cmp	x20, x8
	b.ge	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
	ldr	w2, [x24]
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, x0
	add	x0, x0, #20
	bl	_spin_lock_init
	mov	x0, x20
	bl	_mt76_ac_to_hwq
	str	w0, [x21, #16]
	ldr	x8, [x19, #8]
	lsl	x9, x20, #4
	str	x21, [x8, x9]
	ldr	w0, [x19]
	ldr	w1, [x25]
	ldr	w3, [x24]
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x21, #8]
	cbz	x0, LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x25]
	str	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, x0
	ldr	w2, [x26]
	mov	x0, x19
	bl	_mt76u_urb_alloc
	tbnz	w0, #31, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x27, #0
	mov	w8, #4
LBB0_10:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x27, x27, #1
	ldrsw	x9, [x21]
	cmp	x27, x9
	b.ge	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x28, x8, #4
	ldr	x9, [x21, #8]
	add	x1, x9, x8
	ldr	w2, [x26]
	mov	x0, x19
	bl	_mt76u_urb_alloc
	mov	x8, x28
	tbz	w0, #31, LBB0_10
	b	LBB0_13
LBB0_12:
	mov	w0, #0
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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_TXQ_PSD,4,2                 ; @MT_TXQ_PSD
	.comm	_IEEE80211_NUM_ACS,4,2          ; @IEEE80211_NUM_ACS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MT_NUM_TX_ENTRIES,4,2          ; @MT_NUM_TX_ENTRIES
	.comm	_MT_TX_SG_MAX_SIZE,4,2          ; @MT_TX_SG_MAX_SIZE
	.no_dead_strip	_mt76u_alloc_tx
.subsections_via_symbols
