	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x0_init_hardware           ## -- Begin function mt76x0_init_hardware
	.p2align	4, 0x90
_mt76x0_init_hardware:                  ## @mt76x0_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	$1000, %esi                     ## imm = 0x3E8
	callq	_mt76x02_wait_for_wpdma
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	%r14, %rdi
	callq	_mt76x02_wait_for_mac
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_mt76x0_reset_csr_bbp
	movq	_Q_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_mt76x02_mcu_function_select
	testl	%eax, %eax
	jne	LBB0_14
## %bb.6:
	movq	%r14, %rdi
	callq	_mt76x0_init_mac_registers
	movq	%r14, %rdi
	callq	_mt76x02_wait_for_txrx_idle
	testl	%eax, %eax
	je	LBB0_1
## %bb.7:
	movq	%r14, %rdi
	callq	_mt76x0_init_bbp
	testl	%eax, %eax
	jne	LBB0_14
## %bb.8:
	movq	_MT_RX_FILTR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76_rr
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>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_9
## %bb.10:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>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_11
## %bb.12:
	movq	%r14, %rdi
	callq	_mt76x0_reset_counters
	movq	%r14, %rdi
	callq	_mt76x0_eeprom_init
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	%r14, %rdi
	callq	_mt76x0_phy_init
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_Q_SELECT,4,2                   ## @Q_SELECT
	.comm	_MT_RX_FILTR_CFG,4,2            ## @MT_RX_FILTR_CFG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x0_init_hardware           ; -- Begin function mt76x0_init_hardware
	.p2align	2
_mt76x0_init_hardware:                  ; @mt76x0_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, #1000
	bl	_mt76x02_wait_for_wpdma
	cbz	w0, LBB0_11
; %bb.1:
	mov	x0, x19
	bl	_mt76x02_wait_for_mac
	cbz	w0, LBB0_12
; %bb.2:
	mov	x0, x19
	bl	_mt76x0_reset_csr_bbp
Lloh0:
	adrp	x8, _Q_SELECT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Q_SELECT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_mt76x02_mcu_function_select
	cbnz	w0, LBB0_14
; %bb.3:
	mov	x0, x19
	bl	_mt76x0_init_mac_registers
	mov	x0, x19
	bl	_mt76x02_wait_for_txrx_idle
	cbz	w0, LBB0_11
; %bb.4:
	mov	x0, x19
	bl	_mt76x0_init_bbp
	cbnz	w0, LBB0_14
; %bb.5:
Lloh3:
	adrp	x8, _MT_RX_FILTR_CFG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_RX_FILTR_CFG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76_rr
	mov	w20, #0
	str	w0, [x19]
LBB0_6:                                 ; =>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_6
; %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	x0, x19
	bl	_mt76x0_reset_counters
	mov	x0, x19
	bl	_mt76x0_eeprom_init
	cbnz	w0, LBB0_14
; %bb.10:
	mov	x0, x19
	bl	_mt76x0_phy_init
	mov	w0, #0
	b	LBB0_14
LBB0_11:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh8:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_Q_SELECT,4,2                   ; @Q_SELECT
	.comm	_MT_RX_FILTR_CFG,4,2            ; @MT_RX_FILTR_CFG
.subsections_via_symbols
