	.file	"extr_sca3000_core.c_sca3000_set_frequency.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sca3000_set_frequency, @function
sca3000_set_frequency:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rcx
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	dev_get_drvdata@PLT
	mov	rdi, r12
	lea	rdx, 16[rsp]
	mov	esi, 10
	mov	rbp, QWORD PTR [rax]
	mov	DWORD PTR 4[rsp], 0
	call	strict_strtol@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L11
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rdi, rbp
	call	mutex_lock@PLT
	mov	esi, DWORD PTR 4[rbp]
	lea	rdx, 4[rsp]
	mov	rdi, rbp
	call	__sca3000_get_base_freq@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L3
	mov	esi, DWORD PTR SCA3000_REG_CTRL_SEL_OUT_CTRL[rip]
	lea	rdx, 8[rsp]
	mov	rdi, rbp
	call	sca3000_read_ctrl_reg@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L3
	movsx	rcx, DWORD PTR 4[rsp]
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, QWORD PTR 16[rsp]
	mov	eax, ecx
	mov	edx, DWORD PTR 4[rsi]
	shr	eax, 31
	add	eax, ecx
	and	edx, -4
	sar	eax
	mov	DWORD PTR 4[rsi], edx
	cdqe
	cmp	rax, rdi
	je	.L13
	test	ecx, ecx
	lea	eax, 3[rcx]
	cmovns	eax, ecx
	sar	eax, 2
	cdqe
	cmp	rdi, rax
	je	.L14
	cmp	rdi, rcx
	jne	.L15
.L5:
	mov	esi, DWORD PTR SCA3000_REG_CTRL_SEL_OUT_CTRL[rip]
	mov	rdi, rbp
	call	sca3000_write_ctrl_reg@PLT
	mov	r12d, eax
.L7:
	mov	rdi, rbp
	call	mutex_unlock@PLT
	test	r12d, r12d
	cmove	r12d, ebx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, rbp
	call	mutex_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	or	edx, DWORD PTR SCA3000_OUT_CTRL_BUF_DIV_2[rip]
	mov	DWORD PTR 4[rsi], edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L14:
	or	edx, DWORD PTR SCA3000_OUT_CTRL_BUF_DIV_4[rip]
	mov	DWORD PTR 4[rsi], edx
	jmp	.L5
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sca3000_set_frequency, .-sca3000_set_frequency
	.comm	SCA3000_REG_CTRL_SEL_OUT_CTRL,4,4
	.comm	SCA3000_OUT_CTRL_BUF_DIV_4,4,4
	.comm	SCA3000_OUT_CTRL_BUF_DIV_2,4,4
	.comm	EINVAL,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_sca3000_core.c_sca3000_set_frequency.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sca3000_set_frequency, %function
sca3000_set_frequency:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r5, r3
	ldr	r3, .L16
	sub	sp, sp, #20
	mov	r4, r2
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	dev_get_drvdata
	mov	r3, #0
	mov	ip, r0
	mov	r1, #10
	mov	r0, r4
	add	r2, sp, #8
	ldr	r6, [ip]
	str	r3, [sp]
	bl	strict_strtol
	subs	r4, r0, #0
	beq	.L11
.L1:
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L11:
	mov	r0, r6
	bl	mutex_lock
	mov	r2, sp
	mov	r0, r6
	ldr	r1, [r6, #4]
	bl	__sca3000_get_base_freq
	subs	r4, r0, #0
	bne	.L3
	ldr	r7, .L16+4
	mov	r0, r6
	ldr	r1, [r7]
	add	r2, sp, #4
	bl	sca3000_read_ctrl_reg
	subs	r4, r0, #0
	bne	.L3
	ldr	r1, [sp, #4]
	ldr	r3, [sp]
	ldr	r2, [r1, #4]
	ldr	r0, [sp, #8]
	add	ip, r3, r3, lsr #31
	bic	r2, r2, #3
	cmp	r0, ip, asr #1
	str	r2, [r1, #4]
	beq	.L13
	cmp	r3, #0
	add	ip, r3, #3
	movge	ip, r3
	cmp	r0, ip, asr #2
	beq	.L14
	cmp	r3, r0
	bne	.L15
.L5:
	mov	r0, r6
	ldr	r1, [r7]
	bl	sca3000_write_ctrl_reg
	mov	r4, r0
.L7:
	mov	r0, r6
	bl	mutex_unlock
	cmp	r4, #0
	moveq	r4, r5
	b	.L1
.L3:
	mov	r0, r6
	bl	mutex_unlock
	b	.L1
.L13:
	ldr	r3, .L16+8
	ldr	r3, [r3]
	orr	r2, r2, r3
	str	r2, [r1, #4]
	b	.L5
.L15:
	ldr	r3, .L16+12
	ldr	r0, [r3]
	rsb	r4, r0, #0
	b	.L7
.L14:
	ldr	r3, .L16+16
	ldr	r3, [r3]
	orr	r2, r2, r3
	str	r2, [r1, #4]
	b	.L5
.L12:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	SCA3000_REG_CTRL_SEL_OUT_CTRL
	.word	SCA3000_OUT_CTRL_BUF_DIV_2
	.word	EINVAL
	.word	SCA3000_OUT_CTRL_BUF_DIV_4
	.size	sca3000_set_frequency, .-sca3000_set_frequency
	.comm	SCA3000_REG_CTRL_SEL_OUT_CTRL,4,4
	.comm	SCA3000_OUT_CTRL_BUF_DIV_4,4,4
	.comm	SCA3000_OUT_CTRL_BUF_DIV_2,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
