	.file	"extr_dibusb-mc-common.c_dibusb_dib3000mc_tuner_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"LITE-ON DVB-T: Strange IF1 calibration :%2X %2X\n"
	.text
	.p2align 4
	.globl	dibusb_dib3000mc_tuner_attach
	.type	dibusb_dib3000mc_tuner_attach, @function
dibusb_dib3000mc_tuner_attach:
.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
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	r13, QWORD PTR 16[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR [rax]
	mov	edi, DWORD PTR 4[rax]
	call	le16_to_cpu@PLT
	cmp	rax, QWORD PTR USB_VID_LITEON[rip]
	je	.L21
.L2:
	mov	rax, QWORD PTR 8[rbx]
	mov	rax, QWORD PTR [rax]
	mov	edi, DWORD PTR 4[rax]
	call	le16_to_cpu@PLT
	cmp	rax, QWORD PTR USB_VID_DIBCOM[rip]
	je	.L6
.L7:
	mov	ebp, 1220
.L4:
	mov	rax, QWORD PTR [rbx]
	mov	esi, 1
	mov	edi, DWORD PTR [rax]
	call	dib3000mc_get_tuner_i2c_master@PLT
	mov	edi, DWORD PTR mt2060_attach[rip]
	mov	r8d, ebp
	lea	rcx, stk3000p_mt2060_config[rip]
	mov	r12, rax
	mov	rax, QWORD PTR [rbx]
	mov	edx, r12d
	mov	esi, DWORD PTR [rax]
	call	dvb_attach@PLT
	test	rax, rax
	je	.L22
	mov	rax, QWORD PTR [rbx]
	mov	DWORD PTR 0[r13], 1
	lea	rsi, stk3000p_dib3000p_config[rip]
	mov	edi, DWORD PTR [rax]
	call	dib3000mc_set_config@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L23
	add	rsp, 24
	.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
.L21:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rbx]
	mov	rax, QWORD PTR [rax]
	mov	edi, DWORD PTR [rax]
	call	le16_to_cpu@PLT
	cmp	rax, QWORD PTR USB_PID_LITEON_DVB_T_WARM[rip]
	jne	.L2
	mov	rdi, QWORD PTR 8[rbx]
	mov	rdx, rsp
	mov	esi, 126
	call	dibusb_read_eeprom_byte@PLT
	mov	rdi, QWORD PTR 8[rbx]
	mov	esi, 127
	lea	rdx, 4[rsp]
	call	dibusb_read_eeprom_byte@PLT
	mov	esi, DWORD PTR [rsp]
	test	esi, esi
	je	.L24
	mov	edx, DWORD PTR 4[rsp]
	cmp	esi, 128
	jne	.L5
	mov	ebp, 1220
	sub	ebp, edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rax, QWORD PTR [rbx]
	mov	r8d, DWORD PTR DVB_PLL_ENV57H1XD5[rip]
	mov	rcx, r12
	mov	edx, 96
	mov	edi, DWORD PTR dvb_pll_attach[rip]
	mov	esi, DWORD PTR [rax]
	call	dvb_attach@PLT
	mov	r8, rax
	xor	eax, eax
	test	r8, r8
	jne	.L1
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR 8[rbx]
	mov	rax, QWORD PTR [rax]
	mov	edi, DWORD PTR [rax]
	call	le16_to_cpu@PLT
	cmp	rax, QWORD PTR USB_PID_DIBCOM_MOD3001_WARM[rip]
	jne	.L7
	mov	rdi, QWORD PTR 8[rbx]
	lea	r12, 4[rsp]
	mov	esi, 7
	mov	ebp, 1220
	mov	rdx, r12
	call	dibusb_read_eeprom_byte@PLT
	cmp	DWORD PTR 4[rsp], 2
	jne	.L4
	mov	DWORD PTR [rsp], 127
	mov	esi, 127
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, QWORD PTR 8[rbx]
	mov	rdx, r12
	call	dibusb_read_eeprom_byte@PLT
	mov	eax, DWORD PTR [rsp]
	lea	esi, -1[rax]
	mov	eax, DWORD PTR 4[rsp]
	mov	DWORD PTR [rsp], esi
	cmp	esi, 7
	jle	.L11
	cmp	eax, 255
	je	.L18
	test	eax, eax
	je	.L18
.L11:
	lea	edx, 965[rax]
	lea	ebp, 1220[rax]
	test	al, -128
	cmovne	ebp, edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L24:
	mov	eax, DWORD PTR 4[rsp]
	lea	ebp, 1220[rax]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	lea	rdi, .LC0[rip]
	mov	ebp, 1220
	call	warn@PLT
	jmp	.L4
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	dibusb_dib3000mc_tuner_attach, .-dibusb_dib3000mc_tuner_attach
	.comm	stk3000p_mt2060_config,4,4
	.comm	stk3000p_dib3000p_config,4,4
	.comm	mt2060_attach,4,4
	.comm	dvb_pll_attach,4,4
	.comm	USB_VID_LITEON,8,8
	.comm	USB_VID_DIBCOM,8,8
	.comm	USB_PID_LITEON_DVB_T_WARM,8,8
	.comm	USB_PID_DIBCOM_MOD3001_WARM,8,8
	.comm	ENOMEM,4,4
	.comm	DVB_PLL_ENV57H1XD5,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_dibusb-mc-common.c_dibusb_dib3000mc_tuner_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"LITE-ON DVB-T: Strange IF1 calibration :%2X %2X\012"
	.ascii	"\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	dibusb_dib3000mc_tuner_attach
	.syntax unified
	.arm
	.fpu softvfp
	.type	dibusb_dib3000mc_tuner_attach, %function
