	.file	"extr_cxd2880_tnrdmd.c_x_tune2.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	x_tune2, @function
x_tune2:
.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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR EINVAL[rip]
	mov	DWORD PTR 20[rsp], 0
	mov	QWORD PTR 12[rsp], 0
	neg	eax
	test	rdi, rdi
	je	.L1
	mov	rax, QWORD PTR [rdi]
	mov	r14, rdi
	mov	r12d, esi
	mov	ebp, edx
	mov	ebx, ecx
	xor	edx, edx
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	ecx, 17
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	test	eax, eax
	jne	.L1
	lea	r13, 12[rsp]
	mov	DWORD PTR 20[rsp], 1
	mov	edx, 45
	movabs	rax, 60129542145
	mov	QWORD PTR 12[rsp], rax
	mov	rax, QWORD PTR [r14]
	mov	r8d, 3
	mov	rcx, r13
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	rdi, rax
	call	[QWORD PTR 8[rax]]
	test	eax, eax
	je	.L26
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L27
	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
.L26:
	.cfi_restore_state
	mov	edi, DWORD PTR x_tune2_seq1[rip]
	call	ARRAY_SIZE@PLT
	mov	edx, DWORD PTR x_tune2_seq1[rip]
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	rdi, QWORD PTR [r14]
	mov	ecx, eax
	call	cxd2880_io_write_multi_regs@PLT
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR [r14]
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	rcx, r13
	mov	edx, 44
	mov	r8d, 1
	mov	rdi, rax
	call	[QWORD PTR 16[rax]]
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR [r14]
	xor	edx, edx
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	ecx, 16
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR [r14]
	mov	ecx, DWORD PTR 12[rsp]
	mov	edx, 96
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR x_tune2_seq2[rip]
	call	ARRAY_SIZE@PLT
	mov	edx, DWORD PTR x_tune2_seq2[rip]
	mov	esi, DWORD PTR CXD2880_IO_TGT_SYS[rip]
	mov	rdi, QWORD PTR [r14]
	mov	ecx, eax
	call	cxd2880_io_write_multi_regs@PLT
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR x_tune2_seq3[rip]
	call	ARRAY_SIZE@PLT
	mov	edx, DWORD PTR x_tune2_seq3[rip]
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	rdi, QWORD PTR [r14]
	mov	ecx, eax
	call	cxd2880_io_write_multi_regs@PLT
	test	eax, eax
	jne	.L1
	test	ebx, ebx
	je	.L19
	mov	rax, QWORD PTR [r14]
	xor	edx, edx
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	ecx, 225
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR [r14]
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	rcx, r13
	mov	edx, 96
	mov	r8d, 2
	mov	rdi, rax
	call	[QWORD PTR 16[rax]]
	test	eax, eax
	jne	.L1
	imul	eax, ebx, 1000
	cmp	ebp, 129
	je	.L7
	test	eax, eax
	js	.L8
	lea	r15d, 91[rax]
	mov	eax, 3004130131
	imul	r15, rax
	shr	r15, 39
.L9:
	mov	edi, DWORD PTR 12[rsp]
	mov	esi, 16
	sal	edi, 8
	or	edi, DWORD PTR 16[rsp]
	call	cxd2880_convert2s_complement@PLT
	mov	edx, -32768
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	rcx, r13
	add	eax, r15d
	mov	r8d, 2
	cmp	eax, -32768
	cmovl	eax, edx
	mov	edx, 32767
	cmp	eax, 32767
	cmovg	eax, edx
	movzx	edx, ah
	and	eax, 255
	mov	DWORD PTR 16[rsp], eax
	mov	rax, QWORD PTR [r14]
	mov	DWORD PTR 12[rsp], edx
	mov	edx, 96
	mov	rdi, rax
	call	[QWORD PTR 8[rax]]
	test	eax, eax
	jne	.L1
	mov	rax, QWORD PTR [r14]
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	rcx, r13
	mov	edx, 105
	mov	r8d, 1
	mov	rdi, rax
	call	[QWORD PTR 16[rax]]
	test	eax, eax
	jne	.L1
	imul	eax, ebx, -1000
	cmp	DWORD PTR CXD2880_DTV_BW_1_7_MHZ[rip], r12d
	je	.L28
	cmp	ebp, 129
	je	.L16
	test	ebx, ebx
	jle	.L29
	sub	eax, 17578
	mov	ecx, 35156
	cdq
	idiv	ecx
	mov	ebx, eax
