	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function olpc_bat_get_health
_olpc_bat_get_health:                   ## @olpc_bat_get_health
	.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
	movq	_EC_BAT_ERRCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-12(%rbp), %rcx
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_olpc_ec_cmd
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movl	-12(%rbp), %eax
	cmpl	$129, %eax
	jle	LBB0_2
## %bb.10:
	addl	$-130, %eax
	cmpl	$4, %eax
	jae	LBB0_11
## %bb.9:
	movq	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$128, %eax
	je	LBB0_8
## %bb.4:
	cmpl	$129, %eax
	jne	LBB0_11
## %bb.5:
	movq	_POWER_SUPPLY_HEALTH_OVERHEAT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_11:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_8:
	movq	_POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	xorl	%eax, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_BAT_ERRCODE,4,2             ## @EC_BAT_ERRCODE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ## @POWER_SUPPLY_HEALTH_GOOD
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ## @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ## @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,4,2 ## @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_olpc_bat_get_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function olpc_bat_get_health
_olpc_bat_get_health:                   ; @olpc_bat_get_health
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _EC_BAT_ERRCODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EC_BAT_ERRCODE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x3, sp, #12
	mov	x1, #0
	mov	w2, #0
	mov	w4, #1
	bl	_olpc_ec_cmd
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	w8, [sp, #12]
	cmp	w8, #129
	b.le	LBB0_4
; %bb.2:
	sub	w8, w8, #130
	cmp	w8, #4
	b.hs	LBB0_9
; %bb.3:
	mov	w0, #0
Lloh3:
	adrp	x8, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	cbz	w8, LBB0_8
; %bb.5:
	cmp	w8, #128
	b.eq	LBB0_10
; %bb.6:
	cmp	w8, #129
	b.ne	LBB0_9
; %bb.7:
	mov	w0, #0
Lloh5:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
	mov	w0, #0
Lloh7:
	adrp	x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	w0, #0
Lloh12:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_BAT_ERRCODE,4,2             ; @EC_BAT_ERRCODE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ; @POWER_SUPPLY_HEALTH_GOOD
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ; @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ; @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,4,2 ; @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_olpc_bat_get_health
.subsections_via_symbols
