	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x2u_init_hardware          ## -- Begin function mt76x2u_init_hardware
	.p2align	4, 0x90
_mt76x2u_init_hardware:                 ## @mt76x2u_init_hardware
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	$1, %esi
	callq	_mt76x2_reset_wlan
	movq	%r14, %rdi
	callq	_mt76x2u_power_on
	movq	%r14, %rdi
	callq	_mt76x02_wait_for_mac
	testl	%eax, %eax
	je	LBB0_13
## %bb.1:
	movq	%r14, %rdi
	callq	_mt76x2u_mcu_fw_init
	testl	%eax, %eax
	js	LBB0_14
## %bb.2:
	movq	_MT_WPDMA_GLO_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_WPDMA_GLO_CFG_TX_DMA_BUSY@GOTPCREL(%rip), %rax
	movq	_MT_WPDMA_GLO_CFG_RX_DMA_BUSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	callq	_mt76_poll_msec
	testl	%eax, %eax
	je	LBB0_15
## %bb.3:
	movq	%r14, %rdi
	callq	_mt76x02_wait_for_mac
	testl	%eax, %eax
	je	LBB0_13
## %bb.4:
	movq	%r14, %rdi
	callq	_mt76x2u_init_dma
	movq	%r14, %rdi
	callq	_mt76x2u_mcu_init
	testl	%eax, %eax
	js	LBB0_14
## %bb.5:
	movq	%r14, %rdi
	callq	_mt76x2u_mac_reset
	testl	%eax, %eax
	js	LBB0_14
## %bb.6:
	movq	_MT_EE_MAC_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movq	%r14, %rdi
	callq	_mt76x02_mac_setaddr
	movq	_MT_RX_FILTR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76_rr
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_mt76x02_wait_for_txrx_idle
	testl	%eax, %eax
	je	LBB0_13
## %bb.7:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_mt76x02_mac_wcid_setup
	incl	%ebx
	cmpl	$256, %ebx                      ## imm = 0x100
	jne	LBB0_8
## %bb.9:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_mt76x02_mac_shared_key_setup
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_mt76x02_mac_shared_key_setup
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$2, %edx
	xorl	%ecx, %ecx
	callq	_mt76x02_mac_shared_key_setup
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$3, %edx
	xorl	%ecx, %ecx
	callq	_mt76x02_mac_shared_key_setup
	incl	%ebx
	cmpl	$16, %ebx
	jne	LBB0_10
## %bb.11:
	movq	%r14, %rdi
	callq	_mt76x02u_init_beacon_config
	movq	_MT_US_CYC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_US_CYC_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$30, %ecx
	callq	_mt76_rmw
	movq	_MT_TXOP_CTRL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$22591, %edx                    ## imm = 0x583F
	callq	_mt76_wr
	movq	_MT_RF_BBP_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_mt76x2_mcu_load_cr
	testl	%eax, %eax
	js	LBB0_14
## %bb.12:
	movq	%r14, %rdi
	callq	_mt76x02_phy_set_rxpath
	movq	%r14, %rdi
	callq	_mt76x02_phy_set_txdac
	movq	_MT_CH_TIME_CFG_TIMER_EN@GOTPCREL(%rip), %rax
	movq	_MT_CH_TIME_CFG_TX_AS_BUSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MT_CH_TIME_CFG_RX_AS_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_MT_CH_TIME_CFG@GOTPCREL(%rip), %rax
	movq	_MT_CH_TIME_CFG_NAV_AS_BUSY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	(%rax), %esi
	movq	_MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mt76_wr
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mt76x2u_mac_stop               ## TAILCALL
LBB0_13:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_14:
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_15:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_16:
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MT_WPDMA_GLO_CFG,4,2           ## @MT_WPDMA_GLO_CFG
	.comm	_MT_WPDMA_GLO_CFG_TX_DMA_BUSY,4,2 ## @MT_WPDMA_GLO_CFG_TX_DMA_BUSY
	.comm	_MT_WPDMA_GLO_CFG_RX_DMA_BUSY,4,2 ## @MT_WPDMA_GLO_CFG_RX_DMA_BUSY
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MT_EE_MAC_ADDR,8,3             ## @MT_EE_MAC_ADDR
	.comm	_MT_RX_FILTR_CFG,4,2            ## @MT_RX_FILTR_CFG
	.comm	_MT_US_CYC_CFG,4,2              ## @MT_US_CYC_CFG
	.comm	_MT_US_CYC_CNT,4,2              ## @MT_US_CYC_CNT
	.comm	_MT_TXOP_CTRL_CFG,4,2           ## @MT_TXOP_CTRL_CFG
	.comm	_MT_RF_BBP_CR,4,2               ## @MT_RF_BBP_CR
	.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
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x2u_init_hardware          ; -- Begin function mt76x2u_init_hardware
	.p2align	2
_mt76x2u_init_hardware:                 ; @mt76x2u_init_hardware
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w1, #1
	bl	_mt76x2_reset_wlan
	mov	x0, x19
	bl	_mt76x2u_power_on
	mov	x0, x19
	bl	_mt76x02_wait_for_mac
	cbz	w0, LBB0_13
; %bb.1:
	mov	x0, x19
	bl	_mt76x2u_mcu_fw_init
	tbnz	w0, #31, LBB0_16
