	.file	"753423.c"
	.intel_syntax noprefix
	.text
	.globl	spin_lock
	.type	spin_lock, @function
spin_lock:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	nop
.L2:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	tas@PLT
	test	eax, eax
	jne	.L2
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	spin_lock, .-spin_lock
	.globl	spin_unlock
	.type	spin_unlock, @function
spin_unlock:
.LFB7:
	.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 -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 0
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	spin_unlock, .-spin_unlock
	.section	.rodata
	.align 8
.LC0:
	.string	"Error: unable to create a shared memory (%s)\n"
	.align 8
.LC1:
	.string	"The last updated value for each process is %d\n"
	.align 8
.LC2:
	.string	"Error: unable to fork the process (%s)"
.LC3:
	.string	"Error: unable to unmap (%s)\n"
	.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, 32
	mov	r9d, 0
	mov	r8d, -1
	mov	ecx, 33
	mov	edx, 3
	mov	esi, 4096
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], -1
	jne	.L5
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	r9d, 0
	mov	r8d, -1
	mov	ecx, 33
	mov	edx, 3
	mov	esi, 4096
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L6
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	DWORD PTR -32[rbp], 0
	jmp	.L7
.L12:
	call	fork@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jne	.L8
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	spin_lock
	mov	DWORD PTR -28[rbp], 0
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	add	DWORD PTR -28[rbp], 1
.L9:
	cmp	DWORD PTR -28[rbp], 999999
	jle	.L10
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	spin_unlock
	mov	edi, 0
	call	exit@PLT
.L8:
	cmp	DWORD PTR -20[rbp], -1
	jne	.L11
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	add	DWORD PTR -32[rbp], 1
.L7:
	cmp	DWORD PTR -32[rbp], 5
	jle	.L12
	mov	DWORD PTR -24[rbp], 0
	jmp	.L13
.L14:
	mov	edi, 0
	mov	eax, 0
	call	wait@PLT
	add	DWORD PTR -24[rbp], 1
.L13:
	cmp	DWORD PTR -24[rbp], 5
	jle	.L14
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, 4096
	mov	rdi, rax
	call	munmap@PLT
	cmp	eax, -1
	jne	.L15
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	eax, 0
	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	"753423.c"
	.text
	.align	2
	.global	spin_lock
	.syntax unified
	.arm
	.fpu softvfp
	.type	spin_lock, %function
spin_lock:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	nop
.L2:
	ldr	r0, [fp, #-8]
	bl	tas
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	spin_lock, .-spin_lock
	.align	2
	.global	spin_unlock
	.syntax unified
	.arm
	.fpu softvfp
	.type	spin_unlock, %function
spin_unlock:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	strb	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	spin_unlock, .-spin_unlock
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Error: unable to create a shared memory (%s)\012\000"
	.align	2
.LC1:
	.ascii	"The last updated value for each process is %d\012\000"
	.align	2
.LC2:
	.ascii	"Error: unable to fork the process (%s)\000"
	.align	2
.LC3:
	.ascii	"Error: unable to unmap (%s)\012\000"
	.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
	mov	r3, #0
	str	r3, [sp, #4]
	mvn	r3, #0
	str	r3, [sp]
	mov	r3, #33
	mov	r2, #3
	mov	r1, #4096
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L5
	ldr	r3, .L17
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L17+4
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L5:
	mov	r3, #0
	str	r3, [sp, #4]
	mvn	r3, #0
	str	r3, [sp]
	mov	r3, #33
	mov	r2, #3
	mov	r1, #4096
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L6
	ldr	r3, .L17
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L17+4
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L6:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L7
.L12:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L8
	ldr	r0, [fp, #-20]
	bl	spin_lock
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L9
.L10:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L9:
	ldr	r3, [fp, #-32]
	ldr	r2, .L17+8
	cmp	r3, r2
	blt	.L10
	ldr	r3, .L17
	ldr	r0, [r3]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L17+12
	bl	fprintf
	ldr	r0, [fp, #-20]
	bl	spin_unlock
	mov	r0, #0
	bl	exit
.L8:
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L11
	ldr	r3, .L17
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L17+16
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L7:
	ldr	r3, [fp, #-36]
	cmp	r3, #5
	ble	.L12
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L13
.L14:
	mov	r0, #0
	bl	wait
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L13:
	ldr	r3, [fp, #-28]
	cmp	r3, #5
	ble	.L14
	mov	r1, #4096
	ldr	r0, [fp, #-24]
	bl	munmap
	mov	r3, r0
	cmn	r3, #1
	bne	.L15
	ldr	r3, .L17
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L17+20
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L15:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L18:
	.align	2
.L17:
	.word	stderr
	.word	.LC0
	.word	1000000
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
