	.file	"extr_usbtest.c_get_endpoints.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	get_endpoints, @function
get_endpoints:
.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, 88
	.cfi_def_cfa_offset 144
	mov	QWORD PTR [rsp], rsi
	mov	esi, DWORD PTR [rsi]
	mov	rbx, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rbx
	xor	ebx, ebx
	test	esi, esi
	jle	.L21
	lea	rax, 64[rsp]
	mov	r13, rdi
	xor	ebx, ebx
	mov	QWORD PTR 8[rsp], rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR [rsp]
	add	rbx, 1
	cmp	DWORD PTR [rax], ebx
	jle	.L21
.L2:
	mov	rcx, QWORD PTR [rsp]
	lea	rax, [rbx+rbx*2]
	mov	QWORD PTR 32[rsp], 0
	mov	QWORD PTR 24[rsp], 0
	mov	QWORD PTR 48[rsp], 0
	mov	rdx, QWORD PTR 8[rcx]
	mov	QWORD PTR 40[rsp], 0
	mov	QWORD PTR 64[rsp], 0
	lea	r14, [rdx+rax*8]
	mov	rax, QWORD PTR override_alt[rip]
	mov	QWORD PTR 56[rsp], 0
	test	rax, rax
	js	.L8
	cmp	rax, QWORD PTR [r14]
	jne	.L7
.L8:
	mov	ecx, DWORD PTR 8[r14]
	xor	r15d, r15d
	test	ecx, ecx
	jne	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L52:
	cmp	eax, 128
	je	.L50
.L12:
	add	r15d, 1
	cmp	DWORD PTR 8[r14], r15d
	jbe	.L51
.L5:
	mov	rdx, QWORD PTR 16[r14]
	mov	eax, r15d
	lea	r12, [rdx+rax*4]
	mov	rdi, r12
	call	usb_endpoint_dir_in@PLT
	mov	rdi, r12
	mov	ebp, eax
	call	usb_endpoint_type@PLT
	cmp	eax, 129
	je	.L9
	cmp	eax, 130
	jne	.L52
	lea	rdx, 32[rsp]
	lea	rsi, 24[rsp]
	mov	rcx, r12
	mov	edi, ebp
	call	endpoint_update@PLT
	add	r15d, 1
	cmp	DWORD PTR 8[r14], r15d
	ja	.L5
.L51:
	cmp	QWORD PTR 24[rsp], 0
	je	.L16
	cmp	QWORD PTR 32[rsp], 0
	jne	.L14
.L16:
	cmp	QWORD PTR 40[rsp], 0
	jne	.L14
	cmp	QWORD PTR 48[rsp], 0
	jne	.L14
.L6:
	cmp	QWORD PTR 56[rsp], 0
	jne	.L14
	cmp	QWORD PTR 64[rsp], 0
	je	.L7
.L14:
	mov	rdi, r13
	call	testdev_to_usbdev@PLT
	mov	rdx, QWORD PTR [r14]
	mov	rbp, rax
	mov	rax, QWORD PTR 72[r13]
	mov	QWORD PTR [rax], rdx
	test	rdx, rdx
	jne	.L53
	mov	rax, QWORD PTR 24[rsp]
	test	rax, rax
	je	.L20
.L19:
	mov	esi, DWORD PTR [rax]
	mov	rdi, rbp
	and	esi, DWORD PTR USB_ENDPOINT_NUMBER_MASK[rip]
	call	usb_rcvbulkpipe@PLT
	mov	DWORD PTR 68[r13], eax
.L20:
	mov	rax, QWORD PTR 32[rsp]
	test	rax, rax
	je	.L22
	mov	esi, DWORD PTR [rax]
	mov	rdi, rbp
	and	esi, DWORD PTR USB_ENDPOINT_NUMBER_MASK[rip]
	call	usb_sndbulkpipe@PLT
	mov	DWORD PTR 64[r13], eax
.L22:
	mov	rax, QWORD PTR 40[rsp]
	test	rax, rax
	je	.L23
	mov	QWORD PTR 56[r13], rax
	mov	esi, DWORD PTR [rax]
	mov	rdi, rbp
	and	esi, DWORD PTR USB_ENDPOINT_NUMBER_MASK[rip]
	call	usb_rcvisocpipe@PLT
	mov	DWORD PTR 48[r13], eax
