	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thermal_init
_thermal_init:                          ## @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	%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), %rax
	movq	_ICODE_RTL_SILICON@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.1:
	movq	%rdi, %r14
	movq	_CR_THERM_INIT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_check_chip_resource
	testq	%rax, %rax
	jne	LBB0_19
## %bb.2:
	movq	_CR_SBUS@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_SBUS_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_acquire_chip_resource
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_THERM_FAILURE
	jmp	LBB0_19
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dd_dev_info
	movq	_ASIC_CFG_THERM_POLL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_write_csr
	movl	$100, %edi
	callq	_msleep
	movq	_SBUS_THERMAL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_RESET_SBUS_RECEIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_sbus_request_slow
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_6
LBB0_7:
	movl	(%r15), %esi
	movq	_WRITE_SBUS_RECEIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_sbus_request_slow
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_6
LBB0_9:
	movl	(%r15), %esi
	movq	_WRITE_SBUS_RECEIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$1, %edx
	movl	$50, %r8d
	callq	_sbus_request_slow
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_6
LBB0_11:
	movl	(%r15), %esi
	movq	_WRITE_SBUS_RECEIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SBUS_THERM_MONITOR_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movl	$3, %edx
	callq	_sbus_request_slow
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rdx
LBB0_6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_THERM_FAILURE
LBB0_18:
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_release_chip_resource
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	(%r15), %esi
	movq	_WRITE_SBUS_RECEIVER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	movl	$2, %r8d
	callq	_sbus_request_slow
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%eax, %r15d
	leaq	L_.str.6(%rip), %rdx
	jmp	LBB0_17
LBB0_15:
	movl	$22, %edi
	callq	_msleep
	movq	_ASIC_CFG_THERM_POLL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_write_csr
	movl	(%r13), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_acquire_chip_resource
	testl	%eax, %eax
	je	LBB0_18
## %bb.16:
	movl	%eax, %r15d
	leaq	L_.str.7(%rip), %rdx
LBB0_17:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_THERM_FAILURE
	movl	%r15d, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_ICODE_RTL_SILICON,8,3          ## @ICODE_RTL_SILICON
	.comm	_CR_THERM_INIT,4,2              ## @CR_THERM_INIT
	.comm	_CR_SBUS,4,2                    ## @CR_SBUS
	.comm	_SBUS_TIMEOUT,4,2               ## @SBUS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Acquire SBus"

L_.str.1:                               ## @.str.1
	.asciz	"Initializing thermal sensor\n"

	.comm	_ASIC_CFG_THERM_POLL_EN,4,2     ## @ASIC_CFG_THERM_POLL_EN
	.comm	_SBUS_THERMAL,4,2               ## @SBUS_THERMAL
	.comm	_RESET_SBUS_RECEIVER,4,2        ## @RESET_SBUS_RECEIVER
L_.str.2:                               ## @.str.2
	.asciz	"Bus Reset"

	.comm	_WRITE_SBUS_RECEIVER,4,2        ## @WRITE_SBUS_RECEIVER
L_.str.3:                               ## @.str.3
	.asciz	"Therm Block Reset"

L_.str.4:                               ## @.str.4
	.asciz	"Write Clock Div"

	.comm	_SBUS_THERM_MONITOR_MODE,4,2    ## @SBUS_THERM_MONITOR_MODE
L_.str.5:                               ## @.str.5
	.asciz	"Write Mode Sel"

L_.str.6:                               ## @.str.6
	.asciz	"Write Reset Deassert"

L_.str.7:                               ## @.str.7
	.asciz	"Unable to set thermal init flag"

	.no_dead_strip	_thermal_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thermal_init
