	.file	"513573.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Eex13sema%d"
.LC1:
	.string	"Erro ao abrir o semaforo"
.LC2:
	.string	"/SHM_EEX13"
.LC3:
	.string	"In shm_open()"
.LC4:
	.string	"%i\302\272 nr: %i\n"
.LC5:
	.string	"Erro no sem_close()\n"
.LC6:
	.string	"Erro no sem_unlink()\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -92[rbp], 48
	mov	DWORD PTR -112[rbp], 0
	lea	rax, -80[rbp]
	mov	rdi, rax
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	DWORD PTR -120[rbp], 0
	jmp	.L2
.L4:
	mov	eax, DWORD PTR -120[rbp]
	lea	edx, 1[rax]
	lea	rax, -32[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -32[rbp]
	mov	ecx, 0
	mov	edx, 420
	mov	esi, 192
	mov	rdi, rax
	mov	eax, 0
	call	sem_open@PLT
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	QWORD PTR -64[rbp+rdx*8], rax
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	mov	rax, QWORD PTR -64[rbp+rax*8]
	test	rax, rax
	jne	.L3
	lea	rax, -32[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	sem_open@PLT
	mov	edx, DWORD PTR -120[rbp]
	movsx	rdx, edx
	mov	QWORD PTR -64[rbp+rdx*8], rax
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	mov	rax, QWORD PTR -64[rbp+rax*8]
	test	rax, rax
	jne	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	add	DWORD PTR -120[rbp], 1
.L2:
	cmp	DWORD PTR -120[rbp], 2
	jle	.L4
	mov	DWORD PTR -120[rbp], 0
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	add	DWORD PTR -120[rbp], 1
.L5:
	cmp	DWORD PTR -120[rbp], 9
	jle	.L6
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	mov	edx, 384
	mov	esi, 194
	lea	rdi, .LC2[rip]
	call	shm_open@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	jns	.L7
	mov	edx, 384
	mov	esi, 2
	lea	rdi, .LC2[rip]
	call	shm_open@PLT
	mov	DWORD PTR -116[rbp], eax
	cmp	DWORD PTR -116[rbp], 0
	jns	.L7
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -116[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ftruncate@PLT
	mov	eax, DWORD PTR -92[rbp]
	cdqe
	mov	edx, DWORD PTR -116[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR 44[rax], 0
	mov	DWORD PTR -108[rbp], 0
	jmp	.L8
.L13:
	call	fork@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], 0
	jne	.L9
	mov	DWORD PTR -104[rbp], 0
	jmp	.L10
.L12:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR 44[rax]
	cmp	eax, 10
	jne	.L11
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR 44[rax], 0
.L11:
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR 44[rax]
	mov	rax, QWORD PTR -72[rbp]
	mov	ecx, DWORD PTR 40[rax]
	mov	rax, QWORD PTR -72[rbp]
	movsx	rdx, edx
	mov	DWORD PTR [rax+rdx*4], ecx
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, -2004318071
	shr	rdx, 32
	add	edx, eax
	sar	edx, 4
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 30
	sub	eax, ecx
	mov	edx, eax
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR 40[rax], edx
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR 44[rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -72[rbp]
	mov	DWORD PTR 44[rax], edx
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	add	DWORD PTR -104[rbp], 1
.L10:
	cmp	DWORD PTR -104[rbp], 14
	jle	.L12
	mov	edi, 0
	call	exit@PLT
.L9:
	add	DWORD PTR -108[rbp], 1
.L8:
	cmp	DWORD PTR -108[rbp], 1
	jle	.L13
	mov	DWORD PTR -100[rbp], 0
	jmp	.L14
.L18:
	cmp	DWORD PTR -112[rbp], 10
	jne	.L15
	mov	DWORD PTR -112[rbp], 0
	mov	DWORD PTR -96[rbp], 0
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	sem_post@PLT
	add	DWORD PTR -96[rbp], 1
.L16:
	cmp	DWORD PTR -96[rbp], 9
	jle	.L17
.L15:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR -112[rbp]
	movsx	rdx, edx
	mov	eax, DWORD PTR [rax+rdx*4]
	mov	edx, DWORD PTR -100[rbp]
	lea	ecx, 1[rdx]
	mov	edx, eax
	mov	esi, ecx
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -112[rbp], 1
	add	DWORD PTR -100[rbp], 1
.L14:
	cmp	DWORD PTR -100[rbp], 29
	jle	.L18
	mov	edi, 0
	call	wait@PLT
	mov	edi, 0
	call	wait@PLT
	mov	DWORD PTR -120[rbp], 0
	jmp	.L19
.L22:
	mov	eax, DWORD PTR -120[rbp]
	lea	edx, 1[rax]
	lea	rax, -32[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	eax, DWORD PTR -120[rbp]
	cdqe
	mov	rax, QWORD PTR -64[rbp+rax*8]
	mov	rdi, rax
	call	sem_close@PLT
	cmp	eax, -1
	jne	.L20
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	sem_unlink@PLT
	cmp	eax, -1
	jne	.L21
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	add	DWORD PTR -120[rbp], 1
.L19:
	cmp	DWORD PTR -120[rbp], 2
	jle	.L22
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -72[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], 0
	jns	.L23
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	eax, DWORD PTR -116[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -88[rbp], 0
	jns	.L24
	mov	edi, 1
	call	exit@PLT
.L24:
	lea	rdi, .LC2[rip]
	call	shm_unlink@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], 0
	jns	.L25
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"513573.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Eex13sema%d\000"
	.align	2
.LC1:
	.ascii	"Erro ao abrir o semaforo\000"
	.align	2
.LC2:
	.ascii	"/SHM_EEX13\000"
	.align	2
.LC3:
	.ascii	"In shm_open()\000"
	.align	2
.LC4:
	.ascii	"%i\302\272 nr: %i\012\000"
	.align	2
.LC5:
	.ascii	"Erro no sem_close()\012\000"
	.align	2
.LC6:
	.ascii	"Erro no sem_unlink()\012\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #96
	ldr	r3, .L28
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #48
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-76]
	sub	r3, fp, #88
	mov	r0, r3
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L2
.L4:
	ldr	r3, [fp, #-84]
	add	r2, r3, #1
	sub	r3, fp, #28
	ldr	r1, .L28+4
	mov	r0, r3
	bl	sprintf
	sub	r0, fp, #28
	mov	r3, #0
	mov	r2, #420
	mov	r1, #192
	bl	sem_open
	mov	r2, r0
	ldr	r3, [fp, #-84]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-36]
	ldr	r3, [fp, #-84]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	cmp	r3, #0
	bne	.L3
	sub	r3, fp, #28
	mov	r1, #0
	mov	r0, r3
	bl	sem_open
	mov	r2, r0
	ldr	r3, [fp, #-84]
	lsl	r3, r3, #2
	sub	r1, fp, #4
	add	r3, r1, r3
	str	r2, [r3, #-36]
	ldr	r3, [fp, #-84]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	cmp	r3, #0
	bne	.L3
	ldr	r0, .L28+8
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L2:
	ldr	r3, [fp, #-84]
	cmp	r3, #2
	ble	.L4
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L5
.L6:
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L5:
	ldr	r3, [fp, #-84]
	cmp	r3, #9
	ble	.L6
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	sem_post
	mov	r2, #384
	mov	r1, #194
	ldr	r0, .L28+12
	bl	shm_open
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bge	.L7
	mov	r2, #384
	mov	r1, #2
	ldr	r0, .L28+12
	bl	shm_open
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L28+16
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-80]
	bl	ftruncate
	ldr	r1, [fp, #-56]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-80]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	mov	r2, #0
	str	r2, [r3, #44]
	mov	r3, #0
	str	r3, [fp, #-72]
	b	.L8
.L13:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L9
	mov	r3, #0
	str	r3, [fp, #-68]
	b	.L10
.L12:
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-52]
	ldr	r3, [r3, #44]
	cmp	r3, #10
	bne	.L11
	ldr	r3, [fp, #-52]
	mov	r2, #0
	str	r2, [r3, #44]
.L11:
	ldr	r3, [fp, #-52]
	ldr	r2, [r3, #44]
	ldr	r3, [fp, #-52]
	ldr	r1, [r3, #40]
	ldr	r3, [fp, #-52]
	str	r1, [r3, r2, lsl #2]
	bl	rand
	mov	r2, r0
	ldr	r3, .L28+20
	smull	r1, r3, r2, r3
	add	r3, r3, r2
	asr	r1, r3, #4
	asr	r3, r2, #31
	sub	r1, r1, r3
	mov	r3, r1
	lsl	r3, r3, #4
	sub	r3, r3, r1
	lsl	r3, r3, #1
	sub	r1, r2, r3
	ldr	r3, [fp, #-52]
	str	r1, [r3, #40]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3, #44]
	add	r2, r3, #1
	ldr	r3, [fp, #-52]
	str	r2, [r3, #44]
	ldr	r3, [fp, #-32]
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-68]
	add	r3, r3, #1
	str	r3, [fp, #-68]
.L10:
	ldr	r3, [fp, #-68]
	cmp	r3, #14
	ble	.L12
	mov	r0, #0
	bl	exit
.L9:
	ldr	r3, [fp, #-72]
	add	r3, r3, #1
	str	r3, [fp, #-72]
.L8:
	ldr	r3, [fp, #-72]
	cmp	r3, #1
	ble	.L13
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L14
.L18:
	ldr	r3, [fp, #-76]
	cmp	r3, #10
	bne	.L15
	mov	r3, #0
	str	r3, [fp, #-76]
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L16
.L17:
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L16:
	ldr	r3, [fp, #-60]
	cmp	r3, #9
	ble	.L17
.L15:
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-64]
	add	r1, r3, #1
	ldr	r3, [fp, #-52]
	ldr	r2, [fp, #-76]
	ldr	r3, [r3, r2, lsl #2]
	mov	r2, r3
	ldr	r0, .L28+24
	bl	printf
	ldr	r3, [fp, #-76]
	add	r3, r3, #1
	str	r3, [fp, #-76]
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L14:
	ldr	r3, [fp, #-64]
	cmp	r3, #29
	ble	.L18
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	wait
	mov	r3, #0
	str	r3, [fp, #-84]
	b	.L19
.L22:
	ldr	r3, [fp, #-84]
	add	r2, r3, #1
	sub	r3, fp, #28
	ldr	r1, .L28+4
	mov	r0, r3
	bl	sprintf
	ldr	r3, [fp, #-84]
	lsl	r3, r3, #2
	sub	r2, fp, #4
	add	r3, r2, r3
	ldr	r3, [r3, #-36]
	mov	r0, r3
	bl	sem_close
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L28+28
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	sub	r3, fp, #28
	mov	r0, r3
	bl	sem_unlink
	mov	r3, r0
	cmn	r3, #1
	bne	.L21
	ldr	r0, .L28+32
	bl	perror
	mov	r0, #1
	bl	exit
.L21:
	ldr	r3, [fp, #-84]
	add	r3, r3, #1
	str	r3, [fp, #-84]
.L19:
	ldr	r3, [fp, #-84]
	cmp	r3, #2
	ble	.L22
	ldr	r3, [fp, #-56]
	mov	r1, r3
	ldr	r0, [fp, #-52]
	bl	munmap
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bge	.L23
	mov	r0, #1
	bl	exit
.L23:
	ldr	r0, [fp, #-80]
	bl	close
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bge	.L24
	mov	r0, #1
	bl	exit
.L24:
	ldr	r0, .L28+12
	bl	shm_unlink
	str	r0, [fp, #-48]
	ldr	r3, [fp, #-48]
	cmp	r3, #0
	bge	.L25
	mov	r0, #1
	bl	exit
.L25:
	mov	r3, #0
	ldr	r2, .L28
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L27
	bl	__stack_chk_fail
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC7
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	-2004318071
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