.L23:
	mov	rax, QWORD PTR 48[rsp]
	test	rax, rax
	je	.L24
	mov	QWORD PTR 40[r13], rax
	mov	esi, DWORD PTR [rax]
	mov	rdi, rbp
	and	esi, DWORD PTR USB_ENDPOINT_NUMBER_MASK[rip]
	call	usb_sndisocpipe@PLT
	mov	DWORD PTR 32[r13], eax
.L24:
	mov	rax, QWORD PTR 56[rsp]
	test	rax, rax
	je	.L25
	mov	QWORD PTR 24[r13], rax
	mov	esi, DWORD PTR [rax]
	mov	rdi, rbp
	and	esi, DWORD PTR USB_ENDPOINT_NUMBER_MASK[rip]
	call	usb_rcvintpipe@PLT
	mov	DWORD PTR 16[r13], eax
.L25:
	mov	rax, QWORD PTR 64[rsp]
	xor	r12d, r12d
	test	rax, rax
	je	.L1
	mov	QWORD PTR 8[r13], rax
	mov	esi, DWORD PTR [rax]
	mov	rdi, rbp
	and	esi, DWORD PTR USB_ENDPOINT_NUMBER_MASK[rip]
	call	usb_sndintpipe@PLT
	mov	DWORD PTR 0[r13], eax
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L54
	add	rsp, 88
	.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
.L9:
	.cfi_restore_state
	mov	rax, QWORD PTR 72[r13]
	mov	edx, DWORD PTR 12[rax]
	test	edx, edx
	je	.L12
	mov	rdx, QWORD PTR 8[rsp]
	lea	rsi, 56[rsp]
	mov	rcx, r12
	mov	edi, ebp
	call	endpoint_update@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L50:
	mov	rax, QWORD PTR 72[r13]
	mov	eax, DWORD PTR 8[rax]
	test	eax, eax
	je	.L12
	lea	rdx, 48[rsp]
	lea	rsi, 40[rsp]
	mov	rcx, r12
	mov	edi, ebp
	call	endpoint_update@PLT
	jmp	.L12
.L53:
	mov	esi, DWORD PTR 12[r14]
	mov	rdi, rbp
	call	usb_set_interface@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rax, QWORD PTR 24[rsp]
	test	rax, rax
	jne	.L19
	jmp	.L20
.L21:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	get_endpoints, .-get_endpoints
	.comm	override_alt,8,8
	.comm	USB_ENDPOINT_NUMBER_MASK,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_usbtest.c_get_endpoints.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_endpoints, %function
get_endpoints:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r1
	ldr	r1, [r1]
	ldr	r3, .L62
	cmp	r1, #0
	movgt	r8, #0
	sub	sp, sp, #36
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	movgt	r9, r0
	movgt	r7, r8
	bgt	.L2
	b	.L21
.L7:
	add	r8, r8, #1
	cmp	r1, r8
	ble	.L21
