	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tpacpi_battery_store
_tpacpi_battery_store:                  ## @tpacpi_battery_store
	.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
	movq	%rdx, %rbx
	movl	%edi, %r12d
	movq	%rsi, %rdi
	callq	_to_power_supply
	movq	_battery_info@GOTPCREL(%rip), %r13
	cmpq	$0, 8(%r13)
	je	LBB0_2
## %bb.1:
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_tpacpi_battery_get_id
	movl	%eax, %r15d
	jmp	LBB0_3
LBB0_2:
	movq	_BAT_PRIMARY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_3:
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$10, %esi
	callq	_kstrtoul
	testl	%eax, %eax
	jne	LBB0_22
## %bb.4:
	cmpl	$128, %r12d
	je	LBB0_12
## %bb.5:
	cmpl	$129, %r12d
	jne	LBB0_19
## %bb.6:
	movq	(%r13), %rax
	movslq	%r15d, %rcx
	leaq	(%rcx,%rcx,2), %rbx
	cmpl	$0, 20(%rax,%rbx,8)
	je	LBB0_7
## %bb.8:
	movq	-48(%rbp), %rdx
	cmpq	$100, %rdx
	jae	LBB0_20
## %bb.9:
	cmpq	(%rax,%rbx,8), %rdx
	ja	LBB0_20
## %bb.10:
	movl	$129, %edi
	movl	%r15d, %esi
	callq	_tpacpi_battery_set
	testl	%eax, %eax
	jne	LBB0_7
## %bb.11:
	movq	-48(%rbp), %rax
	movq	(%r13), %rcx
	movq	%rax, 8(%rcx,%rbx,8)
	movl	%r14d, %eax
	jmp	LBB0_22
LBB0_12:
	movq	(%r13), %rax
	movslq	%r15d, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpl	$0, 16(%rax,%rcx,8)
	je	LBB0_7
## %bb.13:
	movq	-48(%rbp), %rdx
	leaq	-101(%rdx), %rsi
	cmpq	$-101, %rsi
	jbe	LBB0_20
## %bb.14:
	cmpq	8(%rax,%rcx,8), %rdx
	jb	LBB0_20
## %bb.15:
	movq	%rdx, (%rax,%rcx,8)
	movq	-48(%rbp), %rdx
	cmpq	$100, %rdx
	jne	LBB0_17
## %bb.16:
	movq	$0, -48(%rbp)
	xorl	%edx, %edx
LBB0_17:
	movl	$128, %edi
	movl	%r15d, %esi
	callq	_tpacpi_battery_set
	testl	%eax, %eax
	jne	LBB0_20
## %bb.18:
	movl	%r14d, %eax
	jmp	LBB0_22
LBB0_19:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	callq	_pr_crit
LBB0_20:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_21
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_21:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_battery_info,16,3              ## @battery_info
	.comm	_BAT_PRIMARY,4,2                ## @BAT_PRIMARY
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wrong parameter: %d"

	.no_dead_strip	_tpacpi_battery_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tpacpi_battery_store
_tpacpi_battery_store:                  ; @tpacpi_battery_store
	.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, x3
	mov	x22, x2
	mov	x21, x0
	mov	x0, x1
	bl	_to_power_supply
Lloh0:
	adrp	x23, _battery_info@GOTPAGE
Lloh1:
	ldr	x23, [x23, _battery_info@GOTPAGEOFF]
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_tpacpi_battery_get_id
	mov	x20, x0
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _BAT_PRIMARY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BAT_PRIMARY@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
LBB0_3:
	add	x2, sp, #8
	mov	x0, x22
	mov	w1, #10
	bl	_kstrtoul
	cbnz	w0, LBB0_22
; %bb.4:
	cmp	w21, #128
	b.eq	LBB0_11
; %bb.5:
	cmp	w21, #129
	b.ne	LBB0_18
; %bb.6:
	ldr	x8, [x23]
	mov	w9, #24
	smaddl	x9, w20, w9, x8
	ldr	w9, [x9, #20]
	cbz	w9, LBB0_20
; %bb.7:
	ldr	x2, [sp, #8]
	cmp	x2, #100
	b.hs	LBB0_19
; %bb.8:
	sxtw	x21, w20
	mov	w9, #24
	mul	x9, x21, x9
	ldr	x8, [x8, x9]
	cmp	x2, x8
	b.hi	LBB0_19
; %bb.9:
	mov	w0, #129
	mov	x1, x20
	bl	_tpacpi_battery_set
	cbnz	w0, LBB0_20
; %bb.10:
	ldr	x8, [sp, #8]
	ldr	x9, [x23]
	mov	w10, #24
	madd	x9, x21, x10, x9
	str	x8, [x9, #8]
	mov	x0, x19
	b	LBB0_22
LBB0_11:
	ldr	x8, [x23]
	mov	w9, #24
	smaddl	x9, w20, w9, x8
	ldr	w9, [x9, #16]
	cbz	w9, LBB0_20
; %bb.12:
	ldr	x9, [sp, #8]
	sub	x10, x9, #101
	cmn	x10, #101
	b.ls	LBB0_19
; %bb.13:
	mov	x10, x20
	sxtw	x10, w10
	mov	w11, #24
	madd	x11, x10, x11, x8
	ldr	x11, [x11, #8]
	cmp	x9, x11
	b.lo	LBB0_19
; %bb.14:
	mov	w11, #24
	mul	x10, x10, x11
	str	x9, [x8, x10]
	ldr	x2, [sp, #8]
	cmp	x2, #100
	b.ne	LBB0_16
; %bb.15:
	mov	x2, #0
	str	xzr, [sp, #8]
LBB0_16:
	mov	w0, #128
	mov	x1, x20
	bl	_tpacpi_battery_set
	cbnz	w0, LBB0_19
; %bb.17:
	mov	x0, x19
	b	LBB0_22
LBB0_18:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_crit
LBB0_19:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:
Lloh9:
	adrp	x8, _ENODEV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_22:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_battery_info,16,3              ; @battery_info
	.comm	_BAT_PRIMARY,4,2                ; @BAT_PRIMARY
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wrong parameter: %d"

	.no_dead_strip	_tpacpi_battery_store
.subsections_via_symbols
