	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smb347_charging_set
_smb347_charging_set:                   ## @smb347_charging_set
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	_SMB347_CHG_ENABLE_SW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movl	%esi, %r14d
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%r12d, %r12d
	cmpl	%r14d, (%rbx)
	je	LBB0_5
## %bb.3:
	movl	8(%rbx), %edi
	movq	_CMD_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CMD_A_CHG_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%r14d, %r14d
	movl	%edx, %ecx
	cmovel	%r14d, %ecx
	callq	_regmap_update_bits
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	%r14d, (%rbx)
	xorl	%r12d, %r12d
LBB0_5:
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_6
LBB0_1:
	movl	12(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	xorl	%r12d, %r12d
LBB0_6:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMB347_CHG_ENABLE_SW,8,3       ## @SMB347_CHG_ENABLE_SW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"charging enable/disable in SW disabled\n"

	.comm	_CMD_A,4,2                      ## @CMD_A
	.comm	_CMD_A_CHG_ENABLED,4,2          ## @CMD_A_CHG_ENABLED
	.no_dead_strip	_smb347_charging_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smb347_charging_set
_smb347_charging_set:                   ; @smb347_charging_set
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _SMB347_CHG_ENABLE_SW@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SMB347_CHG_ENABLE_SW@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x21, x1
	add	x19, x20, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	cmp	w8, w21
	b.ne	LBB0_4
; %bb.2:
	mov	w22, #0
	b	LBB0_6
LBB0_3:
	ldr	w0, [x20, #12]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	mov	w22, #0
	b	LBB0_7
LBB0_4:
	ldr	w0, [x20, #8]
Lloh5:
	adrp	x8, _CMD_A@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CMD_A@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _CMD_A_CHG_ENABLED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CMD_A_CHG_ENABLED@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	cmp	w21, #0
	csel	w3, wzr, w2, eq
	bl	_regmap_update_bits
	mov	x22, x0
	cbnz	w0, LBB0_6
; %bb.5:
	str	w21, [x20]
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SMB347_CHG_ENABLE_SW,8,3       ; @SMB347_CHG_ENABLE_SW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"charging enable/disable in SW disabled\n"

	.comm	_CMD_A,4,2                      ; @CMD_A
	.comm	_CMD_A_CHG_ENABLED,4,2          ; @CMD_A_CHG_ENABLED
	.no_dead_strip	_smb347_charging_set
.subsections_via_symbols
