	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_thermal_init
_aw_thermal_init:                       ## @aw_thermal_init
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	8(%rdi), %edi
	callq	_ofw_bus_get_node
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_nvmem_get_cell_len
	cmpl	$9, %eax
	jb	LBB0_2
## %bb.1:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_9
LBB0_2:
	leaq	L_.str(%rip), %r15
	movl	%ebx, %edi
	movq	%r15, %rsi
	callq	_nvmem_get_cell_len
	leaq	-48(%rbp), %rdx
	movl	%ebx, %edi
	movq	%r15, %rsi
	movl	%eax, %ecx
	callq	_nvmem_read_cell_by_name
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_9
LBB0_4:
	movq	(%r14), %rcx
	movl	-48(%rbp), %eax
	movl	-44(%rbp), %edx
	movl	(%rcx), %esi
	movl	%eax, %edi
	andl	%esi, %edi
	movl	%edi, -48(%rbp)
	andl	4(%rcx), %edx
	movl	%edx, -44(%rbp)
	andl	%esi, %eax
	je	LBB0_6
## %bb.5:
	movq	_THS_CALIB0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_WR4
	movl	-44(%rbp), %edx
LBB0_6:
	testl	%edx, %edx
	je	LBB0_8
## %bb.7:
	movq	_THS_CALIB1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_WR4
LBB0_8:
	movq	_THS_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ADC_CALI_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_WR4
	movq	_THS_CTRL0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rax
	movl	8(%rax), %edx
	movq	%r14, %rdi
	callq	_WR4
	movq	_THS_CTRL2@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	(%r14), %rax
	movl	8(%rax), %edx
	movq	_SENSOR_ACQ1_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_WR4
	movq	_THS_INTC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	(%r14), %rax
	movl	12(%rax), %edx
	movq	_THS_THERMAL_PER_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_WR4
	movq	_THS_FILTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rax
	movl	16(%rax), %edx
	movq	%r14, %rdi
	callq	_WR4
	movq	_THS_INTS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_RD4
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_WR4
	movl	(%r12), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_RD4
	movq	_SHUT_INT_ALL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_ALARM_INT_ALL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_WR4
	movl	(%r15), %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_RD4
	movq	_SENSOR_ENABLE_ALL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_WR4
	xorl	%ebx, %ebx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ths-calib"

L_.str.1:                               ## @.str.1
	.asciz	"ths-calib nvmem cell is too large\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.2:                               ## @.str.2
	.asciz	"Cannot read THS efuse\n"

	.comm	_THS_CALIB0,4,2                 ## @THS_CALIB0
	.comm	_THS_CALIB1,4,2                 ## @THS_CALIB1
	.comm	_THS_CTRL1,4,2                  ## @THS_CTRL1
	.comm	_ADC_CALI_EN,4,2                ## @ADC_CALI_EN
	.comm	_THS_CTRL0,4,2                  ## @THS_CTRL0
	.comm	_THS_CTRL2,4,2                  ## @THS_CTRL2
	.comm	_SENSOR_ACQ1_SHIFT,4,2          ## @SENSOR_ACQ1_SHIFT
	.comm	_THS_INTC,4,2                   ## @THS_INTC
	.comm	_THS_THERMAL_PER_SHIFT,4,2      ## @THS_THERMAL_PER_SHIFT
	.comm	_THS_FILTER,4,2                 ## @THS_FILTER
	.comm	_THS_INTS,4,2                   ## @THS_INTS
	.comm	_SHUT_INT_ALL,4,2               ## @SHUT_INT_ALL
	.comm	_ALARM_INT_ALL,4,2              ## @ALARM_INT_ALL
	.comm	_SENSOR_ENABLE_ALL,4,2          ## @SENSOR_ENABLE_ALL
	.no_dead_strip	_aw_thermal_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_thermal_init
