	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x0_set_chip_cap
_mt76x0_set_chip_cap:                   ## @mt76x0_set_chip_cap
	.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, %rbx
	movq	_MT_EE_NIC_CONF_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mt76x02_eeprom_get
	movl	%eax, %r14d
	movq	_MT_EE_NIC_CONF_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mt76x02_eeprom_get
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_mt76x02_eeprom_parse_hw_cap
	movl	(%rbx), %edi
	movl	4(%rbx), %edx
	movl	8(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	movl	$0, 4(%rbx)
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_2:
	movq	%rbx, %rdi
	callq	_is_mt7630
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	$0, 8(%rbx)
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_4:
	movzbl	%r15b, %edi
	callq	_mt76x02_field_valid
	movl	%r15d, %ecx
	andl	$65280, %ecx                    ## imm = 0xFF00
	testl	%eax, %eax
	cmovnel	%r15d, %ecx
	movq	_MT_EE_NIC_CONF_1_HW_RF_CTRL@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.5:
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
LBB0_6:
	movl	%r14d, %edi
	sarl	$8, %edi
	callq	_mt76x02_field_valid
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movq	_MT_EE_NIC_CONF_0_RX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_FIELD_GET
	cmpl	$1, %eax
	jg	LBB0_10
## %bb.8:
	movq	_MT_EE_NIC_CONF_0_TX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_FIELD_GET
	cmpl	$2, %eax
	jl	LBB0_9
LBB0_10:
	movl	(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_EE_NIC_CONF_0,4,2           ## @MT_EE_NIC_CONF_0
	.comm	_MT_EE_NIC_CONF_1,4,2           ## @MT_EE_NIC_CONF_1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"2GHz %d 5GHz %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"mask out 2GHz support\n"

L_.str.2:                               ## @.str.2
	.asciz	"mask out 5GHz support\n"

	.comm	_MT_EE_NIC_CONF_1_HW_RF_CTRL,4,2 ## @MT_EE_NIC_CONF_1_HW_RF_CTRL
L_.str.3:                               ## @.str.3
	.asciz	"driver does not support HW RF ctrl\n"

	.comm	_MT_EE_NIC_CONF_0_RX_PATH,4,2   ## @MT_EE_NIC_CONF_0_RX_PATH
	.comm	_MT_EE_NIC_CONF_0_TX_PATH,4,2   ## @MT_EE_NIC_CONF_0_TX_PATH
L_.str.4:                               ## @.str.4
	.asciz	"invalid tx-rx stream\n"

	.no_dead_strip	_mt76x0_set_chip_cap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x0_set_chip_cap
_mt76x0_set_chip_cap:                   ; @mt76x0_set_chip_cap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _MT_EE_NIC_CONF_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_EE_NIC_CONF_0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mt76x02_eeprom_get
	mov	x20, x0
Lloh3:
	adrp	x8, _MT_EE_NIC_CONF_1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_EE_NIC_CONF_1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76x02_eeprom_get
	mov	x21, x0
	mov	x0, x19
	bl	_mt76x02_eeprom_parse_hw_cap
	ldp	w0, w8, [x19]
	ldr	w9, [x19, #8]
	stp	x8, x9, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_2
; %bb.1:
	str	wzr, [x19, #4]
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_2:
	mov	x0, x19
	bl	_is_mt7630
	cbz	x0, LBB0_4
; %bb.3:
	str	wzr, [x19, #8]
	ldr	w0, [x19]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
LBB0_4:
	and	w0, w21, #0xff
	bl	_mt76x02_field_valid
	and	w8, w21, #0xff00
	cmp	w0, #0
	csel	w8, w8, w21, eq
Lloh12:
	adrp	x9, _MT_EE_NIC_CONF_1_HW_RF_CTRL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MT_EE_NIC_CONF_1_HW_RF_CTRL@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w8, w9
	b.eq	LBB0_6
; %bb.5:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_6:
	asr	w0, w20, #8
	bl	_mt76x02_field_valid
	cbz	w0, LBB0_10
; %bb.7:
Lloh17:
	adrp	x8, _MT_EE_NIC_CONF_0_RX_PATH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MT_EE_NIC_CONF_0_RX_PATH@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_GET
	cmp	w0, #1
	b.gt	LBB0_9
; %bb.8:
Lloh20:
	adrp	x8, _MT_EE_NIC_CONF_0_TX_PATH@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MT_EE_NIC_CONF_0_TX_PATH@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_GET
	cmp	w0, #2
	b.lt	LBB0_10
LBB0_9:
	ldr	w0, [x19]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	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
	add	sp, sp, #64
	b	_dev_err
LBB0_10:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_EE_NIC_CONF_0,4,2           ; @MT_EE_NIC_CONF_0
	.comm	_MT_EE_NIC_CONF_1,4,2           ; @MT_EE_NIC_CONF_1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"2GHz %d 5GHz %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"mask out 2GHz support\n"

l_.str.2:                               ; @.str.2
	.asciz	"mask out 5GHz support\n"

	.comm	_MT_EE_NIC_CONF_1_HW_RF_CTRL,4,2 ; @MT_EE_NIC_CONF_1_HW_RF_CTRL
l_.str.3:                               ; @.str.3
	.asciz	"driver does not support HW RF ctrl\n"

	.comm	_MT_EE_NIC_CONF_0_RX_PATH,4,2   ; @MT_EE_NIC_CONF_0_RX_PATH
	.comm	_MT_EE_NIC_CONF_0_TX_PATH,4,2   ; @MT_EE_NIC_CONF_0_TX_PATH
l_.str.4:                               ; @.str.4
	.asciz	"invalid tx-rx stream\n"

	.no_dead_strip	_mt76x0_set_chip_cap
.subsections_via_symbols
