	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _rtl92s_firmware_downloadcode
__rtl92s_firmware_downloadcode:         ## @_rtl92s_firmware_downloadcode
	.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
	movq	%rdx, %r15
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_rtl_priv
	movq	%rax, %r14
	movq	_MAX_FIRMWARE_CODE_SIZE@GOTPCREL(%rip), %r12
	movq	(%r12), %r13
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	__rtl92s_fw_set_rqpn
	cmpq	%r15, (%r12)
	jle	LBB0_5
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %r12
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	subq	%r14, %r12
	cmpq	%r13, %r12
	movq	%r13, %r14
	cmovlq	%r12, %r13
	movq	%r13, %rdi
	callq	_dev_alloc_skb
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r15
	cmpq	%r14, %r12
	movq	%r14, %r12
	movl	$1, %eax
	cmovlel	%eax, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_skb_reserve
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	leaq	(%rax,%r14,4), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_skb_put_data
	movq	(%r15), %rax
	movq	_TXCMD_QUEUE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	_DESC_PACKET_TYPE_INIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movl	%ebx, (%rax)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	__rtl92s_cmd_send_packet
	addq	%r13, %r14
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpq	%r15, %r14
	movq	%r12, %r13
	jl	LBB0_2
## %bb.4:
	movq	_TP_POLL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TPPOLL_CQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_rtl_write_byte
	movl	$1, %eax
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_FIRMWARE_CODE_SIZE,8,3     ## @MAX_FIRMWARE_CODE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Size over FIRMWARE_CODE_SIZE!\n"

	.comm	_TXCMD_QUEUE,4,2                ## @TXCMD_QUEUE
	.comm	_DESC_PACKET_TYPE_INIT,4,2      ## @DESC_PACKET_TYPE_INIT
	.comm	_TP_POLL,4,2                    ## @TP_POLL
	.comm	_TPPOLL_CQ,4,2                  ## @TPPOLL_CQ
	.no_dead_strip	__rtl92s_firmware_downloadcode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _rtl92s_firmware_downloadcode
__rtl92s_firmware_downloadcode:         ; @_rtl92s_firmware_downloadcode
	.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, x2
	mov	x21, x1
	mov	x22, x0
	bl	_rtl_priv
	mov	x23, x0
Lloh0:
	adrp	x20, _MAX_FIRMWARE_CODE_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MAX_FIRMWARE_CODE_SIZE@GOTPAGEOFF]
	ldr	x26, [x20]
	mov	x0, x22
	bl	__rtl92s_fw_set_rqpn
	ldr	x8, [x20]
	cmp	x8, x19
	b.le	LBB0_5
; %bb.1:
	str	x23, [sp, #8]                   ; 8-byte Folded Spill
	mov	x27, #0
	mov	w23, #0
Lloh2:
	adrp	x20, _DESC_PACKET_TYPE_INIT@GOTPAGE
Lloh3:
	ldr	x20, [x20, _DESC_PACKET_TYPE_INIT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	x28, x19, x27
	cmp	x28, x26
	csel	x24, x28, x26, lt
	mov	x0, x24
	bl	_dev_alloc_skb
	cbz	x0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x25, x0
	cmp	x28, x26
	csinc	w23, w23, wzr, gt
	mov	x1, #0
	bl	_skb_reserve
	add	x1, x21, x27, lsl #2
	mov	x0, x25
	mov	x2, x24
	bl	_skb_put_data
	ldr	x8, [x25]
Lloh4:
	adrp	x9, _TXCMD_QUEUE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _TXCMD_QUEUE@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x9]
	ldr	w9, [x20]
	stp	w9, w10, [x8, #4]
	str	w23, [x8]
	mov	x0, x22
	mov	x1, x25
	mov	x2, x23
	bl	__rtl92s_cmd_send_packet
	add	x27, x24, x27
	cmp	x27, x19
	b.lt	LBB0_2
; %bb.4:
Lloh7:
	adrp	x8, _TP_POLL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TP_POLL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x8, _TPPOLL_CQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TPPOLL_CQ@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_rtl_write_byte
	mov	w0, #1
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	mov	w0, #0
LBB0_6:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_FIRMWARE_CODE_SIZE,8,3     ; @MAX_FIRMWARE_CODE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Size over FIRMWARE_CODE_SIZE!\n"

	.comm	_TXCMD_QUEUE,4,2                ; @TXCMD_QUEUE
	.comm	_DESC_PACKET_TYPE_INIT,4,2      ; @DESC_PACKET_TYPE_INIT
	.comm	_TP_POLL,4,2                    ; @TP_POLL
	.comm	_TPPOLL_CQ,4,2                  ; @TPPOLL_CQ
	.no_dead_strip	__rtl92s_firmware_downloadcode
.subsections_via_symbols
