	.file	"extr_atp.c_atp_ioctl.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	atp_ioctl, @function
atp_ioctl:
.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
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	usb_fifo_softc@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	mtx_lock@PLT
	lea	esi, -128[rbx]
	cmp	esi, 5
	ja	.L2
	lea	rcx, .L4[rip]
	movsx	rax, DWORD PTR [rcx+rsi*4]
	add	rax, rcx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR 32[rbp]
	xor	r13d, r13d
	mov	DWORD PTR [r12], eax
.L10:
	mov	rdi, rbp
	call	mtx_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	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
.L3:
	.cfi_restore_state
	mov	eax, DWORD PTR 72[rbp]
	xor	r13d, r13d
	mov	DWORD PTR [r12], eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR [r12]
	mov	edx, DWORD PTR 32[r12]
	cmp	eax, -1
	je	.L11
	cmp	eax, 1
	jbe	.L12
.L15:
	mov	r13d, DWORD PTR EINVAL[rip]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	mov	eax, DWORD PTR [r12]
	cmp	eax, 1
	ja	.L15
	mov	DWORD PTR 32[rbp], eax
	mov	rdx, QWORD PTR 40[rbp]
	mov	DWORD PTR 72[rbp], 3
	test	eax, eax
	je	.L24
	mov	rax, QWORD PTR MOUSE_PROTO_SYSMOUSE[rip]
	mov	QWORD PTR 56[rbp], rax
	mov	rax, QWORD PTR MOUSE_SYS_PACKETSIZE[rip]
	mov	QWORD PTR 48[rbp], rax
	mov	rax, QWORD PTR MOUSE_SYS_SYNCMASK[rip]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR 40[rbp]
	mov	rdx, QWORD PTR MOUSE_SYS_SYNC[rip]
	mov	QWORD PTR 8[rax], rdx
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdi, rbp
	xor	r13d, r13d
	call	atp_reset_buf@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	movdqu	xmm2, XMMWORD PTR 4[rbp]
	movups	XMMWORD PTR [r12], xmm2
	mov	rax, QWORD PTR 20[rbp]
	mov	QWORD PTR 16[r12], rax
	mov	eax, DWORD PTR 12[rbp]
	mov	QWORD PTR 20[rbp], 0
	mov	QWORD PTR 12[rbp], 0
	mov	ecx, DWORD PTR 20[r12]
	mov	DWORD PTR 8[rbp], eax
	test	ecx, ecx
	jne	.L18
	mov	edx, DWORD PTR 16[r12]
	test	edx, edx
	je	.L25
.L18:
	mov	eax, DWORD PTR MOUSE_POSCHANGED[rip]
	or	DWORD PTR [r12], eax
.L19:
	mov	eax, DWORD PTR 4[r12]
	xor	r13d, r13d
	cmp	DWORD PTR 8[r12], eax
	je	.L10
	mov	eax, DWORD PTR MOUSE_BUTTONSCHANGED[rip]
	or	DWORD PTR [r12], eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	movdqu	xmm0, XMMWORD PTR 32[rbp]
	xor	r13d, r13d
	movups	XMMWORD PTR [r12], xmm0
	movdqu	xmm1, XMMWORD PTR 48[rbp]
	movups	XMMWORD PTR 16[r12], xmm1
	mov	rax, QWORD PTR 64[rbp]
	mov	QWORD PTR 32[r12], rax
	jmp	.L10
