	.file	"extr_am335x_prcm.c_am335x_clk_generic_set_source.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	am335x_clk_generic_set_source, @function
am335x_clk_generic_set_source:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR am335x_prcm_sc[rip], 0
	je	.L12
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edi, DWORD PTR [rdi]
	call	am335x_clk_details@PLT
	mov	rbp, rax
	mov	eax, DWORD PTR ENXIO[rip]
	test	rbp, rbp
	je	.L1
	lea	esi, -128[rbx]
	mov	eax, DWORD PTR ENXIO[rip]
	cmp	esi, 2
	jbe	.L13
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore 3
	.cfi_restore 6
	mov	eax, DWORD PTR ENXIO[rip]
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	lea	rax, CSWTCH.1[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	ebx, DWORD PTR [rax+rsi*4]
	mov	esi, ebx
	call	prcm_write_4@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, 10
	call	DELAY@PLT
.L6:
	mov	edi, DWORD PTR 0[rbp]
	call	prcm_read_4@PLT
	and	eax, 3
	cmp	eax, ebx
	jne	.L7
	add	rsp, 8
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	am335x_clk_generic_set_source, .-am335x_clk_generic_set_source
	.section	.rodata
	.align 8
	.type	CSWTCH.1, @object
	.size	CSWTCH.1, 12
CSWTCH.1:
	.long	1
	.long	2
	.long	0
	.comm	am335x_prcm_sc,8,8
	.comm	ENXIO,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_am335x_prcm.c_am335x_clk_generic_set_source.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	am335x_clk_generic_set_source, %function
am335x_clk_generic_set_source:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L14
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L12
	push	{r4, r5, r6, lr}
	ldr	r0, [r0]
	mov	r4, r1
	bl	am335x_clk_details
	subs	r5, r0, #0
	beq	.L5
	sub	r1, r4, #128
	cmp	r1, #2
	bls	.L13
.L5:
	ldr	r3, .L14+4
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L12:
	ldr	r3, .L14+4
	ldr	r0, [r3]
	bx	lr
.L13:
	ldr	r3, .L14+8
	ldr	r0, [r5]
	ldr	r4, [r3, r1, lsl #2]
	mov	r1, r4
	bl	prcm_write_4
	b	.L6
.L7:
	mov	r0, #10
	bl	DELAY
.L6:
	ldr	r0, [r5]
	bl	prcm_read_4
	and	r0, r0, #3
	cmp	r0, r4
	bne	.L7
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L15:
	.align	2
.L14:
	.word	am335x_prcm_sc
	.word	ENXIO
	.word	.LANCHOR0
	.size	am335x_clk_generic_set_source, .-am335x_clk_generic_set_source
	.comm	am335x_prcm_sc,4,4
	.comm	ENXIO,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	CSWTCH.1, %object
	.size	CSWTCH.1, 12
CSWTCH.1:
	.word	1
	.word	2
	.word	0
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
