	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl92s_download_fw             ## -- Begin function rtl92s_download_fw
	.p2align	4, 0x90
_rtl92s_download_fw:                    ## @rtl92s_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_rtl_priv
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_rtl_priv
	movq	%rax, %rdi
	callq	_rtl_hal
	movl	$1, %r12d
	cmpq	$0, (%r15)
	je	LBB0_19
## %bb.1:
	movq	(%rax), %r13
	testq	%r13, %r13
	je	LBB0_19
## %bb.2:
	movq	_RT_8192S_FIRMWARE_HDR_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_FW_STATUS_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%r13)
	movq	(%r13), %rbx
	movq	%rbx, 48(%r13)
	movl	16(%rbx), %edi
	xorl	%esi, %esi
	callq	_byte
	movl	%eax, 56(%r13)
	movq	48(%r13), %rax
	movl	$1, 8(%rax)
	movq	_COMP_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	20(%rbx), %r8d
	movl	16(%rbx), %r9d
	movl	12(%rbx), %r10d
	movl	(%rbx), %r11d
	movl	4(%rbx), %eax
	subq	$8, %rsp
	leaq	L_.str(%rip), %rcx
	movq	%r15, %rdi
	pushq	%rax
	pushq	%r11
	pushq	%r10
	callq	_RT_TRACE
	addq	$32, %rsp
	movl	(%rbx), %edx
	leal	-9(%rdx), %eax
	cmpl	$-8, %eax
	jae	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %r15
	jmp	LBB0_18
LBB0_4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rbx,%rax,4), %r15
	movq	8(%r13), %rdi
	movq	%r15, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movslq	(%rbx), %rax
	movl	%eax, 16(%r13)
	movl	4(%rbx), %edx
	cmpl	$8, %edx
	jbe	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %r15
LBB0_18:
	movq	%r15, %rdi
	callq	_pr_err
	xorl	%r12d, %r12d
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	(%r15,%rax,4), %rsi
	movq	24(%r13), %rdi
	callq	_memcpy
	movl	4(%rbx), %eax
	movl	%eax, 32(%r13)
	movq	40(%r13), %rdi
	callq	__rtl92s_firmware_get_nextstatus
	movl	%eax, %ebx
	movq	_FW_STATUS_READY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_19
## %bb.7:
	leaq	L_.str.3(%rip), %r15
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$130, %ebx
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$129, %ebx
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$128, %ebx
	jne	LBB0_18
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r13), %rsi
	movl	16(%r13), %edx
	jmp	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	48(%r13), %rsi
	addq	$8, %rsi
	movq	%r14, %rdi
	callq	__rtl92s_firmwareheader_priveupdate
	movq	_RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %edx
	subl	%esi, %edx
	shlq	$2, %rsi
	addq	48(%r13), %rsi
	jmp	LBB0_14
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	24(%r13), %rsi
	movl	32(%r13), %edx
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	callq	__rtl92s_firmware_downloadcode
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	__rtl92s_firmware_checkready
	testl	%eax, %eax
	je	LBB0_17
## %bb.20:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %r12d
	movq	40(%r13), %rdi
	callq	__rtl92s_firmware_get_nextstatus
	movl	%eax, %ebx
	movq	_FW_STATUS_READY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_8
	jmp	LBB0_19
LBB0_15:
	leaq	L_.str.4(%rip), %r15
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str.5(%rip), %r15
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_RT_8192S_FIRMWARE_HDR_SIZE,4,2 ## @RT_8192S_FIRMWARE_HDR_SIZE
	.comm	_FW_STATUS_INIT,8,3             ## @FW_STATUS_INIT
	.comm	_COMP_INIT,4,2                  ## @COMP_INIT
	.comm	_DBG_LOUD,4,2                   ## @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"signature:%x, version:%x, size:%x, imemsize:%x, sram size:%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"memory for data image is less than IMEM required\n"

L_.str.2:                               ## @.str.2
	.asciz	"memory for data image is less than EMEM required\n"

	.comm	_FW_STATUS_READY,4,2            ## @FW_STATUS_READY
	.comm	_RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE,4,2 ## @RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"Unexpected Download step!!\n"

L_.str.4:                               ## @.str.4
	.asciz	"fail!\n"

L_.str.5:                               ## @.str.5
	.asciz	"rtl8192se: firmware fail!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtl92s_download_fw             ; -- Begin function rtl92s_download_fw
	.p2align	2
_rtl92s_download_fw:                    ; @rtl92s_download_fw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
	bl	_rtl_priv
	mov	x20, x0
	mov	x0, x19
	bl	_rtl_priv
	bl	_rtl_hal
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.1:
	ldr	x23, [x0]
	mov	w22, #1
	cbz	x23, LBB0_9
