	.file	"extr_uipc_sem.c_kern_sem_wait.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	kern_sem_wait, @function
kern_sem_wait:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, edx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rcx
	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
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	DWORD PTR [rsp], edx
	mov	QWORD PTR 8[rsp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [rdi]
	movsx	rdi, DWORD PTR [rax]
	call	DP@PLT
	mov	edi, ebp
	call	AUDIT_ARG_FD@PLT
	mov	esi, DWORD PTR CAP_SEM_WAIT[rip]
	lea	rdi, 36[rsp]
	call	cap_rights_init@PLT
	lea	rcx, 48[rsp]
	mov	esi, ebp
	mov	rdi, rbx
	mov	edx, eax
	call	ksem_get@PLT
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	je	.L18
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	mov	eax, DWORD PTR 4[rsp]
	add	rsp, 72
	.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
.L18:
	.cfi_restore_state
	mov	rax, QWORD PTR 48[rsp]
	lea	rdi, sem_lock[rip]
	mov	r13, QWORD PTR 8[rax]
	call	mtx_lock@PLT
	mov	rax, QWORD PTR [rbx]
	movsx	rdi, DWORD PTR [rax]
	call	DP@PLT
	movsx	rdi, r15d
	lea	r15, 12[r13]
	call	DP@PLT
	lea	rdi, 16[r13]
	call	vfs_timestamp@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	mov	eax, DWORD PTR EAGAIN[rip]
.L5:
	mov	DWORD PTR 8[r13], edx
	test	eax, eax
	jne	.L20
.L3:
	mov	rdi, QWORD PTR 0[r13]
	test	rdi, rdi
	jne	.L21
	mov	edx, DWORD PTR 8[r13]
	lea	eax, 1[rdx]
	mov	DWORD PTR 8[r13], eax
	mov	eax, DWORD PTR [rsp]
	test	eax, eax
	jne	.L22
	test	r14, r14
	je	.L15
	lea	rbp, 32[rsp]
	lea	rbx, 28[rsp]
	lea	r12, 40[rsp]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, r12
	call	tvtohz@PLT
	lea	rsi, sem_lock[rip]
	mov	rdi, r15
	mov	edx, eax
	call	cv_timedwait_sig@PLT
	cmp	DWORD PTR EWOULDBLOCK[rip], eax
	jne	.L23
.L6:
	mov	eax, DWORD PTR [r14]
	mov	rdi, rbp
	mov	DWORD PTR 28[rsp], eax
	call	getnanotime@PLT
	mov	rdx, rbx
	mov	rsi, rbp
	mov	rdi, rbx
	call	timespecsub@PLT
	mov	rsi, rbx
	mov	rdi, r12
	call	TIMESPEC_TO_TIMEVAL@PLT
	cmp	QWORD PTR 40[rsp], 0
	jns	.L7
	mov	ecx, DWORD PTR 8[r13]
	mov	eax, DWORD PTR ETIMEDOUT[rip]
	lea	edx, -1[rcx]
	mov	DWORD PTR 8[r13], edx
	test	eax, eax
	je	.L3
	.p2align 4,,10
	.p2align 3
.L20:
	mov	DWORD PTR 4[rsp], eax
	movsx	rbp, eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L15:
	lea	rsi, sem_lock[rip]
	mov	rdi, r15
	call	cv_wait_sig@PLT
	mov	ecx, DWORD PTR 8[r13]
	lea	edx, -1[rcx]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L23:
	mov	ecx, DWORD PTR 8[r13]
	lea	edx, -1[rcx]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	sub	rdi, 1
	xor	ebp, ebp
	mov	QWORD PTR 0[r13], rdi
	call	DP@PLT
.L8:
	lea	rdi, sem_lock[rip]
	call	mtx_unlock@PLT
	mov	rdi, QWORD PTR 48[rsp]
	mov	rsi, QWORD PTR 8[rsp]
	call	fdrop@PLT
	mov	rdi, rbp
	call	DP@PLT
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	kern_sem_wait, .-kern_sem_wait
	.comm	sem_lock,4,4
	.comm	EWOULDBLOCK,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EAGAIN,4,4
	.comm	CAP_SEM_WAIT,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_uipc_sem.c_kern_sem_wait.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	kern_sem_wait, %function
kern_sem_wait:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	mov	r10, r0
	ldr	r0, [r0]
	mov	r5, r3
	ldr	r3, .L25
	sub	sp, sp, #28
	ldr	r0, [r0]
	mov	r9, r2
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	DP
	mov	r0, r4
	bl	AUDIT_ARG_FD
	ldr	r3, .L25+4
	add	r0, sp, #12
	ldr	r1, [r3]
	bl	cap_rights_init
	mov	r1, r4
	mov	r2, r0
	add	r3, sp, #16
	mov	r0, r10
	bl	ksem_get
	subs	fp, r0, #0
	beq	.L18
.L1:
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L19
	mov	r0, fp
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	ldr	r3, [sp, #16]
	ldr	r0, .L25+8
	ldr	r4, [r3, #4]
	bl	mtx_lock
	ldr	r3, [r10]
	ldr	r6, .L25+8
	ldr	r0, [r3]
	bl	DP
	mov	r0, r9
	bl	DP
	add	r0, r4, #12
	bl	vfs_timestamp
	ldr	r8, .L25+12
	add	r7, r4, #8
	b	.L3
.L22:
	ldr	r2, .L25+16
	ldr	r0, [r2]
.L5:
	cmp	r0, #0
	str	r3, [r4, #4]
	bne	.L20
.L3:
	ldr	r0, [r4]
	cmp	r0, #0
	bne	.L21
	ldr	r3, [r4, #4]
	cmp	r9, #0
	add	r2, r3, #1
	str	r2, [r4, #4]
	bne	.L22
	cmp	r5, #0
	bne	.L6
	b	.L23
.L7:
	add	r0, sp, #8
	bl	tvtohz
	mov	r1, r6
	mov	r2, r0
	mov	r0, r7
	bl	cv_timedwait_sig
	ldr	r3, [r8]
	cmp	r3, r0
	bne	.L24
.L6:
	ldr	r3, [r5]
	add	r0, sp, #4
	str	r3, [sp]
	bl	getnanotime
	mov	r2, sp
	add	r1, sp, #4
	mov	r0, sp
	bl	timespecsub
	mov	r1, sp
	add	r0, sp, #8
	bl	TIMESPEC_TO_TIMEVAL
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bge	.L7
	ldr	r2, .L25+20
	ldr	r3, [r4, #4]
	ldr	r0, [r2]
	sub	r3, r3, #1
	cmp	r0, #0
	str	r3, [r4, #4]
	beq	.L3
.L20:
	mov	fp, r0
	mov	r4, r0
	b	.L8
.L23:
	mov	r1, r6
	mov	r0, r7
	bl	cv_wait_sig
	ldr	r3, [r4, #4]
	sub	r3, r3, #1
	b	.L5
.L24:
	ldr	r3, [r4, #4]
	sub	r3, r3, #1
	b	.L5
.L21:
	sub	r0, r0, #1
	str	r0, [r4]
	bl	DP
	mov	r4, #0
.L8:
	ldr	r0, .L25+8
	bl	mtx_unlock
	mov	r1, r10
	ldr	r0, [sp, #16]
	bl	fdrop
	mov	r0, r4
	bl	DP
	b	.L1
.L19:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	CAP_SEM_WAIT
	.word	sem_lock
	.word	EWOULDBLOCK
	.word	EAGAIN
	.word	ETIMEDOUT
	.size	kern_sem_wait, .-kern_sem_wait
	.comm	sem_lock,4,4
	.comm	EWOULDBLOCK,4,4
	.comm	ETIMEDOUT,4,4
	.comm	EAGAIN,4,4
	.comm	CAP_SEM_WAIT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
