	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x0e_register_device
_mt76x0e_register_device:               ## @mt76x0e_register_device
	.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
	xorl	%ebx, %ebx
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_mt76x0_chip_onoff
	movq	%r14, %rdi
	callq	_mt76x02_wait_for_mac
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	movq	%r14, %rdi
	callq	_mt76x02_dma_disable
	movq	%r14, %rdi
	callq	_mt76x0e_mcu_init
	testl	%eax, %eax
	js	LBB0_13
## %bb.2:
	movq	%r14, %rdi
	callq	_mt76x02_dma_init
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	movq	%r14, %rdi
	callq	_mt76x0_init_hardware
	testl	%eax, %eax
	js	LBB0_13
## %bb.4:
	movq	%r14, %rdi
	callq	_mt76x02e_init_beacon_config
	movq	%r14, %rdi
	callq	_mt76_chip
	cmpl	$30224, %eax                    ## imm = 0x7610
	jne	LBB0_7
## %bb.5:
	movq	_MT_COEXCFG0@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%edi, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mt76_clear
	movq	_MT_EE_NIC_CONF_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76x02_eeprom_get
	movq	_MT_EE_NIC_CONF_0_PA_IO_CURRENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_7
## %bb.6:
	movq	_MT_XO_CTRL7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$3075, %edx                     ## imm = 0xC03
	callq	_mt76_set
LBB0_7:
	movl	$9, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	$272, %esi                      ## imm = 0x110
	movl	%eax, %edx
	callq	_mt76_clear
	movq	_MT_MAX_LEN_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$13, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_mt76_set
	movq	_MT_CH_TIME_CFG_TIMER_EN@GOTPCREL(%rip), %rax
	movq	_MT_CH_TIME_CFG_TX_AS_BUSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	_MT_CH_TIME_CFG@GOTPCREL(%rip), %rax
	movq	_MT_CH_TIME_CFG_RX_AS_BUSY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	movl	(%rax), %r15d
	movq	_MT_CH_TIME_CFG_NAV_AS_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MT_CH_CCA_RC_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MT_CH_TIME_CFG_CH_TIMER_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_mt76_wr
	movq	%r14, %rdi
	callq	_mt76x0_register_device
	testl	%eax, %eax
	js	LBB0_13
## %bb.8:
	movq	_MT76_STATE_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_13:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_9:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MT_COEXCFG0,4,2                ## @MT_COEXCFG0
	.comm	_MT_EE_NIC_CONF_0,4,2           ## @MT_EE_NIC_CONF_0
	.comm	_MT_EE_NIC_CONF_0_PA_IO_CURRENT,4,2 ## @MT_EE_NIC_CONF_0_PA_IO_CURRENT
	.comm	_MT_XO_CTRL7,4,2                ## @MT_XO_CTRL7
	.comm	_MT_MAX_LEN_CFG,4,2             ## @MT_MAX_LEN_CFG
	.comm	_MT_CH_TIME_CFG,4,2             ## @MT_CH_TIME_CFG
	.comm	_MT_CH_TIME_CFG_TIMER_EN,4,2    ## @MT_CH_TIME_CFG_TIMER_EN
	.comm	_MT_CH_TIME_CFG_TX_AS_BUSY,4,2  ## @MT_CH_TIME_CFG_TX_AS_BUSY
	.comm	_MT_CH_TIME_CFG_RX_AS_BUSY,4,2  ## @MT_CH_TIME_CFG_RX_AS_BUSY
	.comm	_MT_CH_TIME_CFG_NAV_AS_BUSY,4,2 ## @MT_CH_TIME_CFG_NAV_AS_BUSY
	.comm	_MT_CH_TIME_CFG_EIFS_AS_BUSY,4,2 ## @MT_CH_TIME_CFG_EIFS_AS_BUSY
	.comm	_MT_CH_CCA_RC_EN,4,2            ## @MT_CH_CCA_RC_EN
	.comm	_MT_CH_TIME_CFG_CH_TIMER_CLR,4,2 ## @MT_CH_TIME_CFG_CH_TIMER_CLR
	.comm	_MT76_STATE_INITIALIZED,4,2     ## @MT76_STATE_INITIALIZED
	.no_dead_strip	_mt76x0e_register_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x0e_register_device
_mt76x0e_register_device:               ; @mt76x0e_register_device
	.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	x19, x0
	mov	w1, #1
	mov	w2, #0
	bl	_mt76x0_chip_onoff
	mov	x0, x19
	bl	_mt76x02_wait_for_mac
	cbz	w0, LBB0_9
; %bb.1:
	mov	x0, x19
	bl	_mt76x02_dma_disable
	mov	x0, x19
	bl	_mt76x0e_mcu_init
	tbnz	w0, #31, LBB0_10
; %bb.2:
	mov	x0, x19
	bl	_mt76x02_dma_init
	tbnz	w0, #31, LBB0_10
; %bb.3:
	mov	x0, x19
	bl	_mt76x0_init_hardware
	tbnz	w0, #31, LBB0_10
