	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ab8500_fg_algorithm
_ab8500_fg_algorithm:                   ## @ab8500_fg_algorithm
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpq	$0, 24(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_ab8500_fg_algorithm_calibrate
	jmp	LBB0_5
LBB0_2:
	cmpq	$0, 16(%rbx)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_ab8500_fg_algorithm_charging
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	callq	_ab8500_fg_algorithm_discharging
LBB0_5:
	movl	80(%rbx), %edi
	movl	76(%rbx), %edx
	movl	72(%rbx), %ecx
	movl	68(%rbx), %r8d
	movl	64(%rbx), %r9d
	movl	60(%rbx), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	56(%rbx), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	52(%rbx), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	48(%rbx), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	44(%rbx), %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	40(%rbx), %r13d
	movl	36(%rbx), %r12d
	movl	32(%rbx), %r15d
	movl	12(%rbx), %r14d
	movl	8(%rbx), %r11d
	movl	(%rbx), %eax
	movl	4(%rbx), %r10d
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	pushq	%rax
	pushq	%r10
	pushq	%r11
	pushq	%r14
	pushq	16(%rbx)
	pushq	%r15
	pushq	%r12
	pushq	%r13
	pushq	-48(%rbp)                       ## 8-byte Folded Reload
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	callq	_dev_dbg
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[FG_DATA] %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n"

	.no_dead_strip	_ab8500_fg_algorithm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ab8500_fg_algorithm
_ab8500_fg_algorithm:                   ; @ab8500_fg_algorithm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_ab8500_fg_algorithm_calibrate
	b	LBB0_5
LBB0_2:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_ab8500_fg_algorithm_charging
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_ab8500_fg_algorithm_discharging
LBB0_5:
	ldp	w2, w0, [x19, #76]
	ldp	w4, w3, [x19, #68]
	ldp	w6, w5, [x19, #60]
	ldp	w8, w7, [x19, #52]
	ldp	w10, w9, [x19, #44]
	ldp	w12, w11, [x19, #36]
	ldr	w13, [x19, #32]
	ldr	x14, [x19, #16]
	ldp	w16, w15, [x19, #8]
	ldp	w1, w17, [x19]
	stp	w17, w1, [sp, #40]
	stp	w15, w16, [sp, #32]
	str	x14, [sp, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	stp	w12, w13, [sp, #16]
	stp	w10, w11, [sp, #8]
	stp	w8, w9, [sp]
	bl	_dev_dbg
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[FG_DATA] %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n"

	.no_dead_strip	_ab8500_fg_algorithm
.subsections_via_symbols
