	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function measure_temp
_measure_temp:                          ## @measure_temp
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movq	_PM860X_TEMP_TINT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	_PM8607_TINT_MEAS1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_measure_12bit_voltage
	testl	%eax, %eax
	jne	LBB0_21
## %bb.2:
	imull	$1000, (%r14), %eax             ## imm = 0x3E8
	addl	$-884000, %eax                  ## imm = 0xFFF282E0
	cltq
	imulq	$38061189, %rax, %rbx           ## imm = 0x244C485
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$37, %rbx
	addl	%eax, %ebx
	jmp	LBB0_20
LBB0_3:
	movq	_PM8607_GPADC1_MEAS1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_measure_12bit_voltage
	testl	%eax, %eax
	jne	LBB0_21
## %bb.4:
	imull	$1000, (%r14), %eax             ## imm = 0x3E8
	movq	_GPBIAS2_GPADC1_UA@GOTPCREL(%rip), %rsi
	cltd
	idivl	(%rsi)
	movl	%eax, (%r14)
	movq	_TBAT_NEG_25D@GOTPCREL(%rip), %rdx
	movq	_TBAT_NEG_10D@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	(%rdx), %eax
	jle	LBB0_6
## %bb.5:
	imull	(%rsi), %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$-30, %ebx
	xorl	%esi, %esi
	jmp	LBB0_19
LBB0_6:
	cmpl	%ecx, %eax
	jle	LBB0_8
## %bb.7:
	imull	(%rsi), %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$-15, %ebx
	xorl	%esi, %esi
	jmp	LBB0_19
LBB0_8:
	movq	_TBAT_0D@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jle	LBB0_10
## %bb.9:
	movl	(%rsi), %eax
	imull	%eax, %ecx
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	movq	_TBAT_40D@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	cltq
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$-5, %ebx
	jmp	LBB0_19
LBB0_10:
	movq	_TBAT_10D@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jle	LBB0_12
## %bb.11:
	movl	(%rsi), %eax
	imull	%eax, %ecx
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	movq	_TBAT_40D@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	cltq
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$5, %ebx
	jmp	LBB0_19
LBB0_12:
	movq	_TBAT_20D@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jle	LBB0_14
## %bb.13:
	movl	(%rsi), %eax
	imull	%eax, %ecx
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	movq	_TBAT_40D@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	cltq
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$15, %ebx
	jmp	LBB0_19
LBB0_14:
	movq	_TBAT_30D@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jle	LBB0_16
## %bb.15:
	movl	(%rsi), %eax
	imull	%eax, %ecx
	movslq	%ecx, %rcx
	imulq	$274877907, %rcx, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rcx
	shrq	$63, %rcx
	sarq	$38, %rsi
	addl	%ecx, %esi
	movq	_TBAT_40D@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	cltq
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$25, %ebx
	jmp	LBB0_19
LBB0_16:
	movq	_TBAT_40D@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	(%rsi), %edi
	cmpl	%edx, %eax
	jle	LBB0_18
## %bb.17:
	imull	%edi, %ecx
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	imull	%edi, %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	movl	$35, %ebx
	jmp	LBB0_19
LBB0_18:
	imull	%edx, %edi
	movslq	%edi, %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	movl	$45, %ebx
	xorl	%edx, %edx
