	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max77693_muic_detect_accessory
_max77693_muic_detect_accessory:        ## @max77693_muic_detect_accessory
	.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, %rbx
	callq	_mutex_lock
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	movq	_MAX77693_MUIC_REG_STATUS1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	movl	$2, %ecx
	callq	_regmap_bulk_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r14d
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
LBB0_2:
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_mutex_unlock
	jmp	LBB0_12
LBB0_3:
	movq	_MAX77693_CABLE_GROUP_ADC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_max77693_muic_get_cable_type
	cmpl	$0, -20(%rbp)
	je	LBB0_7
## %bb.4:
	movq	_MAX77693_MUIC_ADC_OPEN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rdi
	callq	_max77693_muic_adc_handler
	testl	%eax, %eax
	js	LBB0_6
LBB0_7:
	movq	_MAX77693_CABLE_GROUP_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_max77693_muic_get_cable_type
	cmpl	$0, -20(%rbp)
	je	LBB0_11
## %bb.8:
	movq	_MAX77693_CHARGER_TYPE_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_11
## %bb.9:
	movq	%rbx, %rdi
	callq	_max77693_muic_chg_handler
	testl	%eax, %eax
	js	LBB0_10
LBB0_11:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%r14d, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movl	%eax, %r14d
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_10:
	movl	%eax, %r14d
	movl	4(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX77693_MUIC_REG_STATUS1,4,2  ## @MAX77693_MUIC_REG_STATUS1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read MUIC register\n"

	.comm	_MAX77693_CABLE_GROUP_ADC,4,2   ## @MAX77693_CABLE_GROUP_ADC
	.comm	_MAX77693_MUIC_ADC_OPEN,4,2     ## @MAX77693_MUIC_ADC_OPEN
L_.str.1:                               ## @.str.1
	.asciz	"Cannot detect accessory\n"

	.comm	_MAX77693_CABLE_GROUP_CHG,4,2   ## @MAX77693_CABLE_GROUP_CHG
	.comm	_MAX77693_CHARGER_TYPE_NONE,4,2 ## @MAX77693_CHARGER_TYPE_NONE
L_.str.2:                               ## @.str.2
	.asciz	"Cannot detect charger accessory\n"

	.no_dead_strip	_max77693_muic_detect_accessory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max77693_muic_detect_accessory
_max77693_muic_detect_accessory:        ; @max77693_muic_detect_accessory
	.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
	bl	_mutex_lock
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _MAX77693_MUIC_REG_STATUS1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX77693_MUIC_REG_STATUS1@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	w3, #2
	bl	_regmap_bulk_read
	cbz	w0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	bl	_dev_err
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_10
LBB0_3:
Lloh5:
	adrp	x8, _MAX77693_CABLE_GROUP_ADC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MAX77693_CABLE_GROUP_ADC@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_max77693_muic_get_cable_type
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_6
; %bb.4:
Lloh8:
	adrp	x8, _MAX77693_MUIC_ADC_OPEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MAX77693_MUIC_ADC_OPEN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_max77693_muic_adc_handler
	tbnz	w0, #31, LBB0_11
LBB0_6:
Lloh11:
	adrp	x8, _MAX77693_CABLE_GROUP_CHG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAX77693_CABLE_GROUP_CHG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_max77693_muic_get_cable_type
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_9
; %bb.7:
Lloh14:
	adrp	x8, _MAX77693_CHARGER_TYPE_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAX77693_CHARGER_TYPE_NONE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_max77693_muic_chg_handler
	tbnz	w0, #31, LBB0_12
LBB0_9:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w20, #0
LBB0_10:
	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_11:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_12:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX77693_MUIC_REG_STATUS1,4,2  ; @MAX77693_MUIC_REG_STATUS1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read MUIC register\n"

	.comm	_MAX77693_CABLE_GROUP_ADC,4,2   ; @MAX77693_CABLE_GROUP_ADC
	.comm	_MAX77693_MUIC_ADC_OPEN,4,2     ; @MAX77693_MUIC_ADC_OPEN
l_.str.1:                               ; @.str.1
	.asciz	"Cannot detect accessory\n"

	.comm	_MAX77693_CABLE_GROUP_CHG,4,2   ; @MAX77693_CABLE_GROUP_CHG
	.comm	_MAX77693_CHARGER_TYPE_NONE,4,2 ; @MAX77693_CHARGER_TYPE_NONE
l_.str.2:                               ; @.str.2
	.asciz	"Cannot detect charger accessory\n"

	.no_dead_strip	_max77693_muic_detect_accessory
.subsections_via_symbols
