	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cm_check_thermal_status
_cm_check_thermal_status:               ## @cm_check_thermal_status
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	leaq	-20(%rbp), %rsi
	callq	_cm_get_battery_temperature
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_2:
	movl	(%r14), %eax
	movl	4(%r14), %ecx
	cmpq	$0, (%rbx)
	je	LBB0_4
## %bb.3:
	movl	8(%r14), %edx
	subl	%edx, %eax
	addl	%edx, %ecx
LBB0_4:
	movl	-20(%rbp), %edx
	cmpl	%eax, %edx
	jle	LBB0_6
## %bb.5:
	movq	_CM_EVENT_BATT_OVERHEAT@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	xorl	%eax, %eax
	cmpl	%ecx, %edx
	jge	LBB0_9
## %bb.7:
	movq	_CM_EVENT_BATT_COLD@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get battery temperature\n"

	.comm	_CM_EVENT_BATT_OVERHEAT,4,2     ## @CM_EVENT_BATT_OVERHEAT
	.comm	_CM_EVENT_BATT_COLD,4,2         ## @CM_EVENT_BATT_COLD
	.no_dead_strip	_cm_check_thermal_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cm_check_thermal_status
_cm_check_thermal_status:               ; @cm_check_thermal_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x20, [x0, #16]
	add	x1, sp, #12
	bl	_cm_get_battery_temperature
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	w0, #0
	b	LBB0_7
LBB0_2:
	ldp	w9, w8, [x20]
	ldr	x10, [x19]
	cbz	x10, LBB0_4
; %bb.3:
	ldr	w10, [x20, #8]
	sub	w9, w9, w10
	add	w8, w8, w10
LBB0_4:
	ldr	w10, [sp, #12]
	cmp	w10, w9
	b.le	LBB0_6
; %bb.5:
Lloh2:
	adrp	x8, _CM_EVENT_BATT_OVERHEAT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CM_EVENT_BATT_OVERHEAT@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x9, _CM_EVENT_BATT_COLD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CM_EVENT_BATT_COLD@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w10, w8
	csel	w0, w9, wzr, lt
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get battery temperature\n"

	.comm	_CM_EVENT_BATT_OVERHEAT,4,2     ; @CM_EVENT_BATT_OVERHEAT
	.comm	_CM_EVENT_BATT_COLD,4,2         ; @CM_EVENT_BATT_COLD
	.no_dead_strip	_cm_check_thermal_status
.subsections_via_symbols
