	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7603_init_hardware
_mt7603_init_hardware:                  ## @mt7603_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MT_INT_SOURCE_CSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-1, %edx
	callq	_mt76_wr
	movq	%r14, %rdi
	callq	_mt7603_eeprom_init
	testl	%eax, %eax
	js	LBB0_7
## %bb.1:
	movq	%r14, %rdi
	callq	_mt7603_dma_init
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	_MT_WPDMA_GLO_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1375733840, %edx               ## imm = 0x52000850
	callq	_mt76_wr
	movq	%r14, %rdi
	callq	_mt7603_mac_dma_start
	movq	_MT_WF_RFCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76_rr
	movl	%eax, 4(%r14)
	movq	_MT76_STATE_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
	movq	_MT7603_WTBL_SIZE@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_5
## %bb.3:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MT_PSE_RTA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	_MT_PSE_RTA_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_MT_PSE_RTA_BUSY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	movq	_MT_PSE_RTA_TAG_ID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	%r12d, %esi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_mt76_wr
	movq	_MT_PSE_RTA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_PSE_RTA_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$5000, %r8d                     ## imm = 0x1388
	callq	_mt76_poll
	incl	%r12d
	cmpl	(%r13), %r12d
	jl	LBB0_4
LBB0_5:
	movq	%r14, %rdi
	callq	_mt7603_mcu_init
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_mt7603_dma_sched_init
	movq	%r14, %rdi
	callq	_mt7603_mcu_set_eeprom
	movq	%r14, %rdi
	callq	_mt7603_phy_init
	movq	%r14, %rdi
	callq	_mt7603_mac_init
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_INT_SOURCE_CSR,4,2          ## @MT_INT_SOURCE_CSR
	.comm	_MT_WPDMA_GLO_CFG,4,2           ## @MT_WPDMA_GLO_CFG
	.comm	_MT_WF_RFCR,4,2                 ## @MT_WF_RFCR
	.comm	_MT76_STATE_INITIALIZED,4,2     ## @MT76_STATE_INITIALIZED
	.comm	_MT7603_WTBL_SIZE,4,2           ## @MT7603_WTBL_SIZE
	.comm	_MT_PSE_RTA,4,2                 ## @MT_PSE_RTA
	.comm	_MT_PSE_RTA_BUSY,4,2            ## @MT_PSE_RTA_BUSY
	.comm	_MT_PSE_RTA_WRITE,4,2           ## @MT_PSE_RTA_WRITE
	.comm	_MT_PSE_RTA_TAG_ID,4,2          ## @MT_PSE_RTA_TAG_ID
	.no_dead_strip	_mt7603_init_hardware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7603_init_hardware
_mt7603_init_hardware:                  ; @mt7603_init_hardware
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _MT_INT_SOURCE_CSR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_INT_SOURCE_CSR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #-1
	bl	_mt76_wr
	mov	x0, x19
	bl	_mt7603_eeprom_init
	tbnz	w0, #31, LBB0_7
; %bb.1:
	mov	x0, x19
	bl	_mt7603_dma_init
	cbnz	w0, LBB0_7
; %bb.2:
Lloh3:
	adrp	x8, _MT_WPDMA_GLO_CFG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_WPDMA_GLO_CFG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #2128
	movk	w2, #20992, lsl #16
	bl	_mt76_wr
	mov	x0, x19
	bl	_mt7603_mac_dma_start
Lloh6:
	adrp	x8, _MT_WF_RFCR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_WF_RFCR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76_rr
	str	w0, [x19, #4]
Lloh9:
	adrp	x8, _MT76_STATE_INITIALIZED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT76_STATE_INITIALIZED@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_set_bit
Lloh12:
	adrp	x22, _MT7603_WTBL_SIZE@GOTPAGE
Lloh13:
	ldr	x22, [x22, _MT7603_WTBL_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w20, #0
Lloh14:
	adrp	x23, _MT_PSE_RTA@GOTPAGE
Lloh15:
	ldr	x23, [x23, _MT_PSE_RTA@GOTPAGEOFF]
Lloh16:
	adrp	x24, _MT_PSE_RTA_BUSY@GOTPAGE
Lloh17:
	ldr	x24, [x24, _MT_PSE_RTA_BUSY@GOTPAGEOFF]
Lloh18:
	adrp	x25, _MT_PSE_RTA_WRITE@GOTPAGE
Lloh19:
	ldr	x25, [x25, _MT_PSE_RTA_WRITE@GOTPAGEOFF]
Lloh20:
	adrp	x26, _MT_PSE_RTA_TAG_ID@GOTPAGE
Lloh21:
	ldr	x26, [x26, _MT_PSE_RTA_TAG_ID@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x23]
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w27, w9, w8
	ldr	w0, [x26]
	mov	x1, x20
	bl	_FIELD_PREP
	orr	w2, w27, w0
	mov	x0, x19
	mov	x1, x21
	bl	_mt76_wr
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #5000
	bl	_mt76_poll
	add	w20, w20, #1
	ldr	w8, [x22]
	cmp	w20, w8
	b.lt	LBB0_4
LBB0_5:
	mov	x0, x19
	bl	_mt7603_mcu_init
	cbnz	w0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_mt7603_dma_sched_init
	mov	x0, x19
	bl	_mt7603_mcu_set_eeprom
	mov	x0, x19
	bl	_mt7603_phy_init
	mov	x0, x19
	bl	_mt7603_mac_init
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_INT_SOURCE_CSR,4,2          ; @MT_INT_SOURCE_CSR
	.comm	_MT_WPDMA_GLO_CFG,4,2           ; @MT_WPDMA_GLO_CFG
	.comm	_MT_WF_RFCR,4,2                 ; @MT_WF_RFCR
	.comm	_MT76_STATE_INITIALIZED,4,2     ; @MT76_STATE_INITIALIZED
	.comm	_MT7603_WTBL_SIZE,4,2           ; @MT7603_WTBL_SIZE
	.comm	_MT_PSE_RTA,4,2                 ; @MT_PSE_RTA
	.comm	_MT_PSE_RTA_BUSY,4,2            ; @MT_PSE_RTA_BUSY
	.comm	_MT_PSE_RTA_WRITE,4,2           ; @MT_PSE_RTA_WRITE
	.comm	_MT_PSE_RTA_TAG_ID,4,2          ; @MT_PSE_RTA_TAG_ID
	.no_dead_strip	_mt7603_init_hardware
.subsections_via_symbols
