	.file	"extr_pthread_spin_lock.c_pthread_spin_lock.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pthread_spin_lock
	.type	pthread_spin_lock, @function
pthread_spin_lock:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L14
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rbp, QWORD PTR [rdi]
	mov	eax, DWORD PTR EINVAL[rip]
	test	rbp, rbp
	je	.L1
	cmp	rbp, QWORD PTR PTHREAD_SPINLOCK_INITIALIZER[rip]
	je	.L18
.L5:
	mov	rsi, QWORD PTR PTW32_SPIN_LOCKED[rip]
	mov	ebx, ebp
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdx, QWORD PTR PTW32_SPIN_UNLOCKED[rip]
	mov	edi, ebx
	call	PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG@PLT
	mov	rsi, QWORD PTR PTW32_SPIN_LOCKED[rip]
	cmp	rax, rsi
	je	.L6
	mov	rdx, QWORD PTR 0[rbp]
	cmp	rsi, rdx
	je	.L8
	cmp	rdx, QWORD PTR PTW32_SPIN_USE_MUTEX[rip]
	mov	eax, DWORD PTR EINVAL[rip]
	je	.L19
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	lea	rdi, 8[rbp]
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	pthread_mutex_lock@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	QWORD PTR 8[rsp], rdi
	call	ptw32_spinlock_check_need_init@PLT
	test	eax, eax
	jne	.L1
	mov	rdi, QWORD PTR 8[rsp]
	mov	rbp, QWORD PTR [rdi]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	mov	eax, DWORD PTR EINVAL[rip]
	ret
	.cfi_endproc
.LFE0:
	.size	pthread_spin_lock, .-pthread_spin_lock
	.comm	PTW32_SPIN_USE_MUTEX,8,8
	.comm	PTW32_SPIN_UNLOCKED,8,8
	.comm	PTW32_SPIN_LOCKED,8,8
	.comm	PTHREAD_SPINLOCK_INITIALIZER,8,8
	.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_spin_lock.c_pthread_spin_lock.c"
	.text
	.align	2
	.global	pthread_spin_lock
	.syntax unified
	.arm
	.fpu softvfp
	.type	pthread_spin_lock, %function
pthread_spin_lock:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r5, r0, #0
	beq	.L7
	ldr	r4, [r5]
	cmp	r4, #0
	beq	.L7
	ldr	r3, .L17
	ldr	r3, [r3]
	cmp	r4, r3
	beq	.L15
.L5:
	ldr	r5, .L17+4
	ldr	r6, .L17+8
	ldr	r1, [r5]
.L6:
	mov	r0, r4
	ldr	r2, [r6]
	bl	PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG
	ldr	r1, [r5]
	cmp	r0, r1
	beq	.L6
	ldr	r3, [r4]
	cmp	r1, r3
	beq	.L8
	ldr	r2, .L17+12
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L16
.L7:
	ldr	r3, .L17+16
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L8:
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L16:
	add	r0, r4, #4
	pop	{r4, r5, r6, lr}
	b	pthread_mutex_lock
.L15:
	bl	ptw32_spinlock_check_need_init
	cmp	r0, #0
	popne	{r4, r5, r6, pc}
	ldr	r4, [r5]
	b	.L5
.L18:
	.align	2
.L17:
	.word	PTHREAD_SPINLOCK_INITIALIZER
	.word	PTW32_SPIN_LOCKED
	.word	PTW32_SPIN_UNLOCKED
	.word	PTW32_SPIN_USE_MUTEX
	.word	EINVAL
	.size	pthread_spin_lock, .-pthread_spin_lock
	.comm	PTW32_SPIN_USE_MUTEX,4,4
	.comm	PTW32_SPIN_UNLOCKED,4,4
	.comm	PTW32_SPIN_LOCKED,4,4
	.comm	PTHREAD_SPINLOCK_INITIALIZER,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
