	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max17042_set_property
_max17042_set_property:                 ## @max17042_set_property
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %ebx
	callq	_power_supply_get_drvdata
	movq	(%rax), %r14
	cmpl	$129, %ebx
	je	LBB0_4
## %bb.1:
	cmpl	$128, %ebx
	jne	LBB0_7
## %bb.2:
	movq	_MAX17042_TALRT_Th@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movslq	(%r15), %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	movl	-28(%rbp), %edx
	movl	%edx, %ecx
	sarl	$8, %ecx
	leal	-1(%rcx), %esi
	cmpl	%ecx, %eax
	cmovll	%eax, %esi
	andl	$65280, %edx                    ## imm = 0xFF00
	addl	%esi, %edx
	jmp	LBB0_6
LBB0_4:
	movq	_MAX17042_TALRT_Th@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_8
## %bb.5:
	movslq	(%r15), %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	movzbl	-28(%rbp), %ecx
	leal	1(%rcx), %edx
	cmpl	%ecx, %eax
	cmovgl	%eax, %edx
	shll	$8, %edx
	orl	%ecx, %edx
LBB0_6:
	movl	%edx, -28(%rbp)
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_regmap_write
	jmp	LBB0_8
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX17042_TALRT_Th,4,2          ## @MAX17042_TALRT_Th
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_max17042_set_property
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max17042_set_property
_max17042_set_property:                 ; @max17042_set_property
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x21, x1
	bl	_power_supply_get_drvdata
	ldr	x19, [x0]
	cmp	w21, #129
	b.eq	LBB0_4
; %bb.1:
	cmp	w21, #128
	b.ne	LBB0_7
; %bb.2:
Lloh0:
	adrp	x21, _MAX17042_TALRT_Th@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MAX17042_TALRT_Th@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_regmap_read
	tbnz	w0, #31, LBB0_8
; %bb.3:
	ldrsw	x8, [x20]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	ldr	w10, [sp, #12]
	asr	w11, w10, #8
	sub	w12, w11, #1
	add	w8, w8, w9
	cmp	w8, w11
	csel	w8, w8, w12, lt
	and	w9, w10, #0xff00
	add	w2, w8, w9
	b	LBB0_6
LBB0_4:
Lloh2:
	adrp	x21, _MAX17042_TALRT_Th@GOTPAGE
Lloh3:
	ldr	x21, [x21, _MAX17042_TALRT_Th@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_regmap_read
	tbnz	w0, #31, LBB0_8
; %bb.5:
	ldrsw	x8, [x20]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	ldrb	w2, [sp, #12]
	add	w8, w8, w9
	cmp	w8, w2
	csinc	w8, w8, w2, gt
	bfi	w2, w8, #8, #24
LBB0_6:
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_regmap_write
	b	LBB0_8
LBB0_7:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX17042_TALRT_Th,4,2          ; @MAX17042_TALRT_Th
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_max17042_set_property
.subsections_via_symbols
