	.file	"77417.c"
	.intel_syntax noprefix
	.text
	.type	now_usecs, @function
now_usecs:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -32[rbp]
	imul	rdx, rax, 1000000
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	now_usecs, .-now_usecs
	.type	lock_unlock, @function
lock_unlock:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -72[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -48[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	call	now_usecs
	mov	rdx, QWORD PTR -72[rbp]
	mov	QWORD PTR 8[rdx], rax
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -52[rbp], eax
	jmp	.L5
.L6:
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
.L5:
	mov	eax, DWORD PTR -52[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -52[rbp], edx
	test	eax, eax
	jne	.L6
	call	now_usecs
	mov	rdx, QWORD PTR -72[rbp]
	mov	QWORD PTR 16[rdx], rax
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	lock_unlock, .-lock_unlock
	.type	contention_thread, @function
contention_thread:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 48[rax]
	mov	DWORD PTR -32[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 292[rax]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 200
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 288[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 288[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 288[rax]
	cmp	eax, 4
	jne	.L9
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 240
	mov	rdi, rax
	call	pthread_cond_signal@PLT
.L9:
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 200
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	call	now_usecs
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 56[rdx], rax
	mov	DWORD PTR -28[rbp], 1
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -32[rbp]
	add	eax, 1
	movsx	rdx, eax
	imul	rdx, rdx, 1717986919
	shr	rdx, 32
	sar	edx
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	mov	DWORD PTR -20[rbp], edx
	mov	ecx, DWORD PTR -20[rbp]
	mov	edx, ecx
	sal	edx, 2
	add	edx, ecx
	sub	eax, edx
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -32[rbp], eax
	add	DWORD PTR -28[rbp], 1
.L10:
	mov	eax, DWORD PTR -28[rbp]
	cmp	eax, DWORD PTR -24[rbp]
	jl	.L11
	call	now_usecs
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 64[rdx], rax
	mov	eax, DWORD PTR -32[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	mov	rdx, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	contention_thread, .-contention_thread
	.type	contention, @function
contention:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 672
	mov	QWORD PTR -664[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -648[rbp], 0
	jmp	.L14
.L15:
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -648[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	add	DWORD PTR -648[rbp], 1
.L14:
	cmp	DWORD PTR -648[rbp], 4
	jle	.L15
	lea	rax, -304[rbp]
	add	rax, 200
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	lea	rax, -304[rbp]
	add	rax, 240
	mov	esi, 0
	mov	rdi, rax
	call	pthread_cond_init@PLT
	mov	DWORD PTR -16[rbp], 0
	mov	rax, QWORD PTR -664[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 3[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 2
	mov	DWORD PTR -12[rbp], eax
	mov	DWORD PTR -644[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -644[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	lea	rdx, -592[rax]
	lea	rax, -304[rbp]
	mov	QWORD PTR [rdx], rax
	mov	eax, DWORD PTR -644[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	lea	rdx, -544[rax]
	mov	eax, DWORD PTR -644[rbp]
	mov	DWORD PTR [rdx], eax
	lea	rcx, -592[rbp]
	mov	eax, DWORD PTR -644[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	add	rax, 8
	mov	esi, 0
	mov	rdi, rax
	call	pthread_mutex_init@PLT
	lea	rcx, -592[rbp]
	mov	eax, DWORD PTR -644[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	lea	rcx, -592[rbp]
	mov	eax, DWORD PTR -644[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	lea	rdx, [rcx+rax]
	lea	rcx, -624[rbp]
	mov	eax, DWORD PTR -644[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, contention_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -644[rbp], 1
.L16:
	cmp	DWORD PTR -644[rbp], 3
	jle	.L17
	lea	rax, -304[rbp]
	add	rax, 200
	mov	rdi, rax
	call	pthread_mutex_lock@PLT
	jmp	.L18
.L19:
	lea	rax, -304[rbp]
	lea	rdx, 200[rax]
	lea	rax, -304[rbp]
	add	rax, 240
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_cond_wait@PLT
.L18:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, 3
	jle	.L19
	lea	rax, -304[rbp]
	add	rax, 200
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -640[rbp], 0
	jmp	.L20
.L21:
	lea	rcx, -592[rbp]
	mov	eax, DWORD PTR -640[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_unlock@PLT
	add	DWORD PTR -640[rbp], 1
.L20:
	cmp	DWORD PTR -640[rbp], 3
	jle	.L21
	mov	DWORD PTR -636[rbp], 0
	jmp	.L22
.L23:
	mov	eax, DWORD PTR -636[rbp]
	cdqe
	mov	rax, QWORD PTR -624[rbp+rax*8]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	lea	rcx, -592[rbp]
	mov	eax, DWORD PTR -636[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	add	rax, 8
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	add	DWORD PTR -636[rbp], 1
.L22:
	cmp	DWORD PTR -636[rbp], 3
	jle	.L23
	mov	DWORD PTR -632[rbp], 0
	jmp	.L24
.L25:
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -632[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	sal	rax, 3
	add	rax, rcx
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	add	DWORD PTR -632[rbp], 1
.L24:
	cmp	DWORD PTR -632[rbp], 4
	jle	.L25
	lea	rax, -304[rbp]
	add	rax, 200
	mov	rdi, rax
	call	pthread_mutex_destroy@PLT
	lea	rax, -304[rbp]
	add	rax, 240
	mov	rdi, rax
	call	pthread_cond_destroy@PLT
	mov	rdx, QWORD PTR -536[rbp]
	mov	rax, QWORD PTR -664[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rdx, QWORD PTR -528[rbp]
	mov	rax, QWORD PTR -664[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	DWORD PTR -628[rbp], 1
	jmp	.L26
.L29:
	mov	eax, DWORD PTR -628[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 536
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -664[rbp]
	mov	rax, QWORD PTR 8[rax]
	cmp	rdx, rax
	jge	.L27
	mov	eax, DWORD PTR -628[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 536
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -664[rbp]
	mov	QWORD PTR 8[rax], rdx
.L27:
	mov	eax, DWORD PTR -628[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 528
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -664[rbp]
	mov	rax, QWORD PTR 16[rax]
	cmp	rdx, rax
	jle	.L28
	mov	eax, DWORD PTR -628[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 3
	add	rax, rdx
	sal	rax, 3
	add	rax, rbp
	sub	rax, 528
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -664[rbp]
	mov	QWORD PTR 16[rax], rdx
.L28:
	add	DWORD PTR -628[rbp], 1
.L26:
	cmp	DWORD PTR -628[rbp], 3
	jle	.L29
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	contention, .-contention
	.type	cmp_int64, @function
cmp_int64:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jge	.L32
	mov	eax, -1
	jmp	.L33
.L32:
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jle	.L34
	mov	eax, 1
	jmp	.L33
.L34:
	mov	eax, 0
.L33:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	cmp_int64, .-cmp_int64
	.section	.rodata
.LC0:
	.string	"Measuring %s: "
.LC1:
	.string	"best %d ns, 50%%ile %d ns\n"
	.text
	.type	measure, @function
measure:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 176
	mov	QWORD PTR -152[rbp], rdi
	mov	QWORD PTR -160[rbp], rsi
	mov	DWORD PTR -164[rbp], edx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -160[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	QWORD PTR -128[rbp], 0
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -112[rbp], 0
	mov	eax, DWORD PTR -164[rbp]
	mov	DWORD PTR -128[rbp], eax
	mov	DWORD PTR -132[rbp], 0
	jmp	.L36
.L37:
	lea	rax, -128[rbp]
	mov	rdx, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	rdx
	mov	rax, QWORD PTR -112[rbp]
	mov	rcx, QWORD PTR -120[rbp]
	sub	rax, rcx
	mov	rdx, rax
	mov	eax, DWORD PTR -132[rbp]
	cdqe
	mov	QWORD PTR -96[rbp+rax*8], rdx
	add	DWORD PTR -132[rbp], 1
.L36:
	cmp	DWORD PTR -132[rbp], 9
	jle	.L37
	lea	rax, -96[rbp]
	lea	rcx, cmp_int64[rip]
	mov	edx, 8
	mov	esi, 10
	mov	rdi, rax
	call	qsort@PLT
	mov	rax, QWORD PTR -56[rbp]
	imul	rax, rax, 1000
	mov	edx, DWORD PTR -164[rbp]
	movsx	rsi, edx
	cqo
	idiv	rsi
	mov	ecx, eax
	mov	rax, QWORD PTR -96[rbp]
	imul	rax, rax, 1000
	mov	edx, DWORD PTR -164[rbp]
	movsx	rsi, edx
	cqo
	idiv	rsi
	mov	edx, ecx
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	measure, .-measure
	.section	.rodata
	.align 8
.LC2:
	.string	"Locking and unlocking without contention"
	.text
	.globl	main
	.type	main, @function
main:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	edx, 100000
	lea	rsi, .LC2[rip]
	lea	rdi, contention[rip]
	call	measure
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"77417.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	now_usecs, %function
now_usecs:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #16
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	sub	r3, fp, #40
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r3, [fp, #-40]
	mov	r4, r3
	asr	r5, r4, #31
	mov	r2, r4
	mov	r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	mov	r2, r0
	mov	r3, r1
	subs	r2, r2, r4
	sbc	r3, r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #9
	orr	r1, r1, r2, lsr #23
	lsl	r0, r2, #9
	mov	r2, r0
	mov	r3, r1
	adds	r2, r2, r4
	adc	r3, r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #6
	orr	r1, r1, r2, lsr #26
	lsl	r0, r2, #6
	subs	r0, r0, r2
	sbc	r1, r1, r3
	adds	r6, r0, r4
	adc	r7, r1, r5
	ldr	r3, [fp, #-36]
	mov	r2, r3
	asr	r3, r2, #31
	adds	r8, r6, r2
	adc	r9, r7, r3
	mov	r2, r8
	mov	r3, r9
	ldr	r1, .L4
	ldr	r0, [r1]
	ldr	r1, [fp, #-32]
	eors	r0, r1, r0
	mov	r1, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.size	now_usecs, .-now_usecs
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lock_unlock, %function
lock_unlock:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #32
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	bl	now_usecs
	mov	r2, r0
	mov	r3, r1
	ldr	r1, [fp, #-40]
	str	r2, [r1, #8]
	str	r3, [r1, #12]
	ldr	r3, [fp, #-40]
	ldr	r3, [r3]
	str	r3, [fp, #-36]
	b	.L7
.L8:
	sub	r3, fp, #32
	mov	r0, r3
	bl	pthread_mutex_lock
	sub	r3, fp, #32
	mov	r0, r3
	bl	pthread_mutex_unlock
.L7:
	ldr	r3, [fp, #-36]
	sub	r2, r3, #1
	str	r2, [fp, #-36]
	cmp	r3, #0
	bne	.L8
	bl	now_usecs
	mov	r2, r0
	mov	r3, r1
	ldr	r1, [fp, #-40]
	str	r2, [r1, #16]
	str	r3, [r1, #20]
	sub	r3, fp, #32
	mov	r0, r3
	bl	pthread_mutex_destroy
	nop
	ldr	r3, .L10
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.size	lock_unlock, .-lock_unlock
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	contention_thread, %function
contention_thread:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #196]
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-16]
	add	r3, r3, #120
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #192]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3, #192]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #192]
	cmp	r3, #4
	bne	.L13
	ldr	r3, [fp, #-16]
	add	r3, r3, #144
	mov	r0, r3
	bl	pthread_cond_signal
.L13:
	ldr	r3, [fp, #-16]
	add	r3, r3, #120
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	bl	now_usecs
	mov	r2, r0
	mov	r3, r1
	ldr	r1, [fp, #-20]
	str	r2, [r1, #32]
	str	r3, [r1, #36]
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L14
.L15:
	ldr	r3, [fp, #-28]
	add	r2, r3, #1
	ldr	r3, .L17
	smull	r1, r3, r2, r3
	asr	r1, r3, #1
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	sub	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_lock
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L14:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	blt	.L15
	bl	now_usecs
	mov	r2, r0
	mov	r3, r1
	ldr	r1, [fp, #-20]
	str	r2, [r1, #40]
	str	r3, [r1, #44]
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	1717986919
	.size	contention_thread, .-contention_thread
	.section	.rodata
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	contention, %function
contention:
	@ args = 0, pretend = 0, frame = 448
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #448
	str	r0, [fp, #-448]
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-444]
	b	.L20
.L21:
	sub	r1, fp, #212
	ldr	r2, [fp, #-444]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	ldr	r3, [fp, #-444]
	add	r3, r3, #1
	str	r3, [fp, #-444]
.L20:
	ldr	r3, [fp, #-444]
	cmp	r3, #4
	ble	.L21
	sub	r3, fp, #212
	add	r3, r3, #120
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	sub	r3, fp, #212
	add	r3, r3, #144
	mov	r1, #0
	mov	r0, r3
	bl	pthread_cond_init
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-448]
	ldr	r3, [r3]
	add	r2, r3, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #2
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-440]
	b	.L22
.L23:
	ldr	r2, [fp, #-440]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r3, r3, #400
	sub	r2, fp, #212
	str	r2, [r3]
	ldr	r2, [fp, #-440]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r3, r3, #372
	ldr	r2, [fp, #-440]
	str	r2, [r3]
	sub	r1, fp, #404
	ldr	r2, [fp, #-440]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	add	r3, r1, r3
	add	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	pthread_mutex_init
	sub	r1, fp, #404
	ldr	r2, [fp, #-440]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	add	r3, r1, r3
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_lock
	sub	r2, fp, #420
	ldr	r3, [fp, #-440]
	lsl	r3, r3, #2
	add	r0, r2, r3
	sub	r1, fp, #404
	ldr	r2, [fp, #-440]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	add	r3, r1, r3
	ldr	r2, .L37+4
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
.L22:
	ldr	r3, [fp, #-440]
	cmp	r3, #3
	ble	.L23
	sub	r3, fp, #212
	add	r3, r3, #120
	mov	r0, r3
	bl	pthread_mutex_lock
	b	.L24
.L25:
	sub	r3, fp, #212
	add	r2, r3, #120
	sub	r3, fp, #212
	add	r3, r3, #144
	mov	r1, r2
	mov	r0, r3
	bl	pthread_cond_wait
.L24:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	ble	.L25
	sub	r3, fp, #212
	add	r3, r3, #120
	mov	r0, r3
	bl	pthread_mutex_unlock
	mov	r3, #0
	str	r3, [fp, #-436]
	b	.L26
.L27:
	sub	r1, fp, #404
	ldr	r2, [fp, #-436]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	add	r3, r1, r3
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_unlock
	ldr	r3, [fp, #-436]
	add	r3, r3, #1
	str	r3, [fp, #-436]
.L26:
	ldr	r3, [fp, #-436]
	cmp	r3, #3
	ble	.L27
	mov	r3, #0
	str	r3, [fp, #-432]
	b	.L28
.L29:
	ldr	r3, [fp, #-432]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-416]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	sub	r1, fp, #404
	ldr	r2, [fp, #-432]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	add	r3, r1, r3
	add	r3, r3, #4
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-432]
	add	r3, r3, #1
	str	r3, [fp, #-432]
.L28:
	ldr	r3, [fp, #-432]
	cmp	r3, #3
	ble	.L29
	mov	r3, #0
	str	r3, [fp, #-428]
	b	.L30
.L31:
	sub	r1, fp, #212
	ldr	r2, [fp, #-428]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	add	r3, r1, r3
	mov	r0, r3
	bl	pthread_mutex_destroy
	ldr	r3, [fp, #-428]
	add	r3, r3, #1
	str	r3, [fp, #-428]
.L30:
	ldr	r3, [fp, #-428]
	cmp	r3, #4
	ble	.L31
	sub	r3, fp, #212
	add	r3, r3, #120
	mov	r0, r3
	bl	pthread_mutex_destroy
	sub	r3, fp, #212
	add	r3, r3, #144
	mov	r0, r3
	bl	pthread_cond_destroy
	sub	r3, fp, #372
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-448]
	str	r2, [r1, #8]
	str	r3, [r1, #12]
	sub	r3, fp, #364
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-448]
	str	r2, [r1, #16]
	str	r3, [r1, #20]
	mov	r3, #1
	str	r3, [fp, #-424]
	b	.L32
.L35:
	ldr	r2, [fp, #-424]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r3, r3, #368
	ldmia	r3, {r0-r1}
	ldr	r3, [fp, #-448]
	add	r3, r3, #8
	ldmia	r3, {r2-r3}
	cmp	r0, r2
	sbcs	r3, r1, r3
	bge	.L33
	ldr	r2, [fp, #-424]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r3, r3, #368
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-448]
	str	r2, [r1, #8]
	str	r3, [r1, #12]
.L33:
	ldr	r2, [fp, #-424]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r3, r3, #360
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-448]
	add	r1, r1, #16
	ldmia	r1, {r0-r1}
	cmp	r0, r2
	sbcs	r3, r1, r3
	bge	.L34
	ldr	r2, [fp, #-424]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #4
	sub	r2, fp, #4
	add	r3, r2, r3
	sub	r3, r3, #360
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-448]
	str	r2, [r1, #16]
	str	r3, [r1, #20]
.L34:
	ldr	r3, [fp, #-424]
	add	r3, r3, #1
	str	r3, [fp, #-424]
.L32:
	ldr	r3, [fp, #-424]
	cmp	r3, #3
	ble	.L35
	nop
	ldr	r3, .L37
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L36
	bl	__stack_chk_fail
.L36:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC2
	.word	contention_thread
	.size	contention, .-contention
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cmp_int64, %function
cmp_int64:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	ldmia	r3, {r2-r3}
	str	r2, [fp, #-12]
	str	r3, [fp, #-8]
	sub	r1, fp, #20
	ldmia	r1, {r0-r1}
	sub	r3, fp, #12
	ldmia	r3, {r2-r3}
	cmp	r0, r2
	sbcs	r3, r1, r3
	bge	.L40
	mvn	r3, #0
	b	.L41
.L40:
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	sub	r1, fp, #12
	ldmia	r1, {r0-r1}
	cmp	r0, r2
	sbcs	r3, r1, r3
	bge	.L42
	mov	r3, #1
	b	.L41
.L42:
	mov	r3, #0
.L41:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	cmp_int64, .-cmp_int64
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Measuring %s: \000"
	.global	__aeabi_ldivmod
	.align	2
.LC4:
	.ascii	"best %d ns, 50%%ile %d ns\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	measure, %function
measure:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #140
	str	r0, [fp, #-144]
	str	r1, [fp, #-148]
	str	r2, [fp, #-152]
	ldr	r3, .L47
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	ldr	r1, [fp, #-148]
	ldr	r0, .L47+4
	bl	printf
	ldr	r3, .L47+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	sub	r3, fp, #132
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	str	r2, [r3, #12]
	str	r2, [r3, #16]
	str	r2, [r3, #20]
	ldr	r3, [fp, #-152]
	str	r3, [fp, #-132]
	mov	r3, #0
	str	r3, [fp, #-136]
	b	.L44
.L45:
	sub	r2, fp, #132
	ldr	r3, [fp, #-144]
	mov	r0, r2
	blx	r3
	sub	r1, fp, #116
	ldmia	r1, {r0-r1}
	sub	r3, fp, #124
	ldmia	r3, {r2-r3}
	subs	r4, r0, r2
	sbc	r5, r1, r3
	ldr	r3, [fp, #-136]
	lsl	r3, r3, #3
	sub	r2, fp, #20
	add	r3, r2, r3
	sub	r3, r3, #88
	stm	r3, {r4-r5}
	ldr	r3, [fp, #-136]
	add	r3, r3, #1
	str	r3, [fp, #-136]
.L44:
	ldr	r3, [fp, #-136]
	cmp	r3, #9
	ble	.L45
	sub	r0, fp, #108
	ldr	r3, .L47+12
	mov	r2, #8
	mov	r1, #10
	bl	qsort
	sub	r1, fp, #108
	ldmia	r1, {r0-r1}
	mov	r2, r0
	mov	r3, r1
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r3, #5
	orr	r5, r5, r2, lsr #27
	lsl	r4, r2, #5
	mov	r2, r4
	mov	r3, r5
	subs	r2, r2, r0
	sbc	r3, r3, r1
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r3, #2
	orr	r5, r5, r2, lsr #30
	lsl	r4, r2, #2
	mov	r2, r4
	mov	r3, r5
	adds	r2, r2, r0
	adc	r3, r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #3
	orr	r1, r1, r2, lsr #29
	lsl	r0, r2, #3
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-152]
	mov	r2, r3
	asr	r3, r2, #31
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r6, r2
	sub	r1, fp, #68
	ldmia	r1, {r0-r1}
	mov	r2, r0
	mov	r3, r1
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r3, #5
	orr	r5, r5, r2, lsr #27
	lsl	r4, r2, #5
	mov	r2, r4
	mov	r3, r5
	subs	r2, r2, r0
	sbc	r3, r3, r1
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r3, #2
	orr	r5, r5, r2, lsr #30
	lsl	r4, r2, #2
	mov	r2, r4
	mov	r3, r5
	adds	r2, r2, r0
	adc	r3, r3, r1
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #3
	orr	r1, r1, r2, lsr #29
	lsl	r0, r2, #3
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	ldr	r3, [fp, #-152]
	mov	r2, r3
	asr	r3, r2, #31
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r3, r2
	mov	r2, r3
	mov	r1, r6
	ldr	r0, .L47+16
	bl	printf
	nop
	ldr	r3, .L47
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L46
	bl	__stack_chk_fail
.L46:
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L48:
	.align	2
.L47:
	.word	.LC5
	.word	.LC3
	.word	stdout
	.word	cmp_int64
	.word	.LC4
	.size	measure, .-measure
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Locking and unlocking without contention\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r2, .L51
	ldr	r1, .L51+4
	ldr	r0, .L51+8
	bl	measure
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L52:
	.align	2
.L51:
	.word	100000
	.word	.LC6
	.word	contention
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