.L14:
	mov	edi, DWORD PTR 12[rsp]
	mov	esi, 8
	call	cxd2880_convert2s_complement@PLT
	mov	edx, -128
	mov	ecx, 127
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	add	eax, ebx
	cmp	eax, -128
	cmovl	eax, edx
	mov	edx, 105
	cmp	eax, 127
	cmovg	eax, ecx
	movzx	ecx, al
	mov	rax, QWORD PTR [r14]
	mov	DWORD PTR 12[rsp], ecx
	mov	rdi, rax
	call	[QWORD PTR [rax]]
	test	eax, eax
	jne	.L1
.L19:
	cmp	QWORD PTR 8[r14], 0
	je	.L6
	mov	edi, DWORD PTR x_tune2_seq4[rip]
	call	ARRAY_SIZE@PLT
	mov	edx, DWORD PTR x_tune2_seq4[rip]
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	rdi, QWORD PTR [r14]
	mov	ecx, eax
	call	cxd2880_io_write_multi_regs@PLT
	test	eax, eax
	jne	.L1
.L6:
	mov	edi, DWORD PTR x_tune2_seq5[rip]
	call	ARRAY_SIZE@PLT
	mov	edx, DWORD PTR x_tune2_seq5[rip]
	mov	esi, DWORD PTR CXD2880_IO_TGT_DMD[rip]
	mov	rdi, QWORD PTR [r14]
	mov	ecx, eax
	call	cxd2880_io_write_multi_regs@PLT
	jmp	.L1
.L7:
	test	eax, eax
	js	.L10
	add	eax, 89
	mov	ecx, 178
	cdq
	idiv	ecx
	mov	r15d, eax
	jmp	.L9
.L8:
	sub	eax, 91
	mov	ecx, 183
	cdq
	idiv	ecx
	mov	r15d, eax
	jmp	.L9
.L10:
	sub	eax, 89
	mov	ecx, 178
	cdq
	idiv	ecx
	mov	r15d, eax
	jmp	.L9
.L27:
	call	__stack_chk_fail@PLT
.L28:
	cmp	ebp, 129
	je	.L12
	test	ebx, ebx
	jle	.L30
	sub	eax, 8789
	mov	ecx, 17578
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
.L16:
	test	ebx, ebx
	jle	.L31
	sub	eax, 17090
	mov	ecx, 34180
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
.L29:
	add	eax, 17578
	mov	ecx, 35156
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
.L31:
	add	eax, 17090
	mov	ecx, 34180
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
.L30:
	add	eax, 8789
	mov	ecx, 17578
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
.L12:
	test	ebx, ebx
	jle	.L32
	sub	eax, 8545
	mov	ecx, 17090
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
.L32:
	add	eax, 8545
	mov	ecx, 17090
	cdq
	idiv	ecx
	mov	ebx, eax
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	x_tune2, .-x_tune2
	.comm	x_tune2_seq5,4,4
	.comm	x_tune2_seq4,4,4
	.comm	x_tune2_seq3,4,4
	.comm	x_tune2_seq2,4,4
	.comm	x_tune2_seq1,4,4
	.comm	EINVAL,4,4
	.comm	CXD2880_IO_TGT_SYS,4,4
	.comm	CXD2880_IO_TGT_DMD,4,4
	.comm	CXD2880_DTV_BW_1_7_MHZ,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_cxd2880_tnrdmd.c_x_tune2.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	x_tune2, %function
