	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x2u_mac_fixup_xtal
_mt76x2u_mac_fixup_xtal:                ## @mt76x2u_mac_fixup_xtal
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MT_EE_XTAL_TRIM_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mt76x02_eeprom_get
	movl	%eax, %ebx
	andl	$127, %eax
	movl	%eax, %ecx
	negl	%ecx
	testb	$-128, %bl
	cmovel	%eax, %ecx
	xorl	%r15d, %r15d
	cmpb	$-1, %bl
	cmovnel	%ecx, %r15d
	cmpl	$256, %ebx                      ## imm = 0x100
	jb	LBB0_2
## %bb.1:
	sarl	$8, %ebx
	cmpl	$255, %ebx
	jne	LBB0_3
LBB0_2:
	movq	_MT_EE_XTAL_TRIM_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76x02_eeprom_get
	movzbl	%al, %eax
	cmpl	$255, %eax
	movl	$20, %ecx
	movl	%eax, %ebx
	cmovel	%ecx, %ebx
	testl	%eax, %eax
	cmovel	%ecx, %ebx
LBB0_3:
	andl	$127, %ebx
	addl	%r15d, %ebx
	movq	_CFG@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_MT_XO_CTRL5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MT_VEND_ADDR
	movq	_MT_XO_CTRL5_C2_VAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %ecx
	callq	_mt76_rmw_field
	movl	(%r15), %edi
	movq	_MT_XO_CTRL6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MT_VEND_ADDR
	movq	_MT_XO_CTRL6_C2_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt76_set
	movq	%r14, %rdi
	movl	$1284, %esi                     ## imm = 0x504
	movl	$100663296, %edx                ## imm = 0x6000000
	callq	_mt76_wr
	movq	%r14, %rdi
	movl	$1292, %esi                     ## imm = 0x50C
	movl	$142606336, %edx                ## imm = 0x8800000
	callq	_mt76_wr
	movl	$5, %edi
	callq	_mdelay
	movq	%r14, %rdi
	movl	$1284, %esi                     ## imm = 0x504
	xorl	%edx, %edx
	callq	_mt76_wr
	movq	_MT_XIFS_TIME_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_XIFS_TIME_CFG_OFDM_SIFS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$13, %ecx
	callq	_mt76_rmw_field
	movq	_MT_BKOFF_SLOT_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_BKOFF_SLOT_CFG_CC_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_mt76_rmw_field
	movq	_MT_FCE_L2_STUFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_FCE_L2_STUFF_WR_MPDU_LEN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mt76_clear
	movq	_MT_EE_NIC_CONF_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76x02_eeprom_get
	movq	_MT_EE_NIC_CONF_2_XTAL_OPTION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%eax, %esi
	callq	_FIELD_GET
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.6:
	movl	$1545596624, %edx               ## imm = 0x5C1FEED0
	jmp	LBB0_7
LBB0_4:
	movl	$1545596544, %edx               ## imm = 0x5C1FEE80
LBB0_7:
	movq	_MT_XO_CTRL7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt76_wr                        ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_EE_XTAL_TRIM_2,4,2          ## @MT_EE_XTAL_TRIM_2
	.comm	_MT_EE_XTAL_TRIM_1,4,2          ## @MT_EE_XTAL_TRIM_1
	.comm	_CFG,4,2                        ## @CFG
	.comm	_MT_XO_CTRL5,4,2                ## @MT_XO_CTRL5
	.comm	_MT_XO_CTRL5_C2_VAL,4,2         ## @MT_XO_CTRL5_C2_VAL
	.comm	_MT_XO_CTRL6,4,2                ## @MT_XO_CTRL6
	.comm	_MT_XO_CTRL6_C2_CTRL,4,2        ## @MT_XO_CTRL6_C2_CTRL
	.comm	_MT_XIFS_TIME_CFG,4,2           ## @MT_XIFS_TIME_CFG
	.comm	_MT_XIFS_TIME_CFG_OFDM_SIFS,4,2 ## @MT_XIFS_TIME_CFG_OFDM_SIFS
	.comm	_MT_BKOFF_SLOT_CFG,4,2          ## @MT_BKOFF_SLOT_CFG
	.comm	_MT_BKOFF_SLOT_CFG_CC_DELAY,4,2 ## @MT_BKOFF_SLOT_CFG_CC_DELAY
	.comm	_MT_FCE_L2_STUFF,4,2            ## @MT_FCE_L2_STUFF
	.comm	_MT_FCE_L2_STUFF_WR_MPDU_LEN_EN,4,2 ## @MT_FCE_L2_STUFF_WR_MPDU_LEN_EN
	.comm	_MT_EE_NIC_CONF_2,4,2           ## @MT_EE_NIC_CONF_2
	.comm	_MT_EE_NIC_CONF_2_XTAL_OPTION,4,2 ## @MT_EE_NIC_CONF_2_XTAL_OPTION
	.comm	_MT_XO_CTRL7,4,2                ## @MT_XO_CTRL7
	.no_dead_strip	_mt76x2u_mac_fixup_xtal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x2u_mac_fixup_xtal
_mt76x2u_mac_fixup_xtal:                ; @mt76x2u_mac_fixup_xtal
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _MT_EE_XTAL_TRIM_2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_EE_XTAL_TRIM_2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mt76x02_eeprom_get
	and	w8, w0, #0x7f
	tst	w0, #0x80
	cneg	w8, w8, ne
	mov	w9, #255
	bics	wzr, w9, w0
	csel	w21, wzr, w8, eq
	cmp	w0, #256
	b.lo	LBB0_2
