	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbs_get_battery_capacity
_sbs_get_battery_capacity:              ## @sbs_get_battery_capacity
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	_BATTERY_MODE_WATTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%edx, %edi
	callq	_power_supply_is_amp_property
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_BATTERY_MODE_AMPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_2:
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_sbs_set_battery_mode
	movq	%rax, %r12
	movq	_sbs_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r15d, %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r13, %rdi
	callq	_sbs_read_word_data
	testq	%rax, %rax
	js	LBB0_4
## %bb.3:
	movq	%rax, (%r14)
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_sbs_set_battery_mode
	movq	%rax, %rcx
	sarq	$63, %rax
	andq	%rcx, %rax
LBB0_4:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BATTERY_MODE_WATTS,4,2         ## @BATTERY_MODE_WATTS
	.comm	_BATTERY_MODE_AMPS,4,2          ## @BATTERY_MODE_AMPS
	.comm	_sbs_data,8,3                   ## @sbs_data
	.no_dead_strip	_sbs_get_battery_capacity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbs_get_battery_capacity
_sbs_get_battery_capacity:              ; @sbs_get_battery_capacity
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x3
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _BATTERY_MODE_WATTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BATTERY_MODE_WATTS@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x2
	bl	_power_supply_is_amp_property
Lloh3:
	adrp	x8, _BATTERY_MODE_AMPS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BATTERY_MODE_AMPS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w1, w21, w8, eq
	mov	x0, x20
	bl	_sbs_set_battery_mode
	mov	x21, x0
Lloh6:
	adrp	x8, _sbs_data@GOTPAGE
Lloh7:
	ldr	x8, [x8, _sbs_data@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	w1, [x8, w22, sxtw #2]
	mov	x0, x20
	bl	_sbs_read_word_data
	tbnz	x0, #63, LBB0_2
; %bb.1:
	str	x0, [x19]
	mov	x0, x20
	mov	x1, x21
	bl	_sbs_set_battery_mode
	cmp	x0, #0
	csel	x0, x0, xzr, lt
LBB0_2:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BATTERY_MODE_WATTS,4,2         ; @BATTERY_MODE_WATTS
	.comm	_BATTERY_MODE_AMPS,4,2          ; @BATTERY_MODE_AMPS
	.comm	_sbs_data,8,3                   ; @sbs_data
	.no_dead_strip	_sbs_get_battery_capacity
.subsections_via_symbols
