	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function olpc_battery_suspend
_olpc_battery_suspend:                  ## @olpc_battery_suspend
	.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
	callq	_platform_get_drvdata
	movq	%rax, %rbx
	movq	8(%rax), %rdi
	callq	_device_may_wakeup
	movq	_EC_SCI_SRC_ACPWR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	callq	_olpc_ec_wakeup_set
	jmp	LBB0_3
LBB0_2:
	callq	_olpc_ec_wakeup_clear
LBB0_3:
	movq	(%rbx), %rdi
	callq	_device_may_wakeup
	movq	_EC_SCI_SRC_BATTERY@GOTPCREL(%rip), %rcx
	movq	_EC_SCI_SRC_BATSOC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	orl	(%rcx), %edi
	movq	_EC_SCI_SRC_BATERR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	_olpc_ec_wakeup_set
	jmp	LBB0_6
LBB0_5:
	callq	_olpc_ec_wakeup_clear
LBB0_6:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_SCI_SRC_ACPWR,4,2           ## @EC_SCI_SRC_ACPWR
	.comm	_EC_SCI_SRC_BATTERY,4,2         ## @EC_SCI_SRC_BATTERY
	.comm	_EC_SCI_SRC_BATSOC,4,2          ## @EC_SCI_SRC_BATSOC
	.comm	_EC_SCI_SRC_BATERR,4,2          ## @EC_SCI_SRC_BATERR
	.no_dead_strip	_olpc_battery_suspend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function olpc_battery_suspend
_olpc_battery_suspend:                  ; @olpc_battery_suspend
	.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
	bl	_platform_get_drvdata
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_device_may_wakeup
	mov	x8, x0
Lloh0:
	adrp	x9, _EC_SCI_SRC_ACPWR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EC_SCI_SRC_ACPWR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x9]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_olpc_ec_wakeup_set
	b	LBB0_3
LBB0_2:
	bl	_olpc_ec_wakeup_clear
LBB0_3:
	ldr	x0, [x19]
	bl	_device_may_wakeup
	mov	x8, x0
Lloh3:
	adrp	x9, _EC_SCI_SRC_BATTERY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EC_SCI_SRC_BATTERY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _EC_SCI_SRC_BATSOC@GOTPAGE
Lloh7:
	ldr	x10, [x10, _EC_SCI_SRC_BATSOC@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh9:
	adrp	x10, _EC_SCI_SRC_BATERR@GOTPAGE
Lloh10:
	ldr	x10, [x10, _EC_SCI_SRC_BATERR@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w0, w9, w10
	cbz	x8, LBB0_5
; %bb.4:
	bl	_olpc_ec_wakeup_set
	b	LBB0_6
LBB0_5:
	bl	_olpc_ec_wakeup_clear
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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_SCI_SRC_ACPWR,4,2           ; @EC_SCI_SRC_ACPWR
	.comm	_EC_SCI_SRC_BATTERY,4,2         ; @EC_SCI_SRC_BATTERY
	.comm	_EC_SCI_SRC_BATSOC,4,2          ; @EC_SCI_SRC_BATSOC
	.comm	_EC_SCI_SRC_BATERR,4,2          ; @EC_SCI_SRC_BATERR
	.no_dead_strip	_olpc_battery_suspend
.subsections_via_symbols