_thermal_init:                          ; @thermal_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _ICODE_RTL_SILICON@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ICODE_RTL_SILICON@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x22, _CR_THERM_INIT@GOTPAGE
Lloh4:
	ldr	x22, [x22, _CR_THERM_INIT@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x2, #0
	bl	_check_chip_resource
	cbz	x0, LBB0_4
LBB0_2:
	mov	w20, #0
LBB0_3:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh5:
	adrp	x21, _CR_SBUS@GOTPAGE
Lloh6:
	ldr	x21, [x21, _CR_SBUS@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh7:
	adrp	x8, _SBUS_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SBUS_TIMEOUT@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_acquire_chip_resource
	cbz	w0, LBB0_6
; %bb.5:
	mov	x20, x0
Lloh10:
	adrp	x2, l_.str@PAGE
Lloh11:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_THERM_FAILURE
	b	LBB0_3
LBB0_6:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dd_dev_info
Lloh14:
	adrp	x23, _ASIC_CFG_THERM_POLL_EN@GOTPAGE
Lloh15:
	ldr	x23, [x23, _ASIC_CFG_THERM_POLL_EN@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_write_csr
	mov	w0, #100
	bl	_msleep
Lloh16:
	adrp	x24, _SBUS_THERMAL@GOTPAGE
Lloh17:
	ldr	x24, [x24, _SBUS_THERMAL@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh18:
	adrp	x8, _RESET_SBUS_RECEIVER@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RESET_SBUS_RECEIVER@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w4, #0
	bl	_sbus_request_slow
	cbz	w0, LBB0_8
; %bb.7:
	mov	x20, x0
Lloh21:
	adrp	x2, l_.str.2@PAGE
Lloh22:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_8:
	ldr	w1, [x24]
Lloh23:
	adrp	x25, _WRITE_SBUS_RECEIVER@GOTPAGE
Lloh24:
	ldr	x25, [x25, _WRITE_SBUS_RECEIVER@GOTPAGEOFF]
	ldr	w3, [x25]
	mov	x0, x19
	mov	w2, #0
	mov	w4, #1
	bl	_sbus_request_slow
	cbz	w0, LBB0_10
; %bb.9:
	mov	x20, x0
Lloh25:
	adrp	x2, l_.str.3@PAGE
Lloh26:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_18
LBB0_10:
	ldr	w1, [x24]
	ldr	w3, [x25]
	mov	x0, x19
	mov	w2, #1
	mov	w4, #50
	bl	_sbus_request_slow
	cbz	w0, LBB0_12
; %bb.11:
	mov	x20, x0
Lloh27:
	adrp	x2, l_.str.4@PAGE
Lloh28:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_18
LBB0_12:
	ldr	w1, [x24]
	ldr	w3, [x25]
Lloh29:
	adrp	x8, _SBUS_THERM_MONITOR_MODE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SBUS_THERM_MONITOR_MODE@GOTPAGEOFF]
Lloh31:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w2, #3
	bl	_sbus_request_slow
	cbz	w0, LBB0_14
; %bb.13:
	mov	x20, x0
Lloh32:
	adrp	x2, l_.str.5@PAGE
Lloh33:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_18
LBB0_14:
	ldr	w1, [x24]
	ldr	w3, [x25]
	mov	x0, x19
	mov	w2, #0
	mov	w4, #2
	bl	_sbus_request_slow
	cbz	w0, LBB0_16
; %bb.15:
	mov	x20, x0
Lloh34:
	adrp	x2, l_.str.6@PAGE
Lloh35:
	add	x2, x2, l_.str.6@PAGEOFF
	b	LBB0_18
LBB0_16:
	mov	w0, #22
	bl	_msleep
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #1
	bl	_write_csr
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_acquire_chip_resource
	mov	x20, x0
	cbz	w0, LBB0_19
; %bb.17:
Lloh36:
	adrp	x2, l_.str.7@PAGE
Lloh37:
	add	x2, x2, l_.str.7@PAGEOFF
LBB0_18:
	mov	x0, x19
	mov	x1, x20
	bl	_THERM_FAILURE
LBB0_19:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_release_chip_resource
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_ICODE_RTL_SILICON,8,3          ; @ICODE_RTL_SILICON
	.comm	_CR_THERM_INIT,4,2              ; @CR_THERM_INIT
	.comm	_CR_SBUS,4,2                    ; @CR_SBUS
	.comm	_SBUS_TIMEOUT,4,2               ; @SBUS_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Acquire SBus"

l_.str.1:                               ; @.str.1
	.asciz	"Initializing thermal sensor\n"

	.comm	_ASIC_CFG_THERM_POLL_EN,4,2     ; @ASIC_CFG_THERM_POLL_EN
	.comm	_SBUS_THERMAL,4,2               ; @SBUS_THERMAL
	.comm	_RESET_SBUS_RECEIVER,4,2        ; @RESET_SBUS_RECEIVER
l_.str.2:                               ; @.str.2
	.asciz	"Bus Reset"

	.comm	_WRITE_SBUS_RECEIVER,4,2        ; @WRITE_SBUS_RECEIVER
l_.str.3:                               ; @.str.3
	.asciz	"Therm Block Reset"

l_.str.4:                               ; @.str.4
	.asciz	"Write Clock Div"

	.comm	_SBUS_THERM_MONITOR_MODE,4,2    ; @SBUS_THERM_MONITOR_MODE
l_.str.5:                               ; @.str.5
	.asciz	"Write Mode Sel"

l_.str.6:                               ; @.str.6
	.asciz	"Write Reset Deassert"

l_.str.7:                               ; @.str.7
	.asciz	"Unable to set thermal init flag"

	.no_dead_strip	_thermal_init
.subsections_via_symbols
