	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function olpc_bat_get_charge_now
_olpc_bat_get_charge_now:               ## @olpc_bat_get_charge_now
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_EC_BAT_SOC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-20(%rbp), %rcx
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_olpc_ec_cmd
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	leaq	-16(%rbp), %rdi
	callq	_olpc_bat_get_charge_full_design
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movslq	-16(%rbp), %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	imull	-20(%rbp), %eax
	movl	%eax, (%rbx)
	xorl	%eax, %eax
LBB0_3:
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EC_BAT_SOC,4,2                 ## @EC_BAT_SOC
	.no_dead_strip	_olpc_bat_get_charge_now
.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_charge_now
_olpc_bat_get_charge_now:               ; @olpc_bat_get_charge_now
	.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_SOC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EC_BAT_SOC@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_3
; %bb.1:
	add	x0, sp, #8
	bl	_olpc_bat_get_charge_full_design
	cbnz	w0, LBB0_3
; %bb.2:
	ldp	w9, w8, [sp, #8]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mul	w8, w9, w8
	str	w8, [x19]
LBB0_3:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_EC_BAT_SOC,4,2                 ; @EC_BAT_SOC
	.no_dead_strip	_olpc_bat_get_charge_now
.subsections_via_symbols
