	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function download_firmware_reg_backup
_download_firmware_reg_backup:          ## @download_firmware_reg_backup
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movl	$1, (%rsi)
	movq	_REG_TXDMA_PQ_MAP@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	incq	%rsi
	movq	%rsi, 8(%rbx)
	callq	_rtw_read8
	movl	%eax, 4(%rbx)
	movq	_RTW_DMA_MAPPING_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$6, %eax
	movslq	%eax, %rdx
	movq	(%r15), %rsi
	incq	%rsi
	movq	%r14, %rdi
	callq	_rtw_write8
	movl	$1, 16(%rbx)
	movq	_REG_CR@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%rsi, 24(%rbx)
	movq	%r14, %rdi
	callq	_rtw_read8
	movl	%eax, 20(%rbx)
	movl	$4, 32(%rbx)
	movq	_REG_H2CQ_CSR@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%rax, 40(%rbx)
	movq	_BIT_H2CQ_FULL@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, 36(%rbx)
	movq	_BIT_HCI_TXDMA_EN@GOTPCREL(%rip), %rax
	movq	_BIT_TXDMA_EN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	orq	(%rax), %rdx
	movq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_rtw_write8
	movq	(%r12), %rsi
	movl	(%r13), %edx
	movq	%r14, %rdi
	callq	_rtw_write32
	movl	$2, 48(%rbx)
	movq	_REG_FIFOPAGE_INFO_1@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%rsi, 56(%rbx)
	movq	%r14, %rdi
	callq	_rtw_read16
	movl	%eax, 52(%rbx)
	movl	$4, 64(%rbx)
	movq	_REG_RQPN_CTRL_2@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	%rsi, 72(%rbx)
	movq	%r14, %rdi
	callq	_rtw_read32
	movq	_BIT_LD_RQPN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 68(%rbx)
	movq	(%r15), %rsi
	movq	%r14, %rdi
	movl	$512, %edx                      ## imm = 0x200
	callq	_rtw_write16
	movq	(%r12), %rsi
	movl	68(%rbx), %edx
	movq	%r14, %rdi
	callq	_rtw_write32
	movq	_REG_BCN_CTRL@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_rtw_read8
	movl	$1, 80(%rbx)
	movq	(%r15), %rsi
	movq	%rsi, 88(%rbx)
	movl	%eax, 84(%rbx)
	movq	_BIT_EN_BCN_FUNCTION@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	notq	%rdx
	andq	%rax, %rdx
	movq	_BIT_DIS_TSF_UDT@GOTPCREL(%rip), %rax
	orq	(%rax), %rdx
	movq	%r14, %rdi
	callq	_rtw_write8
	movq	_DLFW_RESTORE_REG_NUM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	$6, (%rax)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WARN                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_TXDMA_PQ_MAP,8,3           ## @REG_TXDMA_PQ_MAP
	.comm	_RTW_DMA_MAPPING_HIGH,4,2       ## @RTW_DMA_MAPPING_HIGH
	.comm	_REG_CR,8,3                     ## @REG_CR
	.comm	_REG_H2CQ_CSR,8,3               ## @REG_H2CQ_CSR
	.comm	_BIT_H2CQ_FULL,4,2              ## @BIT_H2CQ_FULL
	.comm	_BIT_HCI_TXDMA_EN,8,3           ## @BIT_HCI_TXDMA_EN
	.comm	_BIT_TXDMA_EN,8,3               ## @BIT_TXDMA_EN
	.comm	_REG_FIFOPAGE_INFO_1,8,3        ## @REG_FIFOPAGE_INFO_1
	.comm	_REG_RQPN_CTRL_2,8,3            ## @REG_RQPN_CTRL_2
	.comm	_BIT_LD_RQPN,4,2                ## @BIT_LD_RQPN
	.comm	_REG_BCN_CTRL,8,3               ## @REG_BCN_CTRL
	.comm	_BIT_EN_BCN_FUNCTION,8,3        ## @BIT_EN_BCN_FUNCTION
	.comm	_BIT_DIS_TSF_UDT,8,3            ## @BIT_DIS_TSF_UDT
	.comm	_DLFW_RESTORE_REG_NUM,8,3       ## @DLFW_RESTORE_REG_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong backup number\n"

	.no_dead_strip	_download_firmware_reg_backup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function download_firmware_reg_backup
_download_firmware_reg_backup:          ; @download_firmware_reg_backup
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	mov	w21, #1
	str	w21, [x1]
