	.file	"extr_renesas-cpg-mssr.c_cpg_mstp_clock_endisable.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Failed to enable SMSTP %p[%d]\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"OFF"
.LC2:
	.string	"MSTP %u%02u/%pC %s\n"
.LC3:
	.string	"ON"
	.text
	.p2align 4
	.type	cpg_mstp_clock_endisable, @function
cpg_mstp_clock_endisable:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, esi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	call	to_mstp_clock@PLT
	mov	r14d, DWORD PTR [rax]
	mov	r13, QWORD PTR 8[rax]
	test	r14d, r14d
	lea	r12d, 31[r14]
	mov	eax, r14d
	cmovns	r12d, r14d
	sar	eax, 31
	shr	eax, 27
	add	r14d, eax
	sar	r12d, 5
	and	r14d, 31
	sub	r14d, eax
	mov	rax, QWORD PTR 24[r13]
	mov	edi, r14d
	mov	QWORD PTR 8[rsp], rax
	call	BIT@PLT
	mov	r15d, eax
	test	ebx, ebx
	je	.L26
	mov	r8d, DWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 8[rsp]
	mov	ecx, r14d
	mov	edx, r12d
	lea	r9, .LC3[rip]
	lea	rsi, .LC2[rip]
	call	dev_dbg@PLT
	lea	rbp, 16[r13]
	xor	esi, esi
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	eax, r15d
	cmp	QWORD PTR 8[r13], 0
	not	eax
	mov	DWORD PTR 16[rsp], eax
	jne	.L12
	mov	rcx, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	QWORD PTR 24[rsp], rcx
	call	SMSTPCR@PLT
	mov	rcx, QWORD PTR 24[rsp]
	lea	rdi, [rax+rcx]
	call	readl@PLT
	mov	r8d, DWORD PTR 16[rsp]
	and	r8d, eax
.L13:
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	DWORD PTR 24[rsp], r8d
	mov	QWORD PTR 16[rsp], rax
	call	SMSTPCR@PLT
	mov	rdx, QWORD PTR 16[rsp]
	mov	r8d, DWORD PTR 24[rsp]
	lea	rsi, [rdx+rax]
	mov	edi, r8d
	call	writel@PLT
.L4:
	xor	esi, esi
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	test	ebx, ebx
	je	.L5
	cmp	QWORD PTR 8[r13], 0
	jne	.L5
	mov	ebp, 1000
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	xor	eax, eax
	call	cpu_relax@PLT
	sub	ebp, 1
	je	.L27
.L6:
	mov	rbx, QWORD PTR 0[r13]
	mov	edi, r12d
	call	MSTPSR@PLT
	lea	rdi, [rbx+rax]
	call	readl@PLT
	test	eax, r15d
	jne	.L28
.L5:
	xor	eax, eax
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L12:
	.cfi_restore_state
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	QWORD PTR 24[rsp], rax
	call	STBCR@PLT
	mov	rdx, QWORD PTR 24[rsp]
	lea	rdi, [rdx+rax]
	call	readb@PLT
	mov	r8d, DWORD PTR 16[rsp]
	and	r8d, eax
.L9:
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	DWORD PTR 24[rsp], r8d
	mov	QWORD PTR 16[rsp], rax
	call	STBCR@PLT
	mov	rcx, QWORD PTR 16[rsp]
	mov	r8d, DWORD PTR 24[rsp]
	lea	rsi, [rcx+rax]
	mov	edi, r8d
	call	writeb@PLT
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	QWORD PTR 16[rsp], rax
	call	STBCR@PLT
	mov	rdx, QWORD PTR 16[rsp]
	lea	rdi, [rdx+rax]
	call	readb@PLT
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	QWORD PTR 16[rsp], rax
	call	STBCR@PLT
	mov	rcx, QWORD PTR 16[rsp]
	lea	rdi, [rcx+rax]
	call	barrier_data@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L26:
	mov	r8d, DWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 8[rsp]
	mov	ecx, r14d
	mov	edx, r12d
	lea	r9, .LC1[rip]
	lea	rsi, .LC2[rip]
	call	dev_dbg@PLT
	lea	rbp, 16[r13]
	xor	esi, esi
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	cmp	QWORD PTR 8[r13], 0
	je	.L29
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	QWORD PTR 16[rsp], rax
	call	STBCR@PLT
	mov	rcx, QWORD PTR 16[rsp]
	lea	rdi, [rcx+rax]
	call	readb@PLT
	or	eax, r15d
	mov	r8d, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rax, QWORD PTR 0[r13]
	mov	edi, r12d
	mov	QWORD PTR 16[rsp], rax
	call	SMSTPCR@PLT
	mov	rdx, QWORD PTR 16[rsp]
	lea	rdi, [rax+rdx]
	call	readl@PLT
	or	eax, r15d
	mov	r8d, eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L27:
	mov	rbx, QWORD PTR 0[r13]
	mov	edi, r12d
	call	SMSTPCR@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	ecx, r14d
	lea	rsi, .LC0[rip]
	lea	rdx, [rbx+rax]
	call	dev_err@PLT
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	neg	eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	cpg_mstp_clock_endisable, .-cpg_mstp_clock_endisable
	.comm	ETIMEDOUT,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_renesas-cpg-mssr.c_cpg_mstp_clock_endisable.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed to enable SMSTP %p[%d]\012\000"
	.align	2
