	.file	"extr_t_sleep.c_do_kevent.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"kqueue: %s"
.LC1:
	.string	"kevent: %s"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"kevent: KEVNT_TIMEOUT did not cause EVFILT_TIMER event"
	.text
	.p2align 4
	.globl	do_kevent
	.type	do_kevent, @function
do_kevent:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR errno[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	strerror@PLT
	mov	r12d, eax
	xor	eax, eax
	call	kqueue@PLT
	xor	edi, edi
	mov	edx, r12d
	lea	rsi, .LC0[rip]
	cmp	eax, -1
	mov	ebp, eax
	setne	dil
	xor	eax, eax
	call	ATF_REQUIRE_MSG@PLT
	xor	eax, eax
	mov	r12d, DWORD PTR KEVNT_TIMEOUT[rip]
	call	isQEMU@PLT
	test	rax, rax
	je	.L2
	movsx	rax, r12d
	mov	esi, r12d
	mov	ecx, DWORD PTR [rbx]
	imul	rax, rax, 274877907
	sar	esi, 31
	mov	rdx, rax
	sar	rax, 38
	sub	eax, esi
	shr	rdx, 32
	cmp	eax, ecx
	jl	.L11
.L2:
	mov	r13, rsp
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	mov	ecx, DWORD PTR EV_ADD[rip]
	mov	r9d, r12d
	push	0
	.cfi_def_cfa_offset 80
	mov	edx, DWORD PTR EVFILT_TIMER[rip]
	mov	rdi, r13
	xor	r8d, r8d
	mov	esi, 1
	call	EV_SET@PLT
	lea	rcx, 20[rsp]
	mov	rsi, r13
	mov	r9, rbx
	mov	edx, 1
	mov	r8d, 1
	mov	edi, ebp
	call	kevent@PLT
	mov	edi, ebp
	mov	r14d, DWORD PTR errno[rip]
	mov	r13d, eax
	call	close@PLT
	pop	rax
	.cfi_def_cfa_offset 72
	pop	rdx
	.cfi_def_cfa_offset 64
	cmp	r13d, -1
	je	.L12
	imul	r12d, DWORD PTR MILLION[rip]
	mov	eax, DWORD PTR [rbx]
	imul	eax, DWORD PTR BILLION[rip]
	add	eax, DWORD PTR 4[rbx]
	cmp	eax, r12d
	jg	.L13
.L4:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	sar	edx, 5
	sub	edx, esi
	cmp	ecx, edx
	jge	.L2
	mov	eax, DWORD PTR MAXSLEEP[rip]
	mov	DWORD PTR [rbx], eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	xor	edi, edi
	test	r13d, r13d
	lea	rsi, .LC2[rip]
	setg	dil
	xor	eax, eax
	call	ATF_REQUIRE_MSG@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edi, r14d
	call	strerror@PLT
	xor	edi, edi
	cmp	DWORD PTR EINTR[rip], r14d
	lea	rsi, .LC1[rip]
	mov	edx, eax
	sete	dil
	xor	eax, eax
	call	ATF_REQUIRE_MSG@PLT
	jmp	.L4
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	do_kevent, .-do_kevent
	.comm	errno,4,4
	.comm	MILLION,4,4
	.comm	MAXSLEEP,4,4
	.comm	KEVNT_TIMEOUT,4,4
	.comm	EV_ADD,4,4
	.comm	EVFILT_TIMER,4,4
	.comm	EINTR,4,4
	.comm	BILLION,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_t_sleep.c_do_kevent.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"kqueue: %s\000"
	.align	2
.LC1:
	.ascii	"kevent: %s\000"
	.align	2
.LC2:
	.ascii	"kevent: KEVNT_TIMEOUT did not cause EVFILT_TIMER ev"
	.ascii	"ent\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	do_kevent
	.syntax unified
	.arm
	.fpu softvfp
	.type	do_kevent, %function
do_kevent:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L15
	sub	sp, sp, #32
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	mov	r4, r0
	bl	kqueue
	ldr	r8, .L15+4
	mov	r5, r0
	ldr	r0, [r8]
	bl	strerror
	mov	r2, r0
	adds	r0, r5, #1
	movne	r0, #1
	ldr	r1, .L15+8
	bl	ATF_REQUIRE_MSG
	ldr	r3, .L15+12
	ldr	r6, [r3]
	bl	isQEMU
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L15+16
	asr	r2, r6, #31
	smull	r1, r3, r6, r3
	ldr	r1, [r4]
	rsb	r0, r2, r3, asr #6
	cmp	r0, r1
	blt	.L11
.L2:
	mov	r3, #0
	ldr	r1, .L15+20
	ldr	r2, .L15+24
	str	r6, [sp, #4]
	str	r3, [sp, #8]
	str	r3, [sp]
	ldr	r3, [r1]
	ldr	r2, [r2]
	mov	r1, #1
	add	r0, sp, #20
	bl	EV_SET
	mov	r2, #1
	mov	r0, r5
	stm	sp, {r2, r4}
	add	r1, sp, #20
	add	r3, sp, #24
	bl	kevent
	mov	r7, r0
	mov	r0, r5
	ldr	r5, [r8]
	bl	close
	cmn	r7, #1
	beq	.L12
	ldr	r3, .L15+28
	ldr	r2, .L15+32
	ldr	r0, [r3]
	ldr	r1, [r4, #4]
	ldr	r3, [r4]
	ldr	r2, [r2]
	mla	r3, r0, r3, r1
	mul	r6, r2, r6
	cmp	r3, r6
	bgt	.L13
.L4:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, #0
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	rsb	r3, r2, r3, asr #5
	cmp	r1, r3
	ldrlt	r3, .L15+36
	ldrlt	r3, [r3]
	strlt	r3, [r4]
	b	.L2
.L13:
	cmp	r7, #0
	movle	r0, #0
	movgt	r0, #1
	ldr	r1, .L15+40
	bl	ATF_REQUIRE_MSG
	b	.L4
.L12:
	ldr	r3, .L15+44
	mov	r0, r5
	ldr	r3, [r3]
	sub	r5, r3, r5
	clz	r5, r5
	bl	strerror
	lsr	r5, r5, #5
	mov	r2, r0
	ldr	r1, .L15+48
	mov	r0, r5
	bl	ATF_REQUIRE_MSG
	b	.L4
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC3
	.word	errno
	.word	.LC0
	.word	KEVNT_TIMEOUT
	.word	274877907
	.word	EV_ADD
	.word	EVFILT_TIMER
	.word	BILLION
	.word	MILLION
	.word	MAXSLEEP
	.word	.LC2
	.word	EINTR
	.word	.LC1
	.size	do_kevent, .-do_kevent
	.comm	errno,4,4
	.comm	MILLION,4,4
	.comm	MAXSLEEP,4,4
	.comm	KEVNT_TIMEOUT,4,4
	.comm	EV_ADD,4,4
	.comm	EVFILT_TIMER,4,4
	.comm	EINTR,4,4
	.comm	BILLION,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
