	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_load_firmware           ## -- Begin function rt2800_load_firmware
	.p2align	4, 0x90
_rt2800_load_firmware:                  ## @rt2800_load_firmware
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_RT3290@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_rt2800_enable_wlan_rt3290
	testl	%eax, %eax
	jne	LBB0_17
LBB0_2:
	movq	_AUTOWAKEUP_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2800_register_write
	movq	%r12, %rdi
	callq	_rt2800_wait_csr_ready
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_4:
	movq	%r12, %rdi
	callq	_rt2x00_is_pci
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:
	movq	_RT3572@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:
	movq	_RT5390@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	_RT5392@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	je	LBB0_10
LBB0_9:
	movq	_AUX_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movq	_AUX_CTRL_FORCE_PCIE_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_AUX_CTRL_WAKE_PCIE_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movl	(%r13), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_rt2800_register_write
LBB0_10:
	movq	_PWR_PIN_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$2, %edx
	callq	_rt2800_register_write
LBB0_11:
	movq	%r12, %rdi
	callq	_rt2800_disable_wpdma
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_rt2800_drv_write_firmware
	movq	_REGISTER_BUSY_COUNT@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_16
## %bb.12:
	xorl	%ebx, %ebx
	movq	_PBF_SYS_CTRL@GOTPCREL(%rip), %r15
	movq	_PBF_SYS_CTRL_READY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_rt2800_register_read
	movl	%eax, -44(%rbp)
	movl	(%r13), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	testq	%rax, %rax
	jne	LBB0_20
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	$1, %edi
	callq	_msleep
	incl	%ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jb	LBB0_13
## %bb.15:
	cmpl	%eax, %ebx
	jne	LBB0_21
LBB0_16:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_rt2x00_err
LBB0_17:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_18:
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	je	LBB0_16
LBB0_21:
	movq	%r12, %rdi
	callq	_rt2800_disable_wpdma
	movq	_H2M_BBP_AGENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2800_register_write
	movq	_H2M_MAILBOX_CSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2800_register_write
	movq	%r12, %rdi
	callq	_rt2x00_is_usb
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	movq	_H2M_INT_SRC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2800_register_write
	movq	_MCU_BOOT_SIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_rt2800_mcu_request
LBB0_23:
	movl	$1, %edi
	callq	_msleep
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_RT3290,4,2                     ## @RT3290
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_AUTOWAKEUP_CFG,4,2             ## @AUTOWAKEUP_CFG
	.comm	_RT3572,4,2                     ## @RT3572
	.comm	_RT5390,4,2                     ## @RT5390
	.comm	_RT5392,4,2                     ## @RT5392
	.comm	_AUX_CTRL,4,2                   ## @AUX_CTRL
	.comm	_AUX_CTRL_FORCE_PCIE_CLK,4,2    ## @AUX_CTRL_FORCE_PCIE_CLK
	.comm	_AUX_CTRL_WAKE_PCIE_EN,4,2      ## @AUX_CTRL_WAKE_PCIE_EN
	.comm	_PWR_PIN_CFG,4,2                ## @PWR_PIN_CFG
	.comm	_REGISTER_BUSY_COUNT,4,2        ## @REGISTER_BUSY_COUNT
	.comm	_PBF_SYS_CTRL,4,2               ## @PBF_SYS_CTRL
	.comm	_PBF_SYS_CTRL_READY,4,2         ## @PBF_SYS_CTRL_READY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PBF system register not ready\n"

	.comm	_H2M_BBP_AGENT,4,2              ## @H2M_BBP_AGENT
	.comm	_H2M_MAILBOX_CSR,4,2            ## @H2M_MAILBOX_CSR
	.comm	_H2M_INT_SRC,4,2                ## @H2M_INT_SRC
	.comm	_MCU_BOOT_SIGNAL,4,2            ## @MCU_BOOT_SIGNAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_load_firmware           ; -- Begin function rt2800_load_firmware
	.p2align	2
