	.file	"14671.c"
	.intel_syntax noprefix
	.text
	.globl	mutex
	.bss
	.align 32
	.type	mutex, @object
	.size	mutex, 40
mutex:
	.zero	40
	.globl	shared_counter
	.align 4
	.type	shared_counter, @object
	.size	shared_counter, 4
shared_counter:
	.zero	4
	.section	.rodata
.LC0:
	.string	"pthread_mutex_lock"
	.text
	.globl	thread_function_1
	.type	thread_function_1, @function
thread_function_1:
.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
	mov	DWORD PTR -8[rbp], 0
	jmp	.L2
.L5:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L3
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR shared_counter[rip]
	add	eax, 1
	mov	DWORD PTR shared_counter[rip], eax
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L4
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	add	DWORD PTR -8[rbp], 1
.L2:
	cmp	DWORD PTR -8[rbp], 9999999
	jle	.L5
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	thread_function_1, .-thread_function_1
	.globl	thread_function_2
	.type	thread_function_2, @function
thread_function_2:
.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	.L8
.L11:
	lea	rdi, mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L9
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR shared_counter[rip]
	sub	eax, 1
	mov	DWORD PTR shared_counter[rip], eax
	lea	rdi, mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L10
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	add	DWORD PTR -8[rbp], 1
.L8:
	cmp	DWORD PTR -8[rbp], 9999999
	jle	.L11
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	thread_function_2, .-thread_function_2
	.section	.rodata
	.align 8
.LC1:
	.string	"initial value of shared_counter=%d, NUMBER_OF_CYCLES=%d\n"
.LC2:
	.string	"pthread_create"
.LC3:
	.string	"pthread_join"
	.align 8
.LC4:
	.string	"final value of shared_counter=%d\n"
.LC5:
	.string	"bye"
	.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR shared_counter[rip]
	mov	edx, 10000000
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -32[rbp]
	mov	ecx, 0
	lea	rdx, thread_function_1[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	je	.L14
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	lea	rax, -24[rbp]
	mov	ecx, 0
	lea	rdx, thread_function_2[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	je	.L15
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	je	.L16
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, -16[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	pthread_join@PLT
	mov	DWORD PTR -36[rbp], eax
	cmp	DWORD PTR -36[rbp], 0
	je	.L17
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	mov	eax, DWORD PTR shared_counter[rip]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	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	"14671.c"
	.text
	.global	mutex
	.bss
	.align	2
	.type	mutex, %object
	.size	mutex, 24
mutex:
	.space	24
	.comm	shared_counter,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"pthread_mutex_lock\000"
	.text
	.align	2
	.global	thread_function_1
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_function_1, %function
thread_function_1:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L2
.L5:
	ldr	r0, .L7
	bl	pthread_mutex_lock
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L3
	ldr	r0, .L7+4
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, .L7+8
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L7+8
	str	r3, [r2]
	ldr	r0, .L7
	bl	pthread_mutex_unlock
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L4
	ldr	r0, .L7+4
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	ldr	r2, .L7+12
	cmp	r3, r2
	ble	.L5
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	mutex
	.word	.LC0
	.word	shared_counter
	.word	9999999
	.size	thread_function_1, .-thread_function_1
	.align	2
	.global	thread_function_2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_function_2, %function
thread_function_2:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L10
.L13:
	ldr	r0, .L15
	bl	pthread_mutex_lock
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L11
	ldr	r0, .L15+4
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, .L15+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L15+8
	str	r3, [r2]
	ldr	r0, .L15
	bl	pthread_mutex_unlock
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L12
	ldr	r0, .L15+4
	bl	perror
	mov	r0, #1
	bl	exit
.L12:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L10:
	ldr	r3, [fp, #-12]
	ldr	r2, .L15+12
	cmp	r3, r2
	ble	.L13
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	mutex
	.word	.LC0
	.word	shared_counter
	.word	9999999
	.size	thread_function_2, .-thread_function_2
	.section	.rodata
	.align	2
.LC1:
	.ascii	"initial value of shared_counter=%d, NUMBER_OF_CYCLE"
	.ascii	"S=%d\012\000"
	.align	2
.LC2:
	.ascii	"pthread_create\000"
	.align	2
.LC3:
	.ascii	"pthread_join\000"
	.align	2
.LC4:
	.ascii	"final value of shared_counter=%d\012\000"
	.align	2
.LC5:
	.ascii	"bye\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-36]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r2, .L24+8
	mov	r1, r3
	ldr	r0, .L24+12
	bl	printf
	sub	r0, fp, #24
	mov	r3, #0
	ldr	r2, .L24+16
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L18
	ldr	r0, .L24+20
	bl	perror
	mov	r0, #1
	bl	exit
.L18:
	sub	r0, fp, #20
	mov	r3, #0
	ldr	r2, .L24+24
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L19
	ldr	r0, .L24+20
	bl	perror
	mov	r0, #1
	bl	exit
.L19:
	ldr	r3, [fp, #-24]
	sub	r2, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L20
	ldr	r0, .L24+28
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-20]
	sub	r2, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L21
	ldr	r0, .L24+28
	bl	perror
	mov	r0, #1
	bl	exit
.L21:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L24+32
	bl	printf
	ldr	r0, .L24+36
	bl	puts
	mov	r3, #0
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC6
	.word	shared_counter
	.word	10000000
	.word	.LC1
	.word	thread_function_1
	.word	.LC2
	.word	thread_function_2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