; %bb.1:
	asr	w8, w0, #8
	cmp	w8, #255
	b.ne	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _MT_EE_XTAL_TRIM_1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_EE_XTAL_TRIM_1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76x02_eeprom_get
	and	w8, w0, #0xff
	cmp	w8, #255
	ccmp	w8, #0, #4, ne
	mov	w9, #20
	csel	w8, w9, w8, eq
LBB0_3:
	mov	w20, #61056
	movk	w20, #23583, lsl #16
	and	w22, w8, #0x7f
Lloh6:
	adrp	x23, _CFG@GOTPAGE
Lloh7:
	ldr	x23, [x23, _CFG@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh8:
	adrp	x8, _MT_XO_CTRL5@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT_XO_CTRL5@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_MT_VEND_ADDR
	mov	x1, x0
Lloh11:
	adrp	x8, _MT_XO_CTRL5_C2_VAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MT_XO_CTRL5_C2_VAL@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	add	w3, w22, w21
	mov	x0, x19
	bl	_mt76_rmw_field
	ldr	w0, [x23]
Lloh14:
	adrp	x8, _MT_XO_CTRL6@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MT_XO_CTRL6@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_MT_VEND_ADDR
	mov	x1, x0
Lloh17:
	adrp	x8, _MT_XO_CTRL6_C2_CTRL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MT_XO_CTRL6_C2_CTRL@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_set
	mov	x0, x19
	mov	w1, #1284
	mov	w2, #100663296
	bl	_mt76_wr
	mov	x0, x19
	mov	w1, #1292
	mov	w2, #142606336
	bl	_mt76_wr
	mov	w0, #5
	bl	_mdelay
	mov	x0, x19
	mov	w1, #1284
	mov	w2, #0
	bl	_mt76_wr
Lloh20:
	adrp	x8, _MT_XIFS_TIME_CFG@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MT_XIFS_TIME_CFG@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _MT_XIFS_TIME_CFG_OFDM_SIFS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MT_XIFS_TIME_CFG_OFDM_SIFS@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #13
	bl	_mt76_rmw_field
Lloh26:
	adrp	x8, _MT_BKOFF_SLOT_CFG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MT_BKOFF_SLOT_CFG@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _MT_BKOFF_SLOT_CFG_CC_DELAY@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MT_BKOFF_SLOT_CFG_CC_DELAY@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_mt76_rmw_field
Lloh32:
	adrp	x8, _MT_FCE_L2_STUFF@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MT_FCE_L2_STUFF@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _MT_FCE_L2_STUFF_WR_MPDU_LEN_EN@GOTPAGE
Lloh36:
	ldr	x8, [x8, _MT_FCE_L2_STUFF_WR_MPDU_LEN_EN@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_clear
Lloh38:
	adrp	x8, _MT_EE_NIC_CONF_2@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MT_EE_NIC_CONF_2@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76x02_eeprom_get
	mov	x1, x0
Lloh41:
	adrp	x8, _MT_EE_NIC_CONF_2_XTAL_OPTION@GOTPAGE
Lloh42:
	ldr	x8, [x8, _MT_EE_NIC_CONF_2_XTAL_OPTION@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	bl	_FIELD_GET
	cbz	w0, LBB0_6
; %bb.4:
	cmp	w0, #1
	b.ne	LBB0_7
; %bb.5:
	add	w20, w20, #80
LBB0_6:
Lloh44:
	adrp	x8, _MT_XO_CTRL7@GOTPAGE
Lloh45:
	ldr	x8, [x8, _MT_XO_CTRL7@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	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
	b	_mt76_wr
LBB0_7:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_EE_XTAL_TRIM_2,4,2          ; @MT_EE_XTAL_TRIM_2
	.comm	_MT_EE_XTAL_TRIM_1,4,2          ; @MT_EE_XTAL_TRIM_1
	.comm	_CFG,4,2                        ; @CFG
	.comm	_MT_XO_CTRL5,4,2                ; @MT_XO_CTRL5
	.comm	_MT_XO_CTRL5_C2_VAL,4,2         ; @MT_XO_CTRL5_C2_VAL
	.comm	_MT_XO_CTRL6,4,2                ; @MT_XO_CTRL6
	.comm	_MT_XO_CTRL6_C2_CTRL,4,2        ; @MT_XO_CTRL6_C2_CTRL
	.comm	_MT_XIFS_TIME_CFG,4,2           ; @MT_XIFS_TIME_CFG
	.comm	_MT_XIFS_TIME_CFG_OFDM_SIFS,4,2 ; @MT_XIFS_TIME_CFG_OFDM_SIFS
	.comm	_MT_BKOFF_SLOT_CFG,4,2          ; @MT_BKOFF_SLOT_CFG
	.comm	_MT_BKOFF_SLOT_CFG_CC_DELAY,4,2 ; @MT_BKOFF_SLOT_CFG_CC_DELAY
	.comm	_MT_FCE_L2_STUFF,4,2            ; @MT_FCE_L2_STUFF
	.comm	_MT_FCE_L2_STUFF_WR_MPDU_LEN_EN,4,2 ; @MT_FCE_L2_STUFF_WR_MPDU_LEN_EN
	.comm	_MT_EE_NIC_CONF_2,4,2           ; @MT_EE_NIC_CONF_2
	.comm	_MT_EE_NIC_CONF_2_XTAL_OPTION,4,2 ; @MT_EE_NIC_CONF_2_XTAL_OPTION
	.comm	_MT_XO_CTRL7,4,2                ; @MT_XO_CTRL7
	.no_dead_strip	_mt76x2u_mac_fixup_xtal
.subsections_via_symbols