LBB0_19:
	movq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_set_temp_threshold
	movl	8(%r15), %edi
	movl	(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
LBB0_20:
	movl	%ebx, (%r14)
	xorl	%eax, %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PM860X_TEMP_TINT,8,3           ## @PM860X_TEMP_TINT
	.comm	_PM8607_TINT_MEAS1,4,2          ## @PM8607_TINT_MEAS1
	.comm	_PM8607_GPADC1_MEAS1,4,2        ## @PM8607_GPADC1_MEAS1
	.comm	_GPBIAS2_GPADC1_UA,4,2          ## @GPBIAS2_GPADC1_UA
	.comm	_TBAT_NEG_25D,4,2               ## @TBAT_NEG_25D
	.comm	_TBAT_NEG_10D,4,2               ## @TBAT_NEG_10D
	.comm	_TBAT_0D,4,2                    ## @TBAT_0D
	.comm	_TBAT_40D,4,2                   ## @TBAT_40D
	.comm	_TBAT_10D,4,2                   ## @TBAT_10D
	.comm	_TBAT_20D,4,2                   ## @TBAT_20D
	.comm	_TBAT_30D,4,2                   ## @TBAT_30D
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"temp_C:%d C,temp_mv:%d mv\n"

	.no_dead_strip	_measure_temp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function measure_temp
_measure_temp:                          ; @measure_temp
	.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	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PM860X_TEMP_TINT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PM860X_TEMP_TINT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _PM8607_TINT_MEAS1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PM8607_TINT_MEAS1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	bl	_measure_12bit_voltage
	cbnz	w0, LBB0_19
; %bb.2:
	ldr	w8, [x19]
	mov	w9, #1000
	mov	w10, #33504
	movk	w10, #65522, lsl #16
	madd	w8, w8, w9, w10
	mov	w9, #50309
	movk	w9, #580, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w21, w8, w9
	b	LBB0_18
LBB0_3:
Lloh6:
	adrp	x8, _PM8607_GPADC1_MEAS1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PM8607_GPADC1_MEAS1@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	bl	_measure_12bit_voltage
	cbnz	w0, LBB0_19
; %bb.4:
	ldr	w8, [x19]
	mov	w9, #1000
	mul	w8, w8, w9
Lloh9:
	adrp	x10, _GPBIAS2_GPADC1_UA@GOTPAGE
Lloh10:
	ldr	x10, [x10, _GPBIAS2_GPADC1_UA@GOTPAGEOFF]
	ldr	w9, [x10]
	sdiv	w8, w8, w9
Lloh11:
	adrp	x9, _TBAT_NEG_25D@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TBAT_NEG_25D@GOTPAGEOFF]
	str	w8, [x19]
Lloh13:
	ldr	w11, [x9]
Lloh14:
	adrp	x9, _TBAT_NEG_10D@GOTPAGE