_aw_thermal_init:                       ; @aw_thermal_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	ldr	w0, [x0, #8]
	bl	_ofw_bus_get_node
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_nvmem_get_cell_len
	cmp	w0, #9
	b.lo	LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
Lloh4:
	adrp	x8, _ENXIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh6:
	ldr	w20, [x8]
	b	LBB0_8
LBB0_2:
Lloh7:
	adrp	x21, l_.str@PAGE
Lloh8:
	add	x21, x21, l_.str@PAGEOFF
	mov	x0, x20
	mov	x1, x21
	bl	_nvmem_get_cell_len
	mov	x3, x0
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_nvmem_read_cell_by_name
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_device_printf
	b	LBB0_8
LBB0_4:
	ldr	x8, [x19]
	ldr	d0, [x8]
	ldr	d1, [sp, #8]
	and.8b	v0, v1, v0
	str	d0, [sp, #8]
	fmov	w2, s0
	cbz	w2, LBB0_9
; %bb.5:
Lloh11:
	adrp	x8, _THS_CALIB0@GOTPAGE
Lloh12:
	ldr	x8, [x8, _THS_CALIB0@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WR4
	ldr	w2, [sp, #12]
	cbz	w2, LBB0_7
LBB0_6:
Lloh14:
	adrp	x8, _THS_CALIB1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _THS_CALIB1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_WR4
LBB0_7:
Lloh17:
	adrp	x8, _THS_CTRL1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _THS_CTRL1@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _ADC_CALI_EN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ADC_CALI_EN@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_WR4
Lloh23:
	adrp	x8, _THS_CTRL0@GOTPAGE
Lloh24:
	ldr	x8, [x8, _THS_CTRL0@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	x8, [x19]
	ldr	w2, [x8, #8]
	mov	x0, x19
	bl	_WR4
Lloh26:
	adrp	x21, _THS_CTRL2@GOTPAGE
Lloh27:
	ldr	x21, [x21, _THS_CTRL2@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	x8, [x19]
	ldr	w8, [x8, #8]
Lloh28:
	adrp	x9, _SENSOR_ACQ1_SHIFT@GOTPAGE
Lloh29:
	ldr	x9, [x9, _SENSOR_ACQ1_SHIFT@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	lsl	w2, w8, w9
	mov	x0, x19
	bl	_WR4
Lloh31:
	adrp	x22, _THS_INTC@GOTPAGE
Lloh32:
	ldr	x22, [x22, _THS_INTC@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	x8, [x19]
	ldr	w8, [x8, #12]
Lloh33:
	adrp	x9, _THS_THERMAL_PER_SHIFT@GOTPAGE
Lloh34:
	ldr	x9, [x9, _THS_THERMAL_PER_SHIFT@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	lsl	w2, w8, w9
	mov	x0, x19
	bl	_WR4
Lloh36:
	adrp	x8, _THS_FILTER@GOTPAGE
Lloh37:
	ldr	x8, [x8, _THS_FILTER@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	ldr	x8, [x19]
	ldr	w2, [x8, #16]
	mov	x0, x19
	bl	_WR4
Lloh39:
	adrp	x8, _THS_INTS@GOTPAGE
Lloh40:
	ldr	x8, [x8, _THS_INTS@GOTPAGEOFF]
Lloh41:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_RD4
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_WR4
	ldr	w20, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_RD4
Lloh42:
	adrp	x8, _SHUT_INT_ALL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _SHUT_INT_ALL@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh45:
	adrp	x9, _ALARM_INT_ALL@GOTPAGE
Lloh46:
	ldr	x9, [x9, _ALARM_INT_ALL@GOTPAGEOFF]
Lloh47:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	mov	x1, x20
	bl	_WR4
	ldr	w20, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_RD4
Lloh48:
	adrp	x8, _SENSOR_ENABLE_ALL@GOTPAGE
Lloh49:
	ldr	x8, [x8, _SENSOR_ENABLE_ALL@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	mov	x1, x20
	bl	_WR4
	mov	w20, #0
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
	mov.s	w2, v0[1]
	cbnz	w2, LBB0_6
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ths-calib"

l_.str.1:                               ; @.str.1
	.asciz	"ths-calib nvmem cell is too large\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.2:                               ; @.str.2
	.asciz	"Cannot read THS efuse\n"

	.comm	_THS_CALIB0,4,2                 ; @THS_CALIB0
	.comm	_THS_CALIB1,4,2                 ; @THS_CALIB1
	.comm	_THS_CTRL1,4,2                  ; @THS_CTRL1
	.comm	_ADC_CALI_EN,4,2                ; @ADC_CALI_EN
	.comm	_THS_CTRL0,4,2                  ; @THS_CTRL0
	.comm	_THS_CTRL2,4,2                  ; @THS_CTRL2
	.comm	_SENSOR_ACQ1_SHIFT,4,2          ; @SENSOR_ACQ1_SHIFT
	.comm	_THS_INTC,4,2                   ; @THS_INTC
	.comm	_THS_THERMAL_PER_SHIFT,4,2      ; @THS_THERMAL_PER_SHIFT
	.comm	_THS_FILTER,4,2                 ; @THS_FILTER
	.comm	_THS_INTS,4,2                   ; @THS_INTS
	.comm	_SHUT_INT_ALL,4,2               ; @SHUT_INT_ALL
	.comm	_ALARM_INT_ALL,4,2              ; @ALARM_INT_ALL
	.comm	_SENSOR_ENABLE_ALL,4,2          ; @SENSOR_ENABLE_ALL
	.no_dead_strip	_aw_thermal_init
.subsections_via_symbols
