	.file	"287700.c"
	.intel_syntax noprefix
	.text
	.globl	mutex
	.bss
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.globl	counter
	.align 8
	.type	counter, @object
	.size	counter, 8
counter:
	.zero	8
	.globl	end_time
	.align 8
	.type	end_time, @object
	.size	end_time, 8
end_time:
	.zero	8
	.section	.rodata
.LC0:
	.string	"the_stack_data/287700.c"
.LC1:
	.string	"Lock mutex"
.LC2:
	.string	"%s at \"%s\":%d: %s\n"
.LC3:
	.string	"Unlock mutex"
	.text
	.globl	counter_thread
	.type	counter_thread, @function
counter_thread:
.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	QWORD PTR -24[rbp], rdi
	jmp	.L2
.L7:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L3
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 29
	lea	rcx, .LC0[rip]
	lea	rdx, .LC1[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L3:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L4
.L5:
	mov	rax, QWORD PTR counter[rip]
	add	rax, 1
	mov	QWORD PTR counter[rip], rax
	add	DWORD PTR -8[rbp], 1
.L4:
	cmp	DWORD PTR -8[rbp], 9999999
	jle	.L5
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L6
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 34
	lea	rcx, .LC0[rip]
	lea	rdx, .LC3[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L6:
	mov	edi, 1
	mov	eax, 0
	call	sleep@PLT
.L2:
	mov	edi, 0
	call	time@PLT
	mov	rdx, QWORD PTR end_time[rip]
	cmp	rax, rdx
	jl	.L7
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	counter_thread, .-counter_thread
	.section	.rodata
.LC4:
	.string	"Trylock mutex"
.LC5:
	.string	"Counter is %ld\n"
	.align 8
.LC6:
	.string	"Monitor thread missed update %d times.\n"
	.text
	.globl	monitor_thread
	.type	monitor_thread, @function
monitor_thread:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -8[rbp], 0
	jmp	.L10
.L13:
	mov	edi, 3
	mov	eax, 0
	call	sleep@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_trylock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 16
	je	.L11
	cmp	DWORD PTR -4[rbp], 0
	je	.L12
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 50
	lea	rcx, .LC0[rip]
	lea	rdx, .LC4[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L12:
	mov	rcx, QWORD PTR counter[rip]
	movabs	rdx, -2972493582642298179
	mov	rax, rcx
	imul	rdx
	lea	rax, [rdx+rcx]
	sar	rax, 23
	sar	rcx, 63
	mov	rdx, rcx
	sub	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L10
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 54
	lea	rcx, .LC0[rip]
	lea	rdx, .LC3[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L11:
	mov	rax, QWORD PTR counter[rip]
	add	rax, 1
	mov	QWORD PTR counter[rip], rax
.L10:
	mov	edi, 0
	call	time@PLT
	mov	rdx, QWORD PTR end_time[rip]
	cmp	rax, rdx
	jl	.L13
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	monitor_thread, .-monitor_thread
	.section	.rodata
.LC7:
	.string	"Create counter thread"
.LC8:
	.string	"Create monitor thread"
.LC9:
	.string	"Join counter thread"
.LC10:
	.string	"Join monitor thread"
	.text
	.globl	main
	.type	main, @function
main:
.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	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	add	rax, 60
	mov	QWORD PTR end_time[rip], rax
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, counter_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L16
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 70
	lea	rcx, .LC0[rip]
	lea	rdx, .LC7[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L16:
	lea	rax, -16[rbp]
	mov	ecx, 0
	lea	rdx, monitor_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L17
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 73
	lea	rcx, .LC0[rip]
	lea	rdx, .LC8[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L17:
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L18
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 76
	lea	rcx, .LC0[rip]
	lea	rdx, .LC9[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L18:
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L19
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	mov	r9, rdx
	mov	r8d, 79
	lea	rcx, .LC0[rip]
	lea	rdx, .LC10[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L19:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"287700.c"
	.text
	.global	mutex
	.bss
	.align	2
	.type	mutex, %object
	.size	mutex, 24
mutex:
	.space	24
	.comm	counter,4,4
	.comm	end_time,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"the_stack_data/287700.c\000"
	.align	2
.LC1:
	.ascii	"Lock mutex\000"
	.align	2
.LC2:
	.ascii	"%s at \"%s\":%d: %s\012\000"
	.align	2
.LC3:
	.ascii	"Unlock mutex\000"
	.text
	.align	2
	.global	counter_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	counter_thread, %function
counter_thread:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	b	.L2
.L7:
	ldr	r0, .L9
	bl	pthread_mutex_lock
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L3
	ldr	r3, .L9+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-16]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #29
	str	r3, [sp]
	ldr	r3, .L9+8
	ldr	r2, .L9+12
	ldr	r1, .L9+16
	mov	r0, r4
	bl	fprintf
	bl	abort
.L3:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L4
.L5:
	ldr	r3, .L9+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L9+20
	str	r3, [r2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L4:
	ldr	r3, [fp, #-20]
	ldr	r2, .L9+24
	cmp	r3, r2
	ble	.L5
	ldr	r0, .L9
	bl	pthread_mutex_unlock
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L9+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-16]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #34
	str	r3, [sp]
	ldr	r3, .L9+8
	ldr	r2, .L9+28
	ldr	r1, .L9+16
	mov	r0, r4
	bl	fprintf
	bl	abort
.L6:
	mov	r0, #1
	bl	sleep
.L2:
	mov	r0, #0
	bl	time
	mov	r2, r0
	ldr	r3, .L9+32
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L7
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L10:
	.align	2
.L9:
	.word	mutex
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	counter
	.word	9999999
	.word	.LC3
	.word	end_time
	.size	counter_thread, .-counter_thread
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Trylock mutex\000"
	.align	2
.LC5:
	.ascii	"Counter is %ld\012\000"
	.align	2
.LC6:
	.ascii	"Monitor thread missed update %d times.\012\000"
	.text
	.align	2
	.global	monitor_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	monitor_thread, %function
monitor_thread:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L12
.L15:
	mov	r0, #3
	bl	sleep
	ldr	r0, .L17
	bl	pthread_mutex_trylock
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #16
	beq	.L13
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L14
	ldr	r3, .L17+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-16]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #50
	str	r3, [sp]
	ldr	r3, .L17+8
	ldr	r2, .L17+12
	ldr	r1, .L17+16
	mov	r0, r4
	bl	fprintf
	bl	abort
.L14:
	ldr	r3, .L17+20
	ldr	r3, [r3]
	ldr	r2, .L17+24
	smull	r1, r2, r3, r2
	asr	r2, r2, #22
	asr	r3, r3, #31
	sub	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L17+28
	bl	printf
	ldr	r0, .L17
	bl	pthread_mutex_unlock
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L12
	ldr	r3, .L17+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-16]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #54
	str	r3, [sp]
	ldr	r3, .L17+8
	ldr	r2, .L17+32
	ldr	r1, .L17+16
	mov	r0, r4
	bl	fprintf
	bl	abort
.L13:
	ldr	r3, .L17+20
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L17+20
	str	r3, [r2]
.L12:
	mov	r0, #0
	bl	time
	mov	r2, r0
	ldr	r3, .L17+36
	ldr	r3, [r3]
	cmp	r2, r3
	blt	.L15
	ldr	r1, [fp, #-20]
	ldr	r0, .L17+40
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L18:
	.align	2
.L17:
	.word	mutex
	.word	stderr
	.word	.LC0
	.word	.LC4
	.word	.LC2
	.word	counter
	.word	1801439851
	.word	.LC5
	.word	.LC3
	.word	end_time
	.word	.LC6
	.size	monitor_thread, .-monitor_thread
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Create counter thread\000"
	.align	2
.LC8:
	.ascii	"Create monitor thread\000"
	.align	2
.LC9:
	.ascii	"Join counter thread\000"
	.align	2
.LC10:
	.ascii	"Join monitor thread\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	add	r3, r3, #60
	ldr	r2, .L26+4
	str	r3, [r2]
	sub	r0, fp, #28
	mov	r3, #0
	ldr	r2, .L26+8
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L20
	ldr	r3, .L26+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-20]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #70
	str	r3, [sp]
	ldr	r3, .L26+16
	ldr	r2, .L26+20
	ldr	r1, .L26+24
	mov	r0, r4
	bl	fprintf
	bl	abort
.L20:
	sub	r0, fp, #24
	mov	r3, #0
	ldr	r2, .L26+28
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L21
	ldr	r3, .L26+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-20]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #73
	str	r3, [sp]
	ldr	r3, .L26+16
	ldr	r2, .L26+32
	ldr	r1, .L26+24
	mov	r0, r4
	bl	fprintf
	bl	abort
.L21:
	ldr	r3, [fp, #-28]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L22
	ldr	r3, .L26+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-20]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #76
	str	r3, [sp]
	ldr	r3, .L26+16
	ldr	r2, .L26+36
	ldr	r1, .L26+24
	mov	r0, r4
	bl	fprintf
	bl	abort
.L22:
	ldr	r3, [fp, #-24]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L23
	ldr	r3, .L26+12
	ldr	r4, [r3]
	ldr	r0, [fp, #-20]
	bl	strerror
	mov	r3, r0
	str	r3, [sp, #4]
	mov	r3, #79
	str	r3, [sp]
	ldr	r3, .L26+16
	ldr	r2, .L26+40
	ldr	r1, .L26+24
	mov	r0, r4
	bl	fprintf
	bl	abort
.L23:
	mov	r3, #0
	ldr	r2, .L26
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L25
	bl	__stack_chk_fail
.L25:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC11
	.word	end_time
	.word	counter_thread
	.word	stderr
	.word	.LC0
	.word	.LC7
	.word	.LC2
	.word	monitor_thread
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
