	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_set_mac_address
_mtk_set_mac_address:                   ## @mtk_set_mac_address
	.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	%rdi, %r15
	callq	_eth_mac_addr
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_netdev_priv
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.1:
	movq	%rax, %r14
	movq	(%rax), %rbx
	movq	(%r15), %r13
	movq	_MTK_RESETTING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%rbx), %rsi
	callq	_test_bit
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_3:
	movq	(%r14), %rdi
	callq	_spin_lock_bh
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	movq	_MTK_SOC_MT7628@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MTK_HAS_CAPS
	movq	(%r14), %r15
	movb	1(%r13), %bl
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_MT7628_SDM_MAC_ADRH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movsbl	%bl, %esi
	movq	%r15, %rdi
	callq	_mtk_w32
	movq	(%r14), %rdi
	movsbl	5(%r13), %esi
	movq	_MT7628_SDM_MAC_ADRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	jmp	LBB0_6
LBB0_5:
	movl	8(%r14), %edi
	callq	_MTK_GDMA_MAC_ADRH
	movsbl	%bl, %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_mtk_w32
	movq	(%r14), %r12
	movsbl	5(%r13), %r15d
	movl	8(%r14), %edi
	callq	_MTK_GDMA_MAC_ADRL
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
LBB0_6:
	callq	_mtk_w32
	movq	(%r14), %rdi
	callq	_spin_unlock_bh
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_RESETTING,4,2              ## @MTK_RESETTING
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_MTK_SOC_MT7628,4,2             ## @MTK_SOC_MT7628
	.comm	_MT7628_SDM_MAC_ADRH,4,2        ## @MT7628_SDM_MAC_ADRH
	.comm	_MT7628_SDM_MAC_ADRL,4,2        ## @MT7628_SDM_MAC_ADRL
	.no_dead_strip	_mtk_set_mac_address
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_set_mac_address
_mtk_set_mac_address:                   ; @mtk_set_mac_address
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	bl	_eth_mac_addr
	mov	x21, x0
	mov	x0, x20
	bl	_netdev_priv
	cbnz	w21, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	x22, [x0]
	ldr	x21, [x20]
Lloh0:
	adrp	x8, _MTK_RESETTING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_RESETTING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x22, #16
	bl	_test_bit
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_7
LBB0_3:
	ldr	x0, [x19]
	bl	_spin_lock_bh
	ldr	x8, [x22, #8]
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _MTK_SOC_MT7628@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTK_SOC_MT7628@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_MTK_HAS_CAPS
	ldr	x20, [x19]
	ldrb	w22, [x21, #1]
	cbz	x0, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _MT7628_SDM_MAC_ADRH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT7628_SDM_MAC_ADRH@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	sxtb	w1, w22
	mov	x0, x20
	bl	_mtk_w32
	ldr	x0, [x19]
	ldrsb	w1, [x21, #5]
Lloh12:
	adrp	x8, _MT7628_SDM_MAC_ADRL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT7628_SDM_MAC_ADRL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_MTK_GDMA_MAC_ADRH
	mov	x2, x0
	sxtb	w1, w22
	mov	x0, x20
	bl	_mtk_w32
	ldr	x20, [x19]
	ldrsb	w21, [x21, #5]
	ldr	w0, [x19, #8]
	bl	_MTK_GDMA_MAC_ADRL
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
LBB0_6:
	bl	_mtk_w32
	ldr	x0, [x19]
	bl	_spin_unlock_bh
	mov	w21, #0
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_RESETTING,4,2              ; @MTK_RESETTING
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_MTK_SOC_MT7628,4,2             ; @MTK_SOC_MT7628
	.comm	_MT7628_SDM_MAC_ADRH,4,2        ; @MT7628_SDM_MAC_ADRH
	.comm	_MT7628_SDM_MAC_ADRL,4,2        ; @MT7628_SDM_MAC_ADRL
	.no_dead_strip	_mtk_set_mac_address
.subsections_via_symbols
