	.file	"extr_cx231xx-core.c_cx231xx_init_bulk.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" while in int"
.LC1:
	.string	""
.LC2:
	.string	"Setting Video mux to %d\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"cannot alloc memory for usb buffers\n"
	.align 8
.LC4:
	.string	"cannot allocate memory for usbtransfer\n"
	.section	.rodata.str1.1
.LC5:
	.string	"cannot alloc bulk_ctl.urb %i\n"
	.section	.rodata.str1.8
	.align 8
.LC6:
	.string	"unable to allocate %i bytes for transfer buffer %i%s\n"
	.align 8
.LC7:
	.string	"submit of urb %i failed (error=%i)\n"
	.text
	.p2align 4
	.globl	cx231xx_init_bulk
	.type	cx231xx_init_bulk, @function
cx231xx_init_bulk:
.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
	mov	r14, r8
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	mov	esi, 2
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	cmp	DWORD PTR [rdi], 2
	cmovle	esi, DWORD PTR [rdi]
	mov	DWORD PTR [rdi], esi
	lea	rdi, .LC2[rip]
	call	cx231xx_coredbg@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	rdi, rbp
	call	video_mux@PLT
	mov	rdi, rbp
	call	cx231xx_uninit_bulk@PLT
	mov	edx, DWORD PTR 4[rbp]
	mov	QWORD PTR 24[rbp], r14
	mov	DWORD PTR 32[rbp], ebx
	mov	eax, edx
	mov	QWORD PTR 160[rbp], 0
	shr	eax, 31
	mov	DWORD PTR 64[rbp], -1
	add	eax, edx
	movabs	rdx, 798863917057
	mov	QWORD PTR 152[rbp], 0
	sar	eax
	mov	QWORD PTR 144[rbp], 0
	mov	DWORD PTR 68[rbp], eax
	mov	eax, DWORD PTR 8[rbp]
	mov	QWORD PTR 136[rbp], 0
	add	eax, eax
	mov	QWORD PTR 120[rbp], 0
	mov	DWORD PTR 72[rbp], eax
	mov	rax, QWORD PTR 80[rbp]
	mov	QWORD PTR 128[rbp], 0
	mov	QWORD PTR 112[rbp], 0
	mov	QWORD PTR 104[rbp], 0
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR 96[rbp]
	lea	rcx, 64[rax]
	.p2align 4,,10
	.p2align 3
.L2:
	mov	QWORD PTR [rax], 0
	add	rax, 8
	cmp	rax, rcx
	jne	.L2
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	lea	r14d, 0[0+rbx*8]
	mov	edi, r14d
	call	kzalloc@PLT
	mov	QWORD PTR 40[rbp], rax
	test	rax, rax
	je	.L23
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, r14d
	call	kzalloc@PLT
	mov	QWORD PTR 48[rbp], rax
	test	rax, rax
	je	.L24
	xor	eax, eax
	mov	DWORD PTR 36[rbp], r13d
	imul	r13d, r12d
	cmp	DWORD PTR 12[rbp], 1
	setne	al
	mov	esi, DWORD PTR 32[rbp]
	mov	QWORD PTR 56[rbp], 0
	lea	eax, 129[rax+rax*2]
	mov	DWORD PTR 16[rbp], eax
	test	esi, esi
	jle	.L7
	lea	r14, 64[rbp]
	xor	ebx, ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 40[rbp]
	mov	edi, DWORD PTR 168[rbp]
	mov	rcx, r12
	mov	esi, r13d
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	QWORD PTR [rax+rbx*8], r12
	mov	rax, QWORD PTR 48[rbp]
	mov	QWORD PTR 8[r12], 0
	lea	r15, [rax+rbx*4]
	call	usb_buffer_alloc@PLT
	mov	DWORD PTR [r15], eax
	mov	rax, QWORD PTR 48[rbp]
	mov	edi, DWORD PTR [rax+rbx*4]
	test	edi, edi
	je	.L25
	mov	edx, r13d
	xor	esi, esi
	call	memset@PLT
	mov	esi, DWORD PTR 16[rbp]
	mov	edi, DWORD PTR 168[rbp]
	call	usb_rcvbulkpipe@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	mov	r8d, r13d
	mov	rdi, r12
	mov	edx, eax
	mov	rax, QWORD PTR 48[rbp]
	mov	esi, DWORD PTR 168[rbp]
	mov	r9d, DWORD PTR cx231xx_bulk_irq_callback[rip]
	mov	ecx, DWORD PTR [rax+rbx*4]
	push	r14
	.cfi_def_cfa_offset 80
	add	rbx, 1
	call	usb_fill_bulk_urb@PLT
	pop	rdx
	.cfi_def_cfa_offset 72
	pop	rcx
	.cfi_def_cfa_offset 64
	cmp	DWORD PTR 32[rbp], ebx
	jle	.L7
