	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8xxxu_start_firmware
_rtl8xxxu_start_firmware:               ## @rtl8xxxu_start_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	%rdi, %r12
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_RTL8XXXU_FIRMWARE_POLL_MAX@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_5
## %bb.1:
	movq	_REG_MCU_FW_DL@GOTPCREL(%rip), %r14
	movq	_MCU_FW_DL_CSUM_REPORT@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_rtl8xxxu_read32
	testl	%eax, (%r13)
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	jl	LBB0_2
LBB0_5:
	cmpl	%eax, %ebx
	jne	LBB0_8
LBB0_6:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_3:
	movl	(%r15), %eax
	cmpl	%eax, %ebx
	je	LBB0_6
LBB0_8:
	movq	_REG_MCU_FW_DL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_rtl8xxxu_read32
	movq	_MCU_FW_DL_READY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_MCU_WINT_INIT_READY@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_rtl8xxxu_write32
	movq	8(%r12), %rax
	movq	%r12, %rdi
	callq	*(%rax)
	movl	(%r15), %eax
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jle	LBB0_12
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_rtl8xxxu_read32
	testl	%eax, (%r13)
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	$100, %edi
	callq	_udelay
	incl	%r14d
	movl	(%r15), %eax
	cmpl	%eax, %r14d
	jl	LBB0_9
LBB0_12:
	cmpl	%eax, %r14d
	jne	LBB0_14
LBB0_13:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_warn
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_16:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r15), %eax
	cmpl	%eax, %r14d
	je	LBB0_13
LBB0_14:
	movq	(%r12), %rax
	movq	_RTL8723B@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movq	_REG_HMTFR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$15, %edx
	callq	_rtl8xxxu_write8
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_RTL8XXXU_FIRMWARE_POLL_MAX,4,2 ## @RTL8XXXU_FIRMWARE_POLL_MAX
	.comm	_REG_MCU_FW_DL,4,2              ## @REG_MCU_FW_DL
	.comm	_MCU_FW_DL_CSUM_REPORT,4,2      ## @MCU_FW_DL_CSUM_REPORT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware checksum poll timed out\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_MCU_FW_DL_READY,4,2            ## @MCU_FW_DL_READY
	.comm	_MCU_WINT_INIT_READY,4,2        ## @MCU_WINT_INIT_READY
L_.str.1:                               ## @.str.1
	.asciz	"Firmware failed to start\n"

	.comm	_RTL8723B,8,3                   ## @RTL8723B
	.comm	_REG_HMTFR,4,2                  ## @REG_HMTFR
	.no_dead_strip	_rtl8xxxu_start_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8xxxu_start_firmware
_rtl8xxxu_start_firmware:               ; @rtl8xxxu_start_firmware
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x21, _RTL8XXXU_FIRMWARE_POLL_MAX@GOTPAGE
Lloh1:
	ldr	x21, [x21, _RTL8XXXU_FIRMWARE_POLL_MAX@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x22, _REG_MCU_FW_DL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _REG_MCU_FW_DL@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w23, #0
Lloh4:
	adrp	x24, _MCU_FW_DL_CSUM_REPORT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _MCU_FW_DL_CSUM_REPORT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtl8xxxu_read32
	ldr	w8, [x24]
	tst	w8, w0
	b.ne	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w23, w23, #1
	ldr	w8, [x21]
	cmp	w23, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	cmp	w23, w8
	b.ne	LBB0_8
LBB0_6:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_15
LBB0_7:
	ldr	w8, [x21]
	cmp	w23, w8
	b.eq	LBB0_6
LBB0_8:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtl8xxxu_read32
Lloh8:
	adrp	x8, _MCU_FW_DL_READY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MCU_FW_DL_READY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh11:
	adrp	x23, _MCU_WINT_INIT_READY@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MCU_WINT_INIT_READY@GOTPAGEOFF]
	ldr	w9, [x23]
	bic	w2, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtl8xxxu_write32
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	w24, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtl8xxxu_read32
	ldr	w8, [x23]
	tst	w8, w0
	b.ne	LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #100
	bl	_udelay
	add	w24, w24, #1
	ldr	w8, [x21]
	cmp	w24, w8
	b.lt	LBB0_10
	b	LBB0_13
LBB0_12:
	mov	w24, #0
LBB0_13:
	cmp	w24, w8
	b.ne	LBB0_17
LBB0_14:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_15:
	mov	x0, x20
	bl	_dev_warn
Lloh15:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_20
LBB0_16:
	ldr	w8, [x21]
	cmp	w24, w8
	b.eq	LBB0_14
LBB0_17:
	ldr	x8, [x19]
Lloh18:
	adrp	x9, _RTL8723B@GOTPAGE
Lloh19:
	ldr	x9, [x9, _RTL8723B@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.18:
Lloh21:
	adrp	x8, _REG_HMTFR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _REG_HMTFR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #15
	bl	_rtl8xxxu_write8
LBB0_19:
	mov	w0, #0
LBB0_20:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_RTL8XXXU_FIRMWARE_POLL_MAX,4,2 ; @RTL8XXXU_FIRMWARE_POLL_MAX
	.comm	_REG_MCU_FW_DL,4,2              ; @REG_MCU_FW_DL
	.comm	_MCU_FW_DL_CSUM_REPORT,4,2      ; @MCU_FW_DL_CSUM_REPORT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware checksum poll timed out\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_MCU_FW_DL_READY,4,2            ; @MCU_FW_DL_READY
	.comm	_MCU_WINT_INIT_READY,4,2        ; @MCU_WINT_INIT_READY
l_.str.1:                               ; @.str.1
	.asciz	"Firmware failed to start\n"

	.comm	_RTL8723B,8,3                   ; @RTL8723B
	.comm	_REG_HMTFR,4,2                  ; @REG_HMTFR
	.no_dead_strip	_rtl8xxxu_start_firmware
.subsections_via_symbols
