	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbs_get_ti_battery_presence_and_health
_sbs_get_ti_battery_presence_and_health: ## @sbs_get_ti_battery_presence_and_health
	.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	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_sbs_data@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_REG_MANUFACTURER_DATA@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	8(%rax,%rcx,4), %esi
	movq	_MANUFACTURER_ACCESS_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_sbs_write_word_data
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movq	(%r12), %rax
	movq	(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	8(%rax,%rcx,4), %esi
	movq	%rbx, %rdi
	callq	_sbs_read_word_data
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movq	(%r12), %rcx
	movq	(%r13), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	(%rcx,%rdx,4), %eax
	jl	LBB0_6
## %bb.3:
	cmpl	4(%rcx,%rdx,4), %eax
	jg	LBB0_6
## %bb.4:
	shrl	$8, %eax
	movl	%eax, %ecx
	andl	$15, %ecx
	movq	_POWER_SUPPLY_PROP_PRESENT@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_11
## %bb.5:
	cmpl	$15, %ecx
	jne	LBB0_16
LBB0_6:
	movl	$0, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	movq	_POWER_SUPPLY_PROP_PRESENT@GOTPCREL(%rip), %rcx
	cmpl	%r15d, (%rcx)
	jne	LBB0_10
## %bb.9:
	movl	$0, (%r14)
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_POWER_SUPPLY_PROP_HEALTH@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpl	%r15d, (%rdx)
	jne	LBB0_10
## %bb.12:
	cmpl	$12, %ecx
	je	LBB0_17
## %bb.13:
	cmpl	$11, %ecx
	je	LBB0_18
## %bb.14:
	cmpl	$9, %ecx
	jne	LBB0_19
## %bb.15:
	movq	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPCREL(%rip), %rcx
	jmp	LBB0_20
LBB0_16:
	movl	$1, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_17:
	movq	_POWER_SUPPLY_HEALTH_DEAD@GOTPCREL(%rip), %rcx
	jmp	LBB0_20
LBB0_18:
	movq	_POWER_SUPPLY_HEALTH_OVERHEAT@GOTPCREL(%rip), %rcx
	jmp	LBB0_20
LBB0_19:
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rcx
LBB0_20:
	movl	(%rcx), %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_sbs_data,8,3                   ## @sbs_data
	.comm	_REG_MANUFACTURER_DATA,8,3      ## @REG_MANUFACTURER_DATA
	.comm	_MANUFACTURER_ACCESS_STATUS,4,2 ## @MANUFACTURER_ACCESS_STATUS
	.comm	_POWER_SUPPLY_PROP_PRESENT,4,2  ## @POWER_SUPPLY_PROP_PRESENT
	.comm	_POWER_SUPPLY_PROP_HEALTH,4,2   ## @POWER_SUPPLY_PROP_HEALTH
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,4,2 ## @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ## @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ## @POWER_SUPPLY_HEALTH_DEAD
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ## @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_sbs_get_ti_battery_presence_and_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbs_get_ti_battery_presence_and_health
_sbs_get_ti_battery_presence_and_health: ; @sbs_get_ti_battery_presence_and_health
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x22, _sbs_data@GOTPAGE
Lloh1:
	ldr	x22, [x22, _sbs_data@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh2:
	adrp	x23, _REG_MANUFACTURER_DATA@GOTPAGE
Lloh3:
	ldr	x23, [x23, _REG_MANUFACTURER_DATA@GOTPAGEOFF]
	ldr	x9, [x23]
	mov	w10, #12
	madd	x8, x9, x10, x8
	ldr	w1, [x8, #8]
Lloh4:
	adrp	x8, _MANUFACTURER_ACCESS_STATUS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MANUFACTURER_ACCESS_STATUS@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	bl	_sbs_write_word_data
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldr	x8, [x22]
	ldr	x9, [x23]
	mov	w10, #12
	madd	x8, x9, x10, x8
	ldr	w1, [x8, #8]
	mov	x0, x21
	bl	_sbs_read_word_data
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	x8, [x22]
	ldr	x9, [x23]
	mov	w10, #12
	mul	x10, x9, x10
	ldr	w10, [x8, x10]
	cmp	w0, w10
	b.lt	LBB0_6
; %bb.3:
	mov	w10, #12
	madd	x8, x9, x10, x8
	ldr	w8, [x8, #4]
	cmp	w0, w8
	b.gt	LBB0_6
; %bb.4:
	ubfx	w8, w0, #8, #4
Lloh7:
	adrp	x9, _POWER_SUPPLY_PROP_PRESENT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _POWER_SUPPLY_PROP_PRESENT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w9, w20
	b.ne	LBB0_10
; %bb.5:
	cmp	w8, #15
	b.ne	LBB0_15
LBB0_6:
	mov	w0, #0
	str	wzr, [x19]
	b	LBB0_9
LBB0_7:
Lloh10:
	adrp	x8, _POWER_SUPPLY_PROP_PRESENT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _POWER_SUPPLY_PROP_PRESENT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_9
; %bb.8:
	str	wzr, [x19]
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh13:
	adrp	x9, _POWER_SUPPLY_PROP_HEALTH@GOTPAGE
Lloh14:
	ldr	x9, [x9, _POWER_SUPPLY_PROP_HEALTH@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	cmp	w9, w20
	b.ne	LBB0_16
; %bb.11:
	cmp	w8, #12
	b.eq	LBB0_17
; %bb.12:
	cmp	w8, #11
	b.eq	LBB0_18
; %bb.13:
	cmp	w8, #9
	b.ne	LBB0_19
; %bb.14:
	mov	w0, #0
Lloh16:
	adrp	x8, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_UNSPEC_FAILURE@GOTPAGEOFF]
	b	LBB0_20
LBB0_15:
	mov	w0, #0
	mov	w8, #1
	b	LBB0_21
LBB0_16:
	mov	w0, #0
	b	LBB0_9
LBB0_17:
	mov	w0, #0
Lloh18:
	adrp	x8, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGEOFF]
	b	LBB0_20
LBB0_18:
	mov	w0, #0
Lloh20:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
	mov	w0, #0
Lloh22:
	adrp	x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh23:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
LBB0_21:
	str	w8, [x19]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_sbs_data,8,3                   ; @sbs_data
	.comm	_REG_MANUFACTURER_DATA,8,3      ; @REG_MANUFACTURER_DATA
	.comm	_MANUFACTURER_ACCESS_STATUS,4,2 ; @MANUFACTURER_ACCESS_STATUS
	.comm	_POWER_SUPPLY_PROP_PRESENT,4,2  ; @POWER_SUPPLY_PROP_PRESENT
	.comm	_POWER_SUPPLY_PROP_HEALTH,4,2   ; @POWER_SUPPLY_PROP_HEALTH
	.comm	_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,4,2 ; @POWER_SUPPLY_HEALTH_UNSPEC_FAILURE
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ; @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ; @POWER_SUPPLY_HEALTH_DEAD
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ; @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_sbs_get_ti_battery_presence_and_health
.subsections_via_symbols