.L11:
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	xor	edi, edi
	call	usb_alloc_urb@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L8
	mov	esi, ebx
	lea	rdi, .LC5[rip]
	xor	eax, eax
	call	cx231xx_err@PLT
	mov	rdi, rbp
	call	cx231xx_uninit_bulk@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L7:
	.cfi_restore_state
	lea	rdi, 88[rbp]
	call	init_waitqueue_head@PLT
	mov	eax, DWORD PTR 32[rbp]
	test	eax, eax
	jle	.L12
	xor	ebx, ebx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	add	rbx, 1
	cmp	DWORD PTR 32[rbp], ebx
	jle	.L12
.L14:
	mov	rax, QWORD PTR 40[rbp]
	mov	esi, DWORD PTR GFP_ATOMIC[rip]
	mov	rdi, QWORD PTR [rax+rbx*8]
	call	usb_submit_urb@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L13
	mov	edx, eax
	mov	esi, ebx
	lea	rdi, .LC7[rip]
	xor	eax, eax
	call	cx231xx_err@PLT
	mov	rdi, rbp
	call	cx231xx_uninit_bulk@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	xor	eax, eax
	call	in_interrupt@PLT
	lea	rcx, .LC0[rip]
	mov	edx, ebx
	mov	esi, r13d
	test	rax, rax
	lea	rax, .LC1[rip]
	lea	rdi, .LC6[rip]
	cmove	rcx, rax
	xor	eax, eax
	call	cx231xx_err@PLT
	mov	rdi, rbp
	call	cx231xx_uninit_bulk@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rdi, .LC3[rip]
	call	cx231xx_errdev@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	r12d, DWORD PTR 12[rbp]
	test	r12d, r12d
	jne	.L15
	mov	edx, DWORD PTR Raw_Video[rip]
	mov	esi, 1
	mov	rdi, rbp
	call	cx231xx_capture_start@PLT
	jmp	.L1
.L24:
	lea	rdi, .LC4[rip]
	call	cx231xx_errdev@PLT
	mov	rdi, QWORD PTR 40[rbp]
	call	kfree@PLT
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L1
.L15:
	mov	edx, DWORD PTR TS1_serial_mode[rip]
	mov	esi, 1
	mov	rdi, rbp
	xor	r12d, r12d
	call	cx231xx_capture_start@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	cx231xx_init_bulk, .-cx231xx_init_bulk
	.comm	cx231xx_bulk_irq_callback,4,4
	.comm	TS1_serial_mode,4,4
	.comm	Raw_Video,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	ENOMEM,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_cx231xx-core.c_cx231xx_init_bulk.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	" while in int\000"
	.align	2
.LC1:
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"Setting Video mux to %d\012\000"
	.align	2
.LC3:
	.ascii	"cannot alloc memory for usb buffers\012\000"
	.align	2
.LC4:
	.ascii	"cannot allocate memory for usbtransfer\012\000"
	.align	2
.LC5:
	.ascii	"cannot alloc bulk_ctl.urb %i\012\000"
	.align	2
.LC6:
	.ascii	"unable to allocate %i bytes for transfer buffer %i%"
	.ascii	"s\012\000"
	.align	2
.LC7:
	.ascii	"submit of urb %i failed (error=%i)\012\000"
	.text
	.align	2
	.global	cx231xx_init_bulk
	.syntax unified
	.arm
	.fpu softvfp
	.type	cx231xx_init_bulk, %function
