	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ds2760_battery_update_status
_ds2760_battery_update_status:          ## @ds2760_battery_update_status
	.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	%rdi, %rbx
	movl	(%rdi), %r14d
	callq	_ds2760_battery_read_status
	movl	(%rbx), %eax
	movq	_POWER_SUPPLY_STATUS_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movl	$0, 4(%rbx)
LBB0_2:
	movl	12(%rbx), %edi
	callq	_power_supply_am_i_supplied
	testq	%rax, %rax
	je	LBB0_13
## %bb.3:
	movl	8(%rbx), %eax
	cmpl	$10001, %eax                    ## imm = 0x2711
	jl	LBB0_5
## %bb.4:
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
LBB0_15:
	movl	%eax, (%rbx)
	movl	$0, 4(%rbx)
LBB0_16:
	cmpl	%r14d, (%rbx)
	jne	LBB0_18
## %bb.17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	12(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_power_supply_changed           ## TAILCALL
LBB0_5:
	cmpl	$-5001, %eax                    ## imm = 0xEC77
	jg	LBB0_8
## %bb.6:
	movl	(%rbx), %eax
	movq	_POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	je	LBB0_15
## %bb.7:
	movl	20(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_notice
	movl	(%r15), %eax
	jmp	LBB0_15
LBB0_8:
	cmpl	$9999, %eax                     ## imm = 0x270F
	jg	LBB0_16
## %bb.9:
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, (%rbx)
	je	LBB0_16
## %bb.10:
	movl	4(%rbx), %ecx
	leal	1(%rcx), %edx
	movl	%edx, 4(%rbx)
	testl	%ecx, %ecx
	jle	LBB0_11
## %bb.12:
	movl	%eax, (%rbx)
	movl	16(%rbx), %esi
	movq	%rbx, %rdi
	callq	_ds2760_battery_set_current_accum
	jmp	LBB0_16
LBB0_11:
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_SUPPLY_STATUS_UNKNOWN,4,2 ## @POWER_SUPPLY_STATUS_UNKNOWN
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ## @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,4,2 ## @POWER_SUPPLY_STATUS_NOT_CHARGING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"not enough power to charge\n"

	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ## @POWER_SUPPLY_STATUS_FULL
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.no_dead_strip	_ds2760_battery_update_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ds2760_battery_update_status
_ds2760_battery_update_status:          ; @ds2760_battery_update_status
	.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	x19, x0
	ldr	w20, [x0]
	bl	_ds2760_battery_read_status
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _POWER_SUPPLY_STATUS_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _POWER_SUPPLY_STATUS_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	str	wzr, [x19, #4]
LBB0_2:
	ldr	w0, [x19, #12]
	bl	_power_supply_am_i_supplied
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w8, [x19, #8]
	mov	w9, #10001
	cmp	w8, w9
	b.lt	LBB0_11
; %bb.4:
Lloh3:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	w8, [x19]
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
LBB0_6:
	str	w8, [x19]
LBB0_7:
	str	wzr, [x19, #4]
LBB0_8:
	ldr	w8, [x19]
	cmp	w8, w20
	b.ne	LBB0_10
; %bb.9:
	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
LBB0_10:
	ldr	w0, [x19, #12]
	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
	b	_power_supply_changed
LBB0_11:
	mov	w9, #-5001
	cmp	w8, w9
	b.gt	LBB0_14
; %bb.12:
	ldr	w8, [x19]
Lloh9:
	adrp	x21, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGE
Lloh10:
	ldr	x21, [x21, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.13:
	ldr	w0, [x19, #20]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_notice
	ldr	w8, [x21]
	b	LBB0_6
LBB0_14:
	mov	w9, #9999
	cmp	w8, w9
	b.gt	LBB0_8
; %bb.15:
	ldr	w9, [x19]
Lloh13:
	adrp	x8, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w9, w8
	b.eq	LBB0_8
; %bb.16:
	ldr	w9, [x19, #4]
	add	w10, w9, #1
	str	w10, [x19, #4]
	cmp	w9, #0
	b.le	LBB0_18
; %bb.17:
	str	w8, [x19]
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_ds2760_battery_set_current_accum
	b	LBB0_8
LBB0_18:
Lloh16:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	str	w8, [x19]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_SUPPLY_STATUS_UNKNOWN,4,2 ; @POWER_SUPPLY_STATUS_UNKNOWN
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ; @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,4,2 ; @POWER_SUPPLY_STATUS_NOT_CHARGING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"not enough power to charge\n"

	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ; @POWER_SUPPLY_STATUS_FULL
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.no_dead_strip	_ds2760_battery_update_status
.subsections_via_symbols
