	.file	"extr_sem_timedwait.c_sem_timedwait.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	sem_timedwait
	.type	sem_timedwait, @function
sem_timedwait:
.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
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 56
	.cfi_def_cfa_offset 96
	mov	r12, QWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 12[rsp], 0
	call	pthread_testcancel@PLT
	mov	r13d, DWORD PTR INFINITE[rip]
	test	rbp, rbp
	je	.L3
	mov	rdi, rbp
	call	ptw32_relmillisecs@PLT
	mov	r13d, eax
.L3:
	lea	rbp, 16[r12]
	mov	rdi, rbp
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR 12[rsp], eax
	test	eax, eax
	je	.L14
.L4:
	mov	DWORD PTR errno[rip], eax
	mov	eax, -1
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rdx, QWORD PTR 40[rsp]
	xor	rdx, QWORD PTR fs:40
	jne	.L15
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L14:
	.cfi_restore_state
	cmp	QWORD PTR [rbx], 0
	je	.L16
	mov	eax, DWORD PTR [r12]
	mov	rdi, rbp
	lea	ebx, -1[rax]
	mov	DWORD PTR [r12], ebx
	call	pthread_mutex_unlock@PLT
	test	ebx, ebx
	js	.L17
.L7:
	mov	eax, DWORD PTR 12[rsp]
	test	eax, eax
	je	.L1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, DWORD PTR ptw32_sem_timedwait_cleanup[rip]
	lea	rax, 12[rsp]
	lea	rsi, 16[rsp]
	mov	QWORD PTR 24[rsp], r12
	mov	QWORD PTR 16[rsp], rax
	call	pthread_cleanup_push@PLT
	mov	edi, DWORD PTR 20[r12]
	mov	esi, r13d
	call	pthreadCancelableTimedWait@PLT
	mov	edi, eax
	mov	DWORD PTR 12[rsp], eax
	call	pthread_cleanup_pop@PLT
	jmp	.L7
.L16:
	mov	rdi, rbp
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR EINVAL[rip]
	mov	DWORD PTR errno[rip], eax
	mov	eax, -1
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sem_timedwait, .-sem_timedwait
	.comm	ptw32_sem_timedwait_cleanup,4,4
	.comm	errno,4,4
	.comm	INFINITE,4,4
	.comm	EINVAL,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_sem_timedwait.c_sem_timedwait.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	sem_timedwait
	.syntax unified
	.arm
	.fpu softvfp
	.type	sem_timedwait, %function
sem_timedwait:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r3, #0
	mov	r4, r1
	ldr	r2, .L19
	sub	sp, sp, #20
	ldr	r2, [r2]
	str	r2, [sp, #12]
	mov	r2,#0
	mov	r5, r0
	ldr	r6, [r0]
	str	r3, [sp]
	bl	pthread_testcancel
	cmp	r4, #0
	beq	.L14
	mov	r0, r4
	bl	ptw32_relmillisecs
	mov	r7, r0
.L3:
	add	r4, r6, #8
	mov	r0, r4
	bl	pthread_mutex_lock
	cmp	r0, #0
	str	r0, [sp]
	beq	.L15
.L4:
	ldr	r3, .L19+4
	str	r0, [r3]
	mvn	r0, #0
.L1:
	ldr	r3, .L19
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L15:
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L17
	ldr	r3, [r6]
	mov	r0, r4
	sub	r4, r3, #1
	str	r4, [r6]
	bl	pthread_mutex_unlock
	cmp	r4, #0
	blt	.L18
.L7:
	ldr	r0, [sp]
	cmp	r0, #0
	beq	.L1
	b	.L4
.L14:
	ldr	r3, .L19+8
	ldr	r7, [r3]
	b	.L3
.L18:
	ldr	r3, .L19+12
	add	r1, sp, #4
	ldr	r0, [r3]
	str	r6, [sp, #8]
	str	sp, [sp, #4]
	bl	pthread_cleanup_push
	mov	r1, r7
	ldr	r0, [r6, #12]
	bl	pthreadCancelableTimedWait
	str	r0, [sp]
	bl	pthread_cleanup_pop
	b	.L7
.L17:
	mov	r0, r4
	bl	pthread_mutex_unlock
	ldr	r2, .L19+16
	ldr	r3, .L19+4
	ldr	r2, [r2]
	mvn	r0, #0
	str	r2, [r3]
	b	.L1
.L16:
	bl	__stack_chk_fail
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	errno
	.word	INFINITE
	.word	ptw32_sem_timedwait_cleanup
	.word	EINVAL
	.size	sem_timedwait, .-sem_timedwait
	.comm	ptw32_sem_timedwait_cleanup,4,4
	.comm	errno,4,4
	.comm	INFINITE,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
