	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rx51_battery_read_temperature
_rx51_battery_read_temperature:         ## @rx51_battery_read_temperature
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_rx51_temp_table2@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %ebx
	decl	%ebx
	movl	4(%r15), %edi
	callq	_rx51_battery_read_adc
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	je	LBB0_3
## %bb.4:
	cmpl	$1024, %r14d                    ## imm = 0x400
	jb	LBB0_6
## %bb.5:
	movq	_INT_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_16
LBB0_1:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
LBB0_3:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_16
LBB0_6:
	movq	_rx51_temp_table1@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r14d
	jge	LBB0_7
## %bb.17:
	movq	(%r15), %rax
	movl	%r14d, %ecx
	movl	(%rax,%rcx,4), %eax
	jmp	LBB0_15
LBB0_7:
	movq	(%r12), %rax
	xorl	%ecx, %ecx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%edx, %ecx
	je	LBB0_14
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edx
	subl	%ecx, %edx
	cmpl	$2, %edx
	jl	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	leal	(%rcx,%rbx), %esi
	movl	%esi, %edx
	shrl	$31, %edx
	addl	%esi, %edx
	sarl	%edx
	movslq	%edx, %rsi
	cmpl	%r14d, (%rax,%rsi,4)
	jle	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%edx, %ebx
	movl	%ecx, %edx
	jne	LBB0_8
	jmp	LBB0_14
LBB0_9:
	movl	%ecx, %edx
LBB0_14:
	movq	_rx51_temp_table2_first@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%edx, %eax
LBB0_15:
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rx51_temp_table2,8,3           ## @rx51_temp_table2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not read ADC: %d\n"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_INT_MIN,4,2                    ## @INT_MIN
	.comm	_rx51_temp_table1,8,3           ## @rx51_temp_table1
	.comm	_rx51_temp_table2_first,4,2     ## @rx51_temp_table2_first
	.no_dead_strip	_rx51_battery_read_temperature
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rx51_battery_read_temperature
_rx51_battery_read_temperature:         ; @rx51_battery_read_temperature
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x0
Lloh0:
	adrp	x22, _rx51_temp_table2@GOTPAGE
Lloh1:
	ldr	x22, [x22, _rx51_temp_table2@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	mov	x20, x0
	ldr	w0, [x21, #4]
	bl	_rx51_battery_read_adc
	mov	x19, x0
	tbnz	w0, #31, LBB0_4
; %bb.1:
	cbz	w19, LBB0_5
; %bb.2:
	cmp	w19, #1024
	b.lo	LBB0_6
; %bb.3:
Lloh2:
	adrp	x8, _INT_MIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INT_MIN@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_4:
	ldr	w0, [x21]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_err
LBB0_5:
Lloh7:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	b	LBB0_13
LBB0_6:
Lloh10:
	adrp	x21, _rx51_temp_table1@GOTPAGE
Lloh11:
	ldr	x21, [x21, _rx51_temp_table1@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w19, w0
	b.ge	LBB0_8
; %bb.7:
	ldr	x8, [x21]
	ldr	w8, [x8, w19, uxtw #2]
	b	LBB0_12
LBB0_8:
	mov	w8, #0
	sub	w9, w20, #1
	ldr	x10, [x22]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w11, w9, w8
	cmp	w11, #2
	b.lt	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w11, w8, w9
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
	ldr	w12, [x10, w11, sxtw #2]
	cmp	w12, w19
	csel	w9, w11, w9, gt
	csel	w8, w8, w11, gt
	b.ne	LBB0_9
LBB0_11:
Lloh12:
	adrp	x9, _rx51_temp_table2_first@GOTPAGE
Lloh13:
	ldr	x9, [x9, _rx51_temp_table2_first@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	sub	w8, w9, w8
LBB0_12:
	add	w8, w8, w8, lsl #2
	lsl	w0, w8, #1
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_rx51_temp_table2,8,3           ; @rx51_temp_table2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not read ADC: %d\n"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_INT_MIN,4,2                    ; @INT_MIN
	.comm	_rx51_temp_table1,8,3           ; @rx51_temp_table1
	.comm	_rx51_temp_table2_first,4,2     ; @rx51_temp_table2_first
	.no_dead_strip	_rx51_battery_read_temperature
.subsections_via_symbols
