	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_check_firmware          ## -- Begin function rt2800_check_firmware
	.p2align	4, 0x90
_rt2800_check_firmware:                 ## @rt2800_check_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	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_rt2x00_is_usb
	movl	$4096, %r15d                    ## imm = 0x1000
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	cmpq	%r14, %r15
	jne	LBB0_3
	jmp	LBB0_8
LBB0_1:
	movq	_RT3290@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	xorl	%r15d, %r15d
	testq	%rax, %rax
	sete	%r15b
	shlq	$12, %r15
	addq	$4096, %r15                     ## imm = 0x1000
	cmpq	%r14, %r15
	je	LBB0_8
LBB0_3:
	movq	%r14, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%r15
	testq	%rdx, %rdx
	je	LBB0_8
LBB0_7:
	movq	_FW_BAD_LENGTH@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_4:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_7
LBB0_8:
	movq	%r12, %rdi
	callq	_rt2x00_is_usb
	testq	%rax, %rax
	je	LBB0_17
## %bb.9:
	movq	_RT2860@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_17
## %bb.10:
	movq	_RT2872@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_17
## %bb.11:
	movq	_RT3070@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	jne	LBB0_17
## %bb.12:
	movq	%r14, %rax
	shrq	$32, %rax
	je	LBB0_13
## %bb.14:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%r15
	jmp	LBB0_15
LBB0_13:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r15d
                                        ## kill: def $eax killed $eax def $rax
LBB0_15:
	cmpq	$1, %rax
	jne	LBB0_17
## %bb.16:
	movq	_FW_BAD_VERSION@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_17:
	movq	_FW_OK@GOTPCREL(%rip), %rax
	testq	%r14, %r14
	je	LBB0_23
## %bb.18:
	leaq	(,%r15,4), %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_rt2800_check_firmware_crc
	testl	%eax, %eax
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	addq	%r15, %r12
	addq	%r13, %rbx
	cmpq	%r14, %r12
	jb	LBB0_19
## %bb.21:
	movq	_FW_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_22:
	movq	_FW_BAD_CRC@GOTPCREL(%rip), %rax
LBB0_23:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RT3290,4,2                     ## @RT3290
	.comm	_FW_BAD_LENGTH,4,2              ## @FW_BAD_LENGTH
	.comm	_RT2860,4,2                     ## @RT2860
	.comm	_RT2872,4,2                     ## @RT2872
	.comm	_RT3070,4,2                     ## @RT3070
	.comm	_FW_BAD_VERSION,4,2             ## @FW_BAD_VERSION
	.comm	_FW_BAD_CRC,4,2                 ## @FW_BAD_CRC
	.comm	_FW_OK,4,2                      ## @FW_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_check_firmware          ; -- Begin function rt2800_check_firmware
	.p2align	2
_rt2800_check_firmware:                 ; @rt2800_check_firmware
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
	bl	_rt2x00_is_usb
	cbz	x0, LBB0_2
; %bb.1:
	mov	w21, #4096
	cmp	x21, x19
	b.ne	LBB0_3
	b	LBB0_5
LBB0_2:
Lloh0:
	adrp	x8, _RT3290@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RT3290@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_rt2x00_rt
	mov	w8, #4096
	mov	w9, #8192
	cmp	x0, #0
	csel	x21, x9, x8, eq
	cmp	x21, x19
	b.eq	LBB0_5
LBB0_3:
	udiv	x8, x19, x21
	msub	x8, x8, x21, x19
	cbz	x8, LBB0_5
; %bb.4:
Lloh3:
	adrp	x22, _FW_BAD_LENGTH@GOTPAGE
Lloh4:
	ldr	x22, [x22, _FW_BAD_LENGTH@GOTPAGEOFF]
	b	LBB0_17
LBB0_5:
	mov	x0, x22
	bl	_rt2x00_is_usb
	cbz	x0, LBB0_11
; %bb.6:
Lloh5:
	adrp	x8, _RT2860@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RT2860@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_rt2x00_rt
	cbnz	x0, LBB0_11
; %bb.7:
Lloh8:
	adrp	x8, _RT2872@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RT2872@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_rt2x00_rt
	cbnz	x0, LBB0_11
; %bb.8:
Lloh11:
	adrp	x8, _RT3070@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RT3070@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_rt2x00_rt
	cbnz	x0, LBB0_11
; %bb.9:
	udiv	x8, x19, x21
	cmp	x8, #1
	b.ne	LBB0_11
; %bb.10:
Lloh14:
	adrp	x22, _FW_BAD_VERSION@GOTPAGE
Lloh15:
	ldr	x22, [x22, _FW_BAD_VERSION@GOTPAGEOFF]
	b	LBB0_17
LBB0_11:
	cbz	x19, LBB0_15
; %bb.12:
	mov	x23, #0
	lsl	x24, x21, #2
Lloh16:
	adrp	x25, _FW_BAD_CRC@GOTPAGE
Lloh17:
	ldr	x25, [x25, _FW_BAD_CRC@GOTPAGEOFF]
Lloh18:
	adrp	x22, _FW_OK@GOTPAGE
Lloh19:
	ldr	x22, [x22, _FW_OK@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_rt2800_check_firmware_crc
	cbz	w0, LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x20, x20, x24
	add	x23, x23, x21
	cmp	x23, x19
	b.lo	LBB0_13
	b	LBB0_17
LBB0_15:
Lloh20:
	adrp	x22, _FW_OK@GOTPAGE
Lloh21:
	ldr	x22, [x22, _FW_OK@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:
	mov	x22, x25
LBB0_17:
	ldr	w0, [x22]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RT3290,4,2                     ; @RT3290
	.comm	_FW_BAD_LENGTH,4,2              ; @FW_BAD_LENGTH
	.comm	_RT2860,4,2                     ; @RT2860
	.comm	_RT2872,4,2                     ; @RT2872
	.comm	_RT3070,4,2                     ; @RT3070
	.comm	_FW_BAD_VERSION,4,2             ; @FW_BAD_VERSION
	.comm	_FW_BAD_CRC,4,2                 ; @FW_BAD_CRC
	.comm	_FW_OK,4,2                      ; @FW_OK
.subsections_via_symbols