.L2:
	mov	r13d, DWORD PTR ENOTTY[rip]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L25:
	mov	eax, DWORD PTR 12[r12]
	test	eax, eax
	je	.L19
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rax, QWORD PTR MOUSE_PROTO_MSC[rip]
	mov	QWORD PTR 56[rbp], rax
	mov	rax, QWORD PTR MOUSE_MSC_PACKETSIZE[rip]
	mov	QWORD PTR 48[rbp], rax
	mov	rax, QWORD PTR MOUSE_MSC_SYNCMASK[rip]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR 40[rbp]
	mov	rdx, QWORD PTR MOUSE_MSC_SYNC[rip]
	mov	QWORD PTR 8[rax], rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L12:
	mov	DWORD PTR 32[rbp], eax
	mov	DWORD PTR 76[rbp], edx
	mov	DWORD PTR 72[rbp], 3
	test	eax, eax
	jne	.L13
	mov	rax, QWORD PTR MOUSE_PROTO_MSC[rip]
	mov	rdx, QWORD PTR MOUSE_MSC_SYNCMASK[rip]
	mov	QWORD PTR 56[rbp], rax
	mov	rax, QWORD PTR MOUSE_MSC_PACKETSIZE[rip]
	mov	QWORD PTR 48[rbp], rax
	mov	rax, QWORD PTR 40[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR 40[rbp]
	mov	rdx, QWORD PTR MOUSE_MSC_SYNC[rip]
	mov	QWORD PTR 8[rax], rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L11:
	mov	DWORD PTR 32[rbp], -1
	mov	DWORD PTR 76[rbp], edx
	mov	DWORD PTR 72[rbp], 3
	jmp	.L17
.L13:
	mov	rax, QWORD PTR MOUSE_PROTO_SYSMOUSE[rip]
	mov	rdx, QWORD PTR MOUSE_SYS_SYNCMASK[rip]
	mov	QWORD PTR 56[rbp], rax
	mov	rax, QWORD PTR MOUSE_SYS_PACKETSIZE[rip]
	mov	QWORD PTR 48[rbp], rax
	mov	rax, QWORD PTR 40[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR 40[rbp]
	mov	rdx, QWORD PTR MOUSE_SYS_SYNC[rip]
	mov	QWORD PTR 8[rax], rdx
	jmp	.L17
	.cfi_endproc
.LFE0:
	.size	atp_ioctl, .-atp_ioctl
	.comm	MOUSE_SYS_SYNCMASK,8,8
	.comm	MOUSE_SYS_SYNC,8,8
	.comm	MOUSE_SYS_PACKETSIZE,8,8
	.comm	MOUSE_PROTO_SYSMOUSE,8,8
	.comm	MOUSE_PROTO_MSC,8,8
	.comm	MOUSE_POSCHANGED,4,4
	.comm	MOUSE_MSC_SYNCMASK,8,8
	.comm	MOUSE_MSC_SYNC,8,8
	.comm	MOUSE_MSC_PACKETSIZE,8,8
	.comm	MOUSE_BUTTONSCHANGED,4,4
	.comm	ENOTTY,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_atp.c_atp_ioctl.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	atp_ioctl, %function
atp_ioctl:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r1
	mov	r6, r2
	bl	usb_fifo_softc
	mov	r5, r0
	bl	mtx_lock
	sub	r1, r4, #128
	cmp	r1, #5
	ldrls	pc, [pc, r1, asl #2]
	b	.L2
.L4:
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L3:
	mov	r4, #0
	ldr	r3, [r5, #48]
	str	r3, [r6]
.L10:
	mov	r0, r5
	bl	mtx_unlock
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L9:
	ldr	r3, [r6]
	ldr	r2, [r6, #16]
	cmn	r3, #1
	beq	.L11
	cmp	r3, #1
	bls	.L12
.L15:
	ldr	r3, .L32
	ldr	r4, [r3]
	b	.L10
.L8:
	ldr	r3, [r6]
	cmp	r3, #1
	bhi	.L15
	mov	r2, #3
	cmp	r3, #0
	str	r3, [r5, #28]
	str	r2, [r5, #48]
	ldr	r3, [r5, #32]
	beq	.L30
	ldr	r0, .L32+4
	ldr	r1, .L32+8
	ldr	r2, .L32+12
	ldr	ip, [r0]
	ldr	r0, [r1]
	ldr	r1, [r2]
	ldr	r2, .L32+16
.L27:
	str	ip, [r5, #40]
	str	r0, [r5, #36]
	str	r1, [r3]
	ldr	r3, [r5, #32]
	ldr	r2, [r2]
	str	r2, [r3, #4]
.L28:
	mov	r0, r5
	bl	atp_reset_buf
	mov	r4, #0
	b	.L10
.L7:
	mov	ip, r6
	mov	r4, #0
	add	lr, r5, #4
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	str	r4, [r5, #24]
	ldr	r2, [r6, #20]
	ldr	r3, [r5, #12]
	cmp	r2, r4
	str	r4, [r5, #20]
	str	r4, [r5, #16]
	str	r4, [r5, #12]
	str	r3, [r5, #8]
	bne	.L18
	ldr	r3, [r6, #16]
	cmp	r3, r4
	beq	.L31
.L18:
	ldr	r2, .L32+20
	ldr	r3, [r6]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r6]
.L19:
	ldr	r2, [r6, #8]
	ldr	r3, [r6, #4]
	cmp	r2, r3
	moveq	r4, #0
	beq	.L10
	ldr	r2, .L32+24
	ldr	r3, [r6]
	ldr	r2, [r2]
	mov	r4, #0
	orr	r3, r3, r2
	str	r3, [r6]
	b	.L10
.L6:
	add	ip, r5, #28
	ldmia	ip!, {r0, r1, r2, r3}
	stmia	r6!, {r0, r1, r2, r3}
	ldr	r3, [ip]
	mov	r4, #0
	str	r3, [r6]
	b	.L10
.L5:
	ldr	r3, [r5, #28]
	mov	r4, #0
	str	r3, [r6]
	b	.L10
.L31:
	ldr	r3, [r6, #12]
	cmp	r3, r4
	beq	.L19
	b	.L18
.L30:
	ldr	r0, .L32+28
	ldr	r1, .L32+32
	ldr	r2, .L32+36
	ldr	ip, [r0]
	ldr	r0, [r1]
	ldr	r1, [r2]
	ldr	r2, .L32+40
	b	.L27
.L12:
	mov	r1, #3
	cmp	r3, #0
	str	r3, [r5, #28]
	str	r2, [r5, #52]
	str	r1, [r5, #48]
	bne	.L13
	ldr	r1, .L32+28
	ldr	r2, .L32+32
	ldr	r3, .L32+36
	ldr	ip, [r1]
	ldr	r0, [r2]
	ldr	r1, [r3]
	ldr	r2, .L32+40
	ldr	r3, [r5, #32]
	b	.L27
.L11:
	mov	r1, #3
	str	r3, [r5, #28]
	str	r2, [r5, #52]
	str	r1, [r5, #48]
	b	.L28
.L13:
	ldr	r1, .L32+4
	ldr	r2, .L32+8
	ldr	r3, .L32+12
	ldr	ip, [r1]
	ldr	r0, [r2]
	ldr	r1, [r3]
	ldr	r2, .L32+16
	ldr	r3, [r5, #32]
	b	.L27
.L2:
	ldr	r3, .L32+44
	ldr	r4, [r3]
	b	.L10
.L33:
	.align	2
.L32:
	.word	EINVAL
	.word	MOUSE_PROTO_SYSMOUSE
	.word	MOUSE_SYS_PACKETSIZE
	.word	MOUSE_SYS_SYNCMASK
	.word	MOUSE_SYS_SYNC
	.word	MOUSE_POSCHANGED
	.word	MOUSE_BUTTONSCHANGED
	.word	MOUSE_PROTO_MSC
	.word	MOUSE_MSC_PACKETSIZE
	.word	MOUSE_MSC_SYNCMASK
	.word	MOUSE_MSC_SYNC
	.word	ENOTTY
	.size	atp_ioctl, .-atp_ioctl
	.comm	MOUSE_SYS_SYNCMASK,4,4
	.comm	MOUSE_SYS_SYNC,4,4
	.comm	MOUSE_SYS_PACKETSIZE,4,4
	.comm	MOUSE_PROTO_SYSMOUSE,4,4
	.comm	MOUSE_PROTO_MSC,4,4
	.comm	MOUSE_POSCHANGED,4,4
	.comm	MOUSE_MSC_SYNCMASK,4,4
	.comm	MOUSE_MSC_SYNC,4,4
	.comm	MOUSE_MSC_PACKETSIZE,4,4
	.comm	MOUSE_BUTTONSCHANGED,4,4
	.comm	ENOTTY,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
