	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7615_load_ram
_mt7615_load_ram:                       ## @mt7615_load_ram
	.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
	movq	%rdi, %r14
	movq	_MT7615_FIRMWARE_N9@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rdi), %edx
	leaq	-32(%rbp), %rdi
	callq	_request_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.1:
	movq	-32(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.2:
	movslq	(%rcx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movslq	4(%rcx), %r15
	movq	_N9_REGION_NUM@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpq	%r15, %rcx
	jbe	LBB0_5
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movq	-32(%rbp), %rdi
	callq	_release_firmware
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	addq	%rax, %r15
	subq	%rcx, %r15
	movl	(%r14), %edi
	movl	(%r15), %ecx
	movl	4(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_info
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_mt7615_mcu_send_ram_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:
	movl	8(%r15), %edi
	callq	_le32_to_cpu
	movq	_FW_START_OVERRIDE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mt7615_mcu_start_firmware
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_15
LBB0_8:
	movq	-32(%rbp), %rdi
	callq	_release_firmware
	movq	_MT7615_FIRMWARE_CR4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	leaq	-32(%rbp), %rdi
	callq	_request_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.9:
	movq	-32(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.10:
	movslq	(%rcx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.11:
	movslq	4(%rcx), %rbx
	movq	_CR4_REGION_NUM@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpq	%rbx, %rcx
	ja	LBB0_4
## %bb.12:
	addq	%rax, %rbx
	subq	%rcx, %rbx
	movl	(%r14), %edi
	movl	(%rbx), %ecx
	movl	4(%rbx), %edx
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	_mt7615_mcu_send_ram_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	movq	_FW_START_WORKING_PDA_CR4@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_mt7615_mcu_start_firmware
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %r15d
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	movl	%r15d, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_MT7615_FIRMWARE_N9,4,2         ## @MT7615_FIRMWARE_N9
	.comm	_N9_REGION_NUM,4,2              ## @N9_REGION_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid firmware\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"N9 Firmware Version: %.10s, Build Time: %.15s\n"

	.comm	_FW_START_OVERRIDE,4,2          ## @FW_START_OVERRIDE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to start N9 firmware\n"

	.comm	_MT7615_FIRMWARE_CR4,4,2        ## @MT7615_FIRMWARE_CR4
	.comm	_CR4_REGION_NUM,4,2             ## @CR4_REGION_NUM
L_.str.3:                               ## @.str.3
	.asciz	"CR4 Firmware Version: %.10s, Build Time: %.15s\n"

	.comm	_FW_START_WORKING_PDA_CR4,4,2   ## @FW_START_WORKING_PDA_CR4
L_.str.4:                               ## @.str.4
	.asciz	"Failed to start CR4 firmware\n"

	.no_dead_strip	_mt7615_load_ram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7615_load_ram
_mt7615_load_ram:                       ; @mt7615_load_ram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
Lloh0:
	adrp	x8, _MT7615_FIRMWARE_N9@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT7615_FIRMWARE_N9@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x0]
	add	x0, sp, #8
	bl	_request_firmware
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	x9, [sp, #8]
	cbz	x9, LBB0_4
; %bb.2:
	ldrsw	x8, [x9]
	cbz	w8, LBB0_4
; %bb.3:
	ldrsw	x9, [x9, #4]
Lloh3:
	adrp	x10, _N9_REGION_NUM@GOTPAGE
Lloh4:
	ldr	x10, [x10, _N9_REGION_NUM@GOTPAGEOFF]
Lloh5:
	ldrsw	x10, [x10]
	add	x10, x10, x10, lsl #1
	lsl	x10, x10, #2
	cmp	x10, x9
	b.ls	LBB0_7
LBB0_4:
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_7:
	add	x8, x9, x8
	sub	x21, x8, x10
	ldr	w0, [x19]
	ldp	w3, w2, [x21]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	x8, [sp, #8]
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	bl	_mt7615_mcu_send_ram_firmware
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.8:
	ldr	w0, [x21, #8]
	bl	_le32_to_cpu
	mov	x1, x0
Lloh13:
	adrp	x8, _FW_START_OVERRIDE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FW_START_OVERRIDE@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt7615_mcu_start_firmware
	cbz	w0, LBB0_11
; %bb.9:
	mov	x20, x0
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	bl	_dev_err
	b	LBB0_5
LBB0_11:
	ldr	x0, [sp, #8]
	bl	_release_firmware
Lloh18:
	adrp	x8, _MT7615_FIRMWARE_CR4@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MT7615_FIRMWARE_CR4@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w2, [x19]
	add	x0, sp, #8
	bl	_request_firmware
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.12:
	ldr	x9, [sp, #8]
	cbz	x9, LBB0_4
; %bb.13:
	ldrsw	x8, [x9]
	cbz	w8, LBB0_4
; %bb.14:
	ldrsw	x9, [x9, #4]
Lloh21:
	adrp	x10, _CR4_REGION_NUM@GOTPAGE
Lloh22:
	ldr	x10, [x10, _CR4_REGION_NUM@GOTPAGEOFF]
Lloh23:
	ldrsw	x10, [x10]
	add	x10, x10, x10, lsl #1
	lsl	x10, x10, #2
	cmp	x10, x9
	b.hi	LBB0_4
; %bb.15:
	add	x8, x9, x8
	sub	x20, x8, x10
	ldr	w0, [x19]
	ldp	w3, w2, [x20]
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	ldr	x8, [sp, #8]
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w3, #1
	bl	_mt7615_mcu_send_ram_firmware
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.16:
Lloh26:
	adrp	x8, _FW_START_WORKING_PDA_CR4@GOTPAGE
Lloh27:
	ldr	x8, [x8, _FW_START_WORKING_PDA_CR4@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_mt7615_mcu_start_firmware
	mov	x20, x0
	cbz	w0, LBB0_5
; %bb.17:
	ldr	w0, [x19]
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MT7615_FIRMWARE_N9,4,2         ; @MT7615_FIRMWARE_N9
	.comm	_N9_REGION_NUM,4,2              ; @N9_REGION_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid firmware\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"N9 Firmware Version: %.10s, Build Time: %.15s\n"

	.comm	_FW_START_OVERRIDE,4,2          ; @FW_START_OVERRIDE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to start N9 firmware\n"

	.comm	_MT7615_FIRMWARE_CR4,4,2        ; @MT7615_FIRMWARE_CR4
	.comm	_CR4_REGION_NUM,4,2             ; @CR4_REGION_NUM
l_.str.3:                               ; @.str.3
	.asciz	"CR4 Firmware Version: %.10s, Build Time: %.15s\n"

	.comm	_FW_START_WORKING_PDA_CR4,4,2   ; @FW_START_WORKING_PDA_CR4
l_.str.4:                               ; @.str.4
	.asciz	"Failed to start CR4 firmware\n"

	.no_dead_strip	_mt7615_load_ram
.subsections_via_symbols
