	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max14577_muic_get_cable_type
_max14577_muic_get_cable_type:          ## @max14577_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
	cmpl	$128, %esi
	je	LBB0_5
## %bb.1:
	movl	%esi, %eax
	cmpl	$129, %esi
	jne	LBB0_8
## %bb.2:
	movq	(%rdi), %rcx
	movq	_MAX14577_MUIC_STATUS1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_STATUS1_ADC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rcx,%rsi,4), %eax
	movq	_STATUS1_ADC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_MAX14577_MUIC_ADC_OPEN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.3:
	movl	$0, (%rdx)
	movl	8(%rdi), %eax
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rdi)
	popq	%rbp
	retq
LBB0_5:
	movq	(%rdi), %rcx
	movq	_MAX14577_MUIC_STATUS2@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_STATUS2_CHGTYP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rcx,%rsi,4), %eax
	movq	_STATUS2_CHGTYP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_MAX14577_CHARGER_TYPE_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.6:
	movl	$0, (%rdx)
	movl	12(%rdi), %eax
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rdi)
	popq	%rbp
	retq
LBB0_8:
	movl	16(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_4:
	movl	$1, (%rdx)
	movl	%eax, 8(%rdi)
	popq	%rbp
	retq
LBB0_7:
	movl	$1, (%rdx)
	movl	%eax, 12(%rdi)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX14577_MUIC_STATUS1,8,3      ## @MAX14577_MUIC_STATUS1
	.comm	_STATUS1_ADC_MASK,4,2           ## @STATUS1_ADC_MASK
	.comm	_STATUS1_ADC_SHIFT,4,2          ## @STATUS1_ADC_SHIFT
	.comm	_MAX14577_MUIC_ADC_OPEN,4,2     ## @MAX14577_MUIC_ADC_OPEN
	.comm	_MAX14577_MUIC_STATUS2,8,3      ## @MAX14577_MUIC_STATUS2
	.comm	_STATUS2_CHGTYP_MASK,4,2        ## @STATUS2_CHGTYP_MASK
	.comm	_STATUS2_CHGTYP_SHIFT,4,2       ## @STATUS2_CHGTYP_SHIFT
	.comm	_MAX14577_CHARGER_TYPE_NONE,4,2 ## @MAX14577_CHARGER_TYPE_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown cable group (%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_max14577_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 max14577_muic_get_cable_type
_max14577_muic_get_cable_type:          ; @max14577_muic_get_cable_type
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	cmp	w1, #128
	b.eq	LBB0_4
; %bb.1:
	mov	x8, x1
	cmp	w1, #129
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _MAX14577_MUIC_STATUS1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX14577_MUIC_STATUS1@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
Lloh3:
	adrp	x9, _STATUS1_ADC_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _STATUS1_ADC_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh6:
	adrp	x9, _STATUS1_ADC_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _STATUS1_ADC_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh9:
	adrp	x9, _MAX14577_MUIC_ADC_OPEN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MAX14577_MUIC_ADC_OPEN@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.ne	LBB0_7
; %bb.3:
	str	wzr, [x2]
	ldr	w8, [x0, #8]
	ldr	w9, [x9]
	str	w9, [x0, #8]
	b	LBB0_9
LBB0_4:
	ldr	x8, [x0]
Lloh11:
	adrp	x9, _MAX14577_MUIC_STATUS2@GOTPAGE
Lloh12:
	ldr	x9, [x9, _MAX14577_MUIC_STATUS2@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
Lloh14:
	adrp	x9, _STATUS2_CHGTYP_MASK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _STATUS2_CHGTYP_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh17:
	adrp	x9, _STATUS2_CHGTYP_SHIFT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _STATUS2_CHGTYP_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh20:
	adrp	x9, _MAX14577_CHARGER_TYPE_NONE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MAX14577_CHARGER_TYPE_NONE@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.ne	LBB0_8
; %bb.5:
	str	wzr, [x2]
	ldr	w8, [x0, #12]
	ldr	w9, [x9]
	str	w9, [x0, #12]
	b	LBB0_9
LBB0_6:
	ldr	w0, [x0, #16]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x8
	bl	_dev_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_9
LBB0_7:
	mov	w9, #1
	str	w9, [x2]
	str	w8, [x0, #8]
	b	LBB0_9
LBB0_8:
	mov	w9, #1
	str	w9, [x2]
	str	w8, [x0, #12]
LBB0_9:
	mov	x0, x8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX14577_MUIC_STATUS1,8,3      ; @MAX14577_MUIC_STATUS1
	.comm	_STATUS1_ADC_MASK,4,2           ; @STATUS1_ADC_MASK
	.comm	_STATUS1_ADC_SHIFT,4,2          ; @STATUS1_ADC_SHIFT
	.comm	_MAX14577_MUIC_ADC_OPEN,4,2     ; @MAX14577_MUIC_ADC_OPEN
	.comm	_MAX14577_MUIC_STATUS2,8,3      ; @MAX14577_MUIC_STATUS2
	.comm	_STATUS2_CHGTYP_MASK,4,2        ; @STATUS2_CHGTYP_MASK
	.comm	_STATUS2_CHGTYP_SHIFT,4,2       ; @STATUS2_CHGTYP_SHIFT
	.comm	_MAX14577_CHARGER_TYPE_NONE,4,2 ; @MAX14577_CHARGER_TYPE_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown cable group (%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_max14577_muic_get_cable_type
.subsections_via_symbols
