	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7615_init_hardware
_mt7615_init_hardware:                  ## @mt7615_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
	movq	_MT_INT_SOURCE_CSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-1, %edx
	callq	_mt76_wr
	leaq	28(%r14), %rdi
	callq	_spin_lock_init
	leaq	24(%r14), %rdi
	callq	_idr_init
	movq	%r14, %rdi
	callq	_mt7615_eeprom_init
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_mt7615_dma_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	_MT76_STATE_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	20(%r14), %rsi
	callq	_set_bit
	movq	%r14, %rdi
	callq	_mt7615_mcu_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_mt7615_mcu_set_eeprom
	movq	%r14, %rdi
	callq	_mt7615_mac_init
	movq	%r14, %rdi
	callq	_mt7615_phy_init
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_mt7615_mcu_ctrl_pm_state
	movq	%r14, %rdi
	callq	_mt7615_mcu_del_wtbl_all
	movl	16(%r14), %edi
	movq	_MT7615_WTBL_STA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	decq	%rsi
	callq	_mt76_wcid_alloc
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movabsq	$-4294967296, %rax              ## imm = 0xFFFFFFFF00000000
	movq	%rax, (%r14)
	movq	8(%r14), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_rcu_assign_pointer
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_INT_SOURCE_CSR,4,2          ## @MT_INT_SOURCE_CSR
	.comm	_MT76_STATE_INITIALIZED,4,2     ## @MT76_STATE_INITIALIZED
	.comm	_MT7615_WTBL_STA,8,3            ## @MT7615_WTBL_STA
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_mt7615_init_hardware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7615_init_hardware
_mt7615_init_hardware:                  ; @mt7615_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
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
	add	x0, x19, #28
	bl	_spin_lock_init
	add	x0, x19, #24
	bl	_idr_init
	mov	x0, x19
	bl	_mt7615_eeprom_init
	tbnz	w0, #31, LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_mt7615_dma_init
	cbnz	w0, LBB0_6
; %bb.2:
Lloh3:
	adrp	x8, _MT76_STATE_INITIALIZED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT76_STATE_INITIALIZED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, x19, #20
	bl	_set_bit
	mov	x0, x19
	bl	_mt7615_mcu_init
	cbnz	w0, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_mt7615_mcu_set_eeprom
	mov	x0, x19
	bl	_mt7615_mac_init
	mov	x0, x19
	bl	_mt7615_phy_init
	mov	x0, x19
	mov	w1, #0
	bl	_mt7615_mcu_ctrl_pm_state
	mov	x0, x19
	bl	_mt7615_mcu_del_wtbl_all
	ldr	w0, [x19, #16]
Lloh6:
	adrp	x8, _MT7615_WTBL_STA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT7615_WTBL_STA@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	sub	x1, x8, #1
	bl	_mt76_wcid_alloc
	cbz	w0, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	movi	d0, #0xffffffff00000000
	str	d0, [x19]
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_rcu_assign_pointer
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_INT_SOURCE_CSR,4,2          ; @MT_INT_SOURCE_CSR
	.comm	_MT76_STATE_INITIALIZED,4,2     ; @MT76_STATE_INITIALIZED
	.comm	_MT7615_WTBL_STA,8,3            ; @MT7615_WTBL_STA
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_mt7615_init_hardware
.subsections_via_symbols