Lloh15:
	ldr	x9, [x9, _TBAT_NEG_10D@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w11
	b.le	LBB0_6
; %bb.5:
	mov	w1, #0
	ldr	w8, [x10]
	mul	w8, w8, w9
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w21, #-30
	b	LBB0_17
LBB0_6:
	cmp	w8, w9
	b.le	LBB0_8
; %bb.7:
	mov	w1, #0
	ldr	w8, [x10]
	mul	w8, w8, w9
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w21, #-15
	b	LBB0_17
LBB0_8:
Lloh17:
	adrp	x11, _TBAT_0D@GOTPAGE
Lloh18:
	ldr	x11, [x11, _TBAT_0D@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	cmp	w8, w11
	b.le	LBB0_10
; %bb.9:
	ldr	w8, [x10]
	mul	w9, w8, w9
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x9, w9, w10
	lsr	x11, x9, #63
	asr	x9, x9, #38
	add	w1, w9, w11
Lloh20:
	adrp	x9, _TBAT_40D@GOTPAGE
Lloh21:
	ldr	x9, [x9, _TBAT_40D@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	mul	w8, w9, w8
	smull	x8, w8, w10
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w21, #-5
	b	LBB0_17
LBB0_10:
Lloh23:
	adrp	x11, _TBAT_10D@GOTPAGE
Lloh24:
	ldr	x11, [x11, _TBAT_10D@GOTPAGEOFF]
Lloh25:
	ldr	w11, [x11]
	cmp	w8, w11
	b.le	LBB0_12
; %bb.11:
	ldr	w8, [x10]
	mul	w9, w8, w9
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x9, w9, w10
	lsr	x11, x9, #63
	asr	x9, x9, #38
	add	w1, w9, w11
Lloh26:
	adrp	x9, _TBAT_40D@GOTPAGE
Lloh27:
	ldr	x9, [x9, _TBAT_40D@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	mul	w8, w9, w8
	smull	x8, w8, w10
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w21, #5
	b	LBB0_17
LBB0_12:
Lloh29:
	adrp	x11, _TBAT_20D@GOTPAGE
Lloh30:
	ldr	x11, [x11, _TBAT_20D@GOTPAGEOFF]
Lloh31:
	ldr	w11, [x11]
	cmp	w8, w11
	b.le	LBB0_14
; %bb.13:
	ldr	w8, [x10]
	mul	w9, w8, w9
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x9, w9, w10
	lsr	x11, x9, #63
	asr	x9, x9, #38
	add	w1, w9, w11
Lloh32:
	adrp	x9, _TBAT_40D@GOTPAGE
Lloh33:
	ldr	x9, [x9, _TBAT_40D@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	mul	w8, w9, w8
	smull	x8, w8, w10
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w21, #15
	b	LBB0_17
LBB0_14:
Lloh35:
	adrp	x11, _TBAT_30D@GOTPAGE
Lloh36:
	ldr	x11, [x11, _TBAT_30D@GOTPAGEOFF]
Lloh37:
	ldr	w11, [x11]
	cmp	w8, w11
	b.le	LBB0_16
; %bb.15:
	ldr	w8, [x10]
	mul	w9, w8, w9
	mov	w10, #19923
	movk	w10, #4194, lsl #16
	smull	x9, w9, w10
	lsr	x11, x9, #63
	asr	x9, x9, #38
	add	w1, w9, w11
Lloh38:
	adrp	x9, _TBAT_40D@GOTPAGE
Lloh39:
	ldr	x9, [x9, _TBAT_40D@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	mul	w8, w9, w8
	smull	x8, w8, w10
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
	mov	w21, #25
	b	LBB0_17
LBB0_16:
Lloh41:
	adrp	x11, _TBAT_40D@GOTPAGE
Lloh42:
	ldr	x11, [x11, _TBAT_40D@GOTPAGEOFF]
Lloh43:
	ldr	w11, [x11]
	ldr	w10, [x10]
	mul	w12, w10, w11
	mov	w13, #19923
	movk	w13, #4194, lsl #16
	smull	x12, w12, w13
	lsr	x14, x12, #63
	asr	x12, x12, #38
	mul	w9, w10, w9
	add	w10, w12, w14
	smull	x9, w9, w13
	lsr	x13, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w13
	mov	w13, #45
	add	w12, w12, w14
	mov	w14, #35
	cmp	w8, w11
	csel	w2, wzr, w12, le
	csel	w1, w10, w9, le
	csel	w21, w13, w14, le
LBB0_17:
	mov	x0, x20
	bl	_set_temp_threshold
	ldr	w0, [x20, #8]
	ldr	w3, [x19]
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
LBB0_18:
	mov	w0, #0
	str	w21, [x19]
LBB0_19:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_PM860X_TEMP_TINT,8,3           ; @PM860X_TEMP_TINT
	.comm	_PM8607_TINT_MEAS1,4,2          ; @PM8607_TINT_MEAS1
	.comm	_PM8607_GPADC1_MEAS1,4,2        ; @PM8607_GPADC1_MEAS1
	.comm	_GPBIAS2_GPADC1_UA,4,2          ; @GPBIAS2_GPADC1_UA
	.comm	_TBAT_NEG_25D,4,2               ; @TBAT_NEG_25D
	.comm	_TBAT_NEG_10D,4,2               ; @TBAT_NEG_10D
	.comm	_TBAT_0D,4,2                    ; @TBAT_0D
	.comm	_TBAT_40D,4,2                   ; @TBAT_40D
	.comm	_TBAT_10D,4,2                   ; @TBAT_10D
	.comm	_TBAT_20D,4,2                   ; @TBAT_20D
	.comm	_TBAT_30D,4,2                   ; @TBAT_30D
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"temp_C:%d C,temp_mv:%d mv\n"

	.no_dead_strip	_measure_temp
.subsections_via_symbols