_rt2800_load_firmware:                  ; @rt2800_load_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _RT3290@GOTPAGE
Lloh1:
	ldr	x22, [x22, _RT3290@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_rt2x00_rt
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_rt2800_enable_wlan_rt3290
	cbnz	w0, LBB0_16
LBB0_2:
Lloh2:
	adrp	x8, _AUTOWAKEUP_CFG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AUTOWAKEUP_CFG@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2800_register_write
	mov	x0, x19
	bl	_rt2800_wait_csr_ready
	cbnz	x0, LBB0_16
; %bb.3:
	mov	x0, x19
	bl	_rt2x00_is_pci
	cbz	x0, LBB0_10
; %bb.4:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_8
; %bb.5:
Lloh5:
	adrp	x8, _RT3572@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RT3572@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_8
; %bb.6:
Lloh8:
	adrp	x8, _RT5390@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RT5390@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbnz	x0, LBB0_8
; %bb.7:
Lloh11:
	adrp	x8, _RT5392@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RT5392@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cbz	x0, LBB0_9
LBB0_8:
Lloh14:
	adrp	x22, _AUX_CTRL@GOTPAGE
Lloh15:
	ldr	x22, [x22, _AUX_CTRL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2800_register_read
	str	w0, [sp, #12]
Lloh16:
	adrp	x8, _AUX_CTRL_FORCE_PCIE_CLK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AUX_CTRL_FORCE_PCIE_CLK@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh19:
	adrp	x8, _AUX_CTRL_WAKE_PCIE_EN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AUX_CTRL_WAKE_PCIE_EN@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x0, sp, #12
	mov	w2, #1
	bl	_rt2x00_set_field32
	ldr	w1, [x22]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rt2800_register_write
LBB0_9:
Lloh22:
	adrp	x8, _PWR_PIN_CFG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PWR_PIN_CFG@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #2
	bl	_rt2800_register_write
LBB0_10:
	mov	x0, x19
	bl	_rt2800_disable_wpdma
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_rt2800_drv_write_firmware
Lloh25:
	adrp	x21, _REGISTER_BUSY_COUNT@GOTPAGE
Lloh26:
	ldr	x21, [x21, _REGISTER_BUSY_COUNT@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w8, LBB0_15
; %bb.11:
	mov	w20, #0
Lloh27:
	adrp	x22, _PBF_SYS_CTRL@GOTPAGE
Lloh28:
	ldr	x22, [x22, _PBF_SYS_CTRL@GOTPAGEOFF]
Lloh29:
	adrp	x23, _PBF_SYS_CTRL_READY@GOTPAGE
Lloh30:
	ldr	x23, [x23, _PBF_SYS_CTRL_READY@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2800_register_read
	str	w0, [sp, #12]
	ldr	w1, [x23]
	bl	_rt2x00_get_field32
	cbnz	x0, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	w0, #1
	bl	_msleep
	add	w20, w20, #1
	ldr	w8, [x21]
	cmp	w20, w8
	b.lo	LBB0_12
; %bb.14:
	cmp	w20, w8
	b.ne	LBB0_19
LBB0_15:
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rt2x00_err
LBB0_16:
Lloh33:
	adrp	x8, _EBUSY@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
	ldr	w8, [x21]
	cmp	w20, w8
	b.eq	LBB0_15
LBB0_19:
	mov	x0, x19
	bl	_rt2800_disable_wpdma
Lloh36:
	adrp	x8, _H2M_BBP_AGENT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _H2M_BBP_AGENT@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2800_register_write
Lloh39:
	adrp	x8, _H2M_MAILBOX_CSR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _H2M_MAILBOX_CSR@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2800_register_write
	mov	x0, x19
	bl	_rt2x00_is_usb
	cbz	x0, LBB0_21
; %bb.20:
Lloh42:
	adrp	x8, _H2M_INT_SRC@GOTPAGE
Lloh43:
	ldr	x8, [x8, _H2M_INT_SRC@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_rt2800_register_write
Lloh45:
	adrp	x8, _MCU_BOOT_SIGNAL@GOTPAGE
Lloh46:
	ldr	x8, [x8, _MCU_BOOT_SIGNAL@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_rt2800_mcu_request
LBB0_21:
	mov	w0, #1
	bl	_msleep
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_RT3290,4,2                     ; @RT3290
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_AUTOWAKEUP_CFG,4,2             ; @AUTOWAKEUP_CFG
	.comm	_RT3572,4,2                     ; @RT3572
	.comm	_RT5390,4,2                     ; @RT5390
	.comm	_RT5392,4,2                     ; @RT5392
	.comm	_AUX_CTRL,4,2                   ; @AUX_CTRL
	.comm	_AUX_CTRL_FORCE_PCIE_CLK,4,2    ; @AUX_CTRL_FORCE_PCIE_CLK
	.comm	_AUX_CTRL_WAKE_PCIE_EN,4,2      ; @AUX_CTRL_WAKE_PCIE_EN
	.comm	_PWR_PIN_CFG,4,2                ; @PWR_PIN_CFG
	.comm	_REGISTER_BUSY_COUNT,4,2        ; @REGISTER_BUSY_COUNT
	.comm	_PBF_SYS_CTRL,4,2               ; @PBF_SYS_CTRL
	.comm	_PBF_SYS_CTRL_READY,4,2         ; @PBF_SYS_CTRL_READY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PBF system register not ready\n"

	.comm	_H2M_BBP_AGENT,4,2              ; @H2M_BBP_AGENT
	.comm	_H2M_MAILBOX_CSR,4,2            ; @H2M_MAILBOX_CSR
	.comm	_H2M_INT_SRC,4,2                ; @H2M_INT_SRC
	.comm	_MCU_BOOT_SIGNAL,4,2            ; @MCU_BOOT_SIGNAL
.subsections_via_symbols
