	.file	"extr_cxusb.c_cxusb_d680_dmb_frontend_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"set interface failed"
.LC1:
	.string	"clear tuner gpio failed"
.LC2:
	.string	"set tuner gpio failed"
	.text
	.p2align 4
	.type	cxusb_d680_dmb_frontend_attach, @function
cxusb_d680_dmb_frontend_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	edx, edx
	xor	esi, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	r12, QWORD PTR 8[rdi]
	mov	edi, DWORD PTR 24[r12]
	call	usb_set_interface@PLT
	test	rax, rax
	js	.L11
.L2:
	mov	esi, DWORD PTR 16[r12]
	mov	edi, DWORD PTR 24[r12]
	mov	ebx, 5
	call	usb_sndbulkpipe@PLT
	mov	edi, DWORD PTR 24[r12]
	mov	esi, eax
	call	usb_clear_halt@PLT
	mov	esi, DWORD PTR 16[r12]
	mov	edi, DWORD PTR 24[r12]
	call	usb_rcvbulkpipe@PLT
	mov	edi, DWORD PTR 24[r12]
	mov	esi, eax
	call	usb_clear_halt@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	edi, DWORD PTR 24[r12]
	mov	rax, QWORD PTR [rax]
	mov	esi, DWORD PTR [rax]
	call	usb_rcvbulkpipe@PLT
	mov	edi, DWORD PTR 24[r12]
	mov	esi, eax
	call	usb_clear_halt@PLT
.L3:
	mov	rdi, r12
	call	cxusb_d680_dmb_drain_message@PLT
	mov	rdi, r12
	call	cxusb_d680_dmb_drain_video@PLT
	mov	edi, 200
	call	msleep@PLT
	sub	ebx, 1
	jne	.L3
	xor	edx, edx
	mov	esi, 7
	mov	rdi, r12
	call	cxusb_d680_dmb_gpio_tuner@PLT
	test	rax, rax
	js	.L12
	mov	edi, 100
	call	msleep@PLT
	mov	edx, 1
	mov	esi, 7
	mov	rdi, r12
	call	cxusb_d680_dmb_gpio_tuner@PLT
	test	rax, rax
	js	.L13
	mov	edi, 100
	call	msleep@PLT
	mov	edi, DWORD PTR lgs8gxx_attach[rip]
	mov	rdx, r12
	mov	rbx, QWORD PTR 0[rbp]
	lea	rsi, d680_lgs8gl5_cfg[rip]
	call	dvb_attach@PLT
	mov	rdx, QWORD PTR 0[rbp]
	mov	DWORD PTR [rbx], eax
	xor	eax, eax
	mov	edx, DWORD PTR [rdx]
	test	edx, edx
	je	.L14
	pop	rbx
	.cfi_remember_state
	.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
.L12:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	err@PLT
	mov	eax, DWORD PTR EIO[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	err@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR EIO[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	lea	rdi, .LC2[rip]
	call	err@PLT
	mov	eax, DWORD PTR EIO[rip]
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	cxusb_d680_dmb_frontend_attach, .-cxusb_d680_dmb_frontend_attach
	.comm	lgs8gxx_attach,4,4
	.comm	d680_lgs8gl5_cfg,4,4
	.comm	EIO,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_cxusb.c_cxusb_d680_dmb_frontend_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"set interface failed\000"
	.align	2
.LC1:
	.ascii	"clear tuner gpio failed\000"
	.align	2
.LC2:
	.ascii	"set tuner gpio failed\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cxusb_d680_dmb_frontend_attach, %function
cxusb_d680_dmb_frontend_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r2, #0
	push	{r4, r5, r6, lr}
	ldr	r5, [r0, #4]
	mov	r6, r0
	mov	r1, r2
	ldr	r0, [r5, #12]
	bl	usb_set_interface
	cmp	r0, #0
	blt	.L11
.L2:
	ldr	r4, [r5, #12]
	ldr	r1, [r5, #8]
	mov	r0, r4
	bl	usb_sndbulkpipe
	mov	r1, r0
	mov	r0, r4
	bl	usb_clear_halt
	ldr	r4, [r5, #12]
	ldr	r1, [r5, #8]
	mov	r0, r4
	bl	usb_rcvbulkpipe
	mov	r1, r0
	mov	r0, r4
	bl	usb_clear_halt
	ldr	r3, [r5, #4]
	ldr	r4, [r5, #12]
	ldr	r3, [r3]
	mov	r0, r4
	ldr	r1, [r3]
	bl	usb_rcvbulkpipe
	mov	r1, r0
	mov	r0, r4
	bl	usb_clear_halt
	mov	r4, #5
.L3:
	mov	r0, r5
	bl	cxusb_d680_dmb_drain_message
	mov	r0, r5
	bl	cxusb_d680_dmb_drain_video
	mov	r0, #200
	bl	msleep
	subs	r4, r4, #1
	bne	.L3
	mov	r2, r4
	mov	r1, #7
	mov	r0, r5
	bl	cxusb_d680_dmb_gpio_tuner
	cmp	r0, #0
	blt	.L12
	mov	r0, #100
	bl	msleep
	mov	r2, #1
	mov	r1, #7
	mov	r0, r5
	bl	cxusb_d680_dmb_gpio_tuner
	cmp	r0, #0
	blt	.L13
	mov	r0, #100
	bl	msleep
	ldr	r3, .L14
	mov	r2, r5
	ldr	r0, [r3]
	ldr	r1, .L14+4
	ldr	r5, [r6]
	bl	dvb_attach
	ldr	r3, [r6]
	str	r0, [r5]
	ldr	r3, [r3]
	cmp	r3, #0
	ldreq	r3, .L14+8
	ldreq	r0, [r3]
	rsbeq	r0, r0, #0
	movne	r0, r4
	pop	{r4, r5, r6, pc}
.L12:
	ldr	r0, .L14+12
	bl	err
	ldr	r3, .L14+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L11:
	ldr	r0, .L14+16
	bl	err
	b	.L2
.L13:
	ldr	r0, .L14+20
	bl	err
	ldr	r3, .L14+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L15:
	.align	2
.L14:
	.word	lgs8gxx_attach
	.word	d680_lgs8gl5_cfg
	.word	EIO
	.word	.LC1
	.word	.LC0
	.word	.LC2
	.size	cxusb_d680_dmb_frontend_attach, .-cxusb_d680_dmb_frontend_attach
	.comm	lgs8gxx_attach,4,4
	.comm	d680_lgs8gl5_cfg,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
