	.file	"extr_sync.c_test_signalandwait.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"should fail\n"
.LC1:
	.string	"failed to create event flags\n"
.LC2:
	.string	"should succeed\n"
.LC3:
	.string	"event was signalled\n"
.LC4:
	.string	"failed to clear event[1]\n"
.LC5:
	.string	"should timeout\n"
.LC6:
	.string	"failed to create semaphore\n"
.LC7:
	.string	"x"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC8:
	.string	"should return invalid handle error\n"
	.text
	.p2align 4
	.type	test_signalandwait, @function
test_signalandwait:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xor	ecx, ecx
	xor	edx, edx
	xor	esi, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xor	edi, edi
	lea	r12, .LC2[rip]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, 10000
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_FAILED[rip], rax
	lea	rsi, .LC0[rip]
	sete	dil
	call	ok@PLT
	xor	ecx, ecx
	xor	edx, edx
	xor	esi, esi
	xor	edi, edi
	call	CreateEventW@PLT
	xor	ecx, ecx
	mov	edx, 1
	xor	edi, edi
	mov	esi, 1
	mov	rbp, rax
	call	CreateEventW@PLT
	test	rbp, rbp
	lea	rsi, .LC1[rip]
	mov	r13, rax
	setne	al
	xor	edi, edi
	test	r13, r13
	setne	dil
	and	edi, eax
	call	ok@PLT
	mov	rcx, QWORD PTR FALSE[rip]
	xor	edx, edx
	xor	esi, esi
	mov	rdi, rbp
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_FAILED[rip], rax
	lea	rsi, .LC0[rip]
	sete	dil
	call	ok@PLT
	mov	rcx, QWORD PTR FALSE[rip]
	xor	edx, edx
	xor	edi, edi
	mov	rsi, rbp
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_FAILED[rip], rax
	lea	rsi, .LC0[rip]
	sete	dil
	call	ok@PLT
	xor	edx, edx
	mov	rsi, r13
	mov	rdi, rbp
	mov	rcx, QWORD PTR FALSE[rip]
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_OBJECT_0[rip], rax
	lea	rsi, .LC2[rip]
	sete	dil
	call	ok@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rcx, QWORD PTR FALSE[rip]
	xor	edx, edx
	mov	rsi, rbp
	mov	rdi, rbp
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_OBJECT_0[rip], rax
	mov	rsi, r12
	sete	dil
	call	ok@PLT
	sub	ebx, 1
	jne	.L2
	xor	esi, esi
	mov	rdi, rbp
	call	WaitForSingleObject@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_TIMEOUT[rip], rax
	lea	rsi, .LC3[rip]
	sete	dil
	call	ok@PLT
	xor	edx, edx
	mov	rsi, rbp
	mov	rdi, rbp
	mov	rcx, QWORD PTR FALSE[rip]
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_OBJECT_0[rip], rax
	lea	rsi, .LC2[rip]
	sete	dil
	call	ok@PLT
	mov	rdi, r13
	call	ResetEvent@PLT
	lea	rsi, .LC4[rip]
	mov	edi, eax
	call	ok@PLT
	xor	edx, edx
	mov	rsi, r13
	mov	rdi, rbp
	mov	rcx, QWORD PTR FALSE[rip]
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_TIMEOUT[rip], rax
	lea	rsi, .LC5[rip]
	sete	dil
	call	ok@PLT
	mov	rdi, rbp
	call	CloseHandle@PLT
	mov	rdi, r13
	call	CloseHandle@PLT
	xor	ecx, ecx
	xor	esi, esi
	xor	edi, edi
	mov	edx, 1
	call	CreateSemaphoreW@PLT
	xor	ecx, ecx
	mov	edx, 1
	xor	edi, edi
	mov	esi, 1
	mov	r12, rax
	call	CreateSemaphoreW@PLT
	test	r12, r12
	lea	rsi, .LC6[rip]
	mov	rbp, rax
	setne	al
	xor	edi, edi
	test	rbp, rbp
	setne	dil
	and	edi, eax
	call	ok@PLT
	xor	edx, edx
	mov	rsi, rbp
	mov	rdi, r12
	mov	rcx, QWORD PTR FALSE[rip]
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_OBJECT_0[rip], rax
	lea	rsi, .LC2[rip]
	sete	dil
	call	ok@PLT
	xor	edx, edx
	mov	rsi, rbp
	mov	rdi, r12
	mov	rcx, QWORD PTR FALSE[rip]
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_FAILED[rip], rax
	lea	rsi, .LC0[rip]
	sete	dil
	call	ok@PLT
	xor	edx, edx
	mov	rdi, r12
	mov	esi, 1
	call	ReleaseSemaphore@PLT
	xor	edi, edi
	cmp	QWORD PTR FALSE[rip], rax
	lea	rsi, .LC0[rip]
	sete	dil
	call	ok@PLT
	xor	edx, edx
	mov	rdi, rbp
	mov	esi, 1
	call	ReleaseSemaphore@PLT
	xor	edi, edi
	cmp	QWORD PTR TRUE[rip], rax
	lea	rsi, .LC2[rip]
	sete	dil
	call	ok@PLT
	mov	rdi, r12
	call	CloseHandle@PLT
	mov	rdi, rbp
	call	CloseHandle@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	xor	ecx, ecx
	xor	edx, edx
	push	0
	.cfi_def_cfa_offset 64
	mov	r8d, DWORD PTR CREATE_ALWAYS[rip]
	lea	rdi, .LC7[rip]
	mov	esi, DWORD PTR GENERIC_READ[rip]
	mov	r9d, DWORD PTR FILE_ATTRIBUTE_NORMAL[rip]
	or	esi, DWORD PTR GENERIC_WRITE[rip]
	or	r9d, DWORD PTR FILE_FLAG_DELETE_ON_CLOSE[rip]
	call	CreateFileA@PLT
	mov	rcx, QWORD PTR FALSE[rip]
	xor	edx, edx
	mov	rsi, rax
	mov	rdi, rax
	mov	rbp, rax
	call	SignalObjectAndWait@PLT
	xor	edi, edi
	cmp	QWORD PTR WAIT_FAILED[rip], rax
	lea	rsi, .LC0[rip]
	sete	dil
	call	ok@PLT
	xor	eax, eax
	call	GetLastError@PLT
	xor	edi, edi
	cmp	QWORD PTR ERROR_INVALID_HANDLE[rip], rax
	lea	rsi, .LC8[rip]
	sete	dil
	call	ok@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	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
	jmp	CloseHandle@PLT
	.cfi_endproc