cx231xx_init_bulk:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r0, [r0]
	mov	r5, r1
	cmp	r0, #2
	movlt	r1, r0
	movge	r1, #2
	sub	sp, sp, #28
	str	r1, [r4]
	ldr	r0, .L27
	mov	r9, r2
	mov	r6, r3
	ldr	r7, [sp, #64]
	bl	cx231xx_coredbg
	ldr	r1, [r4]
	mov	r0, r4
	bl	video_mux
	mov	r0, r4
	bl	cx231xx_uninit_bulk
	mov	r1, #1
	mov	ip, #0
	mvn	r0, #0
	mov	r2, #186
	ldr	r3, [r4, #4]
	ldr	lr, [r4, #64]
	add	r3, r3, r3, lsr #31
	asr	r3, r3, r1
	str	r3, [r4, #48]
	ldr	r3, [r4, #8]
	str	ip, [r4, #96]
	lsl	r3, r3, r1
	str	r3, [r4, #52]
	ldr	r3, [r4, #56]
	str	ip, [r4, #92]
	str	ip, [r4, #88]
	str	ip, [r4, #84]
	str	ip, [r4, #80]
	str	ip, [r4, #76]
	str	ip, [r4, #72]
	str	ip, [r4, #68]
	str	r7, [r4, #20]
	str	r9, [r4, #24]
	str	r0, [r4, #44]
	mov	r8, ip
	str	ip, [r3]
	str	ip, [r3, #4]
	str	r1, [r3, #8]
	sub	ip, lr, #4
	str	r2, [r3, #12]
	add	lr, lr, #28
.L2:
	str	r8, [ip, #4]!
	cmp	lr, ip
	bne	.L2
	ldr	r7, .L27+4
	lsl	r9, r9, #2
	mov	r0, r9
	ldr	r1, [r7]
	bl	kzalloc
	cmp	r0, #0
	str	r0, [r4, #32]
	beq	.L24
	mov	r0, r9
	ldr	r1, [r7]
	bl	kzalloc
	cmp	r0, #0
	str	r0, [r4, #36]
	beq	.L25
	ldr	r3, [r4, #12]
	ldr	r2, [r4, #24]
	cmp	r3, #1
	moveq	r3, #129
	movne	r3, #132
	cmp	r2, #0
	str	r6, [r4, #28]
	str	r8, [r4, #40]
	mul	r6, r5, r6
	str	r3, [r4, #16]
	ble	.L7
	mov	r5, #0
	add	r3, r4, #44
	mov	r9, r5
	ldr	fp, .L27+8
	str	r3, [sp, #20]
	b	.L11
.L8:
	ldr	r2, [r4, #32]
	mov	r3, r10
	str	r10, [r2, r5, lsl #2]
	mov	r1, r6
	ldr	r2, [r7]
	ldr	r0, [r4, #100]
	str	r9, [r10, #4]
	ldr	r8, [r4, #36]
	bl	usb_buffer_alloc
	ldr	r2, [r4, #36]
	str	r0, [r8, r5, lsl #2]
	ldr	r0, [r2, r5, lsl #2]
	cmp	r0, #0
	beq	.L26
	mov	r2, r6
	mov	r1, #0
	bl	memset
	ldr	r1, [r4, #16]
	ldr	r0, [r4, #100]
	bl	usb_rcvbulkpipe
	mov	r2, r0
	ldr	r0, [r4, #36]
	ldr	r1, [fp]
	ldr	ip, [r0, r5, lsl #2]
	str	r6, [sp]
	mov	r3, ip
	ldr	ip, [sp, #20]
	str	r1, [sp, #4]
	str	ip, [sp, #8]
	mov	r0, r10
	ldr	r1, [r4, #100]
	bl	usb_fill_bulk_urb
	ldr	r3, [r4, #24]
	add	r5, r5, #1
	cmp	r3, r5
	ble	.L7
.L11:
	mov	r0, #0
	ldr	r1, [r7]
	bl	usb_alloc_urb
	subs	r10, r0, #0
	bne	.L8
	mov	r1, r5
	ldr	r0, .L27+12
	bl	cx231xx_err
.L22:
	mov	r0, r4
	bl	cx231xx_uninit_bulk
	ldr	r3, .L27+16
	ldr	r0, [r3]
	rsb	r5, r0, #0
.L1:
	mov	r0, r5
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	add	r0, r4, #60
	bl	init_waitqueue_head
	ldr	r3, [r4, #24]
	cmp	r3, #0
	ble	.L12
	mov	r6, #0
	ldr	r7, .L27+20
	b	.L14
.L13:
	ldr	r3, [r4, #24]
	add	r6, r6, #1
	cmp	r3, r6
	ble	.L12
.L14:
	ldr	r3, [r4, #32]
	ldr	r1, [r7]
	ldr	r0, [r3, r6, lsl #2]
	bl	usb_submit_urb
	cmp	r0, #0
	beq	.L13
	mov	r5, r0
	mov	r2, r0
	mov	r1, r6
	ldr	r0, .L27+24
	bl	cx231xx_err
	mov	r0, r4
	bl	cx231xx_uninit_bulk
	mov	r0, r5
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L26:
	bl	in_interrupt
	ldr	ip, .L27+28
	cmp	r0, #0
	ldr	r3, .L27+32
	mov	r2, r5
	mov	r1, r6
	moveq	r3, ip
	ldr	r0, .L27+36
	bl	cx231xx_err
	b	.L22
.L24:
	ldr	r0, .L27+40
	bl	cx231xx_errdev
	ldr	r3, .L27+16
	ldr	r0, [r3]
	rsb	r5, r0, #0
	mov	r0, r5
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	ldr	r5, [r4, #12]
	cmp	r5, #0
	bne	.L15
	ldr	r3, .L27+44
	mov	r0, r4
	mov	r1, #1
	ldr	r2, [r3]
	bl	cx231xx_capture_start
	b	.L1
.L25:
	ldr	r0, .L27+48
	bl	cx231xx_errdev
	ldr	r0, [r4, #32]
	bl	kfree
	ldr	r3, .L27+16
	ldr	r0, [r3]
	rsb	r5, r0, #0
	b	.L1
.L15:
	ldr	r3, .L27+52
	mov	r0, r4
	mov	r1, #1
	ldr	r2, [r3]
	bl	cx231xx_capture_start
	mov	r5, #0
	b	.L1
.L28:
	.align	2
.L27:
	.word	.LC2
	.word	GFP_KERNEL
	.word	cx231xx_bulk_irq_callback
	.word	.LC5
	.word	ENOMEM
	.word	GFP_ATOMIC
	.word	.LC7
	.word	.LC1
	.word	.LC0
	.word	.LC6
	.word	.LC3
	.word	Raw_Video
	.word	.LC4
	.word	TS1_serial_mode
	.size	cx231xx_init_bulk, .-cx231xx_init_bulk
	.comm	cx231xx_bulk_irq_callback,4,4
	.comm	TS1_serial_mode,4,4
	.comm	Raw_Video,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
