	.file	"97399.c"
	.intel_syntax noprefix
	.text
	.globl	cria_filhos
	.type	cria_filhos, @function
cria_filhos:
.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	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -8[rbp], 0
	jmp	.L2
.L6:
	call	fork@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	jns	.L3
	mov	eax, -1
	jmp	.L4
.L3:
	cmp	DWORD PTR -4[rbp], 0
	jne	.L5
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	jmp	.L4
.L5:
	add	DWORD PTR -8[rbp], 1
.L2:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L6
	mov	eax, 0
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cria_filhos, .-cria_filhos
	.section	.rodata
.LC0:
	.string	"Pipe failed!"
.LC1:
	.string	"Fork failed!"
	.align 8
.LC2:
	.string	"Produto com mais de 20 vendas: %d\n"
.LC3:
	.string	"Wait failed!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 96
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	rdi, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rdi
	xor	edi, edi
	mov	rsi, rsp
	mov	r12, rsi
	mov	DWORD PTR -100[rbp], 50000
	mov	DWORD PTR -96[rbp], 10
	mov	DWORD PTR -92[rbp], 12
	mov	esi, DWORD PTR -100[rbp]
	movsx	rsi, esi
	sub	rsi, 1
	mov	QWORD PTR -64[rbp], rsi
	mov	esi, DWORD PTR -100[rbp]
	movsx	rsi, esi
	mov	rax, rsi
	mov	edx, 0
	imul	rdi, rdx, 96
	imul	rsi, rax, 0
	add	rsi, rdi
	mov	edi, 96
	mul	rdi
	add	rsi, rdx
	mov	rdx, rsi
	mov	eax, DWORD PTR -100[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	eax, DWORD PTR -100[rbp]
	cdqe
	mov	rcx, rax
	mov	ebx, 0
	imul	rdx, rbx, 96
	imul	rax, rcx, 0
	lea	rsi, [rdx+rax]
	mov	eax, 96
	mul	rcx
	lea	rcx, [rsi+rdx]
	mov	rdx, rcx
	mov	eax, DWORD PTR -100[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ebx, 16
	mov	edx, 0
	div	rbx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L8:
	cmp	rsp, rdx
	je	.L9
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L8
.L9:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L10
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L10:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -56[rbp], rax
	mov	DWORD PTR -104[rbp], 0
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -104[rbp]
	mov	DWORD PTR -44[rbp], eax
	mov	eax, DWORD PTR -104[rbp]
	mov	DWORD PTR -40[rbp], eax
	mov	DWORD PTR -36[rbp], 2
	mov	rcx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -104[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	mov	rdx, QWORD PTR -44[rbp]
	mov	QWORD PTR [rax], rdx
	mov	edx, DWORD PTR -36[rbp]
	mov	DWORD PTR 8[rax], edx
	add	DWORD PTR -104[rbp], 1
.L11:
	mov	eax, DWORD PTR -104[rbp]
	cmp	eax, DWORD PTR -100[rbp]
	jl	.L12
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 368[rax], 500
	mov	rax, QWORD PTR -56[rbp]
	mov	DWORD PTR 10808[rax], 500
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	pipe@PLT
	cmp	eax, -1
	jne	.L13
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	eax, DWORD PTR -96[rbp]
	mov	edi, eax
	call	cria_filhos
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], -1
	jne	.L14
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	cmp	DWORD PTR -88[rbp], 0
	jne	.L15
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L16:
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -32[rbp]
	lea	rcx, -44[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -72[rbp], eax
	cmp	DWORD PTR -72[rbp], 0
	jg	.L17
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	close@PLT
	mov	DWORD PTR -104[rbp], 0
	jmp	.L22
.L15:
	mov	eax, DWORD PTR -32[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -88[rbp]
	sub	eax, 1
	imul	eax, eax, 5000
	mov	DWORD PTR -84[rbp], eax
	mov	eax, DWORD PTR -88[rbp]
	imul	eax, eax, 5000
	mov	DWORD PTR -80[rbp], eax
	mov	eax, DWORD PTR -84[rbp]
	mov	DWORD PTR -108[rbp], eax
	jmp	.L19
.L21:
	mov	rcx, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR -108[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	add	rax, rcx
	add	rax, 8
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -76[rbp], eax
	cmp	DWORD PTR -76[rbp], 20
	jle	.L20
	mov	eax, DWORD PTR -92[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -108[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, QWORD PTR -56[rbp]
	add	rcx, rax
	mov	eax, DWORD PTR -28[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L20:
	add	DWORD PTR -108[rbp], 1
.L19:
	mov	eax, DWORD PTR -108[rbp]
	cmp	eax, DWORD PTR -80[rbp]
	jl	.L21
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
.L24:
	lea	rax, -44[rbp]
	mov	rdi, rax
	call	wait@PLT
	mov	DWORD PTR -68[rbp], eax
	cmp	DWORD PTR -68[rbp], -1
	jne	.L23
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	add	DWORD PTR -104[rbp], 1
.L22:
	mov	eax, DWORD PTR -104[rbp]
	cmp	eax, DWORD PTR -96[rbp]
	jl	.L24
	mov	eax, 0
	mov	rsp, r12
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	lea	rsp, -16[rbp]
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"97399.c"
	.text
	.align	2
	.global	cria_filhos
	.syntax unified
	.arm
	.fpu softvfp
	.type	cria_filhos, %function
cria_filhos:
	@ 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
.L6:
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L3
	mvn	r3, #0
	b	.L4
.L3:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L5
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	b	.L4
.L5:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L2:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L6
	mov	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	cria_filhos, .-cria_filhos
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Pipe failed!\000"
	.align	2
.LC1:
	.ascii	"Fork failed!\000"
	.align	2
.LC2:
	.ascii	"Produto com mais de 20 vendas: %d\012\000"
	.align	2
.LC3:
	.ascii	"Wait failed!\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #84
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	mov	r3, sp
	mov	r8, r3
	ldr	r3, .L24+4
	str	r3, [fp, #-96]
	mov	r3, #10
	str	r3, [fp, #-92]
	mov	r3, #12
	str	r3, [fp, #-88]
	ldr	r3, [fp, #-96]
	sub	r3, r3, #1
	str	r3, [fp, #-84]
	ldr	r3, [fp, #-96]
	mov	r0, r3
	mov	r1, #0
	mov	r2, r0
	mov	r3, r1
	adds	r6, r2, r2
	adc	r7, r3, r3
	mov	r2, r6
	mov	r3, r7
	adds	r2, r2, r0
	adc	r3, r3, r1
	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
	ldr	r2, [fp, #-96]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	ldr	r3, [fp, #-96]
	mov	r0, r3
	mov	r1, #0
	mov	r2, r0
	mov	r3, r1
	adds	r4, r2, r2
	adc	r5, r3, r3
	mov	r2, r4
	mov	r3, r5
	adds	r2, r2, r0
	adc	r3, r3, r1
	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
	ldr	r2, [fp, #-96]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-80]
	mov	r3, #0
	str	r3, [fp, #-100]
	b	.L8
.L9:
	ldr	r3, [fp, #-100]
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-100]
	str	r3, [fp, #-48]
	mov	r3, #2
	str	r3, [fp, #-44]
	ldr	r1, [fp, #-80]
	ldr	r2, [fp, #-100]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	mov	ip, r3
	sub	r3, fp, #52
	ldm	r3, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r3, [fp, #-100]
	add	r3, r3, #1
	str	r3, [fp, #-100]
.L8:
	ldr	r2, [fp, #-100]
	ldr	r3, [fp, #-96]
	cmp	r2, r3
	blt	.L9
	ldr	r3, [fp, #-80]
	mov	r2, #500
	str	r2, [r3, #368]
	ldr	r3, [fp, #-80]
	add	r3, r3, #8192
	mov	r2, r3
	mov	r3, #500
	str	r3, [r2, #2616]
	sub	r3, fp, #40
	mov	r0, r3
	bl	pipe
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L24+8
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	ldr	r0, [fp, #-92]
	bl	cria_filhos
	str	r0, [fp, #-76]
	ldr	r3, [fp, #-76]
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L24+12
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	close
	b	.L13
.L14:
	ldr	r3, [fp, #-48]
	mov	r1, r3
	ldr	r0, .L24+16
	bl	printf
.L13:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-88]
	sub	r1, fp, #52
	mov	r0, r3
	bl	read
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	bgt	.L14
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	close
	mov	r3, #0
	str	r3, [fp, #-100]
	b	.L19
.L12:
	ldr	r3, [fp, #-40]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-76]
	sub	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	str	r3, [fp, #-72]
	ldr	r2, [fp, #-76]
	mov	r3, r2
	lsl	r3, r3, #5
	sub	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r2, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #3
	str	r3, [fp, #-68]
	ldr	r3, [fp, #-72]
	str	r3, [fp, #-104]
	b	.L16
.L18:
	ldr	r1, [fp, #-80]
	ldr	r2, [fp, #-104]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r1, r3
	add	r3, r3, #8
	ldr	r3, [r3]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmp	r3, #20
	ble	.L17
	ldr	r0, [fp, #-36]
	ldr	r2, [fp, #-104]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	ldr	r2, [fp, #-80]
	add	r3, r2, r3
	ldr	r2, [fp, #-88]
	mov	r1, r3
	bl	write
.L17:
	ldr	r3, [fp, #-104]
	add	r3, r3, #1
	str	r3, [fp, #-104]
.L16:
	ldr	r2, [fp, #-104]
	ldr	r3, [fp, #-68]
	cmp	r2, r3
	blt	.L18
	ldr	r3, [fp, #-36]
	mov	r0, r3
	bl	close
	mov	r0, #0
	bl	exit
.L21:
	sub	r3, fp, #52
	mov	r0, r3
	bl	wait
	str	r0, [fp, #-56]
	ldr	r3, [fp, #-56]
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L24+20
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-100]
	add	r3, r3, #1
	str	r3, [fp, #-100]
.L19:
	ldr	r2, [fp, #-100]
	ldr	r3, [fp, #-92]
	cmp	r2, r3
	blt	.L21
	mov	r3, #0
	mov	sp, r8
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-32]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC4
	.word	50000
	.word	.LC0
	.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
