	.file	"extr_mantis_vp2040.c_tda1002x_cu1216_tuner_set.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	tda1002x_cu1216_tuner_set, @function
tda1002x_cu1216_tuner_set:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 72
	.cfi_def_cfa_offset 112
	mov	ecx, DWORD PTR 16[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	lea	edx, 36156250[rcx]
	mov	r12, QWORD PTR [rax]
	lea	rax, 32[rsp]
	mov	DWORD PTR [rsp], 96
	mov	QWORD PTR 8[rsp], rax
	movsx	rax, edx
	sar	edx, 31
	imul	rax, rax, 1125899907
	mov	DWORD PTR 16[rsp], 24
	mov	QWORD PTR 24[rsp], 0
	mov	DWORD PTR 40[rsp], 206
	sar	rax, 46
	sub	eax, edx
	mov	edx, eax
	and	eax, 255
	sar	edx, 8
	mov	DWORD PTR 36[rsp], eax
	mov	eax, 1
	and	edx, 127
	mov	DWORD PTR 32[rsp], edx
	cmp	ecx, 149999999
	jle	.L2
	xor	eax, eax
	cmp	ecx, 445000000
	setge	al
	lea	eax, 2[rax+rax]
.L2:
	mov	DWORD PTR 44[rsp], eax
	movabs	rax, 137438953694
	mov	QWORD PTR 48[rsp], rax
	mov	rax, QWORD PTR 0[rbp]
	test	rax, rax
	je	.L3
	mov	esi, 1
	mov	rdi, rbp
	call	rax
.L3:
	mov	r13, rsp
	mov	edx, 1
	mov	rdi, r12
	mov	rsi, r13
	call	i2c_transfer@PLT
	cmp	eax, 1
	jne	.L28
	mov	rax, QWORD PTR I2C_M_RD[rip]
	mov	DWORD PTR 16[rsp], 1
	mov	ebx, 20
	mov	QWORD PTR 24[rsp], rax
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, QWORD PTR 0[rbp]
	test	rax, rax
	je	.L6
	mov	esi, 1
	mov	rdi, rbp
	call	rax
.L6:
	mov	edx, 1
	mov	rsi, r13
	mov	rdi, r12
	call	i2c_transfer@PLT
	cmp	eax, 1
	jne	.L7
	test	BYTE PTR 32[rsp], 64
	jne	.L8
.L7:
	mov	edi, 10
	call	msleep@PLT
	sub	ebx, 1
	jne	.L9
.L8:
	lea	rax, 40[rsp]
	and	DWORD PTR 40[rsp], -65
	mov	QWORD PTR 8[rsp], rax
	mov	rax, QWORD PTR 0[rbp]
	mov	QWORD PTR 24[rsp], 0
	mov	DWORD PTR 16[rsp], 2
	test	rax, rax
	je	.L10
	mov	esi, 1
	mov	rdi, rbp
	call	rax
.L10:
	mov	edx, 1
	mov	rsi, r13
	mov	rdi, r12
	call	i2c_transfer@PLT
	mov	r8d, eax
	xor	eax, eax
	cmp	r8d, 1
	jne	.L28
.L1:
	mov	rcx, QWORD PTR 56[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L30
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	mov	eax, DWORD PTR EIO[rip]
	neg	eax
	jmp	.L1
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tda1002x_cu1216_tuner_set, .-tda1002x_cu1216_tuner_set
	.comm	TUNER_MUL,4,4
	.comm	I2C_M_RD,8,8
	.comm	EIO,4,4
	.comm	CU1216_IF,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_mantis_vp2040.c_tda1002x_cu1216_tuner_set.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tda1002x_cu1216_tuner_set, %function
tda1002x_cu1216_tuner_set:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	mov	r4, #96
	mov	lr, #24
	mov	ip, #0
	mov	r0, #206
	ldr	r2, [r5, #8]
	ldr	r3, .L29
	ldr	r1, .L29+4
	add	r3, r2, r3
	smull	r6, r1, r3, r1
	ldr	r6, .L29+8
	asr	r3, r3, #31
	rsb	r3, r3, r1, asr #14
	cmp	r2, r6
	ldr	r7, .L29+12
	ldr	r6, [r5, #4]
	sub	sp, sp, #48
	asr	r1, r3, #8
	and	r3, r3, #255
	ldr	r7, [r7]
	str	r7, [sp, #44]
	mov	r7,#0
	ldr	r6, [r6]
	and	r1, r1, #127
	str	r3, [sp, #24]
	add	r3, sp, #20
	movle	r2, #1
	str	r1, [sp, #20]
	str	r4, [sp, #4]
	str	lr, [sp, #12]
	str	ip, [sp, #16]
	str	r0, [sp, #28]
	str	r3, [sp, #8]
	ble	.L2
	ldr	r3, .L29+16
	cmp	r2, r3
	movlt	r2, #2
	movge	r2, #4
.L2:
	mov	r0, #222
	mov	r1, #32
	ldr	r3, [r5]
	str	r2, [sp, #32]
	cmp	r3, #0
	str	r0, [sp, #36]
	str	r1, [sp, #40]
	beq	.L3
	mov	r1, #1
	mov	r0, r5
	blx	r3
.L3:
	mov	r2, #1
	mov	r0, r6
	add	r1, sp, #4
	bl	i2c_transfer
	cmp	r0, #1
	bne	.L26
	mov	r4, #20
	ldr	r3, .L29+20
	str	r0, [sp, #12]
	ldr	r3, [r3]
	str	r3, [sp, #16]
.L9:
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L6
	mov	r1, #1
	mov	r0, r5
	blx	r3
.L6:
	mov	r2, #1
	mov	r0, r6
	add	r1, sp, #4
	bl	i2c_transfer
	cmp	r0, #1
	bne	.L7
	ldr	r3, [sp, #20]
	tst	r3, #64
	bne	.L8
.L7:
	mov	r0, #10
	bl	msleep
	subs	r4, r4, #1
	bne	.L9
.L8:
	mov	r0, #0
	mov	r1, #2
	ldr	r3, [sp, #28]
	ldr	r2, [r5]
	bic	r3, r3, #64
	str	r3, [sp, #28]
	cmp	r2, r0
	add	r3, sp, #28
	str	r0, [sp, #16]
	str	r1, [sp, #12]
	str	r3, [sp, #8]
	beq	.L10
	mov	r0, r5
	mov	r1, #1
	blx	r2
.L10:
	mov	r0, r6
	mov	r2, #1
	add	r1, sp, #4
	bl	i2c_transfer
	cmp	r0, #1
	moveq	r0, #0
	bne	.L26
.L1:
	ldr	r3, .L29+12
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	add	sp, sp, #48
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L26:
	ldr	r3, .L29+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L28:
	bl	__stack_chk_fail
.L30:
	.align	2
.L29:
	.word	36156250
	.word	1125899907
	.word	149999999
	.word	.LC0
	.word	445000000
	.word	I2C_M_RD
	.word	EIO
	.size	tda1002x_cu1216_tuner_set, .-tda1002x_cu1216_tuner_set
	.comm	TUNER_MUL,4,4
	.comm	I2C_M_RD,4,4
	.comm	EIO,4,4
	.comm	CU1216_IF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
