	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function acpi_battery_read
_acpi_battery_read:                     ## @acpi_battery_read
	.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	%rdi, %rbx
	movl	(%rdi), %r15d
	movq	16(%rdi), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_7
## %bb.1:
	movl	(%rax), %edi
	movq	_SMBUS_READ_WORD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ACPI_SBS_MANAGER@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	$1, %r13d
	leaq	-44(%rbp), %r8
	movl	$1, %ecx
	callq	_acpi_smbus_read
	movl	%eax, %r14d
	movl	-44(%rbp), %eax
	movl	4(%rbx), %ecx
	testl	%r14d, %r14d
	jne	LBB0_3
## %bb.2:
	shll	%cl, %r13d
	andl	%eax, %r13d
	movl	%r13d, (%rbx)
LBB0_3:
	andl	$4095, %eax                     ## imm = 0xFFF
	addb	$12, %cl
	btsl	%ecx, %eax
	movl	%eax, -44(%rbp)
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	movq	_SMBUS_WRITE_WORD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	leaq	-44(%rbp), %r8
	movl	$1, %ecx
	movl	$2, %r9d
	callq	_acpi_smbus_write
	testl	%r14d, %r14d
	jne	LBB0_12
## %bb.4:
	movl	(%rbx), %eax
	jmp	LBB0_5
LBB0_7:
	cmpl	$0, 4(%rbx)
	movl	%r15d, %eax
	je	LBB0_8
LBB0_5:
	testl	%eax, %eax
	je	LBB0_6
## %bb.9:
	cmpl	%eax, %r15d
	jne	LBB0_10
	jmp	LBB0_11
LBB0_6:
	xorl	%r14d, %r14d
	jmp	LBB0_12
LBB0_8:
	movl	$1, (%rbx)
	movl	$1, %eax
	cmpl	%eax, %r15d
	je	LBB0_11
LBB0_10:
	movq	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	_acpi_battery_get_info
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
LBB0_11:
	movq	%rbx, %rdi
	callq	_acpi_battery_get_state
	movl	%eax, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMBUS_READ_WORD,4,2            ## @SMBUS_READ_WORD
	.comm	_ACPI_SBS_MANAGER,4,2           ## @ACPI_SBS_MANAGER
	.comm	_SMBUS_WRITE_WORD,4,2           ## @SMBUS_WRITE_WORD
	.no_dead_strip	_acpi_battery_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function acpi_battery_read
_acpi_battery_read:                     ; @acpi_battery_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	w21, [x0]
	ldr	x8, [x0, #16]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_5
; %bb.1:
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _SMBUS_READ_WORD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMBUS_READ_WORD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x22, _ACPI_SBS_MANAGER@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ACPI_SBS_MANAGER@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w23, #1
	add	x4, sp, #12
	mov	w3, #1
	bl	_acpi_smbus_read
	mov	x20, x0
	ldr	w8, [sp, #12]
	ldr	w9, [x19, #4]
	cbnz	w0, LBB0_3
; %bb.2:
	lsl	w10, w23, w9
	and	w10, w10, w8
	str	w10, [x19]
LBB0_3:
	and	w8, w8, #0xfff
	add	w9, w9, #12
	lsl	w9, w23, w9
	orr	w8, w9, w8
	str	w8, [sp, #12]
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _SMBUS_WRITE_WORD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SMBUS_WRITE_WORD@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	ldr	w2, [x22]
	add	x4, sp, #12
	mov	w3, #1
	mov	w5, #2
	bl	_acpi_smbus_write
	cbnz	w20, LBB0_12
; %bb.4:
	ldr	w8, [x19]
	b	LBB0_6
LBB0_5:
	ldr	w9, [x19, #4]
	mov	x8, x21
	cbz	w9, LBB0_9
LBB0_6:
	cbz	w8, LBB0_8
; %bb.7:
	cmp	w21, w8
	b.ne	LBB0_10
	b	LBB0_11
LBB0_8:
	mov	w20, #0
	b	LBB0_12
LBB0_9:
	mov	w8, #1
	str	w8, [x19]
	cmp	w21, w8
	b.eq	LBB0_11
LBB0_10:
	str	xzr, [x19, #8]
	mov	x0, x19
	bl	_acpi_battery_get_info
	mov	x20, x0
	cbnz	w0, LBB0_12
LBB0_11:
	mov	x0, x19
	bl	_acpi_battery_get_state
	mov	x20, x0
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SMBUS_READ_WORD,4,2            ; @SMBUS_READ_WORD
	.comm	_ACPI_SBS_MANAGER,4,2           ; @ACPI_SBS_MANAGER
	.comm	_SMBUS_WRITE_WORD,4,2           ; @SMBUS_WRITE_WORD
	.no_dead_strip	_acpi_battery_read
.subsections_via_symbols
