	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt8973a_muic_get_cable_type
_rt8973a_muic_get_cable_type:           ## @rt8973a_muic_get_cable_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, %r14
	movl	4(%rdi), %edi
	movq	_RT8973A_REG_ADC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_11
LBB0_2:
	movl	-36(%rbp), %r15d
	movq	_RT8973A_REG_ADC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	4(%r14), %edi
	movq	_RT8973A_REG_DEV1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_11
LBB0_4:
	cmpl	$128, -36(%rbp)
	jne	LBB0_5
## %bb.6:
	movl	-40(%rbp), %eax
	movq	_RT8973A_REG_DEV1_USB_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_RT8973A_MUIC_ADC_USB@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	andl	%r15d, %r12d
	movl	%r12d, %ebx
	jmp	LBB0_11
LBB0_8:
	movq	_RT8973A_REG_DEV1_DCPORT_MASK@GOTPCREL(%rip), %rcx
	movl	$128, %ebx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.9:
	movq	_RT8973A_MUIC_ADC_TA@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RT8973A_REG_ADC,4,2            ## @RT8973A_REG_ADC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read ADC register\n"

	.comm	_RT8973A_REG_ADC_MASK,4,2       ## @RT8973A_REG_ADC_MASK
	.comm	_RT8973A_REG_DEV1,4,2           ## @RT8973A_REG_DEV1
L_.str.1:                               ## @.str.1
	.asciz	"failed to read DEV1 register\n"

	.comm	_RT8973A_REG_DEV1_USB_MASK,4,2  ## @RT8973A_REG_DEV1_USB_MASK
	.comm	_RT8973A_MUIC_ADC_USB,4,2       ## @RT8973A_MUIC_ADC_USB
	.comm	_RT8973A_REG_DEV1_DCPORT_MASK,4,2 ## @RT8973A_REG_DEV1_DCPORT_MASK
	.comm	_RT8973A_MUIC_ADC_TA,4,2        ## @RT8973A_MUIC_ADC_TA
	.no_dead_strip	_rt8973a_muic_get_cable_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt8973a_muic_get_cable_type
_rt8973a_muic_get_cable_type:           ; @rt8973a_muic_get_cable_type
	.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
	mov	x20, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _RT8973A_REG_ADC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RT8973A_REG_ADC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x19, x0
	ldr	w0, [x20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_2:
Lloh5:
	adrp	x8, _RT8973A_REG_ADC_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RT8973A_REG_ADC_MASK@GOTPAGEOFF]
	ldr	w21, [sp, #12]
Lloh7:
	ldr	w22, [x8]
	ldr	w0, [x20, #4]
Lloh8:
	adrp	x8, _RT8973A_REG_DEV1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RT8973A_REG_DEV1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_regmap_read
	cbz	w0, LBB0_4
; %bb.3:
	mov	x19, x0
	ldr	w0, [x20]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_4:
	ldr	w8, [sp, #12]
	cmp	w8, #128
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [sp, #8]
Lloh13:
	adrp	x9, _RT8973A_REG_DEV1_USB_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _RT8973A_REG_DEV1_USB_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.6:
Lloh16:
	adrp	x8, _RT8973A_MUIC_ADC_USB@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RT8973A_MUIC_ADC_USB@GOTPAGEOFF]
Lloh18:
	ldr	w19, [x8]
	b	LBB0_9
LBB0_7:
	and	w19, w22, w21
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x9, _RT8973A_REG_DEV1_DCPORT_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _RT8973A_REG_DEV1_DCPORT_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
Lloh22:
	adrp	x10, _RT8973A_MUIC_ADC_TA@GOTPAGE
Lloh23:
	ldr	x10, [x10, _RT8973A_MUIC_ADC_TA@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	tst	w9, w8
	mov	w8, #128
	csel	w19, w8, w10, eq
LBB0_9:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RT8973A_REG_ADC,4,2            ; @RT8973A_REG_ADC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read ADC register\n"

	.comm	_RT8973A_REG_ADC_MASK,4,2       ; @RT8973A_REG_ADC_MASK
	.comm	_RT8973A_REG_DEV1,4,2           ; @RT8973A_REG_DEV1
l_.str.1:                               ; @.str.1
	.asciz	"failed to read DEV1 register\n"

	.comm	_RT8973A_REG_DEV1_USB_MASK,4,2  ; @RT8973A_REG_DEV1_USB_MASK
	.comm	_RT8973A_MUIC_ADC_USB,4,2       ; @RT8973A_MUIC_ADC_USB
	.comm	_RT8973A_REG_DEV1_DCPORT_MASK,4,2 ; @RT8973A_REG_DEV1_DCPORT_MASK
	.comm	_RT8973A_MUIC_ADC_TA,4,2        ; @RT8973A_MUIC_ADC_TA
	.no_dead_strip	_rt8973a_muic_get_cable_type
.subsections_via_symbols