.LFE0:
	.size	test_signalandwait, .-test_signalandwait
	.comm	WAIT_TIMEOUT,8,8
	.comm	WAIT_OBJECT_0,8,8
	.comm	WAIT_FAILED,8,8
	.comm	TRUE,8,8
	.comm	GENERIC_WRITE,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_FLAG_DELETE_ON_CLOSE,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	FALSE,8,8
	.comm	ERROR_INVALID_HANDLE,8,8
	.comm	CREATE_ALWAYS,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_sync.c_test_signalandwait.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"should fail\012\000"
	.align	2
.LC1:
	.ascii	"failed to create event flags\012\000"
	.align	2
.LC2:
	.ascii	"should succeed\012\000"
	.align	2
.LC3:
	.ascii	"event was signalled\012\000"
	.align	2
.LC4:
	.ascii	"failed to clear event[1]\012\000"
	.align	2
.LC5:
	.ascii	"should timeout\012\000"
	.align	2
.LC6:
	.ascii	"failed to create semaphore\012\000"
	.align	2
.LC7:
	.ascii	"x\000"
	.align	2
.LC8:
	.ascii	"should return invalid handle error\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_signalandwait, %function
test_signalandwait:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r2, r3
	sub	sp, sp, #16
	mov	r1, r3
	mov	r0, r3
	bl	SignalObjectAndWait
	ldr	r10, .L6
	ldr	r1, .L6+4
	ldr	r3, [r10]
	ldr	r6, .L6+8
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r3, #0
	mov	r2, r3
	mov	r1, r3
	mov	r0, r3
	bl	CreateEventW
	mov	r3, #0
	mov	r2, #1
	mov	r5, r0
	mov	r1, r2
	mov	r0, r3
	bl	CreateEventW
	mov	r9, r0
	subs	r0, r0, #0
	movne	r0, #1
	cmp	r5, #0
	moveq	r0, #0
	ldr	r1, .L6+12
	bl	ok
	mov	r2, #0
	ldr	r3, [r6]
	mov	r1, r2
	mov	r0, r5
	bl	SignalObjectAndWait
	ldr	r3, [r10]
	ldr	r1, .L6+4
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r2, #0
	mov	r1, r5
	mov	r0, r2
	ldr	r3, [r6]
	bl	SignalObjectAndWait
	ldr	r3, [r10]
	ldr	r1, .L6+4
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r1, r9
	mov	r2, #0
	ldr	r3, [r6]
	mov	r0, r5
	bl	SignalObjectAndWait
	ldr	r7, .L6+16
	ldr	r1, .L6+20
	ldr	r3, [r7]
	ldr	r4, .L6+24
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	ldr	r8, .L6+20
.L2:
	mov	r2, #0
	mov	r1, r5
	ldr	r3, [r6]
	mov	r0, r5
	bl	SignalObjectAndWait
	ldr	r3, [r7]
	mov	r1, r8
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	subs	r4, r4, #1
	bne	.L2
	mov	r1, r4
	mov	r0, r5
	bl	WaitForSingleObject
	ldr	r8, .L6+28
	ldr	r1, .L6+32
	ldr	r3, [r8]
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r2, r4
	mov	r1, r5
	ldr	r3, [r6]
	mov	r0, r5
	bl	SignalObjectAndWait
	ldr	r3, [r7]
	ldr	r1, .L6+20
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r0, r9
	bl	ResetEvent
	ldr	r1, .L6+36
	bl	ok
	mov	r2, r4
	mov	r1, r9
	ldr	r3, [r6]
	mov	r0, r5
	bl	SignalObjectAndWait
	ldr	r3, [r8]
	ldr	r1, .L6+40
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r0, r5
	bl	CloseHandle
	mov	r0, r9
	bl	CloseHandle
	mov	r3, r4
	mov	r1, r4
	mov	r2, #1
	mov	r0, r4
	bl	CreateSemaphoreW
	mov	r2, #1
	mov	r8, r0
	mov	r1, r2
	mov	r3, r4
	mov	r0, r4
	bl	CreateSemaphoreW
	subs	r3, r0, #0
	movne	r3, #1
	mov	r5, r0
	cmp	r8, #0
	movne	r0, r3
	moveq	r0, #0
	ldr	r1, .L6+44
	bl	ok
	mov	r2, r4
	mov	r1, r5
	ldr	r3, [r6]
	mov	r0, r8
	bl	SignalObjectAndWait
	ldr	r3, [r7]
	ldr	r1, .L6+20
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r2, r4
	mov	r1, r5
	ldr	r3, [r6]
	mov	r0, r8
	bl	SignalObjectAndWait
	ldr	r3, [r10]
	ldr	r1, .L6+4
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r2, r4
	mov	r0, r8
	mov	r1, #1
	bl	ReleaseSemaphore
	ldr	r3, [r6]
	ldr	r1, .L6+4
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r2, r4
	mov	r0, r5
	mov	r1, #1
	bl	ReleaseSemaphore
	ldr	r3, .L6+48
	ldr	r1, .L6+20
	ldr	r3, [r3]
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r0, r8
	bl	CloseHandle
	mov	r0, r5
	bl	CloseHandle
	ldr	r3, .L6+52
	ldr	ip, .L6+56
	ldr	r0, .L6+60
	ldr	r1, .L6+64
	ldr	r2, .L6+68
	ldr	ip, [ip]
	ldr	r3, [r3]
	ldr	r0, [r0]
	ldr	r1, [r1]
	ldr	r2, [r2]
	orr	r3, r3, ip
	stmib	sp, {r3, r4}
	orr	r1, r0, r1
	mov	r3, r4
	str	r2, [sp]
	ldr	r0, .L6+72
	mov	r2, r4
	bl	CreateFileA
	mov	r2, r4
	ldr	r3, [r6]
	mov	r1, r0
	mov	r5, r0
	bl	SignalObjectAndWait
	ldr	r3, [r10]
	ldr	r1, .L6+4
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	bl	GetLastError
	ldr	r3, .L6+76
	ldr	r1, .L6+80
	ldr	r3, [r3]
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	ok
	mov	r0, r5
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	CloseHandle
.L7:
	.align	2
.L6:
	.word	WAIT_FAILED
	.word	.LC0
	.word	FALSE
	.word	.LC1
	.word	WAIT_OBJECT_0
	.word	.LC2
	.word	10000
	.word	WAIT_TIMEOUT
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	TRUE
	.word	FILE_ATTRIBUTE_NORMAL
	.word	FILE_FLAG_DELETE_ON_CLOSE
	.word	GENERIC_READ
	.word	GENERIC_WRITE
	.word	CREATE_ALWAYS
	.word	.LC7
	.word	ERROR_INVALID_HANDLE
	.word	.LC8
	.size	test_signalandwait, .-test_signalandwait
	.comm	WAIT_TIMEOUT,4,4
	.comm	WAIT_OBJECT_0,4,4
	.comm	WAIT_FAILED,4,4
	.comm	TRUE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_FLAG_DELETE_ON_CLOSE,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	FALSE,4,4
	.comm	ERROR_INVALID_HANDLE,4,4
	.comm	CREATE_ALWAYS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
