	.file	"extr_pthread_mutex_destroy.c_pthread_mutex_destroy.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pthread_mutex_destroy
	.type	pthread_mutex_destroy, @function
pthread_mutex_destroy:
.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, rdi
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR [rdi]
	cmp	rax, QWORD PTR PTHREAD_ERRORCHECK_MUTEX_INITIALIZER[rip]
	jnb	.L2
	mov	rbp, rsp
	mov	QWORD PTR [rsp], rax
	mov	rdi, rbp
	call	pthread_mutex_trylock@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L31
	mov	rax, QWORD PTR [rsp]
	mov	rcx, QWORD PTR PTHREAD_MUTEX_RECURSIVE[rip]
	cmp	QWORD PTR [rax], rcx
	jne	.L12
	mov	edx, DWORD PTR 8[rax]
	cmp	edx, 1
	je	.L12
.L17:
	sub	edx, 1
	mov	r12d, DWORD PTR EBUSY[rip]
	mov	DWORD PTR 8[rax], edx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rbp, rsp
	lea	rdi, ptw32_mutex_test_init_lock[rip]
	mov	rsi, rbp
	call	ptw32_mcs_lock_acquire@PLT
	mov	r12d, DWORD PTR EBUSY[rip]
	mov	rax, QWORD PTR PTHREAD_ERRORCHECK_MUTEX_INITIALIZER[rip]
	cmp	QWORD PTR [rbx], rax
	jnb	.L32
.L9:
	mov	rdi, rbp
	call	ptw32_mcs_lock_release@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L33
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbx
	.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
.L32:
	.cfi_restore_state
	mov	QWORD PTR [rbx], 0
	xor	r12d, r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L31:
	cmp	DWORD PTR ENOTRECOVERABLE[rip], eax
	jne	.L1
	mov	rax, QWORD PTR [rsp]
	mov	rdx, QWORD PTR PTHREAD_MUTEX_RECURSIVE[rip]
	cmp	QWORD PTR [rax], rdx
	je	.L34
.L18:
	mov	QWORD PTR [rbx], 0
.L14:
	mov	rdi, QWORD PTR 16[rax]
	test	rdi, rdi
	je	.L6
	call	free@PLT
	mov	rax, QWORD PTR [rsp]
.L6:
	mov	edi, DWORD PTR 12[rax]
	call	CloseHandle@PLT
	test	eax, eax
	jne	.L7
	mov	rax, QWORD PTR [rsp]
	mov	r12d, DWORD PTR EINVAL[rip]
	mov	QWORD PTR [rbx], rax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	mov	QWORD PTR [rbx], 0
	mov	rdi, rbp
	call	pthread_mutex_unlock@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L35
	mov	rax, QWORD PTR [rsp]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, QWORD PTR [rsp]
	xor	r12d, r12d
	call	free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rax, QWORD PTR [rsp]
	mov	QWORD PTR [rbx], rax
	jmp	.L1
.L33:
	call	__stack_chk_fail@PLT
.L34:
	mov	edx, DWORD PTR 8[rax]
	cmp	edx, 1
	jne	.L17
	jmp	.L18
	.cfi_endproc
.LFE0:
	.size	pthread_mutex_destroy, .-pthread_mutex_destroy
	.comm	ptw32_mutex_test_init_lock,4,4
	.comm	PTHREAD_MUTEX_RECURSIVE,8,8
	.comm	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,8,8
	.comm	ENOTRECOVERABLE,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,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_destroy.c_pthread_mutex_destroy.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pthread_mutex_destroy
	.syntax unified
	.arm
	.fpu softvfp
	.type	pthread_mutex_destroy, %function
pthread_mutex_destroy:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r4, .L35
	ldr	r3, [r0]
	ldr	r2, [r4]
	ldr	r1, .L35+4
	sub	sp, sp, #8
	cmp	r3, r2
	mov	r5, r0
	ldr	r1, [r1]
	str	r1, [sp, #4]
	mov	r1,#0
	mov	r6, sp
	bcs	.L2
	mov	r0, r6
	str	r3, [sp]
	bl	pthread_mutex_trylock
	subs	r4, r0, #0
	bne	.L31
	ldr	r3, [sp]
	ldr	r2, .L35+8
	ldr	r1, [r3]
	ldr	r2, [r2]
	cmp	r1, r2
	bne	.L12
	ldr	r2, [r3, #4]
	cmp	r2, #1
	beq	.L12
.L17:
	ldr	r1, .L35+12
	sub	r2, r2, #1
	ldr	r4, [r1]
	str	r2, [r3, #4]
	b	.L1
.L2:
	mov	r1, r6
	ldr	r0, .L35+16
	bl	ptw32_mcs_lock_acquire
	ldr	r3, [r4]
	ldr	r2, [r5]
	mov	r0, r6
	cmp	r2, r3
	movcs	r4, #0
	ldrcc	r3, .L35+12
	strcs	r4, [r5]
	ldrcc	r4, [r3]
	bl	ptw32_mcs_lock_release
.L1:
	ldr	r3, .L35+4
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L32
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L31:
	ldr	r3, .L35+20
	ldr	r3, [r3]
	cmp	r3, r4
	bne	.L1
	ldr	r3, [sp]
	ldr	r2, .L35+8
	ldr	r1, [r3]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L33
.L18:
	mov	r2, #0
	str	r2, [r5]
.L14:
	ldr	r0, [r3, #12]
	cmp	r0, #0
	beq	.L6
	bl	free
	ldr	r3, [sp]
.L6:
	ldr	r0, [r3, #8]
	bl	CloseHandle
	cmp	r0, #0
	bne	.L7
	ldr	r2, [sp]
	ldr	r3, .L35+24
	str	r2, [r5]
	ldr	r4, [r3]
	b	.L1
.L12:
	mov	r3, #0
	mov	r0, r6
	str	r3, [r5]
	bl	pthread_mutex_unlock
	subs	r4, r0, #0
	bne	.L34
	ldr	r3, [sp]
	b	.L14
.L7:
	ldr	r0, [sp]
	bl	free
	mov	r4, #0
	b	.L1
.L34:
	ldr	r3, [sp]
	str	r3, [r5]
	b	.L1
.L32:
	bl	__stack_chk_fail
.L33:
	ldr	r2, [r3, #4]
	cmp	r2, #1
	bne	.L17
	b	.L18
.L36:
	.align	2
.L35:
	.word	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER
	.word	.LC0
	.word	PTHREAD_MUTEX_RECURSIVE
	.word	EBUSY
	.word	ptw32_mutex_test_init_lock
	.word	ENOTRECOVERABLE
	.word	EINVAL
	.size	pthread_mutex_destroy, .-pthread_mutex_destroy
	.comm	ptw32_mutex_test_init_lock,4,4
	.comm	PTHREAD_MUTEX_RECURSIVE,4,4
	.comm	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER,4,4
	.comm	ENOTRECOVERABLE,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
