	.file	"extr_pthread_mutex_unlock.c_pthread_mutex_unlock.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pthread_mutex_unlock
	.type	pthread_mutex_unlock, @function
pthread_mutex_unlock:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, QWORD PTR [rdi]
	cmp	QWORD PTR PTHREAD_ERRORCHECK_MUTEX_INITIALIZER[rip], rbx
	jbe	.L2
	mov	r12d, DWORD PTR [rbx]
	test	r12d, r12d
	js	.L3
	cmp	DWORD PTR PTHREAD_MUTEX_NORMAL[rip], r12d
	je	.L31
	xor	eax, eax
	call	pthread_self@PLT
	mov	rdi, QWORD PTR 32[rbx]
	mov	esi, eax
	call	pthread_equal@PLT
	mov	r8, rax
	mov	eax, DWORD PTR EPERM[rip]
	test	r8, r8
	je	.L1
	cmp	DWORD PTR PTHREAD_MUTEX_RECURSIVE[rip], r12d
	jne	.L11
	sub	QWORD PTR 8[rbx], 1
	jne	.L7
.L11:
	mov	QWORD PTR 32[rbx], 0
.L31:
	xor	esi, esi
	lea	rdi, 20[rbx]
	call	PTW32_INTERLOCKED_EXCHANGE_LONG@PLT
	test	rax, rax
	js	.L34
.L7:
	xor	eax, eax
.L35:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	cmp	QWORD PTR PTHREAD_MUTEX_INITIALIZER[rip], rbx
	je	.L7
.L26:
	mov	eax, DWORD PTR EINVAL[rip]
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	xor	eax, eax
	mov	rbp, rdi
	call	pthread_self@PLT
	mov	rdi, QWORD PTR 32[rbx]
	mov	esi, eax
	call	pthread_equal@PLT
	mov	r8, rax
	mov	eax, DWORD PTR EPERM[rip]
	test	r8, r8
	je	.L1
	mov	edx, DWORD PTR PTW32_ROBUST_INCONSISTENT[rip]
	mov	esi, DWORD PTR PTW32_ROBUST_NOTRECOVERABLE[rip]
	not	r12d
	mov	edi, DWORD PTR 24[rbx]
	call	PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG@PLT
	cmp	DWORD PTR PTHREAD_MUTEX_NORMAL[rip], r12d
	je	.L16
	cmp	DWORD PTR PTHREAD_MUTEX_RECURSIVE[rip], r12d
	jne	.L16
	sub	QWORD PTR 8[rbx], 1
	jne	.L7
.L16:
	xor	esi, esi
	mov	rdi, rbp
	call	ptw32_robust_mutex_remove@PLT
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L34:
	mov	edi, DWORD PTR 16[rbx]
	call	SetEvent@PLT
	test	rax, rax
	je	.L26
	xor	eax, eax
	jmp	.L35
	.cfi_endproc
.LFE0:
	.size	pthread_mutex_unlock, .-pthread_mutex_unlock
	.comm	PTW32_ROBUST_NOTRECOVERABLE,8,8
	.comm	PTW32_ROBUST_INCONSISTENT,8,8
	.comm	PTHREAD_MUTEX_RECURSIVE,4,4
	.comm	PTHREAD_MUTEX_NORMAL,4,4
	.comm	PTHREAD_MUTEX_INITIALIZER,8,8
	.comm	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,8
	.comm	EPERM,4,4
	.comm	EINVAL,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_pthread_mutex_unlock.c_pthread_mutex_unlock.c"
	.text
	.align	2
	.global	pthread_mutex_unlock
	.syntax unified
	.arm
	.fpu softvfp
	.type	pthread_mutex_unlock, %function
pthread_mutex_unlock:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L31
	push	{r4, r5, r6, lr}
	ldr	r3, [r3]
	ldr	r5, [r0]
	cmp	r3, r5
	bls	.L2
	ldr	r6, [r5]
	cmp	r6, #0
	blt	.L3
	ldr	r3, .L31+4
	ldr	r3, [r3]
	cmp	r3, r6
	beq	.L28
	bl	pthread_self
	mov	r1, r0
	ldr	r0, [r5, #20]
	bl	pthread_equal
	cmp	r0, #0
	beq	.L12
	ldr	r3, .L31+8
	ldr	r3, [r3]
	cmp	r3, r6
	bne	.L11
	ldr	r3, [r5, #4]
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r5, #4]
	bne	.L7
.L11:
	mov	r1, #0
	add	r0, r5, #12
	str	r1, [r5, #20]
	bl	PTW32_INTERLOCKED_EXCHANGE_LONG
	cmp	r0, #0
	blt	.L15
.L7:
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r3, .L31+12
	ldr	r3, [r3]
	cmp	r3, r5
	beq	.L7
.L24:
	ldr	r3, .L31+16
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L3:
	mov	r4, r0
	bl	pthread_self
	mov	r1, r0
	ldr	r0, [r5, #20]
	bl	pthread_equal
	cmp	r0, #0
	bne	.L30
.L12:
	ldr	r3, .L31+20
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L30:
	mvn	r6, r6
	ldr	r3, .L31+24
	ldr	r2, .L31+28
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r0, [r5, #16]
	bl	PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG
	ldr	r3, .L31+4
	ldr	r3, [r3]
	cmp	r3, r6
	beq	.L16
	ldr	r3, .L31+8
	ldr	r3, [r3]
	cmp	r3, r6
	bne	.L16
	ldr	r3, [r5, #4]
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r5, #4]
	bne	.L7
.L16:
	mov	r0, r4
	mov	r1, #0
	bl	ptw32_robust_mutex_remove
.L28:
	mov	r1, #0
	add	r0, r5, #12
	bl	PTW32_INTERLOCKED_EXCHANGE_LONG
	cmp	r0, #0
	bge	.L7
.L15:
	ldr	r0, [r5, #8]
	bl	SetEvent
	cmp	r0, #0
	bne	.L7
	b	.L24
.L32:
	.align	2
.L31:
	.word	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.word	PTHREAD_MUTEX_NORMAL
	.word	PTHREAD_MUTEX_RECURSIVE
	.word	PTHREAD_MUTEX_INITIALIZER
	.word	EINVAL
	.word	EPERM
	.word	PTW32_ROBUST_NOTRECOVERABLE
	.word	PTW32_ROBUST_INCONSISTENT
	.size	pthread_mutex_unlock, .-pthread_mutex_unlock
	.comm	PTW32_ROBUST_NOTRECOVERABLE,4,4
	.comm	PTW32_ROBUST_INCONSISTENT,4,4
	.comm	PTHREAD_MUTEX_RECURSIVE,4,4
	.comm	PTHREAD_MUTEX_NORMAL,4,4
	.comm	PTHREAD_MUTEX_INITIALIZER,4,4
	.comm	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,4,4
	.comm	EPERM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