.L2:
	ldr	r3, .L62+4
	ldr	r2, [r10, #4]
	ldr	r3, [r3]
	str	r7, [sp, #8]
	cmp	r3, #0
	str	r7, [sp, #4]
	str	r7, [sp, #16]
	str	r7, [sp, #12]
	str	r7, [sp, #24]
	str	r7, [sp, #20]
	add	r6, r2, r8, lsl #4
	blt	.L8
	ldr	r2, [r2, r8, lsl #4]
	cmp	r3, r2
	bne	.L7
.L8:
	ldr	r3, [r6, #4]
	cmp	r3, #0
	movne	r4, #0
	bne	.L5
	b	.L6
.L59:
	cmp	r0, #128
	beq	.L57
.L12:
	ldr	r3, [r6, #4]
	add	r4, r4, #1
	cmp	r3, r4
	bls	.L58
.L5:
	ldr	r3, [r6, #12]
	add	fp, r3, r4, lsl #2
	mov	r0, fp
	bl	usb_endpoint_dir_in
	mov	r5, r0
	mov	r0, fp
	bl	usb_endpoint_type
	cmp	r0, #129
	beq	.L9
	cmp	r0, #130
	bne	.L59
	mov	r3, fp
	mov	r0, r5
	add	r2, sp, #8
	add	r1, sp, #4
	bl	endpoint_update
	ldr	r3, [r6, #4]
	add	r4, r4, #1
	cmp	r3, r4
	bhi	.L5
.L58:
	ldr	r3, [sp, #4]
	cmp	r3, #0
	beq	.L16
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bne	.L14
.L16:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [sp, #16]
	cmp	r3, #0
	bne	.L14
.L6:
	ldr	r3, [sp, #20]
	cmp	r3, #0
	bne	.L14
	ldr	r3, [sp, #24]
	cmp	r3, #0
	bne	.L14
	ldr	r1, [r10]
	add	r8, r8, #1
	cmp	r1, r8
	bgt	.L2
.L21:
	ldr	r3, .L62+8
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L62
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L60
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	ldr	r2, [r9, #40]
	ldr	r2, [r2, #8]
	cmp	r2, #0
	beq	.L12
	mov	r3, fp
	mov	r0, r5
	add	r2, sp, #24
	add	r1, sp, #20
	bl	endpoint_update
	b	.L12
.L57:
	ldr	r2, [r9, #40]
	ldr	r2, [r2, #4]
	cmp	r2, #0
	beq	.L12
	mov	r3, fp
	mov	r0, r5
	add	r2, sp, #16
	add	r1, sp, #12
	bl	endpoint_update
	b	.L12
.L14:
	mov	r0, r9
	bl	testdev_to_usbdev
	ldr	r2, [r6]
	ldr	r3, [r9, #40]
	cmp	r2, #0
	mov	r4, r0
	str	r2, [r3]
	bne	.L61
	ldr	r3, [sp, #4]
	cmp	r3, #0
	beq	.L20
.L19:
	ldr	r2, .L62+12
	ldr	r1, [r3]
	ldr	r3, [r2]
	mov	r0, r4
	and	r1, r1, r3
	bl	usb_rcvbulkpipe
	str	r0, [r9, #36]
.L20:
	ldr	r3, [sp, #8]
	cmp	r3, #0
	beq	.L22
	ldr	r2, .L62+12
	ldr	r1, [r3]
	ldr	r3, [r2]
	mov	r0, r4
	and	r1, r1, r3
	bl	usb_sndbulkpipe
	str	r0, [r9, #32]
.L22:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	beq	.L23
	ldr	r2, .L62+12
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	str	r3, [r9, #28]
	and	r1, r1, r2
	bl	usb_rcvisocpipe
	str	r0, [r9, #24]
.L23:
	ldr	r3, [sp, #16]
	cmp	r3, #0
	beq	.L24
	ldr	r2, .L62+12
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	str	r3, [r9, #20]
	and	r1, r1, r2
	bl	usb_sndisocpipe
	str	r0, [r9, #16]
.L24:
	ldr	r3, [sp, #20]
	cmp	r3, #0
	beq	.L25
	ldr	r2, .L62+12
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	str	r3, [r9, #12]
	and	r1, r1, r2
	bl	usb_rcvintpipe
	str	r0, [r9, #8]
.L25:
	ldr	r0, [sp, #24]
	cmp	r0, #0
	beq	.L1
	ldr	r3, .L62+12
	ldr	r1, [r0]
	ldr	r3, [r3]
	str	r0, [r9, #4]
	and	r1, r1, r3
	mov	r0, r4
	bl	usb_sndintpipe
	mov	r3, r0
	mov	r0, #0
	str	r3, [r9]
	b	.L1
.L61:
	ldr	r1, [r6, #8]
	bl	usb_set_interface
	cmp	r0, #0
	blt	.L1
	ldr	r3, [sp, #4]
	cmp	r3, #0
	bne	.L19
	b	.L20
.L60:
	bl	__stack_chk_fail
.L63:
	.align	2
.L62:
	.word	.LC0
	.word	override_alt
	.word	EINVAL
	.word	USB_ENDPOINT_NUMBER_MASK
	.size	get_endpoints, .-get_endpoints
	.comm	override_alt,4,4
	.comm	USB_ENDPOINT_NUMBER_MASK,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
