	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function download_firmware_validate
_download_firmware_validate:            ## @download_firmware_validate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_REG_MCUFW_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FW_READY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FW_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_check_hw_ready
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_4
## %bb.1:
	movq	_REG_FW_DBG7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtw_read32
	movq	_FW_KEY_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_ILLEGAL_KEY_GROUP@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_rtw_err
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_MCUFW_CTRL,4,2             ## @REG_MCUFW_CTRL
	.comm	_FW_READY_MASK,4,2              ## @FW_READY_MASK
	.comm	_FW_READY,4,2                   ## @FW_READY
	.comm	_REG_FW_DBG7,4,2                ## @REG_FW_DBG7
	.comm	_FW_KEY_MASK,4,2                ## @FW_KEY_MASK
	.comm	_ILLEGAL_KEY_GROUP,4,2          ## @ILLEGAL_KEY_GROUP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid fw key\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_download_firmware_validate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function download_firmware_validate
_download_firmware_validate:            ; @download_firmware_validate
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _REG_MCUFW_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_MCUFW_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _FW_READY_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FW_READY_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _FW_READY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FW_READY@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	bl	_check_hw_ready
	cbz	w0, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
Lloh9:
	adrp	x8, _REG_FW_DBG7@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_FW_DBG7@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtw_read32
Lloh12:
	adrp	x8, _FW_KEY_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FW_KEY_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh15:
	adrp	x9, _ILLEGAL_KEY_GROUP@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ILLEGAL_KEY_GROUP@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rtw_err
LBB0_4:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_MCUFW_CTRL,4,2             ; @REG_MCUFW_CTRL
	.comm	_FW_READY_MASK,4,2              ; @FW_READY_MASK
	.comm	_FW_READY,4,2                   ; @FW_READY
	.comm	_REG_FW_DBG7,4,2                ; @REG_FW_DBG7
	.comm	_FW_KEY_MASK,4,2                ; @FW_KEY_MASK
	.comm	_ILLEGAL_KEY_GROUP,4,2          ; @ILLEGAL_KEY_GROUP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid fw key\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_download_firmware_validate
.subsections_via_symbols