dibusb_dib3000mc_tuner_attach:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, [r0, #4]
	ldr	r2, .L26
	ldr	r3, [r3]
	ldr	r7, [r0, #8]
	sub	sp, sp, #28
	mov	r4, r0
	ldr	r0, [r3, #4]
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	bl	le16_to_cpu
	ldr	r3, .L26+4
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L21
.L2:
	ldr	r3, [r4, #4]
	ldr	r3, [r3]
	ldr	r0, [r3, #4]
	bl	le16_to_cpu
	ldr	r3, .L26+8
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L6
.L16:
	ldr	r5, .L26+12
.L4:
	ldr	r3, [r4]
	mov	r1, #1
	ldr	r0, [r3]
	bl	dib3000mc_get_tuner_i2c_master
	ldr	r2, [r4]
	ldr	r3, .L26+16
	ldr	r1, [r2]
	str	r5, [sp]
	mov	r2, r0
	mov	r6, r0
	ldr	r0, [r3]
	ldr	r3, .L26+20
	bl	dvb_attach
	subs	r5, r0, #0
	beq	.L22
	mov	r2, #1
	ldr	r3, [r4]
	ldr	r1, .L26+24
	ldr	r0, [r3]
	str	r2, [r7]
	bl	dib3000mc_set_config
	mov	r0, #0
.L1:
	ldr	r3, .L26
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L21:
	ldr	r3, [r4, #4]
	ldr	r3, [r3]
	ldr	r0, [r3]
	bl	le16_to_cpu
	ldr	r3, .L26+28
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L2
	mov	r1, #126
	add	r2, sp, #12
	ldr	r0, [r4, #4]
	bl	dibusb_read_eeprom_byte
	mov	r1, #127
	ldr	r0, [r4, #4]
	add	r2, sp, #16
	bl	dibusb_read_eeprom_byte
	ldr	r1, [sp, #12]
	cmp	r1, #0
	beq	.L24
	ldr	r2, [sp, #16]
	cmp	r1, #128
	rsbeq	r5, r2, #1216
	addeq	r5, r5, #4
	beq	.L4
	ldr	r0, .L26+32
	bl	warn
	ldr	r5, .L26+12
	b	.L4
.L22:
	ldr	r3, .L26+36
	ldr	r2, [r4]
	ldr	r0, [r3]
	ldr	r1, [r2]
	ldr	r2, .L26+40
	str	r0, [sp]
	ldr	r0, [r2]
	mov	r3, r6
	mov	r2, #96
	bl	dvb_attach
	cmp	r0, #0
	movne	r0, r5
	ldreq	r3, .L26+44
	ldreq	r0, [r3]
	rsbeq	r0, r0, #0
	b	.L1
.L6:
	ldr	r3, [r4, #4]
	ldr	r3, [r3]
	ldr	r0, [r3]
	bl	le16_to_cpu
	ldr	r3, .L26+48
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L16
	mov	r1, #7
	ldr	r0, [r4, #4]
	add	r2, sp, #16
	bl	dibusb_read_eeprom_byte
	ldr	r3, [sp, #16]
	cmp	r3, #2
	bne	.L16
	mov	r3, #127
	mov	r1, r3
	str	r3, [sp, #12]
	b	.L10
.L25:
	cmp	r5, #0
	cmpne	r5, #255
	bne	.L11
.L10:
	ldr	r0, [r4, #4]
	add	r2, sp, #16
	bl	dibusb_read_eeprom_byte
	ldr	r1, [sp, #12]
	ldr	r5, [sp, #16]
	sub	r1, r1, #1
	cmp	r1, #7
	str	r1, [sp, #12]
	bgt	.L25
.L11:
	tst	r5, #128
	addne	r5, r5, #964
	addeq	r5, r5, #1216
	addne	r5, r5, #1
	addeq	r5, r5, #4
	b	.L4
.L24:
	ldr	r5, [sp, #16]
	add	r5, r5, #1216
	add	r5, r5, #4
	b	.L4
.L23:
	bl	__stack_chk_fail
.L27:
	.align	2
.L26:
	.word	.LC1
	.word	USB_VID_LITEON
	.word	USB_VID_DIBCOM
	.word	1220
	.word	mt2060_attach
	.word	stk3000p_mt2060_config
	.word	stk3000p_dib3000p_config
	.word	USB_PID_LITEON_DVB_T_WARM
	.word	.LC0
	.word	DVB_PLL_ENV57H1XD5
	.word	dvb_pll_attach
	.word	ENOMEM
	.word	USB_PID_DIBCOM_MOD3001_WARM
	.size	dibusb_dib3000mc_tuner_attach, .-dibusb_dib3000mc_tuner_attach
	.comm	stk3000p_mt2060_config,4,4
	.comm	stk3000p_dib3000p_config,4,4
	.comm	mt2060_attach,4,4
	.comm	dvb_pll_attach,4,4
	.comm	USB_VID_LITEON,4,4
	.comm	USB_VID_DIBCOM,4,4
	.comm	USB_PID_LITEON_DVB_T_WARM,4,4
	.comm	USB_PID_DIBCOM_MOD3001_WARM,4,4
	.comm	ENOMEM,4,4
	.comm	DVB_PLL_ENV57H1XD5,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
