	.file	"extr_poll.c_poll.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	poll
	.type	poll, @function
poll:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	xmm0, xmm0
	mov	r15, rdi
	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
	mov	ebx, esi
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	QWORD PTR 24[rsp], rdi
	lea	rbp, 60[rsp]
	lea	r12, 64[rsp]
	mov	DWORD PTR 20[rsp], esi
	mov	rdi, rbp
	lea	r13, 68[rsp]
	mov	DWORD PTR 16[rsp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	movaps	XMMWORD PTR 32[rsp], xmm0
	call	FD_ZERO@PLT
	mov	rdi, r12
	call	FD_ZERO@PLT
	mov	rdi, r13
	call	FD_ZERO@PLT
	test	ebx, ebx
	je	.L22
	mov	eax, ebx
	mov	rcx, r15
	lea	r15, 4[r15]
	mov	ebx, -1
	sub	eax, 1
	lea	rax, [rax+rax*2]
	lea	rax, 16[rcx+rax*4]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	test	DWORD PTR POLLWRNORM[rip], eax
	jne	.L47
.L6:
	test	DWORD PTR POLLPRI[rip], eax
	jne	.L48
.L7:
	add	r15, 12
	cmp	QWORD PTR 8[rsp], r15
	je	.L49
.L8:
	mov	r14d, DWORD PTR -4[r15]
	cmp	ebx, r14d
	cmovl	ebx, r14d
	cmp	r14d, DWORD PTR FD_SETSIZE[rip]
	jnb	.L50
	mov	eax, DWORD PTR [r15]
	test	DWORD PTR POLLRDNORM[rip], eax
	je	.L5
	mov	rsi, rbp
	mov	edi, r14d
	call	FD_SET@PLT
	mov	eax, DWORD PTR [r15]
	test	DWORD PTR POLLWRNORM[rip], eax
	je	.L6
.L47:
	mov	rsi, r12
	mov	edi, r14d
	call	FD_SET@PLT
	mov	eax, DWORD PTR [r15]
	test	DWORD PTR POLLPRI[rip], eax
	je	.L7
.L48:
	mov	rsi, r13
	mov	edi, r14d
	add	r15, 12
	call	FD_SET@PLT
	cmp	QWORD PTR 8[rsp], r15
	jne	.L8
.L49:
	lea	r14d, 1[rbx]
.L2:
	mov	eax, DWORD PTR 16[rsp]
	xor	r8d, r8d
	test	eax, eax
	js	.L9
	mov	esi, 1000
	mov	edi, eax
	call	div@PLT
	lea	r8, 32[rsp]
	mov	rdx, rax
	imul	eax, eax, 1000
	sar	rdx, 32
	mov	DWORD PTR 36[rsp], edx
	mov	DWORD PTR 32[rsp], eax
.L9:
	mov	rcx, r13
	mov	rdx, r12
	mov	rsi, rbp
	mov	edi, r14d
	call	select@PLT
	mov	DWORD PTR 16[rsp], eax
	cmp	eax, -1
	je	.L10
	mov	eax, DWORD PTR 20[rsp]
	test	eax, eax
	je	.L1
	mov	eax, DWORD PTR 20[rsp]
	mov	r14, QWORD PTR 24[rsp]
	sub	eax, 1
	lea	rax, [rax+rax*2]
	lea	rax, 12[r14+rax*4]
	mov	QWORD PTR 8[rsp], rax
	.p2align 4,,10
	.p2align 3
.L20:
	mov	r15d, DWORD PTR [r14]
	mov	rsi, rbp
	mov	ebx, 0
	mov	edi, r15d
	call	FD_ISSET@PLT
	mov	rsi, r12
	mov	edi, r15d
	test	rax, rax
	cmovne	ebx, DWORD PTR POLLRDNORM[rip]
	call	FD_ISSET@PLT
	test	rax, rax
	je	.L18
	or	ebx, DWORD PTR POLLWRNORM[rip]
.L18:
	mov	rsi, r13
	mov	edi, r15d
	call	FD_ISSET@PLT
	test	rax, rax
	je	.L19
	or	ebx, DWORD PTR POLLPRI[rip]
.L19:
	mov	DWORD PTR 8[r14], ebx
	add	r14, 12
	cmp	r14, QWORD PTR 8[rsp]
	jne	.L20
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L50:
	mov	rax, QWORD PTR EINVAL[rip]
	mov	DWORD PTR 16[rsp], -1
	mov	QWORD PTR errno[rip], rax
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L51
	mov	eax, DWORD PTR 16[rsp]
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L10:
	.cfi_restore_state
	mov	rax, QWORD PTR EBADF[rip]
	cmp	QWORD PTR errno[rip], rax
	jne	.L1
	mov	eax, DWORD PTR 20[rsp]
	test	eax, eax
	je	.L1
	mov	rbx, QWORD PTR 24[rsp]
	sub	eax, 1
	xor	r12d, r12d
	lea	rax, [rax+rax*2]
	lea	rbp, 12[rbx+rax*4]
	.p2align 4,,10
	.p2align 3
.L15:
	mov	esi, DWORD PTR F_GETFD[rip]
	mov	edi, DWORD PTR [rbx]
	call	fcntl@PLT
	mov	r8d, eax
	xor	eax, eax
	cmp	r8d, -1
	jne	.L14
	mov	eax, DWORD PTR POLLNVAL[rip]
	add	r12d, 1
.L14:
	mov	DWORD PTR 8[rbx], eax
	add	rbx, 12
	cmp	rbp, rbx
	jne	.L15
	test	r12d, r12d
	cmove	r12d, DWORD PTR 16[rsp]
	mov	DWORD PTR 16[rsp], r12d
	jmp	.L1
.L22:
	xor	r14d, r14d
	jmp	.L2
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	poll, .-poll
	.comm	errno,8,8
	.comm	POLLWRNORM,4,4
	.comm	POLLRDNORM,4,4
	.comm	POLLPRI,4,4
	.comm	POLLNVAL,4,4
	.comm	F_GETFD,4,4
	.comm	FD_SETSIZE,4,4
	.comm	EINVAL,8,8
	.comm	EBADF,8,8
	.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_poll.c_poll.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	poll
	.syntax unified
	.arm
	.fpu softvfp
	.type	poll, %function
poll:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	mov	r6, #0
	mov	r4, r1
	sub	sp, sp, #68
	ldr	r3, .L54
	str	r1, [sp, #12]
	str	r2, [sp, #16]
	str	r8, [sp, #20]
	add	r0, sp, #48
	ldr	r3, [r3]
	str	r3, [sp, #60]
	mov	r3,#0
	str	r6, [sp, #32]
	str	r6, [sp, #36]
	str	r6, [sp, #40]
	str	r6, [sp, #44]
	bl	FD_ZERO
	add	r0, sp, #52
	bl	FD_ZERO
	add	r0, sp, #56
	bl	FD_ZERO
	cmp	r4, r6
	beq	.L22
	mov	r5, r8
	mvn	r7, #0
	ldr	r10, .L54+4
	ldr	r9, .L54+8
	ldr	r8, .L54+12
	ldr	fp, .L54+16
	b	.L8
.L5:
	ldr	r1, [r8]
	tst	r3, r1
	bne	.L49
.L6:
	ldr	r1, [fp]
	tst	r3, r1
	bne	.L50
.L7:
	ldr	r3, [sp, #12]
	add	r6, r6, #1
	cmp	r3, r6
	add	r5, r5, #12
	beq	.L51
.L8:
	ldr	r4, [r5]
	ldr	r3, [r10]
	cmp	r7, r4
	movlt	r7, r4
	cmp	r4, r3
	bcs	.L52
	ldr	r3, [r5, #4]
	ldr	r1, [r9]
	tst	r3, r1
	beq	.L5
	add	r1, sp, #48
	mov	r0, r4
	bl	FD_SET
	ldr	r3, [r5, #4]
	ldr	r1, [r8]
	tst	r3, r1
	beq	.L6
.L49:
	add	r1, sp, #52
	mov	r0, r4
	bl	FD_SET
	ldr	r3, [r5, #4]
	ldr	r1, [fp]
	tst	r3, r1
	beq	.L7
.L50:
	mov	r0, r4
	add	r1, sp, #56
	bl	FD_SET
	b	.L7
.L52:
	mvn	r5, #0
	ldr	r2, .L54+20
	ldr	r3, .L54+24
	ldr	r2, [r2]
	str	r2, [r3]
.L1:
	ldr	r3, .L54
	ldr	r2, [r3]
	ldr	r3, [sp, #60]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L53
	mov	r0, r5
	add	sp, sp, #68
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L51:
	add	r7, r7, #1
.L2:
	ldr	r1, [sp, #16]
	cmp	r1, #0
	movlt	r3, #0
	blt	.L9
	mov	r2, #1000
	add	r0, sp, #24
	bl	div
	ldr	r3, [sp, #24]
	ldr	r1, [sp, #28]
	rsb	r2, r3, r3, lsl #5
	add	r3, r3, r2, lsl #2
	lsl	r2, r3, #3
	str	r2, [sp, #32]
	add	r3, sp, #32
	str	r1, [sp, #36]
.L9:
	str	r3, [sp]
	mov	r0, r7
	add	r3, sp, #56
	add	r2, sp, #52
	add	r1, sp, #48
	bl	select
	cmn	r0, #1
	mov	r5, r0
	beq	.L10
	ldr	r3, [sp, #12]
	cmp	r3, #0
	beq	.L1
	ldr	r3, [sp, #12]
	ldr	r8, [sp, #20]
	add	r9, r3, r3, lsl #1
	ldr	r10, .L54+8
	ldr	r7, .L54+12
	ldr	r6, .L54+16
	add	r9, r8, r9, lsl #2
.L20:
	ldr	fp, [r8]
	add	r1, sp, #48
	mov	r0, fp
	bl	FD_ISSET
	add	r1, sp, #52
	subs	r4, r0, #0
	mov	r0, fp
	ldrne	r4, [r10]
	bl	FD_ISSET
	cmp	r0, #0
	ldrne	r3, [r7]
	mov	r0, fp
	add	r1, sp, #56
	orrne	r4, r4, r3
	bl	FD_ISSET
	cmp	r0, #0
	ldrne	r3, [r6]
	add	r8, r8, #12
	orrne	r4, r4, r3
	str	r4, [r8, #-4]
	cmp	r9, r8
	bne	.L20
	b	.L1
.L10:
	ldr	r2, .L54+24
	ldr	r3, .L54+28
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L1
	ldr	r3, [sp, #12]
	cmp	r3, #0
	beq	.L1
	mov	r6, #0
	ldr	r8, [sp, #20]
	add	r9, r3, r3, lsl #1
	ldr	r4, .L54+32
	ldr	r7, .L54+36
	add	r9, r8, r9, lsl #2
.L15:
	ldr	r0, [r8]
	ldr	r1, [r4]
	bl	fcntl
	cmn	r0, #1
	movne	r3, #0
	ldreq	r3, [r7]
	add	r8, r8, #12
	str	r3, [r8, #-4]
	addeq	r6, r6, #1
	cmp	r9, r8
	bne	.L15
	cmp	r6, #0
	movne	r5, r6
	b	.L1
.L22:
	ldr	r7, [sp, #12]
	b	.L2
.L53:
	bl	__stack_chk_fail
.L55:
	.align	2
.L54:
	.word	.LC0
	.word	FD_SETSIZE
	.word	POLLRDNORM
	.word	POLLWRNORM
	.word	POLLPRI
	.word	EINVAL
	.word	errno
	.word	EBADF
	.word	F_GETFD
	.word	POLLNVAL
	.size	poll, .-poll
	.comm	errno,4,4
	.comm	POLLWRNORM,4,4
	.comm	POLLRDNORM,4,4
	.comm	POLLPRI,4,4
	.comm	POLLNVAL,4,4
	.comm	F_GETFD,4,4
	.comm	FD_SETSIZE,4,4
	.comm	EINVAL,4,4
	.comm	EBADF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