.LC1:
	.ascii	"MSTP %u%02u/%pC %s\012\000"
	.align	2
.LC2:
	.ascii	"OFF\000"
	.align	2
.LC3:
	.ascii	"ON\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cpg_mstp_clock_endisable, %function
cpg_mstp_clock_endisable:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r4, r1
	mov	r10, r0
	bl	to_mstp_clock
	ldr	r7, [r0]
	ldr	r6, [r0, #4]
	cmp	r7, #0
	add	r5, r7, #31
	movge	r5, r7
	rsbs	r3, r7, #0
	and	r3, r3, #31
	and	r7, r7, #31
	rsbpl	r7, r3, #0
	mov	r0, r7
	ldr	r9, [r6, #12]
	bl	BIT
	cmp	r4, #0
	mov	r8, r0
	ldr	r3, [r10]
	asr	r5, r5, #5
	beq	.L26
	ldr	r2, .L30
	ldr	r1, .L30+4
	str	r3, [sp]
	str	r2, [sp, #4]
	mov	r3, r7
	mov	r2, r5
	mov	r0, r9
	add	r10, r6, #8
	bl	dev_dbg
	mov	r0, r10
	mov	r1, #0
	bl	spin_lock_irqsave
	ldr	r3, [r6, #4]
	mvn	fp, r8
	cmp	r3, #0
	ldr	r3, [r6]
	mov	r0, r5
	str	r3, [sp, #12]
	bne	.L12
	bl	SMSTPCR
	ldr	r3, [sp, #12]
	add	r0, r0, r3
	bl	readl
	and	fp, fp, r0
.L13:
	ldr	r1, [r6]
	mov	r0, r5
	str	r1, [sp, #12]
	bl	SMSTPCR
	mov	r3, r0
	ldr	r1, [sp, #12]
	mov	r0, fp
	add	r1, r1, r3
	bl	writel
.L4:
	mov	r0, r10
	mov	r1, #0
	bl	spin_unlock_irqrestore
	cmp	r4, #0
	beq	.L5
	ldr	r3, [r6, #4]
	cmp	r3, #0
	bne	.L5
	mov	r4, #1000
	b	.L6
.L28:
	bl	cpu_relax
	subs	r4, r4, #1
	beq	.L27
.L6:
	mov	r0, r5
	ldr	r10, [r6]
	bl	MSTPSR
	add	r0, r10, r0
	bl	readl
	tst	r0, r8
	bne	.L28
.L5:
	mov	r0, #0
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	bl	STBCR
	ldr	r3, [sp, #12]
	add	r0, r3, r0
	bl	readb
	and	fp, fp, r0
.L9:
	ldr	r1, [r6]
	mov	r0, r5
	str	r1, [sp, #12]
	bl	STBCR
	mov	r3, r0
	ldr	r1, [sp, #12]
	mov	r0, fp
	add	r1, r1, r3
	bl	writeb
	mov	r0, r5
	ldr	fp, [r6]
	bl	STBCR
	add	r0, fp, r0
	bl	readb
	mov	r0, r5
	ldr	fp, [r6]
	bl	STBCR
	add	r0, fp, r0
	bl	barrier_data
	b	.L4
.L26:
	ldr	r2, .L30+8
	ldr	r1, .L30+4
	str	r3, [sp]
	str	r2, [sp, #4]
	mov	r3, r7
	mov	r2, r5
	mov	r0, r9
	add	r10, r6, #8
	bl	dev_dbg
	mov	r0, r10
	mov	r1, #0
	bl	spin_lock_irqsave
	ldr	r3, [r6, #4]
	cmp	r3, #0
	beq	.L29
	mov	r0, r5
	ldr	fp, [r6]
	bl	STBCR
	add	r0, fp, r0
	bl	readb
	orr	fp, r8, r0
	b	.L9
.L29:
	mov	r0, r5
	ldr	fp, [r6]
	bl	SMSTPCR
	add	r0, r0, fp
	bl	readl
	orr	fp, r0, r8
	b	.L13
.L27:
	mov	r0, r5
	ldr	r4, [r6]
	bl	SMSTPCR
	mov	r3, r7
	add	r2, r4, r0
	ldr	r1, .L30+12
	mov	r0, r9
	bl	dev_err
	ldr	r3, .L30+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L31:
	.align	2
.L30:
	.word	.LC3
	.word	.LC1
	.word	.LC2
	.word	.LC0
	.word	ETIMEDOUT
	.size	cpg_mstp_clock_endisable, .-cpg_mstp_clock_endisable
	.comm	ETIMEDOUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
