	.file	"extr_adb_mouse.c_ams_poll.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ams_poll, @function
ams_poll:
.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	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	CDEV_GET_SOFTC@PLT
	test	rax, rax
	je	.L11
	mov	rbx, rax
	mov	eax, DWORD PTR POLLIN[rip]
	or	eax, DWORD PTR POLLRDNORM[rip]
	test	eax, r12d
	jne	.L12
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L12:
	.cfi_restore_state
	lea	r13, 40[rbx]
	mov	rdi, r13
	call	mtx_lock@PLT
	cmp	QWORD PTR [rbx], 0
	jne	.L4
	cmp	QWORD PTR 8[rbx], 0
	jne	.L4
	mov	rax, QWORD PTR 24[rbx]
	cmp	QWORD PTR 16[rbx], rax
	je	.L13
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR POLLIN[rip]
	or	eax, DWORD PTR POLLRDNORM[rip]
	and	r12d, eax
.L5:
	mov	rdi, r13
	call	mtx_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
.L11:
	.cfi_restore_state
	mov	r12d, DWORD PTR EIO[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	cmp	QWORD PTR 32[rbx], 0
	jne	.L4
	lea	rsi, 44[rbx]
	mov	rdi, rbp
	xor	r12d, r12d
	call	selrecord@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	ams_poll, .-ams_poll
	.comm	POLLRDNORM,4,4
	.comm	POLLIN,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_adb_mouse.c_ams_poll.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ams_poll, %function
ams_poll:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	mov	r6, r2
	bl	CDEV_GET_SOFTC
	subs	r5, r0, #0
	beq	.L11
	ldr	r8, .L14
	ldr	r7, .L14+4
	ldr	r3, [r8]
	ldr	r2, [r7]
	orr	r3, r3, r2
	tst	r3, r4
	bne	.L12
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	add	r9, r5, #20
	mov	r0, r9
	bl	mtx_lock
	ldr	r3, [r5]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [r5, #4]
	cmp	r3, #0
	bne	.L4
	ldr	r2, [r5, #8]
	ldr	r3, [r5, #12]
	cmp	r2, r3
	beq	.L13
.L4:
	ldr	r3, [r8]
	ldr	r2, [r7]
	orr	r3, r3, r2
	and	r4, r4, r3
.L5:
	mov	r0, r9
	bl	mtx_unlock
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	ldr	r3, .L14+8
	ldr	r4, [r3]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	ldr	r10, [r5, #16]
	cmp	r10, #0
	bne	.L4
	mov	r0, r6
	add	r1, r5, #24
	bl	selrecord
	mov	r4, r10
	b	.L5
.L15:
	.align	2
.L14:
	.word	POLLIN
	.word	POLLRDNORM
	.word	EIO
	.size	ams_poll, .-ams_poll
	.comm	POLLRDNORM,4,4
	.comm	POLLIN,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
