	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ab8500_read_sensor
_ab8500_read_sensor:                    ## @ab8500_read_sensor
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movq	(%rdi), %rbx
	movq	_BAT_CTRL@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_2
## %bb.1:
	movl	8(%rbx), %edi
	callq	_ab8500_btemp_get_batctrl_temp
	movl	%eax, (%r14)
	jmp	LBB0_7
LBB0_2:
	movq	_BTEMP_BALL@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_5
## %bb.3:
	movl	8(%rbx), %edi
	callq	_ab8500_btemp_get_temp
	movl	%eax, (%r14)
	jmp	LBB0_7
LBB0_5:
	movl	4(%rbx), %edi
	callq	_ab8500_gpadc_convert
	testl	%eax, %eax
	js	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r14, %rdx
	callq	_ab8500_voltage_to_temp
	testl	%eax, %eax
	js	LBB0_8
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BAT_CTRL,4,2                   ## @BAT_CTRL
	.comm	_BTEMP_BALL,4,2                 ## @BTEMP_BALL
	.no_dead_strip	_ab8500_read_sensor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ab8500_read_sensor
_ab8500_read_sensor:                    ; @ab8500_read_sensor
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _BAT_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BAT_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
	ldr	w0, [x20, #8]
	bl	_ab8500_btemp_get_batctrl_temp
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _BTEMP_BALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BTEMP_BALL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_7
; %bb.3:
	ldr	w0, [x20, #8]
	bl	_ab8500_btemp_get_temp
LBB0_4:
	str	w0, [x19]
LBB0_5:
	mov	w1, #0
LBB0_6:
	mov	x0, x1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w0, [x20, #4]
	bl	_ab8500_gpadc_convert
	mov	x1, x0
	tbnz	w0, #31, LBB0_6
; %bb.8:
	mov	x0, x20
	mov	x2, x19
	bl	_ab8500_voltage_to_temp
	tbz	w0, #31, LBB0_5
; %bb.9:
	mov	x1, x0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_BAT_CTRL,4,2                   ; @BAT_CTRL
	.comm	_BTEMP_BALL,4,2                 ; @BTEMP_BALL
	.no_dead_strip	_ab8500_read_sensor
.subsections_via_symbols
