	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt8973a_init_dev_type
_rt8973a_init_dev_type:                 ## @rt8973a_init_dev_type
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	12(%rdi), %edi
	movq	_RT8973A_REG_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movl	-36(%rbp), %edx
	movq	_RT8973A_REG_DEVICE_ID_VENDOR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	movq	_RT8973A_REG_DEVICE_ID_VENDOR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	movq	_RT8973A_REG_DEVICE_ID_VERSION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movq	_RT8973A_REG_DEVICE_ID_VERSION_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %edx
	movl	8(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_info
	cmpl	$0, (%r15)
	jle	LBB0_6
## %bb.4:
	movl	$20, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	cmpq	-12(%rax,%rbx), %r14
	movl	-4(%rax,%rbx), %edx
	movl	$0, %ecx
	sbbl	%ecx, %ecx
	movl	(%rax,%rbx), %esi
	xorl	-20(%rax,%rbx), %ecx
	movl	12(%r15), %edi
	callq	_regmap_update_bits
	incq	%r12
	movslq	(%r15), %rax
	addq	$24, %rbx
	cmpq	%rax, %r12
	jl	LBB0_5
LBB0_6:
	movl	12(%r15), %edi
	movq	_RT8973A_REG_CONTROL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	8(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	movl	%eax, %edx
	callq	_dev_err
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, -36(%rbp)
	je	LBB0_10
## %bb.9:
	movl	$1, 4(%r15)
	movl	8(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_RT8973A_REG_DEVICE_ID,4,2      ## @RT8973A_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read DEVICE_ID register: %d\n"

	.comm	_RT8973A_REG_DEVICE_ID_VENDOR_MASK,4,2 ## @RT8973A_REG_DEVICE_ID_VENDOR_MASK
	.comm	_RT8973A_REG_DEVICE_ID_VENDOR_SHIFT,4,2 ## @RT8973A_REG_DEVICE_ID_VENDOR_SHIFT
	.comm	_RT8973A_REG_DEVICE_ID_VERSION_MASK,4,2 ## @RT8973A_REG_DEVICE_ID_VERSION_MASK
	.comm	_RT8973A_REG_DEVICE_ID_VERSION_SHIFT,4,2 ## @RT8973A_REG_DEVICE_ID_VERSION_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Device type: version: 0x%x, vendor: 0x%x\n"

	.comm	_RT8973A_REG_CONTROL1,4,2       ## @RT8973A_REG_CONTROL1
L_.str.2:                               ## @.str.2
	.asciz	"failed to read CONTROL1 register: %d\n"

	.comm	_RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK,4,2 ## @RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK
L_.str.3:                               ## @.str.3
	.asciz	"Enable Auto-configuration for internal path\n"

	.no_dead_strip	_rt8973a_init_dev_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt8973a_init_dev_type
_rt8973a_init_dev_type:                 ; @rt8973a_init_dev_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	ldr	w0, [x0, #12]
Lloh0:
	adrp	x8, _RT8973A_REG_DEVICE_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RT8973A_REG_DEVICE_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #28
	bl	_regmap_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	w0, [x19, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_2:
	ldr	w8, [sp, #28]
Lloh5:
	adrp	x9, _RT8973A_REG_DEVICE_ID_VENDOR_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _RT8973A_REG_DEVICE_ID_VENDOR_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _RT8973A_REG_DEVICE_ID_VENDOR_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _RT8973A_REG_DEVICE_ID_VENDOR_SHIFT@GOTPAGEOFF]
	and	w9, w9, w8
Lloh10:
	ldr	w10, [x10]
	lsr	w9, w9, w10
Lloh11:
	adrp	x10, _RT8973A_REG_DEVICE_ID_VERSION_MASK@GOTPAGE
Lloh12:
	ldr	x10, [x10, _RT8973A_REG_DEVICE_ID_VERSION_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	and	w8, w10, w8
Lloh14:
	adrp	x10, _RT8973A_REG_DEVICE_ID_VERSION_SHIFT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _RT8973A_REG_DEVICE_ID_VERSION_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	lsr	w8, w8, w10
	ldr	w0, [x19, #8]
	stp	x8, x9, [sp]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x20, #0
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x20
	ldp	w2, w1, [x8, #16]
	ldr	x9, [x8, #8]
	ldr	w8, [x8]
	cmp	x9, #0
	cinv	w3, w8, ne
	ldr	w0, [x19, #12]
	bl	_regmap_update_bits
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x20, x20, #24
	cmp	x21, x8
	b.lt	LBB0_4
LBB0_5:
	ldr	w0, [x19, #12]
Lloh19:
	adrp	x8, _RT8973A_REG_CONTROL1@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RT8973A_REG_CONTROL1@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x2, sp, #28
	bl	_regmap_read
	cbz	w0, LBB0_7
; %bb.6:
	mov	x2, x0
	ldr	w0, [x19, #8]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_7:
Lloh24:
	adrp	x8, _RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [sp, #28]
	ands	w8, w9, w8
	str	w8, [sp, #28]
	b.eq	LBB0_9
; %bb.8:
	mov	w8, #1
	str	w8, [x19, #4]
	ldr	w0, [x19, #8]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
LBB0_9:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_RT8973A_REG_DEVICE_ID,4,2      ; @RT8973A_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read DEVICE_ID register: %d\n"

	.comm	_RT8973A_REG_DEVICE_ID_VENDOR_MASK,4,2 ; @RT8973A_REG_DEVICE_ID_VENDOR_MASK
	.comm	_RT8973A_REG_DEVICE_ID_VENDOR_SHIFT,4,2 ; @RT8973A_REG_DEVICE_ID_VENDOR_SHIFT
	.comm	_RT8973A_REG_DEVICE_ID_VERSION_MASK,4,2 ; @RT8973A_REG_DEVICE_ID_VERSION_MASK
	.comm	_RT8973A_REG_DEVICE_ID_VERSION_SHIFT,4,2 ; @RT8973A_REG_DEVICE_ID_VERSION_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Device type: version: 0x%x, vendor: 0x%x\n"

	.comm	_RT8973A_REG_CONTROL1,4,2       ; @RT8973A_REG_CONTROL1
l_.str.2:                               ; @.str.2
	.asciz	"failed to read CONTROL1 register: %d\n"

	.comm	_RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK,4,2 ; @RT8973A_REG_CONTROL1_AUTO_CONFIG_MASK
l_.str.3:                               ; @.str.3
	.asciz	"Enable Auto-configuration for internal path\n"

	.no_dead_strip	_rt8973a_init_dev_type
.subsections_via_symbols
