	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8723_download_fw            ## -- Begin function rtl8723_download_fw
	.p2align	4, 0x90
_rtl8723_download_fw:                   ## @rtl8723_download_fw
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	callq	_rtl_priv
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_hal
	movl	$1, %ebx
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.1:
	movq	%rax, %r15
	movl	%r13d, -64(%rbp)                ## 4-byte Spill
	movq	16(%rax), %r13
	testq	%r13, %r13
	je	LBB0_12
## %bb.2:
	movl	(%r15), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	4(%r13), %edi
	callq	_le16_to_cpu
	movl	%eax, 28(%r15)
	movl	8(%r13), %eax
	movl	%eax, 24(%r15)
	movq	8(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r15), %r15
	xorl	%ebx, %ebx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	setne	%bl
	movq	8(%r12), %rax
	movq	(%rax), %rax
	movq	%r13, %rdi
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	_COMP_FW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r13), %r9d
	movl	4(%r13), %r8d
	movl	$12, (%rsp)
	leaq	L_.str(%rip), %rcx
	movq	%r12, %rdi
	callq	_RT_TRACE
	addq	$48, %r15
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	addq	$-12, %r13
	jmp	LBB0_5
LBB0_3:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_5:
	leal	(%rbx,%rbx), %eax
	addl	$6, %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_REG_MCUFWDL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rtl_read_byte
	movl	%eax, %ebx
	movl	$7, %edi
	callq	_BIT
	testl	%ebx, %eax
	je	LBB0_10
## %bb.6:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	callq	_rtl8723be_firmware_selfreset
	jmp	LBB0_9
LBB0_8:
	movq	%r14, %rdi
	callq	_rtl8723ae_firmware_selfreset
LBB0_9:
	movq	_REG_MCUFWDL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rtl_write_byte
LBB0_10:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_rtl8723_enable_fw_download
	movq	%r14, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	movq	%r13, %rcx
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	callq	_rtl8723_write_fw
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_rtl8723_enable_fw_download
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	callq	_rtl8723_fw_free_to_go
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
LBB0_12:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COMP_FW,4,2                    ## @COMP_FW
	.comm	_DBG_LOUD,4,2                   ## @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware Version(%d), Signature(%#x), Size(%d)\n"

	.comm	_REG_MCUFWDL,4,2                ## @REG_MCUFWDL
L_.str.1:                               ## @.str.1
	.asciz	"Firmware is not ready to run!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl8723_download_fw            ; -- Begin function rtl8723_download_fw
	.p2align	2
_rtl8723_download_fw:                   ; @rtl8723_download_fw
	.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, x2
	mov	x20, x1
	mov	x21, x0
	bl	_rtl_priv
	mov	x22, x0
	mov	x0, x21
	bl	_rtl_priv
	bl	_rtl_hal
	ldr	x8, [x22]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x24, x0
	ldr	x27, [x0, #16]
	cbz	x27, LBB0_7
; %bb.2:
	ldr	w23, [x24]
	ldr	w0, [x27, #4]
	bl	_le16_to_cpu
	ldr	w8, [x27, #8]
	stp	w8, w0, [x24, #24]
	ldp	x24, x25, [x24, #8]
	mov	w8, #8
	mov	w9, #6
	cmp	w20, #0
	csel	w26, w9, w8, eq
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	mov	x0, x27
	blr	x8
	cbz	x0, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _COMP_FW@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COMP_FW@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _DBG_LOUD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DBG_LOUD@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	ldp	w5, w4, [x27]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x22
	mov	w6, #12
	bl	_RT_TRACE
	add	x25, x25, #48
	sub	x24, x24, #12
LBB0_4:
Lloh8:
	adrp	x28, _REG_MCUFWDL@GOTPAGE
Lloh9:
	ldr	x28, [x28, _REG_MCUFWDL@GOTPAGEOFF]
	ldr	w1, [x28]
	mov	x0, x22
	bl	_rtl_read_byte
	mov	x27, x0
	mov	w0, #7
	bl	_BIT
	tst	w0, w27
	b.eq	LBB0_10
; %bb.5:
	mov	x0, x21
	cbz	w20, LBB0_8
; %bb.6:
	bl	_rtl8723be_firmware_selfreset
	b	LBB0_9
LBB0_7:
	mov	w0, #1
	b	LBB0_12
LBB0_8:
	bl	_rtl8723ae_firmware_selfreset
LBB0_9:
	ldr	w1, [x28]
	mov	x0, x22
	mov	w2, #0
	bl	_rtl_write_byte
LBB0_10:
	mov	x0, x21
	mov	w1, #1
	bl	_rtl8723_enable_fw_download
	mov	x0, x21
	mov	x1, x23
	mov	x2, x25
	mov	x3, x24
	mov	x4, x26
	bl	_rtl8723_write_fw
	mov	x0, x21
	mov	w1, #0
	bl	_rtl8723_enable_fw_download
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_rtl8723_fw_free_to_go
	cbz	w0, LBB0_12
; %bb.11:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	mov	w0, #0
LBB0_12:
	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 AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_COMP_FW,4,2                    ; @COMP_FW
	.comm	_DBG_LOUD,4,2                   ; @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware Version(%d), Signature(%#x), Size(%d)\n"

	.comm	_REG_MCUFWDL,4,2                ; @REG_MCUFWDL
l_.str.1:                               ; @.str.1
	.asciz	"Firmware is not ready to run!\n"

.subsections_via_symbols
