	.file	"extr_phy_lcn.c_wlc_lcnphy_tempsense.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	wlc_lcnphy_tempsense
	.type	wlc_lcnphy_tempsense, @function
wlc_lcnphy_tempsense:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	wlc_lcnphy_get_tx_pwr_ctrl@PLT
	mov	DWORD PTR 8[rsp], 0
	mov	r14, QWORD PTR 24[r15]
	mov	DWORD PTR 12[rsp], eax
	cmp	ebx, 1
	je	.L28
.L2:
	mov	esi, 1142
	mov	rdi, r15
	call	read_phy_reg@PLT
	mov	esi, 1143
	mov	rdi, r15
	mov	ebp, eax
	mov	r13d, eax
	call	read_phy_reg@PLT
	and	r13d, 511
	mov	ecx, DWORD PTR [r14]
	mov	esi, eax
	lea	r12d, -512[r13]
	and	esi, 511
	and	ebp, 256
	cmove	r12d, r13d
	and	eax, 256
	cmp	ecx, 1
	je	.L5
	cmp	QWORD PTR 8[r15], 0
	je	.L6
.L5:
	sub	r12d, esi
	test	eax, eax
	lea	esi, 512[r12]
	cmovne	r12d, esi
.L7:
	test	r12d, r12d
	lea	eax, 512[r12]
	cmovs	r12d, eax
	cmp	ecx, 2
	cmove	r12d, r13d
	test	ebx, ebx
	jne	.L29
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	add	r12d, esi
	test	eax, eax
	lea	esi, -512[r12]
	cmovne	r12d, esi
	mov	eax, r12d
	shr	eax, 31
	add	r12d, eax
	sar	r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, r15
	call	wlc_lcnphy_set_tx_pwr_ctrl@PLT
	cmp	ebx, 1
	jne	.L1
	mov	ecx, 16384
	mov	edx, 16384
	mov	esi, 1096
	mov	rdi, r15
	call	mod_phy_reg@PLT
	mov	edi, 100
	call	udelay@PLT
	xor	ecx, ecx
	mov	edx, 16384
	mov	rdi, r15
	mov	esi, 1096
	call	mod_phy_reg@PLT
	mov	eax, DWORD PTR 8[rsp]
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR [r15]
	mov	edi, DWORD PTR [rax]
	call	wlapi_enable_mac@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edi, DWORD PTR maccontrol[rip]
	call	D11REGOFFS@PLT
	mov	edi, DWORD PTR 16[r15]
	mov	esi, eax
	call	bcma_read32@PLT
	xor	edx, edx
	and	eax, DWORD PTR MCTL_EN_MAC[rip]
	sete	dl
	mov	DWORD PTR 8[rsp], edx
	jne	.L30
.L3:
	mov	esi, DWORD PTR TEMPSENSE[rip]
	mov	rdi, r15
	call	wlc_lcnphy_vbat_temp_sense_setup@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L30:
	mov	rax, QWORD PTR [r15]
	mov	edi, DWORD PTR [rax]
	call	wlapi_suspend_mac_and_wait@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	wlc_lcnphy_tempsense, .-wlc_lcnphy_tempsense
	.comm	maccontrol,4,4
	.comm	TEMPSENSE,4,4
	.comm	MCTL_EN_MAC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_phy_lcn.c_wlc_lcnphy_tempsense.c"
	.text
	.align	2
	.global	wlc_lcnphy_tempsense
	.syntax unified
	.arm
	.fpu softvfp
	.type	wlc_lcnphy_tempsense, %function
wlc_lcnphy_tempsense:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r1
	mov	r5, r0
	bl	wlc_lcnphy_get_tx_pwr_ctrl
	cmp	r6, #1
	mov	r7, r0
	movne	r8, #0
	ldr	r9, [r5, #12]
	beq	.L30
.L2:
	ldr	r1, .L33
	mov	r0, r5
	bl	read_phy_reg
	ldr	r1, .L33+4
	mov	r10, r0
	mov	r0, r5
	bl	read_phy_reg
	ldr	r4, .L33+8
	ldr	r2, [r9]
	tst	r10, #256
	and	r10, r10, r4
	and	r3, r0, r4
	moveq	r4, r10
	subne	r4, r10, #512
	cmp	r2, #1
	and	r0, r0, #256
	beq	.L5
	ldr	r1, [r5, #4]
	cmp	r1, #0
	beq	.L6
.L5:
	cmp	r0, #0
	sub	r4, r4, r3
	addne	r4, r4, #512
.L7:
	cmp	r4, #0
	addlt	r4, r4, #512
	cmp	r2, #2
	moveq	r4, r10
	cmp	r6, #0
	bne	.L31
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	add	r4, r4, r3
	cmp	r0, #0
	subne	r4, r4, #512
	add	r4, r4, r4, lsr #31
	asr	r4, r4, #1
	b	.L7
.L31:
	mov	r1, r7
	mov	r0, r5
	bl	wlc_lcnphy_set_tx_pwr_ctrl
	cmp	r6, #1
	bne	.L1
	mov	r3, #16384
	ldr	r1, .L33+12
	mov	r2, r3
	mov	r0, r5
	bl	mod_phy_reg
	mov	r0, #100
	bl	udelay
	mov	r3, #0
	mov	r2, #16384
	mov	r0, r5
	ldr	r1, .L33+12
	bl	mod_phy_reg
	cmp	r8, #0
	bne	.L1
	ldr	r3, [r5]
	ldr	r0, [r3]
	bl	wlapi_enable_mac
	b	.L1
.L30:
	ldr	r3, .L33+16
	ldr	r4, [r5, #8]
	ldr	r0, [r3]
	bl	D11REGOFFS
	mov	r1, r0
	mov	r0, r4
	bl	bcma_read32
	ldr	r3, .L33+20
	ldr	r3, [r3]
	and	r0, r0, r3
	cmp	r0, #0
	moveq	r8, #1
	movne	r8, #0
	bne	.L32
.L3:
	ldr	r3, .L33+24
	mov	r0, r5
	ldr	r1, [r3]
	bl	wlc_lcnphy_vbat_temp_sense_setup
	b	.L2
.L32:
	ldr	r3, [r5]
	ldr	r0, [r3]
	bl	wlapi_suspend_mac_and_wait
	b	.L3
.L34:
	.align	2
.L33:
	.word	1142
	.word	1143
	.word	511
	.word	1096
	.word	maccontrol
	.word	MCTL_EN_MAC
	.word	TEMPSENSE
	.size	wlc_lcnphy_tempsense, .-wlc_lcnphy_tempsense
	.comm	maccontrol,4,4
	.comm	TEMPSENSE,4,4
	.comm	MCTL_EN_MAC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
