	.file	"extr_rsi_91x_usb.c_rsi_find_bulk_in_and_out_endpoints.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rsi_find_bulk_in_and_out_endpoints, @function
rsi_find_bulk_in_and_out_endpoints:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	r9, QWORD PTR [rdi]
	mov	rbp, QWORD PTR [rsi]
	mov	eax, DWORD PTR 8[r9]
	mov	rbx, QWORD PTR 0[rbp]
	test	eax, eax
	jle	.L2
	xor	esi, esi
	xor	r8d, r8d
	xor	edi, edi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L22:
	mov	r11d, DWORD PTR [rax]
	test	DWORD PTR USB_DIR_IN[rip], r11d
	je	.L4
	mov	r12d, DWORD PTR 4[rax]
	and	r12d, DWORD PTR USB_ENDPOINT_XFERTYPE_MASK[rip]
	cmp	r12d, DWORD PTR USB_ENDPOINT_XFER_BULK[rip]
	je	.L21
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	r8d, edi
	mov	eax, edi
	cmovge	eax, r8d
	cmp	DWORD PTR MAX_BULK_EP[rip], eax
	jle	.L2
	add	rsi, 1
	cmp	DWORD PTR 8[r9], esi
	jle	.L2
.L9:
	movsx	rcx, edi
	mov	rax, rsi
	movsx	r10, r8d
	mov	r12d, DWORD PTR [rbx+rcx*4]
	sal	rax, 4
	lea	rdx, 0[0+r10*4]
	add	rax, QWORD PTR [r9]
	test	r12d, r12d
	je	.L22
.L3:
	add	rdx, QWORD PTR 8[rbp]
	mov	r11d, DWORD PTR [rdx]
	test	r11d, r11d
	jne	.L5
	mov	r11d, DWORD PTR [rax]
	test	DWORD PTR USB_DIR_IN[rip], r11d
	jne	.L5
.L7:
	mov	ecx, DWORD PTR 4[rax]
	and	ecx, DWORD PTR USB_ENDPOINT_XFERTYPE_MASK[rip]
	cmp	ecx, DWORD PTR USB_ENDPOINT_XFER_BULK[rip]
	jne	.L5
	mov	rcx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 16[rbp]
	mov	DWORD PTR [rdx], r11d
	add	r8d, 1
	mov	QWORD PTR [rax+r10*8], rcx
	mov	rbx, QWORD PTR 0[rbp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	add	rdx, QWORD PTR 8[rbp]
	mov	ecx, DWORD PTR [rdx]
	test	ecx, ecx
	je	.L7
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	mov	esi, DWORD PTR [rbx]
	xor	eax, eax
	test	esi, esi
	jne	.L1
	mov	rax, QWORD PTR 8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L23
.L1:
	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
.L21:
	.cfi_restore_state
	mov	rbx, QWORD PTR 24[rbp]
	mov	r12, QWORD PTR 8[rax]
	add	edi, 1
	mov	QWORD PTR [rbx+rcx*8], r12
	mov	rbx, QWORD PTR 0[rbp]
	mov	DWORD PTR [rbx+rcx*4], r11d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L23:
	mov	eax, DWORD PTR EINVAL[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	rsi_find_bulk_in_and_out_endpoints, .-rsi_find_bulk_in_and_out_endpoints
	.comm	USB_ENDPOINT_XFER_BULK,4,4
	.comm	USB_ENDPOINT_XFERTYPE_MASK,4,4
	.comm	USB_DIR_IN,4,4
	.comm	MAX_BULK_EP,4,4
	.comm	EINVAL,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_rsi_91x_usb.c_rsi_find_bulk_in_and_out_endpoints.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rsi_find_bulk_in_and_out_endpoints, %function
rsi_find_bulk_in_and_out_endpoints:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r4, [r0]
	ldr	r8, [r1]
	ldr	r3, [r4, #4]
	ldr	r7, [r8]
	cmp	r3, #0
	sub	sp, sp, #12
	ble	.L2
	mov	r2, #0
	mov	r0, r2
	mov	r3, r2
	mov	ip, r2
	b	.L9
.L26:
	ldr	r10, [r6, r2]
	ldr	r6, .L28
	ldr	r6, [r6]
	tst	r10, r6
	beq	.L4
	ldr	r6, .L28+4
	ldr	fp, .L28+8
	ldr	r6, [r6]
	ldr	fp, [fp]
	ldr	r9, [r5, #4]
	str	r6, [sp, #4]
	and	r6, r9, fp
	ldr	fp, [sp, #4]
	cmp	r6, fp
	beq	.L25
.L5:
	cmp	r0, r3
	movge	r1, r0
	movlt	r1, r3
	ldr	lr, .L28+12
	ldr	lr, [lr]
	cmp	lr, r1
	ble	.L2
	ldr	r1, [r4, #4]
	add	ip, ip, #1
	cmp	r1, ip
	add	r2, r2, #12
	ble	.L2
.L9:
	ldr	r1, [r7, r3, lsl #2]
	ldr	r6, [r4]
	cmp	r1, #0
	add	r5, r6, r2
	lsl	r1, r3, #2
	lsl	lr, r0, #2
	beq	.L26
.L3:
	ldr	r1, [r8, #4]
	ldr	r6, [r1, lr]
	add	r1, r1, lr
	cmp	r6, #0
	bne	.L5
	ldr	r6, .L28
	ldr	r10, [r5]
	ldr	r6, [r6]
	tst	r10, r6
	bne	.L5
.L7:
	ldr	fp, .L28+8
	ldr	r9, .L28+4
	ldr	r6, [r5, #4]
	ldr	fp, [fp]
	ldr	r9, [r9]
	and	r6, r6, fp
	cmp	r6, r9
	bne	.L5
	ldr	r6, [r5, #8]
	ldr	r5, [r8, #8]
	str	r10, [r1]
	str	r6, [r5, lr]
	ldr	r7, [r8]
	add	r0, r0, #1
	b	.L5
.L4:
	ldr	r1, [r8, #4]
	ldr	r6, [r1, lr]
	add	r1, r1, lr
	cmp	r6, #0
	beq	.L7
	b	.L5
.L2:
	ldr	r3, [r7]
	cmp	r3, #0
	movne	r0, #0
	bne	.L1
	ldr	r3, [r8, #4]
	ldr	r0, [r3]
	cmp	r0, #0
	bne	.L27
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	ldr	r7, [r5, #8]
	ldr	r6, [r8, #12]
	add	r3, r3, #1
	str	r7, [r6, r1]
	ldr	r7, [r8]
	str	r10, [r7, r1]
	b	.L3
.L27:
	ldr	r3, .L28+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L29:
	.align	2
.L28:
	.word	USB_DIR_IN
	.word	USB_ENDPOINT_XFER_BULK
	.word	USB_ENDPOINT_XFERTYPE_MASK
	.word	MAX_BULK_EP
	.word	EINVAL
	.size	rsi_find_bulk_in_and_out_endpoints, .-rsi_find_bulk_in_and_out_endpoints
	.comm	USB_ENDPOINT_XFER_BULK,4,4
	.comm	USB_ENDPOINT_XFERTYPE_MASK,4,4
	.comm	USB_DIR_IN,4,4
	.comm	MAX_BULK_EP,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
