	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_lcnphy_tempsense_new       ## -- Begin function wlc_lcnphy_tempsense_new
	.p2align	4, 0x90
_wlc_lcnphy_tempsense_new:              ## @wlc_lcnphy_tempsense_new
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	xorl	%r13d, %r13d
	cmpl	$1, %esi
	jne	LBB0_4
## %bb.1:
	movl	8(%r15), %ebx
	movq	_maccontrol@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_D11REGOFFS
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_bcma_read32
	movq	_MCTL_EN_MAC@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	testl	%eax, (%rcx)
	sete	%bl
	je	LBB0_3
## %bb.2:
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_wlapi_suspend_mac_and_wait
LBB0_3:
	movb	%bl, %r13b
	movq	_TEMPSENSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wlc_lcnphy_vbat_temp_sense_setup
LBB0_4:
	movq	%r15, %rdi
	movl	$1142, %esi                     ## imm = 0x476
	callq	_read_phy_reg
	movl	%eax, %r12d
	movq	%r15, %rdi
	movl	$1143, %esi                     ## imm = 0x477
	callq	_read_phy_reg
	movl	%eax, %ebx
	cmpl	$1, %r14d
	jne	LBB0_7
## %bb.5:
	movq	%r15, %rdi
	movl	$1096, %esi                     ## imm = 0x448
	movl	$16384, %edx                    ## imm = 0x4000
	movl	$16384, %ecx                    ## imm = 0x4000
	callq	_mod_phy_reg
	movl	$100, %edi
	callq	_udelay
	movq	%r15, %rdi
	movl	$1096, %esi                     ## imm = 0x448
	movl	$16384, %edx                    ## imm = 0x4000
	xorl	%ecx, %ecx
	callq	_mod_phy_reg
	testl	%r13d, %r13d
	jne	LBB0_7
## %bb.6:
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_wlapi_enable_mac
LBB0_7:
	andl	$511, %ebx                      ## imm = 0x1FF
	andl	$511, %r12d                     ## imm = 0x1FF
	leal	(%rbx,%r12), %eax
	cmpl	$256, %r12d                     ## imm = 0x100
	leal	65024(%rbx,%r12), %ecx
	cmovbl	%eax, %ecx
	leal	65024(%rcx), %eax
	cmpl	$256, %ebx                      ## imm = 0x100
	cmovbl	%ecx, %eax
	movzwl	%ax, %ecx
	shrl	$15, %ecx
	addl	%eax, %ecx
	movswl	%cx, %eax
	sarl	%eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_maccontrol,4,2                 ## @maccontrol
	.comm	_MCTL_EN_MAC,4,2                ## @MCTL_EN_MAC
	.comm	_TEMPSENSE,4,2                  ## @TEMPSENSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wlc_lcnphy_tempsense_new       ; -- Begin function wlc_lcnphy_tempsense_new
	.p2align	2
_wlc_lcnphy_tempsense_new:              ; @wlc_lcnphy_tempsense_new
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	cmp	w1, #1
	b.ne	LBB0_4
; %bb.1:
	ldr	w21, [x19, #8]
Lloh0:
	adrp	x8, _maccontrol@GOTPAGE
Lloh1:
	ldr	x8, [x8, _maccontrol@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_D11REGOFFS
	mov	x1, x0
	mov	x0, x21
	bl	_bcma_read32
Lloh3:
	adrp	x8, _MCTL_EN_MAC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MCTL_EN_MAC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ands	w8, w8, w0
	cset	w23, eq
	cbz	w8, LBB0_3
; %bb.2:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_wlapi_suspend_mac_and_wait
LBB0_3:
Lloh6:
	adrp	x8, _TEMPSENSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TEMPSENSE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wlc_lcnphy_vbat_temp_sense_setup
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	mov	x0, x19
	mov	w1, #1142
	bl	_read_phy_reg
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1143
	bl	_read_phy_reg
	mov	x22, x0
	cmp	w20, #1
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x19
	mov	w1, #1096
	mov	w2, #16384
	mov	w3, #16384
	bl	_mod_phy_reg
	mov	w0, #100
	bl	_udelay
	mov	x0, x19
	mov	w1, #1096
	mov	w2, #16384
	mov	w3, #0
	bl	_mod_phy_reg
	cbnz	w23, LBB0_8
; %bb.7:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_wlapi_enable_mac
LBB0_8:
	and	w8, w22, #0x1ff
	mov	w9, #65024
	cmp	w8, #255
	csel	w10, w9, wzr, hi
	and	w11, w21, #0x1ff
	cmp	w11, #255
	csel	w9, w9, wzr, hi
	add	w8, w8, w11
	add	w8, w8, w9
	add	w8, w8, w10
	and	w9, w8, #0x8000
	add	w8, w8, w9, lsr #15
	sbfx	w0, w8, #1, #15
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_maccontrol,4,2                 ; @maccontrol
	.comm	_MCTL_EN_MAC,4,2                ; @MCTL_EN_MAC
	.comm	_TEMPSENSE,4,2                  ; @TEMPSENSE
.subsections_via_symbols
