	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7603_add_interface
_mt7603_add_interface:                  ## @mt7603_add_interface
	.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	%rsi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rsi), %r15
	movq	(%rdi), %r12
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	16(%r12), %eax
	movl	%eax, %ecx
	notl	%ecx
	bsfl	%ecx, %edi
	cmpl	$-1, %eax
	cmovel	%eax, %edi
	movl	%edi, (%r15)
	movq	_MT7603_MAX_INTERFACES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jge	LBB0_1
## %bb.2:
	callq	_MT_MAC_ADDR0
	movl	%eax, %ebx
	movq	16(%r13), %rdi
	callq	_get_unaligned_le32
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mt76_wr
	movl	(%r15), %edi
	callq	_MT_MAC_ADDR1
	movl	%eax, %ebx
	movq	16(%r13), %rdi
	addq	$4, %rdi
	callq	_get_unaligned_le16
	movq	_MT_MAC_ADDR1_VALID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mt76_wr
	movq	(%r13), %rax
	movq	_NL80211_IFTYPE_AP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movl	(%r15), %edi
	callq	_MT_BSSID0
	movl	%eax, %ebx
	movq	16(%r13), %rdi
	callq	_get_unaligned_le32
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mt76_wr
	movl	(%r15), %edi
	callq	_MT_BSSID1
	movl	%eax, %ebx
	movq	16(%r13), %rdi
	addq	$4, %rdi
	callq	_get_unaligned_le16
	movq	_MT_BSSID1_VALID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mt76_wr
LBB0_4:
	movq	_MT7603_WTBL_RESERVED@GOTPCREL(%rip), %rax
	movl	(%r15), %edi
	movl	%edi, %ebx
	notl	%ebx
	addl	(%rax), %ebx
	callq	_BIT
	orl	%eax, 16(%r12)
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	leaq	4(%r15), %r13
	movl	%ebx, 4(%r15)
	movl	$-1, 8(%r15)
	movq	%r14, %rdi
	callq	_eth_broadcast_addr
	movl	(%r15), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r14, %rcx
	callq	_mt7603_wtbl_init
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rsi
	movq	(%rsi), %rax
	movq	%r13, (%rax)
	movq	%r12, %rdi
	callq	_mt76_txq_init
	movq	8(%r12), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	%r13, %rsi
	callq	_rcu_assign_pointer
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_1:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.comm	_MT7603_MAX_INTERFACES,4,2      ## @MT7603_MAX_INTERFACES
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_MT_MAC_ADDR1_VALID,4,2         ## @MT_MAC_ADDR1_VALID
	.comm	_NL80211_IFTYPE_AP,8,3          ## @NL80211_IFTYPE_AP
	.comm	_MT_BSSID1_VALID,4,2            ## @MT_BSSID1_VALID
	.comm	_MT7603_WTBL_RESERVED,4,2       ## @MT7603_WTBL_RESERVED
	.no_dead_strip	_mt7603_add_interface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7603_add_interface
_mt7603_add_interface:                  ; @mt7603_add_interface
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	mov	x20, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x24, [x1, #24]
	ldr	x19, [x0]
Lloh3:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x19, #16]
	mvn	w9, w8
	rbit	w9, w9
	clz	w9, w9
	cmn	w8, #1
	csinv	w0, w9, wzr, ne
	str	w0, [x24]
Lloh8:
	adrp	x8, _MT7603_MAX_INTERFACES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT7603_MAX_INTERFACES@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_4
; %bb.1:
	bl	_MT_MAC_ADDR0
	mov	x22, x0
	ldr	x0, [x20, #16]
	bl	_get_unaligned_le32
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_mt76_wr
	ldr	w0, [x24]
	bl	_MT_MAC_ADDR1
	mov	x22, x0
	ldr	x8, [x20, #16]
	add	x0, x8, #4
	bl	_get_unaligned_le16
Lloh11:
	adrp	x8, _MT_MAC_ADDR1_VALID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MT_MAC_ADDR1_VALID@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	mov	x1, x22
	bl	_mt76_wr
	ldr	x8, [x20]
Lloh14:
	adrp	x9, _NL80211_IFTYPE_AP@GOTPAGE
Lloh15:
	ldr	x9, [x9, _NL80211_IFTYPE_AP@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x24]
	bl	_MT_BSSID0
	mov	x22, x0
	ldr	x0, [x20, #16]
	bl	_get_unaligned_le32
	mov	x2, x0
	mov	x0, x19
	mov	x1, x22
	bl	_mt76_wr
	ldr	w0, [x24]
	bl	_MT_BSSID1
	mov	x22, x0
	ldr	x8, [x20, #16]
	add	x0, x8, #4
	bl	_get_unaligned_le16
Lloh17:
	adrp	x8, _MT_BSSID1_VALID@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MT_BSSID1_VALID@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	mov	x1, x22
	bl	_mt76_wr
LBB0_3:
Lloh20:
	adrp	x8, _MT7603_WTBL_RESERVED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MT7603_WTBL_RESERVED@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	w0, [x24]
	mvn	w9, w0
	add	w22, w8, w9
	bl	_BIT
	ldr	w8, [x19, #16]
	orr	w8, w8, w0
	str	w8, [x19, #16]
	mov	x23, x24
	str	w22, [x23, #4]!
	mov	w8, #-1
	str	w8, [x24, #8]
	mov	x0, x21
	bl	_eth_broadcast_addr
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	bl	_mt7603_wtbl_init
	ldr	x1, [x20, #8]
	ldr	x8, [x1]
	str	x23, [x8]
	mov	x0, x19
	bl	_mt76_txq_init
	ldr	x8, [x19, #8]
	ldr	w0, [x8, w22, sxtw #2]
	mov	x1, x23
	bl	_rcu_assign_pointer
	mov	w20, #0
	b	LBB0_5
LBB0_4:
Lloh23:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	ldur	x8, [x29, #-56]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.comm	_MT7603_MAX_INTERFACES,4,2      ; @MT7603_MAX_INTERFACES
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_MT_MAC_ADDR1_VALID,4,2         ; @MT_MAC_ADDR1_VALID
	.comm	_NL80211_IFTYPE_AP,8,3          ; @NL80211_IFTYPE_AP
	.comm	_MT_BSSID1_VALID,4,2            ; @MT_BSSID1_VALID
	.comm	_MT7603_WTBL_RESERVED,4,2       ; @MT7603_WTBL_RESERVED
	.no_dead_strip	_mt7603_add_interface
.subsections_via_symbols
