	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wlcore_allocate_hw_queue_base
_wlcore_allocate_hw_queue_base:         ## @wlcore_allocate_hw_queue_base
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_wl12xx_wlvif_to_vif
	movq	%rax, %r14
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	(%rax), %rax
	movq	_NL80211_IFTYPE_P2P_DEVICE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.1:
	movq	%r14, -48(%rbp)
	movl	8(%r15), %edi
	movq	_IEEE80211_IFACE_ITER_RESUME_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_wlcore_hw_queue_iter@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %rcx
	callq	_ieee80211_iterate_active_interfaces_atomic
	cmpq	$0, -56(%rbp)
	je	LBB0_3
## %bb.2:
	movq	16(%r14), %rax
	movl	(%rax), %edx
	movl	%edx, (%rbx)
	movq	_DEBUG_MAC80211@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_wl1271_debug
LBB0_8:
	movq	8(%rbx), %rax
	movq	_BSS_TYPE_AP_BSS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_NUM_TX_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_WLCORE_NUM_MAC_ADDRESSES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	imull	%ecx, %esi
	movl	(%rbx), %eax
	cltd
	idivl	%ecx
	addl	%esi, %eax
	jmp	LBB0_11
LBB0_10:
	movq	_IEEE80211_INVAL_HW_QUEUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	movl	%eax, 8(%r14)
	xorl	%eax, %eax
LBB0_12:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	-64(%rbp), %edi
	movq	_WLCORE_NUM_MAC_ADDRESSES@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_find_first_zero_bit
	cmpl	(%r12), %eax
	jge	LBB0_4
## %bb.5:
	movq	_NUM_TX_QUEUES@GOTPCREL(%rip), %r12
	imull	(%r12), %eax
	movl	%eax, (%rbx)
	movq	_DEBUG_MAC80211@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_wl1271_debug
	cmpl	$0, (%r12)
	jle	LBB0_8
## %bb.6:
	movq	(%r15), %rax
	movq	16(%r14), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rbx), %rsi
	leal	(%rdx,%rsi), %edi
	addq	%rdx, %rsi
	movq	$0, (%rax,%rsi,8)
	movl	%edi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%r12), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_7
	jmp	LBB0_8
