	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c_adc_bat_remove
_s3c_adc_bat_remove:                    ## @s3c_adc_bat_remove
	.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	%rdi, %rbx
	callq	_platform_get_drvdata
	movq	%rax, %r14
	movq	(%rbx), %rbx
	movq	_main_bat@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_power_supply_unregister
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_backup_bat@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_power_supply_unregister
LBB0_2:
	movq	%r14, %rdi
	callq	_s3c_adc_release
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	js	LBB0_4
## %bb.3:
	callq	_gpio_to_irq
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_free_irq
	movq	(%rbx), %rdi
	callq	_gpio_free
LBB0_4:
	movq	_bat_work@GOTPCREL(%rip), %rdi
	callq	_cancel_delayed_work
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	*%rcx
LBB0_6:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_main_bat,4,2                   ## @main_bat
	.comm	_backup_bat,4,2                 ## @backup_bat
	.comm	_bat_work,4,2                   ## @bat_work
	.no_dead_strip	_s3c_adc_bat_remove
.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_remove
_s3c_adc_bat_remove:                    ; @s3c_adc_bat_remove
	.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	x20, x0
	bl	_platform_get_drvdata
	mov	x19, x0
	ldr	x20, [x20]
Lloh0:
	adrp	x8, _main_bat@GOTPAGE
Lloh1:
	ldr	x8, [x8, _main_bat@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_power_supply_unregister
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _backup_bat@GOTPAGE
Lloh4:
	ldr	x8, [x8, _backup_bat@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_power_supply_unregister
LBB0_2:
	mov	x0, x19
	bl	_s3c_adc_release
	ldr	x0, [x20]
	tbnz	x0, #63, LBB0_4
; %bb.3:
	bl	_gpio_to_irq
	mov	x1, #0
	bl	_free_irq
	ldr	x0, [x20]
	bl	_gpio_free
LBB0_4:
Lloh6:
	adrp	x0, _bat_work@GOTPAGE
Lloh7:
	ldr	x0, [x0, _bat_work@GOTPAGEOFF]
	bl	_cancel_delayed_work
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_6
; %bb.5:
	blr	x8
LBB0_6:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_main_bat,4,2                   ; @main_bat
	.comm	_backup_bat,4,2                 ; @backup_bat
	.comm	_bat_work,4,2                   ; @bat_work
	.no_dead_strip	_s3c_adc_bat_remove
.subsections_via_symbols
