	.file	"60741.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Debe introducirse el archivo a copiar y opcionalmente el nombre del fichero de salida"
.LC1:
	.string	"%s(copy)"
.LC2:
	.string	"\nError en open del original"
.LC3:
	.string	"\nError en fstat"
.LC4:
	.string	"\nEl archivo no es regular"
.LC5:
	.string	"\nError en open de la copia"
	.align 8
.LC6:
	.string	"\nFallo en proyecci\303\263n del original"
	.align 8
.LC7:
	.string	"\nFallo en proyecci\303\263n de la copia"
	.align 8
.LC8:
	.string	"\nError al eliminar la proyecci\303\263n del original"
	.align 8
.LC9:
	.string	"\nError al eliminar la proyecci\303\263n de la copia"
	.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
	sub	rsp, 1232
	mov	DWORD PTR -1220[rbp], edi
	mov	QWORD PTR -1232[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1220[rbp], 1
	jg	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L2:
	cmp	DWORD PTR -1220[rbp], 3
	jne	.L3
	mov	rax, QWORD PTR -1232[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1040[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	jmp	.L4
.L3:
	mov	rax, QWORD PTR -1232[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1040[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
.L4:
	mov	rax, QWORD PTR -1232[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1208[rbp], eax
	cmp	DWORD PTR -1208[rbp], 0
	jns	.L5
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L5:
	lea	rdx, -1184[rbp]
	mov	eax, DWORD PTR -1208[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fstat@PLT
	cmp	eax, -1
	jne	.L6
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR -1160[rbp]
	and	eax, 61440
	cmp	eax, 32768
	je	.L7
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
.L7:
	mov	edi, 0
	call	umask@PLT
	mov	edx, DWORD PTR -1160[rbp]
	lea	rax, -1040[rbp]
	mov	esi, 578
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1204[rbp], eax
	cmp	DWORD PTR -1204[rbp], 0
	jns	.L8
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L8:
	mov	rdx, QWORD PTR -1136[rbp]
	mov	eax, DWORD PTR -1204[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ftruncate@PLT
	mov	rax, QWORD PTR -1136[rbp]
	mov	rsi, rax
	mov	eax, DWORD PTR -1208[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 1
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -1200[rbp], rax
	cmp	QWORD PTR -1200[rbp], -1
	jne	.L9
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -1208[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -1136[rbp]
	mov	rsi, rax
	mov	eax, DWORD PTR -1204[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 2
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -1192[rbp], rax
	cmp	QWORD PTR -1192[rbp], -1
	jne	.L10
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	edi, -1
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -1204[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -1136[rbp]
	mov	rdx, rax
	mov	rcx, QWORD PTR -1200[rbp]
	mov	rax, QWORD PTR -1192[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	mov	rax, QWORD PTR -1136[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -1200[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	cmp	eax, -1
	jne	.L11
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L14
.L11:
	mov	rax, QWORD PTR -1136[rbp]
	mov	rdx, rax
	mov	rax, QWORD PTR -1192[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	cmp	eax, -1
	jne	.L13
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L14
.L13:
	mov	eax, 0
.L14:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"60741.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Debe introducirse el archivo a copiar y opcionalmen"
	.ascii	"te el nombre del fichero de salida\000"
	.align	2
.LC1:
	.ascii	"%s(copy)\000"
	.align	2
.LC2:
	.ascii	"\012Error en open del original\000"
	.align	2
.LC3:
	.ascii	"\012Error en fstat\000"
	.align	2
.LC4:
	.ascii	"\012El archivo no es regular\000"
	.align	2
.LC5:
	.ascii	"\012Error en open de la copia\000"
	.align	2
.LC6:
	.ascii	"\012Fallo en proyecci\303\263n del original\000"
	.align	2
.LC7:
	.ascii	"\012Fallo en proyecci\303\263n de la copia\000"
	.align	2
.LC8:
	.ascii	"\012Error al eliminar la proyecci\303\263n del orig"
	.ascii	"inal\000"
	.align	2
.LC9:
	.ascii	"\012Error al eliminar la proyecci\303\263n de la co"
	.ascii	"pia\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1152
	str	r0, [fp, #-1144]
	str	r1, [fp, #-1148]
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1144]
	cmp	r3, #1
	bgt	.L2
	ldr	r0, .L16+4
	bl	puts
	mvn	r0, #0
	bl	exit
.L2:
	ldr	r3, [fp, #-1144]
	cmp	r3, #3
	bne	.L3
	ldr	r3, [fp, #-1148]
	add	r3, r3, #8
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	b	.L4
.L3:
	ldr	r3, [fp, #-1148]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L16+8
	mov	r0, r3
	bl	sprintf
.L4:
	ldr	r3, [fp, #-1148]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-1140]
	ldr	r3, [fp, #-1140]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L16+12
	bl	perror
	mvn	r0, #0
	bl	exit
.L5:
	sub	r3, fp, #1120
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, [fp, #-1140]
	bl	fstat
	mov	r3, r0
	cmn	r3, #1
	bne	.L6
	ldr	r0, .L16+16
	bl	perror
	mvn	r0, #0
	bl	exit
.L6:
	ldr	r3, [fp, #-1108]
	and	r3, r3, #61440
	cmp	r3, #32768
	beq	.L7
	ldr	r0, .L16+20
	bl	puts
	mvn	r0, #0
	bl	exit
.L7:
	mov	r0, #0
	bl	umask
	ldr	r2, [fp, #-1108]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r1, .L16+24
	mov	r0, r3
	bl	open
	str	r0, [fp, #-1136]
	ldr	r3, [fp, #-1136]
	cmp	r3, #0
	bge	.L8
	ldr	r0, .L16+28
	bl	perror
	mvn	r0, #0
	bl	exit
.L8:
	ldr	r3, [fp, #-1080]
	mov	r1, r3
	ldr	r0, [fp, #-1136]
	bl	ftruncate
	ldr	r3, [fp, #-1080]
	mov	r1, r3
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-1140]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #1
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-1132]
	ldr	r3, [fp, #-1132]
	cmn	r3, #1
	bne	.L9
	ldr	r0, .L16+32
	bl	perror
	mvn	r0, #0
	bl	exit
.L9:
	ldr	r0, [fp, #-1140]
	bl	close
	ldr	r3, [fp, #-1080]
	mov	r1, r3
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-1136]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #2
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-1128]
	ldr	r3, [fp, #-1128]
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L16+36
	bl	perror
	mvn	r0, #0
	bl	exit
.L10:
	ldr	r0, [fp, #-1136]
	bl	close
	ldr	r3, [fp, #-1080]
	mov	r2, r3
	ldr	r1, [fp, #-1132]
	ldr	r0, [fp, #-1128]
	bl	memcpy
	ldr	r3, [fp, #-1080]
	mov	r1, r3
	ldr	r0, [fp, #-1132]
	bl	munmap
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L16+40
	bl	perror
	mvn	r3, #0
	b	.L14
.L11:
	ldr	r3, [fp, #-1080]
	mov	r1, r3
	ldr	r0, [fp, #-1128]
	bl	munmap
	mov	r3, r0
	cmn	r3, #1
	bne	.L13
	ldr	r0, .L16+44
	bl	perror
	mvn	r3, #0
	b	.L14
.L13:
	mov	r3, #0
.L14:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC10
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	578
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