; %bb.4:
	mov	x0, x19
	bl	_mt76x02e_init_beacon_config
	mov	x0, x19
	bl	_mt76_chip
	mov	w8, #30224
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.5:
Lloh0:
	adrp	x8, _MT_COEXCFG0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_COEXCFG0@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mov	w0, #0
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_mt76_clear
Lloh3:
	adrp	x8, _MT_EE_NIC_CONF_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_EE_NIC_CONF_0@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76x02_eeprom_get
Lloh6:
	adrp	x8, _MT_EE_NIC_CONF_0_PA_IO_CURRENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_EE_NIC_CONF_0_PA_IO_CURRENT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_7
; %bb.6:
Lloh9:
	adrp	x8, _MT_XO_CTRL7@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_XO_CTRL7@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3075
	bl	_mt76_set
LBB0_7:
	mov	w0, #9
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	w1, #272
	bl	_mt76_clear
Lloh12:
	adrp	x8, _MT_MAX_LEN_CFG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT_MAX_LEN_CFG@GOTPAGEOFF]
Lloh14:
	ldr	w20, [x8]
	mov	w0, #13
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_mt76_set
Lloh15:
	adrp	x8, _MT_CH_TIME_CFG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MT_CH_TIME_CFG@GOTPAGEOFF]
Lloh17:
	adrp	x9, _MT_CH_TIME_CFG_TIMER_EN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MT_CH_TIME_CFG_TIMER_EN@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _MT_CH_TIME_CFG_TX_AS_BUSY@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MT_CH_TIME_CFG_TX_AS_BUSY@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh23:
	adrp	x10, _MT_CH_TIME_CFG_RX_AS_BUSY@GOTPAGE
Lloh24:
	ldr	x10, [x10, _MT_CH_TIME_CFG_RX_AS_BUSY@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh26:
	adrp	x10, _MT_CH_TIME_CFG_NAV_AS_BUSY@GOTPAGE
Lloh27:
	ldr	x10, [x10, _MT_CH_TIME_CFG_NAV_AS_BUSY@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh29:
	adrp	x10, _MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPAGE
Lloh30:
	ldr	x10, [x10, _MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPAGEOFF]
Lloh31:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh32:
	adrp	x10, _MT_CH_CCA_RC_EN@GOTPAGE
Lloh33:
	ldr	x10, [x10, _MT_CH_CCA_RC_EN@GOTPAGEOFF]
Lloh34:
	ldr	w20, [x8]
Lloh35:
	ldr	w8, [x10]
	orr	w21, w9, w8
Lloh36:
	adrp	x8, _MT_CH_TIME_CFG_CH_TIMER_CLR@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MT_CH_TIME_CFG_CH_TIMER_CLR@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_FIELD_PREP
	orr	w2, w21, w0
	mov	x0, x19
	mov	x1, x20
	bl	_mt76_wr
	mov	x0, x19
	bl	_mt76x0_register_device
	tbnz	w0, #31, LBB0_10
; %bb.8:
Lloh39:
	adrp	x8, _MT76_STATE_INITIALIZED@GOTPAGE
Lloh40:
	ldr	x8, [x8, _MT76_STATE_INITIALIZED@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
	mov	w0, #0
	b	LBB0_10
LBB0_9:
Lloh42:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh35
	.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	Lloh15, Lloh16, Lloh34
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MT_COEXCFG0,4,2                ; @MT_COEXCFG0
	.comm	_MT_EE_NIC_CONF_0,4,2           ; @MT_EE_NIC_CONF_0
	.comm	_MT_EE_NIC_CONF_0_PA_IO_CURRENT,4,2 ; @MT_EE_NIC_CONF_0_PA_IO_CURRENT
	.comm	_MT_XO_CTRL7,4,2                ; @MT_XO_CTRL7
	.comm	_MT_MAX_LEN_CFG,4,2             ; @MT_MAX_LEN_CFG
	.comm	_MT_CH_TIME_CFG,4,2             ; @MT_CH_TIME_CFG
	.comm	_MT_CH_TIME_CFG_TIMER_EN,4,2    ; @MT_CH_TIME_CFG_TIMER_EN
	.comm	_MT_CH_TIME_CFG_TX_AS_BUSY,4,2  ; @MT_CH_TIME_CFG_TX_AS_BUSY
	.comm	_MT_CH_TIME_CFG_RX_AS_BUSY,4,2  ; @MT_CH_TIME_CFG_RX_AS_BUSY
	.comm	_MT_CH_TIME_CFG_NAV_AS_BUSY,4,2 ; @MT_CH_TIME_CFG_NAV_AS_BUSY
	.comm	_MT_CH_TIME_CFG_EIFS_AS_BUSY,4,2 ; @MT_CH_TIME_CFG_EIFS_AS_BUSY
	.comm	_MT_CH_CCA_RC_EN,4,2            ; @MT_CH_CCA_RC_EN
	.comm	_MT_CH_TIME_CFG_CH_TIMER_CLR,4,2 ; @MT_CH_TIME_CFG_CH_TIMER_CLR
	.comm	_MT76_STATE_INITIALIZED,4,2     ; @MT76_STATE_INITIALIZED
	.no_dead_strip	_mt76x0e_register_device
.subsections_via_symbols