; %bb.2:
Lloh0:
	adrp	x8, _MT_WPDMA_GLO_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_WPDMA_GLO_CFG@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MT_WPDMA_GLO_CFG_TX_DMA_BUSY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MT_WPDMA_GLO_CFG_TX_DMA_BUSY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _MT_WPDMA_GLO_CFG_RX_DMA_BUSY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MT_WPDMA_GLO_CFG_RX_DMA_BUSY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	mov	w3, #0
	mov	w4, #100
	bl	_mt76_poll_msec
	cbz	w0, LBB0_14
; %bb.3:
	mov	x0, x19
	bl	_mt76x02_wait_for_mac
	cbz	w0, LBB0_13
; %bb.4:
	mov	x0, x19
	bl	_mt76x2u_init_dma
	mov	x0, x19
	bl	_mt76x2u_mcu_init
	tbnz	w0, #31, LBB0_16
; %bb.5:
	mov	x0, x19
	bl	_mt76x2u_mac_reset
	tbnz	w0, #31, LBB0_16
; %bb.6:
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _MT_EE_MAC_ADDR@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MT_EE_MAC_ADDR@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_mt76x02_mac_setaddr
Lloh12:
	adrp	x8, _MT_RX_FILTR_CFG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT_RX_FILTR_CFG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76_rr
	str	w0, [x19]
	mov	x0, x19
	bl	_mt76x02_wait_for_txrx_idle
	cbz	w0, LBB0_13
; %bb.7:
	mov	w20, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	x3, #0
	bl	_mt76x02_mac_wcid_setup
	add	w20, w20, #1
	cmp	w20, #256
	b.ne	LBB0_8
; %bb.9:
	mov	w20, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	mov	x3, #0
	bl	_mt76x02_mac_shared_key_setup
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	mov	x3, #0
	bl	_mt76x02_mac_shared_key_setup
	mov	x0, x19
	mov	x1, x20
	mov	w2, #2
	mov	x3, #0
	bl	_mt76x02_mac_shared_key_setup
	mov	x0, x19
	mov	x1, x20
	mov	w2, #3
	mov	x3, #0
	bl	_mt76x02_mac_shared_key_setup
	add	w20, w20, #1
	cmp	w20, #16
	b.ne	LBB0_10
; %bb.11:
	mov	x0, x19
	bl	_mt76x02u_init_beacon_config
Lloh15:
	adrp	x8, _MT_US_CYC_CFG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MT_US_CYC_CFG@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _MT_US_CYC_CNT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MT_US_CYC_CNT@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #30
	bl	_mt76_rmw
Lloh21:
	adrp	x8, _MT_TXOP_CTRL_CFG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MT_TXOP_CTRL_CFG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #22591
	bl	_mt76_wr
Lloh24:
	adrp	x8, _MT_RF_BBP_CR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MT_RF_BBP_CR@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_mt76x2_mcu_load_cr
	tbnz	w0, #31, LBB0_16
; %bb.12:
	mov	x0, x19
	bl	_mt76x02_phy_set_rxpath
	mov	x0, x19
	bl	_mt76x02_phy_set_txdac
Lloh27:
	adrp	x8, _MT_CH_TIME_CFG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MT_CH_TIME_CFG@GOTPAGEOFF]
Lloh29:
	adrp	x9, _MT_CH_TIME_CFG_TIMER_EN@GOTPAGE
Lloh30:
	ldr	x9, [x9, _MT_CH_TIME_CFG_TIMER_EN@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	ldr	w8, [x9]
Lloh33:
	adrp	x9, _MT_CH_TIME_CFG_TX_AS_BUSY@GOTPAGE
Lloh34:
	ldr	x9, [x9, _MT_CH_TIME_CFG_TX_AS_BUSY@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh36:
	adrp	x9, _MT_CH_TIME_CFG_RX_AS_BUSY@GOTPAGE
Lloh37:
	ldr	x9, [x9, _MT_CH_TIME_CFG_RX_AS_BUSY@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh39:
	adrp	x9, _MT_CH_TIME_CFG_NAV_AS_BUSY@GOTPAGE
Lloh40:
	ldr	x9, [x9, _MT_CH_TIME_CFG_NAV_AS_BUSY@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh42:
	adrp	x9, _MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPAGE
Lloh43:
	ldr	x9, [x9, _MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_mt76_wr
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mt76x2u_mac_stop
LBB0_13:
Lloh45:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh47:
	adrp	x8, _EIO@GOTPAGE
Lloh48:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MT_WPDMA_GLO_CFG,4,2           ; @MT_WPDMA_GLO_CFG
	.comm	_MT_WPDMA_GLO_CFG_TX_DMA_BUSY,4,2 ; @MT_WPDMA_GLO_CFG_TX_DMA_BUSY
	.comm	_MT_WPDMA_GLO_CFG_RX_DMA_BUSY,4,2 ; @MT_WPDMA_GLO_CFG_RX_DMA_BUSY
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MT_EE_MAC_ADDR,8,3             ; @MT_EE_MAC_ADDR
	.comm	_MT_RX_FILTR_CFG,4,2            ; @MT_RX_FILTR_CFG
	.comm	_MT_US_CYC_CFG,4,2              ; @MT_US_CYC_CFG
	.comm	_MT_US_CYC_CNT,4,2              ; @MT_US_CYC_CNT
	.comm	_MT_TXOP_CTRL_CFG,4,2           ; @MT_TXOP_CTRL_CFG
	.comm	_MT_RF_BBP_CR,4,2               ; @MT_RF_BBP_CR
	.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
.subsections_via_symbols
