	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _rtl8723be_read_chip_version
__rtl8723be_read_chip_version:          ## @_rtl8723be_read_chip_version
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_rtl_priv
	movq	%rax, %r14
	movq	_VERSION_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_REG_SYS_CFG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtl_read_dword
	movq	_CHIP_8723B@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	notl	%eax
	testl	%eax, %r15d
	je	LBB0_2
## %bb.1:
	movq	_COMP_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_RT_TRACE
	movl	%ebx, %r15d
LBB0_2:
	movq	_RF_1T1R@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	_NORMAL_CHIP@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_REG_SYS_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtl_read_dword
	movq	_CHIP_VER_RTL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	andl	%eax, %ebx
	movq	_EXT_VENDOR_ID@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%r15d, %ebx
	andl	$-262144, %eax                  ## imm = 0xFFFC0000
	movl	$0, %ecx
	cmpl	$262144, %eax                   ## imm = 0x40000
	jne	LBB0_4
## %bb.3:
	movq	_CHIP_VENDOR_SMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_4:
	orl	%ecx, %ebx
	movq	_COMP_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DBG_LOUD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r14), %rax
	movq	_RF_2T2R@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %r8
	cmoveq	%rax, %r8
	leaq	L_.str.1(%rip), %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_RT_TRACE
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VERSION_UNKNOWN,4,2            ## @VERSION_UNKNOWN
	.comm	_REG_SYS_CFG1,4,2               ## @REG_SYS_CFG1
	.comm	_CHIP_8723B,4,2                 ## @CHIP_8723B
	.comm	_COMP_INIT,4,2                  ## @COMP_INIT
	.comm	_DBG_LOUD,4,2                   ## @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown chip version\n"

	.comm	_RF_1T1R,8,3                    ## @RF_1T1R
	.comm	_NORMAL_CHIP,4,2                ## @NORMAL_CHIP
	.comm	_REG_SYS_CFG,4,2                ## @REG_SYS_CFG
	.comm	_CHIP_VER_RTL_MASK,4,2          ## @CHIP_VER_RTL_MASK
	.comm	_EXT_VENDOR_ID,4,2              ## @EXT_VENDOR_ID
	.comm	_CHIP_VENDOR_SMIC,4,2           ## @CHIP_VENDOR_SMIC
L_.str.1:                               ## @.str.1
	.asciz	"Chip RF Type: %s\n"

	.comm	_RF_2T2R,8,3                    ## @RF_2T2R
L_.str.2:                               ## @.str.2
	.asciz	"RF_2T2R"

L_.str.3:                               ## @.str.3
	.asciz	"RF_1T1R"

	.no_dead_strip	__rtl8723be_read_chip_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _rtl8723be_read_chip_version
__rtl8723be_read_chip_version:          ; @_rtl8723be_read_chip_version
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	bl	_rtl_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _VERSION_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VERSION_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x8, _REG_SYS_CFG1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_SYS_CFG1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_rtl_read_dword
Lloh6:
	adrp	x8, _CHIP_8723B@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CHIP_8723B@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x21, _COMP_INIT@GOTPAGE
Lloh10:
	ldr	x21, [x21, _COMP_INIT@GOTPAGEOFF]
Lloh11:
	adrp	x22, _DBG_LOUD@GOTPAGE
Lloh12:
	ldr	x22, [x22, _DBG_LOUD@GOTPAGEOFF]
	bics	wzr, w8, w0
	b.eq	LBB0_2
; %bb.1:
	ldr	w1, [x21]
	ldr	w2, [x22]
Lloh13:
	adrp	x3, l_.str@PAGE
Lloh14:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	bl	_RT_TRACE
	mov	x8, x20
LBB0_2:
Lloh15:
	adrp	x9, _RF_1T1R@GOTPAGE
Lloh16:
	ldr	x9, [x9, _RF_1T1R@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
Lloh18:
	adrp	x10, _NORMAL_CHIP@GOTPAGE
Lloh19:
	ldr	x10, [x10, _NORMAL_CHIP@GOTPAGEOFF]
	str	x9, [x19]
Lloh20:
	ldr	w9, [x10]
	orr	w20, w9, w8
Lloh21:
	adrp	x8, _REG_SYS_CFG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _REG_SYS_CFG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtl_read_dword
Lloh24:
	adrp	x8, _CHIP_VER_RTL_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CHIP_VER_RTL_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	and	w8, w8, w0
	orr	w8, w20, w8
Lloh27:
	adrp	x9, _EXT_VENDOR_ID@GOTPAGE
Lloh28:
	ldr	x9, [x9, _EXT_VENDOR_ID@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	and	w9, w0, w9
	and	w9, w9, #0xfffc0000
Lloh30:
	adrp	x10, _CHIP_VENDOR_SMIC@GOTPAGE
Lloh31:
	ldr	x10, [x10, _CHIP_VENDOR_SMIC@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
	cmp	w9, #64, lsl #12                ; =262144
	csel	w9, w10, wzr, eq
	orr	w20, w8, w9
	ldr	w1, [x21]
	ldr	w2, [x22]
	ldr	x8, [x19]
Lloh33:
	adrp	x9, _RF_2T2R@GOTPAGE
Lloh34:
	ldr	x9, [x9, _RF_2T2R@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
Lloh36:
	adrp	x10, l_.str.3@PAGE
Lloh37:
	add	x10, x10, l_.str.3@PAGEOFF
Lloh38:
	adrp	x11, l_.str.2@PAGE
Lloh39:
	add	x11, x11, l_.str.2@PAGEOFF
	cmp	x8, x9
	csel	x8, x11, x10, eq
	str	x8, [sp]
Lloh40:
	adrp	x3, l_.str.1@PAGE
Lloh41:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_RT_TRACE
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_VERSION_UNKNOWN,4,2            ; @VERSION_UNKNOWN
	.comm	_REG_SYS_CFG1,4,2               ; @REG_SYS_CFG1
	.comm	_CHIP_8723B,4,2                 ; @CHIP_8723B
	.comm	_COMP_INIT,4,2                  ; @COMP_INIT
	.comm	_DBG_LOUD,4,2                   ; @DBG_LOUD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown chip version\n"

	.comm	_RF_1T1R,8,3                    ; @RF_1T1R
	.comm	_NORMAL_CHIP,4,2                ; @NORMAL_CHIP
	.comm	_REG_SYS_CFG,4,2                ; @REG_SYS_CFG
	.comm	_CHIP_VER_RTL_MASK,4,2          ; @CHIP_VER_RTL_MASK
	.comm	_EXT_VENDOR_ID,4,2              ; @EXT_VENDOR_ID
	.comm	_CHIP_VENDOR_SMIC,4,2           ; @CHIP_VENDOR_SMIC
l_.str.1:                               ; @.str.1
	.asciz	"Chip RF Type: %s\n"

	.comm	_RF_2T2R,8,3                    ; @RF_2T2R
l_.str.2:                               ; @.str.2
	.asciz	"RF_2T2R"

l_.str.3:                               ; @.str.3
	.asciz	"RF_1T1R"

	.no_dead_strip	__rtl8723be_read_chip_version
.subsections_via_symbols
