	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x0u_init_hardware
_mt76x0u_init_hardware:                 ## @mt76x0u_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %edx
	movq	%rdi, %rbx
	movl	$1, %esi
	callq	_mt76x0_chip_onoff
	movq	%rbx, %rdi
	callq	_mt76x02_wait_for_mac
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_mt76x0u_mcu_init
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movq	%rbx, %rdi
	callq	_mt76x0_init_usb_dma
	movq	%rbx, %rdi
	callq	_mt76x0_init_hardware
	testl	%eax, %eax
	js	LBB0_5
## %bb.4:
	movq	%rbx, %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	%rbx, %rdi
	movl	$30, %ecx
	callq	_mt76_rmw
	movq	_MT_TXOP_CTRL_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_MT_TXOP_TRUN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$63, %esi
	callq	_FIELD_PREP
	movl	%eax, %r15d
	movq	_MT_TXOP_EXT_CCA_DLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$88, %esi
	callq	_FIELD_PREP
	orl	%eax, %r15d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_mt76_wr
	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	%rbx, %rdi
	callq	_mt76_wr
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.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_TXOP_TRUN_EN,4,2            ## @MT_TXOP_TRUN_EN
	.comm	_MT_TXOP_EXT_CCA_DLY,4,2        ## @MT_TXOP_EXT_CCA_DLY
	.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
	.no_dead_strip	_mt76x0u_init_hardware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x0u_init_hardware
_mt76x0u_init_hardware:                 ; @mt76x0u_init_hardware
	.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	x2, x1
	mov	x19, x0
	mov	w1, #1
	bl	_mt76x0_chip_onoff
	mov	x0, x19
	bl	_mt76x02_wait_for_mac
	cbz	w0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_mt76x0u_mcu_init
	tbnz	w0, #31, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_mt76x0_init_usb_dma
	mov	x0, x19
	bl	_mt76x0_init_hardware
	tbnz	w0, #31, LBB0_5
; %bb.3:
	mov	x0, x19
	bl	_mt76x02u_init_beacon_config
Lloh0:
	adrp	x8, _MT_US_CYC_CFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_US_CYC_CFG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MT_US_CYC_CNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_US_CYC_CNT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #30
	bl	_mt76_rmw
Lloh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S_BUSY@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh30:
	adrp	x9, _MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MT_CH_TIME_CFG_EIFS_AS_BUSY@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_mt76_wr
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh33:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.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_TXOP_TRUN_EN,4,2            ; @MT_TXOP_TRUN_EN
	.comm	_MT_TXOP_EXT_CCA_DLY,4,2        ; @MT_TXOP_EXT_CCA_DLY
	.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
	.no_dead_strip	_mt76x0u_init_hardware
.subsections_via_symbols
