	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function il4965_hw_get_temperature
_il4965_hw_get_temperature:             ## @il4965_hw_get_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	%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	%rdi, %rbx
	movq	_S_TEMPERATURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %r14
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_STATS_REPLY_FLG_HT40_MODE_MSK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_D_TEMP
	movq	40(%rbx), %rax
	movl	4(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %r15
	movq	32(%rbx), %rax
	movl	4(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	24(%rbx), %rax
	movl	4(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %r12
	movq	16(%rbx), %rax
	addq	$4, %rax
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_D_TEMP
	movq	40(%rbx), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %r15
	movq	32(%rbx), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	24(%rbx), %rax
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %r12
	movq	16(%rbx), %rax
LBB0_4:
	movl	(%rax), %edi
	callq	_le32_to_cpu
	movq	%rax, %r13
	movq	_S_TEMPERATURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	4(%rbx), %edi
	callq	_le32_to_cpu
	movq	%rax, %r13
LBB0_6:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	$23, %esi
	callq	_sign_extend32
	movq	%rax, %rbx
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r12, %rcx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_D_TEMP
	subq	%r15, %r12
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rdi
	callq	_IL_ERR
	movl	$-1, %ebx
	jmp	LBB0_12
LBB0_8:
	movq	_TEMPERATURE_CALIB_A_VAL@GOTPCREL(%rip), %rax
	subq	%r14, %rbx
	imulq	(%rax), %rbx
	movq	%rbx, %rax
	orq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_9
## %bb.10:
	movq	%rbx, %rax
	cqto
	idivq	%r12
	jmp	LBB0_11
LBB0_9:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $eax killed $eax def $rax
LBB0_11:
	imulq	$97, %rax, %rcx
	movabsq	$-6640827866535438581, %rdx     ## imm = 0xA3D70A3D70A3D70B
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rbx
	addq	%rcx, %rbx
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$6, %rbx
	addq	%rax, %rbx
	movq	_TEMPERATURE_CALIB_KELVIN_OFFSET@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_KELVIN_TO_CELSIUS
	leaq	L_.str.4(%rip), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_D_TEMP
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S_TEMPERATURE,4,2              ## @S_TEMPERATURE
	.comm	_STATS_REPLY_FLG_HT40_MODE_MSK,4,2 ## @STATS_REPLY_FLG_HT40_MODE_MSK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Running HT40 temperature calibration\n"

L_.str.1:                               ## @.str.1
	.asciz	"Running temperature calibration\n"

L_.str.2:                               ## @.str.2
	.asciz	"Calib values R[1-3]: %d %d %d R4: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Calibration conflict R1 == R3\n"

	.comm	_TEMPERATURE_CALIB_A_VAL,8,3    ## @TEMPERATURE_CALIB_A_VAL
	.comm	_TEMPERATURE_CALIB_KELVIN_OFFSET,8,3 ## @TEMPERATURE_CALIB_KELVIN_OFFSET
L_.str.4:                               ## @.str.4
	.asciz	"Calibrated temperature: %dK, %dC\n"

	.no_dead_strip	_il4965_hw_get_temperature
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function il4965_hw_get_temperature
_il4965_hw_get_temperature:             ; @il4965_hw_get_temperature
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x25, _S_TEMPERATURE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _S_TEMPERATURE@GOTPAGEOFF]
	ldr	w0, [x25]
	add	x20, x19, #8
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _STATS_REPLY_FLG_HT40_MODE_MSK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STATS_REPLY_FLG_HT40_MODE_MSK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_D_TEMP
	ldr	x8, [x19, #40]
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	x8, [x19, #32]
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	x8, [x19, #24]
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	mov	x23, x0
	ldr	x8, [x19, #16]
	add	x8, x8, #4
	b	LBB0_4
LBB0_3:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_D_TEMP
	ldr	x8, [x19, #40]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	mov	x21, x0
	ldr	x8, [x19, #32]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	x8, [x19, #24]
	ldr	w0, [x8]
	bl	_le32_to_cpu
	mov	x23, x0
	ldr	x8, [x19, #16]
LBB0_4:
	ldr	w0, [x8]
	bl	_le32_to_cpu
	mov	x24, x0
	ldr	w0, [x25]
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_le32_to_cpu
	mov	x24, x0
LBB0_6:
	mov	x0, x24
	mov	w1, #23
	bl	_sign_extend32
	mov	x19, x0
	stp	x23, x0, [sp, #16]
	stp	x21, x22, [sp]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_D_TEMP
	subs	x8, x23, x21
	b.ne	LBB0_8
; %bb.7:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IL_ERR
	mov	w19, #-1
	b	LBB0_9
LBB0_8:
Lloh13:
	adrp	x9, _TEMPERATURE_CALIB_A_VAL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _TEMPERATURE_CALIB_A_VAL@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	sub	x10, x19, x22
	mul	x9, x9, x10
	sdiv	x8, x9, x8
	mov	w9, #97
	mul	x8, x8, x9
	mov	x9, #55051
	movk	x9, #28835, lsl #16
	movk	x9, #2621, lsl #32
	movk	x9, #41943, lsl #48
	smulh	x9, x8, x9
	add	x8, x9, x8
	asr	x9, x8, #6
	add	x8, x9, x8, lsr #63
Lloh16:
	adrp	x9, _TEMPERATURE_CALIB_KELVIN_OFFSET@GOTPAGE
Lloh17:
	ldr	x9, [x9, _TEMPERATURE_CALIB_KELVIN_OFFSET@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	add	x19, x8, x9
	mov	x0, x19
	bl	_KELVIN_TO_CELSIUS
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp]
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_D_TEMP
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_S_TEMPERATURE,4,2              ; @S_TEMPERATURE
	.comm	_STATS_REPLY_FLG_HT40_MODE_MSK,4,2 ; @STATS_REPLY_FLG_HT40_MODE_MSK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Running HT40 temperature calibration\n"

l_.str.1:                               ; @.str.1
	.asciz	"Running temperature calibration\n"

l_.str.2:                               ; @.str.2
	.asciz	"Calib values R[1-3]: %d %d %d R4: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Calibration conflict R1 == R3\n"

	.comm	_TEMPERATURE_CALIB_A_VAL,8,3    ; @TEMPERATURE_CALIB_A_VAL
	.comm	_TEMPERATURE_CALIB_KELVIN_OFFSET,8,3 ; @TEMPERATURE_CALIB_KELVIN_OFFSET
l_.str.4:                               ; @.str.4
	.asciz	"Calibrated temperature: %dK, %dC\n"

	.no_dead_strip	_il4965_hw_get_temperature
.subsections_via_symbols