LBB0_4:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_IFTYPE_P2P_DEVICE,8,3  ## @NL80211_IFTYPE_P2P_DEVICE
	.comm	_IEEE80211_INVAL_HW_QUEUE,8,3   ## @IEEE80211_INVAL_HW_QUEUE
	.comm	_IEEE80211_IFACE_ITER_RESUME_ALL,4,2 ## @IEEE80211_IFACE_ITER_RESUME_ALL
	.comm	_wlcore_hw_queue_iter,4,2       ## @wlcore_hw_queue_iter
	.comm	_DEBUG_MAC80211,4,2             ## @DEBUG_MAC80211
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"using pre-allocated hw queue base %d"

	.comm	_WLCORE_NUM_MAC_ADDRESSES,4,2   ## @WLCORE_NUM_MAC_ADDRESSES
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_NUM_TX_QUEUES,4,2              ## @NUM_TX_QUEUES
L_.str.1:                               ## @.str.1
	.asciz	"allocating hw queue base: %d"

	.comm	_BSS_TYPE_AP_BSS,8,3            ## @BSS_TYPE_AP_BSS
	.no_dead_strip	_wlcore_allocate_hw_queue_base
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wlcore_allocate_hw_queue_base
_wlcore_allocate_hw_queue_base:         ; @wlcore_allocate_hw_queue_base
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_wl12xx_wlvif_to_vif
	mov	x19, x0
	stp	xzr, xzr, [sp, #8]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NL80211_IFTYPE_P2P_DEVICE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_IFTYPE_P2P_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.1:
	str	x19, [sp, #24]
	ldr	w0, [x21, #8]
Lloh3:
	adrp	x8, _IEEE80211_IFACE_ITER_RESUME_ALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IEEE80211_IFACE_ITER_RESUME_ALL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _wlcore_hw_queue_iter@GOTPAGE
Lloh7:
	ldr	x8, [x8, _wlcore_hw_queue_iter@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x3, sp, #8
	bl	_ieee80211_iterate_active_interfaces_atomic
	ldr	x8, [sp, #16]
	cbz	x8, LBB0_7
; %bb.2:
	ldr	x8, [x19, #16]
	ldr	w2, [x8]
	str	w2, [x20]
Lloh9:
	adrp	x8, _DEBUG_MAC80211@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DEBUG_MAC80211@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wl1271_debug
LBB0_3:
	ldr	x8, [x20, #8]
Lloh14:
	adrp	x9, _BSS_TYPE_AP_BSS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BSS_TYPE_AP_BSS@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	mov	w0, #0
Lloh17:
	adrp	x8, _NUM_TX_QUEUES@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NUM_TX_QUEUES@GOTPAGEOFF]
Lloh19:
	adrp	x9, _WLCORE_NUM_MAC_ADDRESSES@GOTPAGE
Lloh20:
	ldr	x9, [x9, _WLCORE_NUM_MAC_ADDRESSES@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	ldr	w10, [x20]
	sdiv	w10, w10, w8
	madd	w8, w9, w8, w10
	str	w8, [x19, #8]
	b	LBB0_6
LBB0_5:
	mov	w0, #0
Lloh23:
	adrp	x8, _IEEE80211_INVAL_HW_QUEUE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IEEE80211_INVAL_HW_QUEUE@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	w8, [x19, #8]
LBB0_6:
	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
	add	sp, sp, #80
	ret
LBB0_7:
	ldr	w0, [sp, #8]
Lloh26:
	adrp	x22, _WLCORE_NUM_MAC_ADDRESSES@GOTPAGE
Lloh27:
	ldr	x22, [x22, _WLCORE_NUM_MAC_ADDRESSES@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_find_first_zero_bit
	ldr	w8, [x22]
	cmp	w0, w8
	b.ge	LBB0_11
; %bb.8:
Lloh28:
	adrp	x22, _NUM_TX_QUEUES@GOTPAGE
Lloh29:
	ldr	x22, [x22, _NUM_TX_QUEUES@GOTPAGEOFF]
	ldr	w8, [x22]
	mul	w2, w8, w0
	str	w2, [x20]
Lloh30:
	adrp	x8, _DEBUG_MAC80211@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DEBUG_MAC80211@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wl1271_debug
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.9:
	mov	x8, #0
	ldr	x9, [x21]
	ldr	x10, [x19, #16]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x11, [x20]
	add	x12, x8, x11
	str	xzr, [x9, x12, lsl #3]
	add	w11, w8, w11
	str	w11, [x10, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x11, [x22]
	cmp	x8, x11
	b.lt	LBB0_10
	b	LBB0_3
LBB0_11:
Lloh35:
	adrp	x8, _EBUSY@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_IFTYPE_P2P_DEVICE,8,3  ; @NL80211_IFTYPE_P2P_DEVICE
	.comm	_IEEE80211_INVAL_HW_QUEUE,8,3   ; @IEEE80211_INVAL_HW_QUEUE
	.comm	_IEEE80211_IFACE_ITER_RESUME_ALL,4,2 ; @IEEE80211_IFACE_ITER_RESUME_ALL
	.comm	_wlcore_hw_queue_iter,4,2       ; @wlcore_hw_queue_iter
	.comm	_DEBUG_MAC80211,4,2             ; @DEBUG_MAC80211
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"using pre-allocated hw queue base %d"

	.comm	_WLCORE_NUM_MAC_ADDRESSES,4,2   ; @WLCORE_NUM_MAC_ADDRESSES
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_NUM_TX_QUEUES,4,2              ; @NUM_TX_QUEUES
l_.str.1:                               ; @.str.1
	.asciz	"allocating hw queue base: %d"

	.comm	_BSS_TYPE_AP_BSS,8,3            ; @BSS_TYPE_AP_BSS
	.no_dead_strip	_wlcore_allocate_hw_queue_base
.subsections_via_symbols