Lloh0:
	adrp	x22, _REG_TXDMA_PQ_MAP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _REG_TXDMA_PQ_MAP@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x1, x8, #1
	str	x1, [x20, #8]
	bl	_rtw_read8
Lloh2:
	adrp	x8, _RTW_DMA_MAPPING_HIGH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _RTW_DMA_MAPPING_HIGH@GOTPAGEOFF]
	str	w0, [x20, #4]
Lloh4:
	ldr	w8, [x8]
	lsl	w8, w8, #6
	sxtw	x2, w8
	ldr	x8, [x22]
	add	x1, x8, #1
	mov	x0, x19
	bl	_rtw_write8
	str	w21, [x20, #16]
Lloh5:
	adrp	x22, _REG_CR@GOTPAGE
Lloh6:
	ldr	x22, [x22, _REG_CR@GOTPAGEOFF]
	ldr	x1, [x22]
	str	x1, [x20, #24]
	mov	x0, x19
	bl	_rtw_read8
	str	w0, [x20, #20]
	mov	w23, #4
Lloh7:
	adrp	x24, _REG_H2CQ_CSR@GOTPAGE
Lloh8:
	ldr	x24, [x24, _REG_H2CQ_CSR@GOTPAGEOFF]
	ldr	x8, [x24]
Lloh9:
	adrp	x25, _BIT_H2CQ_FULL@GOTPAGE
Lloh10:
	ldr	x25, [x25, _BIT_H2CQ_FULL@GOTPAGEOFF]
	str	x8, [x20, #40]
	ldr	w8, [x25]
	stp	w23, w8, [x20, #32]
Lloh11:
	adrp	x8, _BIT_HCI_TXDMA_EN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BIT_HCI_TXDMA_EN@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _BIT_TXDMA_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BIT_TXDMA_EN@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	orr	x2, x9, x8
	ldr	x1, [x22]
	mov	x0, x19
	bl	_rtw_write8
	ldr	x1, [x24]
	ldr	w2, [x25]
	mov	x0, x19
	bl	_rtw_write32
	mov	w8, #2
	str	w8, [x20, #48]
Lloh17:
	adrp	x22, _REG_FIFOPAGE_INFO_1@GOTPAGE
Lloh18:
	ldr	x22, [x22, _REG_FIFOPAGE_INFO_1@GOTPAGEOFF]
	ldr	x1, [x22]
	str	x1, [x20, #56]
	mov	x0, x19
	bl	_rtw_read16
	str	w0, [x20, #52]
	str	w23, [x20, #64]
Lloh19:
	adrp	x23, _REG_RQPN_CTRL_2@GOTPAGE
Lloh20:
	ldr	x23, [x23, _REG_RQPN_CTRL_2@GOTPAGEOFF]
	ldr	x1, [x23]
	str	x1, [x20, #72]
	mov	x0, x19
	bl	_rtw_read32
Lloh21:
	adrp	x8, _BIT_LD_RQPN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BIT_LD_RQPN@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	orr	w8, w8, w0
	str	w8, [x20, #68]
	ldr	x1, [x22]
	mov	x0, x19
	mov	w2, #512
	bl	_rtw_write16
	ldr	x1, [x23]
	ldr	w2, [x20, #68]
	mov	x0, x19
	bl	_rtw_write32
Lloh24:
	adrp	x22, _REG_BCN_CTRL@GOTPAGE
Lloh25:
	ldr	x22, [x22, _REG_BCN_CTRL@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x19
	bl	_rtw_read8
	ldr	x1, [x22]
	str	x1, [x20, #88]
	stp	w21, w0, [x20, #80]
Lloh26:
	adrp	x8, _BIT_EN_BCN_FUNCTION@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BIT_EN_BCN_FUNCTION@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	bic	x8, x0, x8
Lloh29:
	adrp	x9, _BIT_DIS_TSF_UDT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _BIT_DIS_TSF_UDT@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	orr	x2, x8, x9
	mov	x0, x19
	bl	_rtw_write8
Lloh32:
	adrp	x8, _DLFW_RESTORE_REG_NUM@GOTPAGE
Lloh33:
	ldr	x8, [x8, _DLFW_RESTORE_REG_NUM@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	cmp	x8, #6
	cset	w0, ne
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_WARN
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_TXDMA_PQ_MAP,8,3           ; @REG_TXDMA_PQ_MAP
	.comm	_RTW_DMA_MAPPING_HIGH,4,2       ; @RTW_DMA_MAPPING_HIGH
	.comm	_REG_CR,8,3                     ; @REG_CR
	.comm	_REG_H2CQ_CSR,8,3               ; @REG_H2CQ_CSR
	.comm	_BIT_H2CQ_FULL,4,2              ; @BIT_H2CQ_FULL
	.comm	_BIT_HCI_TXDMA_EN,8,3           ; @BIT_HCI_TXDMA_EN
	.comm	_BIT_TXDMA_EN,8,3               ; @BIT_TXDMA_EN
	.comm	_REG_FIFOPAGE_INFO_1,8,3        ; @REG_FIFOPAGE_INFO_1
	.comm	_REG_RQPN_CTRL_2,8,3            ; @REG_RQPN_CTRL_2
	.comm	_BIT_LD_RQPN,4,2                ; @BIT_LD_RQPN
	.comm	_REG_BCN_CTRL,8,3               ; @REG_BCN_CTRL
	.comm	_BIT_EN_BCN_FUNCTION,8,3        ; @BIT_EN_BCN_FUNCTION
	.comm	_BIT_DIS_TSF_UDT,8,3            ; @BIT_DIS_TSF_UDT
	.comm	_DLFW_RESTORE_REG_NUM,8,3       ; @DLFW_RESTORE_REG_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong backup number\n"

	.no_dead_strip	_download_firmware_reg_backup
.subsections_via_symbols