; %bb.2:
Lloh0:
	adrp	x8, _RT_8192S_FIRMWARE_HDR_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RT_8192S_FIRMWARE_HDR_SIZE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _FW_STATUS_INIT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FW_STATUS_INIT@GOTPAGEOFF]
Lloh4:
	ldrsw	x24, [x8]
Lloh5:
	ldr	x8, [x9]
	ldr	x21, [x23]
	stp	x8, x21, [x23, #40]
	ldr	w0, [x21, #16]
	mov	w1, #0
	bl	_byte
	str	w0, [x23, #56]
	ldr	x8, [x23, #48]
	str	w22, [x8, #8]
Lloh6:
	adrp	x8, _COMP_INIT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _COMP_INIT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _DBG_LOUD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DBG_LOUD@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	ldp	w5, w4, [x21, #16]
	ldr	w6, [x21, #12]
	ldp	w7, w8, [x21]
	str	w8, [sp]
Lloh12:
	adrp	x3, l_.str@PAGE
Lloh13:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	bl	_RT_TRACE
	ldr	w2, [x21]
	sub	w8, w2, #9
	cmn	w8, #8
	b.hs	LBB0_4
; %bb.3:
Lloh14:
	adrp	x20, l_.str.1@PAGE
Lloh15:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	add	x20, x21, x24, lsl #2
	ldr	x0, [x23, #8]
	mov	x1, x20
	bl	_memcpy
	ldp	w8, w2, [x21]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	str	w8, [x23, #16]
	cmp	w2, #8
	b.ls	LBB0_7
; %bb.5:
Lloh16:
	adrp	x20, l_.str.2@PAGE
Lloh17:
	add	x20, x20, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_pr_err
	mov	w22, #0
	b	LBB0_9
LBB0_7:
	add	x1, x20, x8, lsl #2
	ldr	x0, [x23, #24]
	bl	_memcpy
	ldr	w8, [x21, #4]
	str	w8, [x23, #32]
	ldr	x0, [x23, #40]
	bl	__rtl92s_firmware_get_nextstatus
Lloh18:
	adrp	x25, _FW_STATUS_READY@GOTPAGE
Lloh19:
	ldr	x25, [x25, _FW_STATUS_READY@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_10
LBB0_8:
	mov	w22, #1
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	mov	x21, x0
Lloh20:
	adrp	x20, l_.str.3@PAGE
Lloh21:
	add	x20, x20, l_.str.3@PAGEOFF
Lloh22:
	adrp	x28, _RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE@GOTPAGE
Lloh23:
	ldr	x28, [x28, _RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE@GOTPAGEOFF]
Lloh24:
	adrp	x26, l_.str.4@PAGE
Lloh25:
	add	x26, x26, l_.str.4@PAGEOFF
Lloh26:
	adrp	x27, l_.str.5@PAGE
Lloh27:
	add	x27, x27, l_.str.5@PAGEOFF
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	cmp	w21, #130
	b.eq	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	w21, #129
	b.eq	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	cmp	w21, #128
	b.ne	LBB0_6
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x1, [x23, #8]
	ldr	w2, [x23, #16]
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x23, #48]
	add	x1, x8, #8
	mov	x0, x19
	bl	__rtl92s_firmwareheader_priveupdate
	ldr	x8, [x23, #48]
	ldrsw	x9, [x28]
	add	x1, x8, x9, lsl #2
	sub	w2, w24, w9
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x1, [x23, #24]
	ldr	w2, [x23, #32]
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x19
	bl	__rtl92s_firmware_downloadcode
	cbz	w0, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	__rtl92s_firmware_checkready
	cbz	w0, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x22, x0
	ldr	x0, [x23, #40]
	bl	__rtl92s_firmware_get_nextstatus
	mov	x21, x0
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_11
	b	LBB0_9
LBB0_20:
	mov	x20, x26
	b	LBB0_6
LBB0_21:
	mov	x20, x27
	b	LBB0_6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RT_8192S_FIRMWARE_HDR_SIZE,4,2 ; @RT_8192S_FIRMWARE_HDR_SIZE
	.comm	_FW_STATUS_INIT,8,3             ; @FW_STATUS_INIT
	.comm	_COMP_INIT,4,2                  ; @COMP_INIT
	.comm	_DBG_LOUD,4,2                   ; @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"signature:%x, version:%x, size:%x, imemsize:%x, sram size:%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"memory for data image is less than IMEM required\n"

l_.str.2:                               ; @.str.2
	.asciz	"memory for data image is less than EMEM required\n"

	.comm	_FW_STATUS_READY,4,2            ; @FW_STATUS_READY
	.comm	_RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE,4,2 ; @RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"Unexpected Download step!!\n"

l_.str.4:                               ; @.str.4
	.asciz	"fail!\n"

l_.str.5:                               ; @.str.5
	.asciz	"rtl8192se: firmware fail!\n"

.subsections_via_symbols
