	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm5502_muic_get_cable_type
_sm5502_muic_get_cable_type:            ## @sm5502_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	movq	_SM5502_REG_ADC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_17
LBB0_3:
	movl	-20(%rbp), %edx
	movq	_SM5502_REG_ADC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	%edx, %ebx
	leal	-131(%rbx), %eax
	cmpl	$23, %eax
	jb	LBB0_17
## %bb.4:
	leal	-155(%rbx), %eax
	cmpl	$8, %eax
	jae	LBB0_5
LBB0_17:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	cmpl	$154, %ebx
	jne	LBB0_15
## %bb.6:
	movl	4(%r14), %edi
	movq	_SM5502_REG_DEV_TYPE1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_15:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_16:
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_8:
	movl	-24(%rbp), %eax
	cmpl	$130, %eax
	je	LBB0_12
## %bb.9:
	cmpl	$129, %eax
	je	LBB0_13
## %bb.10:
	cmpl	$128, %eax
	jne	LBB0_14
## %bb.11:
	movq	_SM5502_MUIC_ADC_OPEN_USB@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_17
LBB0_12:
	movq	_SM5502_MUIC_ADC_OPEN_TA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_17
LBB0_13:
	movq	_SM5502_MUIC_ADC_OPEN_USB_OTG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_17
LBB0_14:
	movl	(%r14), %edi
	movl	-20(%rbp), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_SM5502_REG_ADC,4,2             ## @SM5502_REG_ADC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read ADC register\n"

	.comm	_SM5502_REG_ADC_MASK,4,2        ## @SM5502_REG_ADC_MASK
	.comm	_SM5502_REG_DEV_TYPE1,4,2       ## @SM5502_REG_DEV_TYPE1
L_.str.1:                               ## @.str.1
	.asciz	"failed to read DEV_TYPE1 reg\n"

	.comm	_SM5502_MUIC_ADC_OPEN_USB,4,2   ## @SM5502_MUIC_ADC_OPEN_USB
	.comm	_SM5502_MUIC_ADC_OPEN_TA,4,2    ## @SM5502_MUIC_ADC_OPEN_TA
	.comm	_SM5502_MUIC_ADC_OPEN_USB_OTG,4,2 ## @SM5502_MUIC_ADC_OPEN_USB_OTG
L_.str.2:                               ## @.str.2
	.asciz	"cannot identify the cable type: adc(0x%x)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"failed to identify the cable type: adc(0x%x)\n"

	.no_dead_strip	_sm5502_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 sm5502_muic_get_cable_type
_sm5502_muic_get_cable_type:            ; @sm5502_muic_get_cable_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _SM5502_REG_ADC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SM5502_REG_ADC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _SM5502_REG_ADC_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SM5502_REG_ADC_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w20, w9, w8
	sub	w9, w20, #131
	cmp	w9, #23
	b.lo	LBB0_4
; %bb.3:
	sub	w9, w20, #155
	cmp	w9, #8
	b.hs	LBB0_5
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_5:
	cmp	w20, #154
	b.ne	LBB0_8
; %bb.6:
	ldr	w0, [x19, #4]
Lloh8:
	adrp	x8, _SM5502_REG_DEV_TYPE1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SM5502_REG_DEV_TYPE1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_regmap_read
	cbz	w0, LBB0_10
; %bb.7:
	mov	x20, x0
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_8:
	ldr	w0, [x19]
	str	x8, [sp]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_9:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_4
LBB0_10:
	ldr	w8, [sp, #8]
	cmp	w8, #130
	b.eq	LBB0_14
; %bb.11:
	cmp	w8, #129
	b.eq	LBB0_15
; %bb.12:
	cmp	w8, #128
	b.ne	LBB0_16
; %bb.13:
Lloh18:
	adrp	x8, _SM5502_MUIC_ADC_OPEN_USB@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SM5502_MUIC_ADC_OPEN_USB@GOTPAGEOFF]
Lloh20:
	ldr	w20, [x8]
	b	LBB0_4
LBB0_14:
Lloh21:
	adrp	x8, _SM5502_MUIC_ADC_OPEN_TA@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SM5502_MUIC_ADC_OPEN_TA@GOTPAGEOFF]
Lloh23:
	ldr	w20, [x8]
	b	LBB0_4
LBB0_15:
Lloh24:
	adrp	x8, _SM5502_MUIC_ADC_OPEN_USB_OTG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SM5502_MUIC_ADC_OPEN_USB_OTG@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
	b	LBB0_4
LBB0_16:
	ldr	w0, [x19]
	ldr	w2, [sp, #12]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SM5502_REG_ADC,4,2             ; @SM5502_REG_ADC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read ADC register\n"

	.comm	_SM5502_REG_ADC_MASK,4,2        ; @SM5502_REG_ADC_MASK
	.comm	_SM5502_REG_DEV_TYPE1,4,2       ; @SM5502_REG_DEV_TYPE1
l_.str.1:                               ; @.str.1
	.asciz	"failed to read DEV_TYPE1 reg\n"

	.comm	_SM5502_MUIC_ADC_OPEN_USB,4,2   ; @SM5502_MUIC_ADC_OPEN_USB
	.comm	_SM5502_MUIC_ADC_OPEN_TA,4,2    ; @SM5502_MUIC_ADC_OPEN_TA
	.comm	_SM5502_MUIC_ADC_OPEN_USB_OTG,4,2 ; @SM5502_MUIC_ADC_OPEN_USB_OTG
l_.str.2:                               ; @.str.2
	.asciz	"cannot identify the cable type: adc(0x%x)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"failed to identify the cable type: adc(0x%x)\n"

	.no_dead_strip	_sm5502_muic_get_cable_type
.subsections_via_symbols
