	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7601u_temp_comp
_mt7601u_temp_comp:                     ## @mt7601u_temp_comp
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	24(%rdi), %rax
	movl	(%rdi), %ebx
	subl	(%rax), %ebx
	movl	8(%rdi), %eax
	movq	_MT_EE_TEMPERATURE_SLOPE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %ebx
	movl	%ebx, 4(%rdi)
	negl	%eax
	addl	%ebx, %eax
	addl	$-451, %eax                     ## imm = 0xFE3D
	cmpl	$-902, %eax                     ## imm = 0xFC7A
	ja	LBB0_3
## %bb.1:
	movl	%ebx, 8(%r14)
	movq	_MCU_CAL_DPD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_mt7601u_mcu_calibrate
	testl	%eax, %eax
	je	LBB0_2
## %bb.13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, %rdi
	callq	_mt7601u_vco_cal
	movl	16(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
LBB0_3:
	cmpl	$-51, %ebx
	jg	LBB0_6
## %bb.4:
	cmpl	$0, 12(%r14)
	jne	LBB0_10
## %bb.5:
	movl	$1, 12(%r14)
	movq	%r14, %rdi
	movl	$4, %esi
	movl	$4, %edx
	movl	$6, %ecx
	callq	_mt7601u_rf_wr
	movq	%r14, %rdi
	movl	$4, %esi
	movl	$10, %edx
	movl	$48, %ecx
	callq	_mt7601u_rf_clear
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	cmpl	$51, %ebx
	jl	LBB0_10
## %bb.7:
	cmpl	$0, 12(%r14)
	je	LBB0_10
## %bb.8:
	movl	$0, 12(%r14)
	movq	%r14, %rdi
	movl	$4, %esi
	movl	$4, %edx
	xorl	%ecx, %ecx
	callq	_mt7601u_rf_wr
	movq	%r14, %rdi
	movl	$4, %esi
	movl	$10, %edx
	movl	$48, %ecx
	movl	$16, %r8d
	callq	_mt7601u_rf_rmw
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movl	16(%r14), %edi
	callq	_dev_dbg
LBB0_10:
	testl	%r15d, %r15d
	movl	$400, %eax                      ## imm = 0x190
	movl	$350, %ecx                      ## imm = 0x15E
	cmovel	%eax, %ecx
	movl	$-200, %eax
	movl	$-250, %edx
	cmovel	%eax, %edx
	cmpl	%edx, %ebx
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.5(%rip), %rdx
	cmovgq	%rax, %rdx
	movq	_MT_TEMP_MODE_LOW@GOTPCREL(%rip), %rax
	cmovgq	_MT_TEMP_MODE_NORMAL@GOTPCREL(%rip), %rax
	cmpl	%ecx, %ebx
	jle	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rdx
	movq	_MT_TEMP_MODE_HIGH@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt7601u_bbp_temp               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_EE_TEMPERATURE_SLOPE,4,2    ## @MT_EE_TEMPERATURE_SLOPE
	.comm	_MCU_CAL_DPD,4,2                ## @MCU_CAL_DPD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Recalibrate DPD\n"

L_.str.1:                               ## @.str.1
	.asciz	"PLL lock protect on - too cold\n"

L_.str.2:                               ## @.str.2
	.asciz	"PLL lock protect off\n"

	.comm	_MT_TEMP_MODE_HIGH,4,2          ## @MT_TEMP_MODE_HIGH
L_.str.3:                               ## @.str.3
	.asciz	"high"

	.comm	_MT_TEMP_MODE_NORMAL,4,2        ## @MT_TEMP_MODE_NORMAL
L_.str.4:                               ## @.str.4
	.asciz	"normal"

	.comm	_MT_TEMP_MODE_LOW,4,2           ## @MT_TEMP_MODE_LOW
L_.str.5:                               ## @.str.5
	.asciz	"low"

	.no_dead_strip	_mt7601u_temp_comp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7601u_temp_comp
_mt7601u_temp_comp:                     ; @mt7601u_temp_comp
	.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	x21, x1
	mov	x19, x0
	ldr	w8, [x0]
	ldr	x9, [x0, #24]
	ldr	w9, [x9]
	sub	w8, w8, w9
Lloh0:
	adrp	x9, _MT_EE_TEMPERATURE_SLOPE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MT_EE_TEMPERATURE_SLOPE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mul	w20, w8, w9
	str	w20, [x0, #4]
	ldr	w8, [x0, #8]
	sub	w8, w20, w8
	sub	w8, w8, #451
	cmn	w8, #902
	b.hi	LBB0_4
; %bb.1:
	str	w20, [x19, #8]
Lloh3:
	adrp	x8, _MCU_CAL_DPD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MCU_CAL_DPD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_mt7601u_mcu_calibrate
	cbz	w0, LBB0_3
; %bb.2:
	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
LBB0_3:
	mov	x0, x19
	bl	_mt7601u_vco_cal
	ldr	w0, [x19, #16]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
LBB0_4:
	cmn	w20, #51
	b.gt	LBB0_7
; %bb.5:
	ldr	w8, [x19, #12]
	cbnz	w8, LBB0_11
; %bb.6:
	mov	w8, #1
	str	w8, [x19, #12]
	mov	x0, x19
	mov	w1, #4
	mov	w2, #4
	mov	w3, #6
	bl	_mt7601u_rf_wr
	mov	x0, x19
	mov	w1, #4
	mov	w2, #10
	mov	w3, #48
	bl	_mt7601u_rf_clear
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_7:
	cmp	w20, #51
	b.lt	LBB0_11
; %bb.8:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_11
; %bb.9:
	str	wzr, [x19, #12]
	mov	x0, x19
	mov	w1, #4
	mov	w2, #4
	mov	w3, #0
	bl	_mt7601u_rf_wr
	mov	x0, x19
	mov	w1, #4
	mov	w2, #10
	mov	w3, #48
	mov	w4, #16
	bl	_mt7601u_rf_rmw
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	ldr	w0, [x19, #16]
	bl	_dev_dbg
LBB0_11:
	mov	w8, #350
	mov	w9, #400
	cmp	w21, #0
	csel	w8, w9, w8, eq
	mov	w9, #-250
	mov	w10, #-200
	csel	w9, w10, w9, eq
Lloh12:
	adrp	x10, l_.str.5@PAGE
Lloh13:
	add	x10, x10, l_.str.5@PAGEOFF
Lloh14:
	adrp	x11, l_.str.4@PAGE
Lloh15:
	add	x11, x11, l_.str.4@PAGEOFF
	cmp	w20, w9
	csel	x9, x11, x10, gt
Lloh16:
	adrp	x10, l_.str.3@PAGE
Lloh17:
	add	x10, x10, l_.str.3@PAGEOFF
Lloh18:
	adrp	x11, _MT_TEMP_MODE_NORMAL@GOTPAGE
Lloh19:
	ldr	x11, [x11, _MT_TEMP_MODE_NORMAL@GOTPAGEOFF]
Lloh20:
	adrp	x12, _MT_TEMP_MODE_LOW@GOTPAGE
Lloh21:
	ldr	x12, [x12, _MT_TEMP_MODE_LOW@GOTPAGEOFF]
	csel	x11, x11, x12, gt
	cmp	w20, w8
Lloh22:
	adrp	x8, _MT_TEMP_MODE_HIGH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MT_TEMP_MODE_HIGH@GOTPAGEOFF]
	csel	x2, x10, x9, gt
	csel	x8, x8, x11, gt
	ldr	w1, [x8]
	mov	x0, x19
	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
	b	_mt7601u_bbp_temp
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_EE_TEMPERATURE_SLOPE,4,2    ; @MT_EE_TEMPERATURE_SLOPE
	.comm	_MCU_CAL_DPD,4,2                ; @MCU_CAL_DPD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Recalibrate DPD\n"

l_.str.1:                               ; @.str.1
	.asciz	"PLL lock protect on - too cold\n"

l_.str.2:                               ; @.str.2
	.asciz	"PLL lock protect off\n"

	.comm	_MT_TEMP_MODE_HIGH,4,2          ; @MT_TEMP_MODE_HIGH
l_.str.3:                               ; @.str.3
	.asciz	"high"

	.comm	_MT_TEMP_MODE_NORMAL,4,2        ; @MT_TEMP_MODE_NORMAL
l_.str.4:                               ; @.str.4
	.asciz	"normal"

	.comm	_MT_TEMP_MODE_LOW,4,2           ; @MT_TEMP_MODE_LOW
l_.str.5:                               ; @.str.5
	.asciz	"low"

	.no_dead_strip	_mt7601u_temp_comp
.subsections_via_symbols
