	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9030_set_charge
_da9030_set_charge:                     ## @da9030_set_charge
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movq	_DA9030_CHRG_CHARGER_ENABLE@GOTPCREL(%rip), %rax
	movslq	(%rbx), %rcx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
	shll	$3, %ecx
	orl	(%rax), %ecx
	movl	$-4000, %eax                    ## imm = 0xF060
	addl	4(%rbx), %eax
	cltq
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$36, %rdx
	addl	%eax, %edx
	orl	%ecx, %edx
	movl	$1, %eax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
	xorl	%edx, %edx
LBB0_3:
	movl	%eax, 8(%rbx)
	movl	16(%rbx), %edi
	movq	_DA9030_CHARGE_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_da903x_write
	movl	12(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_power_supply_changed           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9030_CHRG_CHARGER_ENABLE,4,2 ## @DA9030_CHRG_CHARGER_ENABLE
	.comm	_DA9030_CHARGE_CONTROL,4,2      ## @DA9030_CHARGE_CONTROL
	.no_dead_strip	_da9030_set_charge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9030_set_charge
_da9030_set_charge:                     ; @da9030_set_charge
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cbz	w1, LBB0_2
; %bb.1:
	mov	w8, #34079
	movk	w8, #20971, lsl #16
	ldp	w9, w10, [x19]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	mul	x9, x9, x8
	lsr	x11, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w11
Lloh0:
	adrp	x11, _DA9030_CHRG_CHARGER_ENABLE@GOTPAGE
Lloh1:
	ldr	x11, [x11, _DA9030_CHRG_CHARGER_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	orr	w9, w11, w9, lsl #3
	sub	w10, w10, #4000
	smull	x8, w10, w8
	lsr	x10, x8, #63
	asr	x8, x8, #36
	add	w8, w8, w10
	orr	w2, w9, w8
	mov	w8, #1
	b	LBB0_3
LBB0_2:
	mov	w8, #0
	mov	w2, #0
LBB0_3:
	str	w8, [x19, #8]
	ldr	w0, [x19, #16]
Lloh3:
	adrp	x8, _DA9030_CHARGE_CONTROL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DA9030_CHARGE_CONTROL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_da903x_write
	ldr	w0, [x19, #12]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_power_supply_changed
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9030_CHRG_CHARGER_ENABLE,4,2 ; @DA9030_CHRG_CHARGER_ENABLE
	.comm	_DA9030_CHARGE_CONTROL,4,2      ; @DA9030_CHARGE_CONTROL
	.no_dead_strip	_da9030_set_charge
.subsections_via_symbols
