	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smbb_charger_attr_write
_smbb_charger_attr_write:               ## @smbb_charger_attr_write
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_smbb_charger_attrs@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movl	%esi, %eax
	leaq	(%rax,%rax,4), %r12
	movl	(%r13,%r12,8), %r8d
	movl	4(%r13,%r12,8), %ecx
	cmpl	%edx, %r8d
	jb	LBB0_2
## %bb.1:
	movl	%edx, %r15d
	cmpl	%edx, %ecx
	ja	LBB0_2
## %bb.3:
	movq	32(%r13,%r12,8), %rsi
	testq	%rsi, %rsi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.4:
	movl	24(%r14), %edi
	addq	16(%r14), %rsi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	movl	16(%r13,%r12,8), %edx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_6
LBB0_2:
	movl	8(%r14), %edi
	movl	16(%r13,%r12,8), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_7:
	movl	-44(%rbp), %edi
	callq	*8(%r13,%r12,8)
	movl	%eax, -44(%rbp)
	cmpl	%r15d, %eax
	jae	LBB0_9
## %bb.8:
	movl	8(%r14), %edi
	movl	16(%r13,%r12,8), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_warn
	movl	-44(%rbp), %r15d
LBB0_9:
	movq	8(%r13,%r12,8), %rsi
	movl	%r15d, %edi
	callq	_smbb_hw_lookup
	movl	%eax, -44(%rbp)
	movl	24(%r14), %edi
	movq	24(%r13,%r12,8), %rsi
	addq	16(%r14), %rsi
	movl	%eax, %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	movl	16(%r13,%r12,8), %edx
	leaq	L_.str.3(%rip), %rsi
LBB0_6:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_11:
	leaq	8(,%r12,8), %rax
	addq	%r13, %rax
	movl	-44(%rbp), %edi
	callq	*(%rax)
	movl	%eax, %ebx
	cmpl	%r15d, %eax
	je	LBB0_13
## %bb.12:
	movl	8(%r14), %edi
	movl	16(%r13,%r12,8), %edx
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_warn
LBB0_13:
	movl	8(%r14), %edi
	movl	16(%r13,%r12,8), %edx
	leaq	L_.str.5(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_dbg
	movq	(%r14), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%ebx, (%rax,%rcx,4)
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_smbb_charger_attrs,8,3         ## @smbb_charger_attrs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"value out of range for %s [%u:%u]\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"unable to read safe value for '%s'\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s above safe value, clamping at %u\n"

L_.str.3:                               ## @.str.3
	.asciz	"unable to update %s"

L_.str.4:                               ## @.str.4
	.asciz	"%s inaccurate, rounded to %u\n"

L_.str.5:                               ## @.str.5
	.asciz	"%s <= %d\n"

	.no_dead_strip	_smbb_charger_attr_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smbb_charger_attr_write
_smbb_charger_attr_write:               ; @smbb_charger_attr_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x8, _smbb_charger_attrs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _smbb_charger_attrs@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
	mov	w23, w1
	mov	w8, #40
	umaddl	x8, w1, w8, x24
	ldp	w9, w8, [x8]
	cmp	w9, w2
	ccmp	w8, w2, #2, hs
	b.ls	LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
	mov	w10, #40
	madd	x10, x23, x10, x24
	ldr	w2, [x10, #16]
	stp	x8, x9, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_2:
	mov	x20, x2
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	x8, [x8, #32]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	w0, [x19, #24]
	ldr	x9, [x19, #16]
	add	x1, x9, x8
	add	x2, sp, #28
	bl	_regmap_read
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
	ldr	w0, [x19, #8]
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	w2, [x8, #16]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_5:
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	x8, [x8, #8]
	ldr	w0, [sp, #28]
	blr	x8
	str	w0, [sp, #28]
	cmp	w0, w20
	b.hs	LBB0_7
; %bb.6:
	mov	x3, x0
	ldr	w0, [x19, #8]
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	w2, [x8, #16]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	w20, [sp, #28]
LBB0_7:
	mov	w8, #40
	madd	x22, x23, x8, x24
	ldr	x1, [x22, #8]!
	mov	x0, x20
	bl	_smbb_hw_lookup
	mov	x2, x0
	str	w0, [sp, #28]
	ldr	w0, [x19, #24]
	ldr	x8, [x19, #16]
	ldr	x9, [x22, #16]
	add	x1, x9, x8
	bl	_regmap_write
	cbz	w0, LBB0_9
; %bb.8:
	mov	x21, x0
	ldr	w0, [x19, #8]
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	w2, [x8, #16]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_9:
	ldr	x8, [x22]
	ldr	w0, [sp, #28]
	blr	x8
	mov	x22, x0
	cmp	w0, w20
	b.eq	LBB0_11
; %bb.10:
	ldr	w0, [x19, #8]
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	w2, [x8, #16]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x3, x22
	bl	_dev_warn
LBB0_11:
	ldr	w0, [x19, #8]
	mov	w8, #40
	madd	x8, x23, x8, x24
	ldr	w2, [x8, #16]
Lloh16:
	adrp	x1, l_.str.5@PAGE
Lloh17:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x3, x22
	bl	_dev_dbg
	mov	w21, #0
	ldr	x8, [x19]
	str	w22, [x8, x23, lsl #2]
LBB0_12:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_smbb_charger_attrs,8,3         ; @smbb_charger_attrs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"value out of range for %s [%u:%u]\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"unable to read safe value for '%s'\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s above safe value, clamping at %u\n"

l_.str.3:                               ; @.str.3
	.asciz	"unable to update %s"

l_.str.4:                               ; @.str.4
	.asciz	"%s inaccurate, rounded to %u\n"

l_.str.5:                               ; @.str.5
	.asciz	"%s <= %d\n"

	.no_dead_strip	_smbb_charger_attr_write
.subsections_via_symbols
