	.file	"61074842.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"\nfd[%d] !Erro! - %s;"
	.text
	.globl	isopen
	.type	isopen, @function
isopen:
.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	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	cmp	rax, -1
	jne	.L2
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 9
	jne	.L3
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L4
.L3:
	mov	DWORD PTR -4[rbp], 1
	jmp	.L4
.L2:
	mov	DWORD PTR -4[rbp], 1
.L4:
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	isopen, .-isopen
	.section	.rodata
	.align 8
.LC1:
	.string	"\nAbrir\303\241 %d arquivos tempor\303\241rios\n"
.LC2:
	.string	"\n!@Malloc(fds)@! - %s;"
.LC3:
	.string	"/tmp/"
.LC4:
	.string	"\n!@Open(fds[%d])@! - %s;"
	.text
	.globl	open_random_files
	.type	open_random_files, @function
open_random_files:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srandom@PLT
	call	rand@PLT
	movsx	rdx, eax
	imul	rdx, rdx, -1307163959
	shr	rdx, 32
	add	edx, eax
	sar	edx, 4
	mov	ecx, eax
	sar	ecx, 31
	sub	edx, ecx
	imul	ecx, edx, 23
	sub	eax, ecx
	mov	edx, eax
	lea	eax, 2[rdx]
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L7
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L7:
	mov	DWORD PTR -32[rbp], 0
	jmp	.L8
.L10:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	lea	rbx, [rdx+rax]
	mov	edx, 384
	mov	esi, 4259842
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR [rbx], eax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	cmp	eax, -1
	jne	.L9
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
.L9:
	add	DWORD PTR -32[rbp], 1
.L8:
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	cmp	DWORD PTR -32[rbp], eax
	jl	.L10
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	sal	rax, 2
	lea	rdx, -4[rax]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	open_random_files, .-open_random_files
	.section	.rodata
.LC5:
	.string	"\n!@Close(fds[%d])@! - %s;"
	.text
	.globl	close_random_files
	.type	close_random_files, @function
close_random_files:
.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	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L13
.L15:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L14
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
.L14:
	add	DWORD PTR -4[rbp], 1
.L13:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L15
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	close_random_files, .-close_random_files
	.section	.rodata
	.align 8
.LC6:
	.string	"\nExistem %d descritores abertos\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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	eax, 0
	call	open_random_files
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -16[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L17
.L19:
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	isopen
	test	eax, eax
	je	.L18
	add	DWORD PTR -16[rbp], 1
.L18:
	add	DWORD PTR -12[rbp], 1
.L17:
	call	getdtablesize@PLT
	cmp	DWORD PTR -12[rbp], eax
	jl	.L19
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	close_random_files
	mov	eax, DWORD PTR -16[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
.LFE9:
	.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	"61074842.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012fd[%d] !Erro! - %s;\000"
	.text
	.align	2
	.global	isopen
	.syntax unified
	.arm
	.fpu softvfp
	.type	isopen, %function
isopen:
	@ 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	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-16]
	bl	lseek
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #9
	bne	.L3
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-16]
	ldr	r0, .L6
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L4
.L3:
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L4
.L2:
	mov	r3, #1
	str	r3, [fp, #-8]
.L4:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.size	isopen, .-isopen
	.section	.rodata
	.align	2
.LC1:
	.ascii	"\012Abrir\303\241 %d arquivos tempor\303\241rios\012"
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"\012!@Malloc(fds)@! - %s;\000"
	.align	2
.LC3:
	.ascii	"/tmp/\000"
	.align	2
.LC4:
	.ascii	"\012!@Open(fds[%d])@! - %s;\000"
	.text
	.align	2
	.global	open_random_files
	.syntax unified
	.arm
	.fpu softvfp
	.type	open_random_files, %function
open_random_files:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srandom
	bl	rand
	mov	r1, r0
	ldr	r3, .L14
	smull	r2, r3, r1, r3
	add	r3, r3, r1
	asr	r2, r3, #4
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	sub	r2, r1, r3
	add	r3, r2, #2
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L14+4
	bl	printf
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L14+8
	bl	printf
.L9:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L10
.L12:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r4, r2, r3
	mov	r2, #384
	ldr	r1, .L14+12
	ldr	r0, .L14+16
	bl	open
	mov	r3, r0
	str	r3, [r4]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L11
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-24]
	ldr	r0, .L14+20
	bl	printf
.L11:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L10:
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L12
	ldr	r3, [fp, #-20]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	-1307163959
	.word	.LC1
	.word	.LC2
	.word	4210690
	.word	.LC3
	.word	.LC4
	.size	open_random_files, .-open_random_files
	.section	.rodata
	.align	2
.LC5:
	.ascii	"\012!@Close(fds[%d])@! - %s;\000"
	.text
	.align	2
	.global	close_random_files
	.syntax unified
	.arm
	.fpu softvfp
	.type	close_random_files, %function
close_random_files:
	@ 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, #-8]
	b	.L17
.L19:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L18
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-8]
	ldr	r0, .L20
	bl	printf
.L18:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L17:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L19
	ldr	r0, [fp, #-16]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC5
	.size	close_random_files, .-close_random_files
	.section	.rodata
	.align	2
.LC6:
	.ascii	"\012Existem %d descritores abertos\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	bl	open_random_files
	str	r0, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L23
.L25:
	ldr	r0, [fp, #-12]
	bl	isopen
	mov	r3, r0
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L24:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L23:
	bl	getdtablesize
	mov	r2, r0
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	blt	.L25
	ldr	r0, [fp, #-8]
	bl	close_random_files
	ldr	r1, [fp, #-16]
	ldr	r0, .L27
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
