	.file	"extr_radio-terratec.c_tt_setfreq.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tt_setfreq, @function
tt_setfreq:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	lea	r13, 8[rdi]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	mov	rdi, r13
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 56
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	r12, rsp
	call	mutex_lock@PLT
	mov	QWORD PTR 0[rbp], rbx
	mov	edx, 25
	xor	esi, esi
	mov	rdi, r12
	call	memset@PLT
	mov	rax, rbx
	lea	r8, 13[rsp]
	movabs	rdx, -3689348814741910323
	mul	rdx
	mov	ecx, 102400
	shr	rdx, 7
	lea	eax, [rdx+rdx*4]
	lea	eax, 10700[rax+rax]
	movsx	rsi, eax
	test	eax, eax
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, rsi
	movsx	rdi, ecx
	cqo
	idiv	rdi
	xor	eax, eax
	cmp	rdx, rsi
	je	.L4
	sub	rsi, rdi
	mov	eax, 1
.L4:
	mov	BYTE PTR [r8], al
	mov	eax, ecx
	sub	r8, 1
	shr	eax, 31
	add	ecx, eax
	sar	ecx
	test	rsi, rsi
	jne	.L5
.L6:
	lea	rbx, 24[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	call	outb@PLT
	mov	esi, DWORD PTR 12[rbp]
	mov	edi, DWORD PTR WRT_EN[rip]
	or	edi, DWORD PTR CLK_ON[rip]
	call	outb@PLT
	lea	rax, -1[rbx]
	cmp	r12, rbx
	je	.L17
.L11:
	mov	rbx, rax
.L3:
	cmp	BYTE PTR [rbx], 1
	mov	esi, DWORD PTR 12[rbp]
	mov	edi, DWORD PTR WRT_EN[rip]
	jne	.L7
	or	edi, DWORD PTR DATA[rip]
	call	outb@PLT
	mov	esi, DWORD PTR 12[rbp]
	mov	edi, DWORD PTR WRT_EN[rip]
	or	edi, DWORD PTR DATA[rip]
	or	edi, DWORD PTR CLK_ON[rip]
	call	outb@PLT
	mov	esi, DWORD PTR 12[rbp]
	mov	edi, DWORD PTR WRT_EN[rip]
	or	edi, DWORD PTR DATA[rip]
	call	outb@PLT
	lea	rax, -1[rbx]
	cmp	r12, rbx
	jne	.L11
.L17:
	mov	esi, DWORD PTR 12[rbp]
	xor	edi, edi
	call	outb@PLT
	mov	rdi, r13
	call	mutex_unlock@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tt_setfreq, .-tt_setfreq
	.comm	WRT_EN,4,4
	.comm	DATA,4,4
	.comm	CLK_ON,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_radio-terratec.c_tt_setfreq.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tt_setfreq, %function
tt_setfreq:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L16
	add	r9, r0, #4
	sub	sp, sp, #36
	mov	r5, r0
	mov	r0, r9
	mov	r4, r1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	mutex_lock
	mov	r2, #0
	mov	r8, #1
	mov	r7, sp
	mov	fp, #102400
	mov	r10, r2
	ldr	r3, .L16+4
	str	r4, [r5]
	umull	r1, r4, r3, r4
	lsr	r4, r4, #7
	add	r4, r4, r4, lsl #2
	lsl	r3, r4, r8
	add	r4, r3, #10688
	str	r2, [sp]
	add	r4, r4, #12
	str	r2, [r7, #4]
	str	r2, [r7, #8]
	str	r2, [r7, #12]
	str	r2, [r7, #16]
	str	r2, [r7, #20]
	strb	r2, [r7, #24]
	add	r6, sp, #13
.L4:
	mov	r1, fp
	mov	r0, r4
	bl	__aeabi_idivmod
	cmp	r1, r4
	beq	.L2
	sub	r4, r4, fp
	cmp	r4, #0
	add	fp, fp, fp, lsr #31
	asr	fp, fp, #1
	strb	r8, [r6], #-1
	bne	.L4
	mov	r3, r4
	ldr	r6, .L16+8
	ldr	r10, .L16+12
	ldr	r8, .L16+16
	add	r4, sp, #24
	b	.L8
.L5:
	bl	outb
	ldr	r0, [r6]
	ldr	r3, [r10]
	ldr	r1, [r5, #8]
	orr	r0, r0, r3
	bl	outb
	cmp	r4, r7
	beq	.L7
.L14:
	ldrb	r3, [r4, #-1]!	@ zero_extendqisi2
.L8:
	cmp	r3, #1
	ldr	r0, [r6]
	ldr	r1, [r5, #8]
	bne	.L5
	ldr	r3, [r8]
	orr	r0, r0, r3
	bl	outb
	ldr	r2, [r8]
	ldr	r3, [r6]
	ldr	r0, [r10]
	orr	r3, r3, r2
	ldr	r1, [r5, #8]
	orr	r0, r3, r0
	bl	outb
	ldr	r0, [r6]
	ldr	r3, [r8]
	ldr	r1, [r5, #8]
	orr	r0, r0, r3
	bl	outb
	cmp	r4, r7
	bne	.L14
.L7:
	ldr	r1, [r5, #8]
	mov	r0, #0
	bl	outb
	mov	r0, r9
	bl	mutex_unlock
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	mov	r0, #0
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	add	fp, fp, fp, lsr #31
	asr	fp, fp, #1
	strb	r10, [r6], #-1
	b	.L4
.L15:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	-858993459
	.word	WRT_EN
	.word	CLK_ON
	.word	DATA
	.size	tt_setfreq, .-tt_setfreq
	.comm	WRT_EN,4,4
	.comm	DATA,4,4
	.comm	CLK_ON,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
