	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x2_phy_temp_compensate
_mt76x2_phy_temp_compensate:            ## @mt76x2_phy_temp_compensate
	.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	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	-40(%rbp), %rsi
	callq	_mt76x2_get_temp_comp
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movq	_MT_TEMP_SENSOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TEMP_SENSOR_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_mt76_get_field
	subl	-24(%rbp), %eax
	imull	$1789, %eax, %eax               ## imm = 0x6FD
	movslq	%eax, %rcx
	imulq	$274877907, %rcx, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$38, %rdx
	leal	(%rdx,%rsi), %eax
	addl	%esi, %edx
	addl	$25, %edx
	movl	%edx, (%rbx)
	cltd
	cmpl	$1000, %ecx                     ## imm = 0x3E8
	jl	LBB0_3
## %bb.2:
	idivl	-40(%rbp)
	jmp	LBB0_4
LBB0_3:
	idivl	-36(%rbp)
	negl	%eax
LBB0_4:
	movl	-28(%rbp), %esi
	movl	%eax, %edi
	callq	_min
	movl	-32(%rbp), %esi
	movl	%eax, %edi
	callq	_max
                                        ## kill: def $eax killed $eax def $rax
	movq	_MT_TX_ALC_CFG_1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_MT_TX_ALC_CFG_1_TEMP_COMP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leal	(%rax,%rax), %r14d
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	callq	_mt76_rmw_field
	movq	_MT_TX_ALC_CFG_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_TX_ALC_CFG_2_TEMP_COMP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	callq	_mt76_rmw_field
LBB0_5:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_TEMP_SENSOR,4,2             ## @MT_TEMP_SENSOR
	.comm	_MT_TEMP_SENSOR_VAL,4,2         ## @MT_TEMP_SENSOR_VAL
	.comm	_MT_TX_ALC_CFG_1,4,2            ## @MT_TX_ALC_CFG_1
	.comm	_MT_TX_ALC_CFG_1_TEMP_COMP,4,2  ## @MT_TX_ALC_CFG_1_TEMP_COMP
	.comm	_MT_TX_ALC_CFG_2,4,2            ## @MT_TX_ALC_CFG_2
	.comm	_MT_TX_ALC_CFG_2_TEMP_COMP,4,2  ## @MT_TX_ALC_CFG_2_TEMP_COMP
	.no_dead_strip	_mt76x2_phy_temp_compensate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x2_phy_temp_compensate
_mt76x2_phy_temp_compensate:            ; @mt76x2_phy_temp_compensate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	add	x1, sp, #8
	bl	_mt76x2_get_temp_comp
	cbnz	x0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _MT_TEMP_SENSOR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_TEMP_SENSOR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MT_TEMP_SENSOR_VAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_TEMP_SENSOR_VAL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mt76_get_field
	ldr	w8, [sp, #24]
	sub	w8, w0, w8
	mov	w9, #1789
	mul	w9, w8, w9
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w9, w8
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	add	w10, w8, #25
	str	w10, [x19]
	cmp	w9, #1000
	b.lt	LBB0_3
; %bb.2:
	ldr	w9, [sp, #8]
	sdiv	w0, w8, w9
	b	LBB0_4
LBB0_3:
	ldr	w9, [sp, #12]
	sdiv	w8, w8, w9
	neg	w0, w8
LBB0_4:
	ldr	w1, [sp, #20]
	bl	_min
	ldr	w1, [sp, #16]
	bl	_max
Lloh6:
	adrp	x8, _MT_TX_ALC_CFG_1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_TX_ALC_CFG_1@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _MT_TX_ALC_CFG_1_TEMP_COMP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_TX_ALC_CFG_1_TEMP_COMP@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	lsl	w20, w0, #1
	mov	x0, x19
	mov	x3, x20
	bl	_mt76_rmw_field
Lloh12:
	adrp	x8, _MT_TX_ALC_CFG_2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MT_TX_ALC_CFG_2@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _MT_TX_ALC_CFG_2_TEMP_COMP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MT_TX_ALC_CFG_2_TEMP_COMP@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x20
	bl	_mt76_rmw_field
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_TEMP_SENSOR,4,2             ; @MT_TEMP_SENSOR
	.comm	_MT_TEMP_SENSOR_VAL,4,2         ; @MT_TEMP_SENSOR_VAL
	.comm	_MT_TX_ALC_CFG_1,4,2            ; @MT_TX_ALC_CFG_1
	.comm	_MT_TX_ALC_CFG_1_TEMP_COMP,4,2  ; @MT_TX_ALC_CFG_1_TEMP_COMP
	.comm	_MT_TX_ALC_CFG_2,4,2            ; @MT_TX_ALC_CFG_2
	.comm	_MT_TX_ALC_CFG_2_TEMP_COMP,4,2  ; @MT_TX_ALC_CFG_2_TEMP_COMP
	.no_dead_strip	_mt76x2_phy_temp_compensate
.subsections_via_symbols