x_tune2:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r3
	ldr	r3, .L35
	sub	sp, sp, #36
	subs	r4, r0, #0
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	str	ip, [sp, #16]
	str	ip, [sp, #20]
	str	ip, [sp, #24]
	beq	.L27
	ldr	r0, [r4]
	ldr	r8, .L35+4
	mov	r7, r1
	mov	r6, r2
	mov	r3, #17
	mov	r2, ip
	ldr	r9, [r0]
	ldr	r1, [r8]
	blx	r9
	cmp	r0, #0
	bne	.L1
	mov	r2, #3
	mov	r9, #1
	mov	r3, #14
	ldr	r0, [r4]
	str	r2, [sp]
	ldr	r10, [r0, #4]
	mov	r2, #45
	str	r3, [sp, #20]
	ldr	r1, [r8]
	str	r9, [sp, #16]
	str	r9, [sp, #24]
	add	r3, sp, #16
	blx	r10
	cmp	r0, #0
	beq	.L28
.L1:
	ldr	r3, .L35
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L29
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	ldr	r3, .L35+8
	ldr	r1, [r8]
	ldr	r10, [r3]
	ldr	fp, [r4]
	mov	r0, r10
	str	r1, [sp, #12]
	bl	ARRAY_SIZE
	mov	r2, r10
	mov	r3, r0
	ldr	r1, [sp, #12]
	mov	r0, fp
	bl	cxd2880_io_write_multi_regs
	cmp	r0, #0
	bne	.L1
	ldr	r0, [r4]
	str	r9, [sp]
	mov	r2, #44
	ldr	r9, [r0, #8]
	ldr	r1, [r8]
	add	r3, sp, #16
	blx	r9
	cmp	r0, #0
	bne	.L1
	ldr	r3, [r4]
	mov	r2, r0
	ldr	r9, [r3]
	mov	r0, r3
	ldr	r1, [r8]
	mov	r3, #16
	blx	r9
	cmp	r0, #0
	bne	.L1
	ldr	r0, [r4]
	mov	r2, #96
	ldr	r3, [sp, #16]
	ldr	r9, [r0]
	ldr	r1, [r8]
	blx	r9
	cmp	r0, #0
	bne	.L1
	ldr	r3, .L35+12
	ldr	r10, [r8]
	ldr	r8, [r3]
	ldr	r9, [r4]
	mov	r0, r8
	bl	ARRAY_SIZE
	mov	r2, r8
	mov	r3, r0
	mov	r1, r10
	mov	r0, r9
	bl	cxd2880_io_write_multi_regs
	cmp	r0, #0
	bne	.L1
	ldr	r3, .L35+16
	ldr	r8, .L35+20
	ldr	r9, [r3]
	ldr	fp, [r8]
	mov	r0, r9
	ldr	r10, [r4]
	bl	ARRAY_SIZE
	mov	r2, r9
	mov	r3, r0
	mov	r1, fp
	mov	r0, r10
	bl	cxd2880_io_write_multi_regs
	cmp	r0, #0
	bne	.L1
	cmp	r5, #0
	ldr	r9, [r4]
	ldr	r10, [r8]
	beq	.L4
	mov	r1, r10
	mov	r0, r9
	mov	r3, #225
	mov	r2, #0
	ldr	r10, [r9]
	blx	r10
	cmp	r0, #0
	bne	.L1
	mov	r3, #2
	ldr	r0, [r4]
	str	r3, [sp]
	mov	r2, #96
	ldr	r9, [r0, #8]
	ldr	r1, [r8]
	add	r3, sp, #16
	blx	r9
	cmp	r0, #0
	bne	.L1
	rsb	r0, r5, r5, lsl #5
	add	r0, r5, r0, lsl #2
	cmp	r6, #129
	lsl	r0, r0, #3
	beq	.L5
	cmp	r0, #0
	blt	.L6
	ldr	r9, .L35+24
	add	r3, r0, #91
	umull	r2, r3, r9, r3
	lsr	r9, r3, #7
.L7:
	ldr	r3, [sp, #20]
	ldr	r0, [sp, #16]
	mov	r1, #16
	orr	r0, r3, r0, lsl #8
	bl	cxd2880_convert2s_complement
	ldr	r2, .L35+28
	add	r3, r9, r0
	cmp	r3, r2
	movlt	r3, r2
	ldr	r2, .L35+32
	mov	r1, #2
	cmp	r3, r2
	movge	r3, r2
	ldr	r0, [r4]
	asr	r2, r3, #8
	str	r1, [sp]
	and	r2, r2, #255
	and	r3, r3, #255
	str	r2, [sp, #16]
	str	r3, [sp, #20]
	mov	r2, #96
	ldr	r9, [r0, #4]
	ldr	r1, [r8]
	add	r3, sp, #16
	blx	r9
	cmp	r0, #0
	bne	.L1
	mov	r3, #1
	ldr	r0, [r4]
	str	r3, [sp]
	mov	r2, #105
	ldr	r9, [r0, #8]
	ldr	r1, [r8]
	add	r3, sp, #16
	blx	r9
	cmp	r0, #0
	bne	.L1
	ldr	r2, .L35+36
	rsb	r3, r5, r5, lsl #22
	ldr	r2, [r2]
	add	r3, r5, r3, lsl #6
	add	r3, r5, r3, lsl #1
	cmp	r2, r7
	lsl	r3, r3, #3
	beq	.L30
	cmp	r6, #129
	beq	.L14
	cmp	r5, #0
	ble	.L31
	ldr	r2, .L35+40
	sub	r3, r3, #17408
	sub	r3, r3, #170
	smull	r0, r1, r3, r2
	asr	r3, r3, #31
	rsb	r5, r3, r1, asr #14
.L12:
	mov	r1, #8
	ldr	r0, [sp, #16]
	bl	cxd2880_convert2s_complement
	mvn	r3, #127
	add	r5, r5, r0
	cmp	r5, r3
	movlt	r5, r3
	cmp	r5, #127
	movge	r5, #127
	ldr	r0, [r4]
	and	r3, r5, #255
	mov	r2, #105
	ldr	r5, [r0]
	ldr	r1, [r8]
	str	r3, [sp, #16]
	blx	r5
	cmp	r0, #0
	bne	.L1
	ldr	r9, [r4]
	ldr	r10, [r8]
.L4:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	beq	.L17
	ldr	r3, .L35+44
	ldr	r5, [r3]
	mov	r0, r5
	bl	ARRAY_SIZE
	mov	r2, r5
	mov	r3, r0
	mov	r1, r10
	mov	r0, r9
	bl	cxd2880_io_write_multi_regs
	cmp	r0, #0
	bne	.L1
	ldr	r9, [r4]
	ldr	r10, [r8]
.L17:
	ldr	r3, .L35+48
	ldr	r4, [r3]
	mov	r0, r4
	bl	ARRAY_SIZE
	mov	r2, r4
	mov	r3, r0
	mov	r1, r10
	mov	r0, r9
	bl	cxd2880_io_write_multi_regs
	b	.L1
.L27:
	ldr	r3, .L35+52
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L5:
	cmp	r0, #0
	mov	r1, #178
	addge	r0, r0, #89
	sublt	r0, r0, #89
	bl	__aeabi_idiv
	mov	r9, r0
	b	.L7
.L6:
	mov	r1, #183
	sub	r0, r0, #91
	bl	__aeabi_idiv
	mov	r9, r0
	b	.L7
.L29:
	bl	__stack_chk_fail
.L30:
	cmp	r6, #129
	beq	.L10
	cmp	r5, #0
	ble	.L32
	ldr	r2, .L35+40
	sub	r3, r3, #8768
	sub	r3, r3, #21
	smull	r0, r1, r3, r2
	asr	r3, r3, #31
	rsb	r5, r3, r1, asr #13
	b	.L12
.L14:
	cmp	r5, #0
	ble	.L33
	ldr	r2, .L35+56
	sub	r3, r3, #16896
	sub	r3, r3, #194
	smull	r0, r1, r3, r2
	asr	r3, r3, #31
	rsb	r5, r3, r1, asr #14
	b	.L12
.L31:
	ldr	r2, .L35+60
	add	r3, r3, #17408
	add	r3, r3, #170
	umull	r0, r1, r3, r2
	lsr	r5, r1, #15
	b	.L12
.L33:
	ldr	r2, .L35+64
	add	r3, r3, #16896
	add	r3, r3, #194
	umull	r0, r1, r3, r2
	lsr	r5, r1, #15
	b	.L12
.L32:
	ldr	r2, .L35+60
	add	r3, r3, #8768
	add	r3, r3, #21
	umull	r0, r1, r3, r2
	lsr	r5, r1, #14
	b	.L12
.L10:
	cmp	r5, #0
	ble	.L34
	ldr	r2, .L35+56
	sub	r3, r3, #8512
	sub	r3, r3, #33
	smull	r0, r1, r3, r2
	asr	r3, r3, #31
	rsb	r5, r3, r1, asr #13
	b	.L12
.L34:
	ldr	r2, .L35+64
	add	r3, r3, #8512
	add	r3, r3, #33
	umull	r0, r1, r3, r2
	lsr	r5, r1, #14
	b	.L12
.L36:
	.align	2
.L35:
	.word	.LC0
	.word	CXD2880_IO_TGT_SYS
	.word	x_tune2_seq1
	.word	x_tune2_seq2
	.word	x_tune2_seq3
	.word	CXD2880_IO_TGT_DMD
	.word	-1290837165
	.word	-32768
	.word	32767
	.word	CXD2880_DTV_BW_1_7_MHZ
	.word	2001614069
	.word	x_tune2_seq4
	.word	x_tune2_seq5
	.word	EINVAL
	.word	2058769579
	.word	-291739159
	.word	-177428139
	.size	x_tune2, .-x_tune2
	.comm	x_tune2_seq5,4,4
	.comm	x_tune2_seq4,4,4
	.comm	x_tune2_seq3,4,4
	.comm	x_tune2_seq2,4,4
	.comm	x_tune2_seq1,4,4
	.comm	EINVAL,4,4
	.comm	CXD2880_IO_TGT_SYS,4,4
	.comm	CXD2880_IO_TGT_DMD,4,4
	.comm	CXD2880_DTV_BW_1_7_MHZ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
