	.file	"extr_pthread_detach.c_pthread_detach.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pthread_detach
	.type	pthread_detach, @function
pthread_detach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	lea	rdi, ptw32_thread_reuse_lock[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rbx, QWORD PTR PTW32_FALSE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	r13, rsp
	mov	rsi, r13
	call	ptw32_mcs_lock_acquire@PLT
	test	rbp, rbp
	je	.L2
	cmp	QWORD PTR 24[rbp], r14
	je	.L3
.L2:
	mov	r12d, DWORD PTR ESRCH[rip]
.L4:
	mov	rdi, r13
	call	ptw32_mcs_lock_release@PLT
	test	r12d, r12d
	je	.L8
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	rax, QWORD PTR PTHREAD_CREATE_DETACHED[rip]
	mov	r12d, DWORD PTR EINVAL[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L4
	lea	r12, 4[rsp]
	lea	rdi, 20[rbp]
	mov	rsi, r12
	call	ptw32_mcs_lock_acquire@PLT
	mov	rax, QWORD PTR PThreadStateLast[rip]
	cmp	QWORD PTR 8[rbp], rax
	mov	rax, QWORD PTR PTHREAD_CREATE_DETACHED[rip]
	je	.L6
	mov	QWORD PTR 0[rbp], rax
.L7:
	mov	rdi, r12
	call	ptw32_mcs_lock_release@PLT
	mov	rdi, r13
	call	ptw32_mcs_lock_release@PLT
	.p2align 4,,10
	.p2align 3
.L8:
	xor	r12d, r12d
	test	rbx, rbx
	je	.L1
	mov	edi, DWORD PTR 16[rbp]
	mov	esi, DWORD PTR INFINITE[rip]
	call	WaitForSingleObject@PLT
	mov	rdi, r14
	mov	rsi, rbp
	call	ptw32_threadDestroy@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	cmp	QWORD PTR 0[rbp], rax
	je	.L7
	mov	rbx, QWORD PTR PTW32_TRUE[rip]
	jmp	.L7
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pthread_detach, .-pthread_detach
	.comm	ptw32_thread_reuse_lock,4,4
	.comm	PThreadStateLast,8,8
	.comm	PTW32_TRUE,8,8
	.comm	PTW32_FALSE,8,8
	.comm	PTHREAD_CREATE_DETACHED,8,8
	.comm	INFINITE,4,4
	.comm	ESRCH,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_detach.c_pthread_detach.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pthread_detach
	.syntax unified
	.arm
	.fpu softvfp
	.type	pthread_detach, %function
pthread_detach:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	sub	sp, sp, #28
	mov	r5, sp
	mov	r6, r1
	stm	r5, {r0, r1}
	ldr	r3, .L18
	ldr	r2, .L18+4
	ldr	r0, .L18+8
	add	r1, sp, #12
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	ldr	r7, [r3]
	bl	ptw32_mcs_lock_acquire
	cmp	r6, #0
	beq	.L2
	ldr	r2, [sp]
	ldr	r3, [r6, #16]
	cmp	r2, r3
	beq	.L3
.L2:
	ldr	r3, .L18+12
	ldr	r4, [r3]
.L4:
	add	r0, sp, #12
	bl	ptw32_mcs_lock_release
	cmp	r4, #0
	beq	.L8
.L1:
	ldr	r3, .L18+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L17
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L5:
	add	r1, sp, #16
	add	r0, r6, #12
	bl	ptw32_mcs_lock_acquire
	ldr	r3, .L18+16
	ldr	r2, [r6, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	ldr	r3, [r4]
	strne	r3, [r6]
	bne	.L7
	ldr	r2, [r6]
	cmp	r2, r3
	ldrne	r3, .L18+20
	ldrne	r7, [r3]
.L7:
	add	r0, sp, #16
	bl	ptw32_mcs_lock_release
	add	r0, sp, #12
	bl	ptw32_mcs_lock_release
.L8:
	cmp	r7, #0
	moveq	r4, r7
	beq	.L1
	ldr	r3, .L18+24
	ldr	r0, [r6, #8]
	ldr	r1, [r3]
	bl	WaitForSingleObject
	ldm	r5, {r0, r1}
	bl	ptw32_threadDestroy
	mov	r4, #0
	b	.L1
.L3:
	ldr	r4, .L18+28
	ldr	r2, [r6]
	ldr	r3, [r4]
	cmp	r2, r3
	bne	.L5
	ldr	r3, .L18+32
	ldr	r4, [r3]
	b	.L4
.L17:
	bl	__stack_chk_fail
.L19:
	.align	2
.L18:
	.word	PTW32_FALSE
	.word	.LC0
	.word	ptw32_thread_reuse_lock
	.word	ESRCH
	.word	PThreadStateLast
	.word	PTW32_TRUE
	.word	INFINITE
	.word	PTHREAD_CREATE_DETACHED
	.word	EINVAL
	.size	pthread_detach, .-pthread_detach
	.comm	ptw32_thread_reuse_lock,4,4
	.comm	PThreadStateLast,4,4
	.comm	PTW32_TRUE,4,4
	.comm	PTW32_FALSE,4,4
	.comm	PTHREAD_CREATE_DETACHED,4,4
	.comm	INFINITE,4,4
	.comm	ESRCH,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
