	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c_adc_bat_work
_s3c_adc_bat_work:                      ## @s3c_adc_bat_work
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_main_bat@GOTPCREL(%rip), %rbx
	movl	4(%rbx), %edi
	callq	_power_supply_am_i_supplied
	movl	%eax, (%rbx)
	cmpl	_s3c_adc_bat_work.was_plugged(%rip), %eax
	jne	LBB0_1
## %bb.3:
	movq	16(%rbx), %rcx
	cmpq	$0, (%rcx)
	js	LBB0_11
## %bb.4:
	testl	%eax, %eax
	je	LBB0_11
## %bb.5:
	movq	%rbx, %rdi
	callq	_charge_finished
	movq	16(%rbx), %rcx
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	16(%rcx), %rcx
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %r14
	testq	%rcx, %rcx
	jne	LBB0_9
	jmp	LBB0_10
LBB0_1:
	movl	%eax, _s3c_adc_bat_work.was_plugged(%rip)
	movq	16(%rbx), %rcx
	testl	%eax, %eax
	je	LBB0_2
LBB0_7:
	movq	8(%rcx), %rcx
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %r14
	testq	%rcx, %rcx
	je	LBB0_10
LBB0_9:
	xorl	%eax, %eax
	callq	*%rcx
LBB0_10:
	movq	(%r14), %rax
	movq	%rax, 8(%rbx)
LBB0_11:
	movl	4(%rbx), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_power_supply_changed           ## TAILCALL
LBB0_2:
	movq	16(%rcx), %rcx
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %r14
	testq	%rcx, %rcx
	jne	LBB0_9
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_main_bat,24,3                  ## @main_bat
.zerofill __DATA,__bss,_s3c_adc_bat_work.was_plugged,4,2 ## @s3c_adc_bat_work.was_plugged
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ## @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,8,3 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,8,3   ## @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_s3c_adc_bat_work
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3c_adc_bat_work
_s3c_adc_bat_work:                      ; @s3c_adc_bat_work
	.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
Lloh0:
	adrp	x19, _main_bat@GOTPAGE
Lloh1:
	ldr	x19, [x19, _main_bat@GOTPAGEOFF]
	ldr	w0, [x19, #4]
	bl	_power_supply_am_i_supplied
	str	w0, [x19]
	adrp	x8, _s3c_adc_bat_work.was_plugged@PAGE
	ldr	w9, [x8, _s3c_adc_bat_work.was_plugged@PAGEOFF]
	cmp	w0, w9
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	tbnz	x8, #63, LBB0_9
; %bb.2:
	cbz	w0, LBB0_9
; %bb.3:
	mov	x0, x19
	bl	_charge_finished
	ldr	x8, [x19, #16]
	cbz	w0, LBB0_6
; %bb.4:
	ldr	x8, [x8, #16]
Lloh2:
	adrp	x20, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh3:
	ldr	x20, [x20, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
	cbnz	x8, LBB0_7
	b	LBB0_8
LBB0_5:
	str	w0, [x8, _s3c_adc_bat_work.was_plugged@PAGEOFF]
	ldr	x8, [x19, #16]
	cbz	w0, LBB0_10
LBB0_6:
	ldr	x8, [x8, #8]
Lloh4:
	adrp	x20, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh5:
	ldr	x20, [x20, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
	cbz	x8, LBB0_8
LBB0_7:
	blr	x8
LBB0_8:
	ldr	x8, [x20]
	str	x8, [x19, #8]
LBB0_9:
	ldr	w0, [x19, #4]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_power_supply_changed
LBB0_10:
	ldr	x8, [x8, #16]
Lloh6:
	adrp	x20, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh7:
	ldr	x20, [x20, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
	cbnz	x8, LBB0_7
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_main_bat,24,3                  ; @main_bat
.zerofill __DATA,__bss,_s3c_adc_bat_work.was_plugged,4,2 ; @s3c_adc_bat_work.was_plugged
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ; @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,8,3 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_POWER_SUPPLY_STATUS_FULL,8,3   ; @POWER_SUPPLY_STATUS_FULL
	.no_dead_strip	_s3c_adc_bat_work
.subsections_via_symbols
