	.file	"99158.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Arguments expected.\n"
	.align 8
.LC1:
	.string	"Error with opening directory.\n"
.LC2:
	.string	"Directory not writable.\n"
.LC3:
	.string	"%s"
	.align 8
.LC4:
	.string	"Error while writing to files.\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 96
	mov	DWORD PTR -4180[rbp], edi
	mov	QWORD PTR -4192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -4180[rbp], 2
	jg	.L2
	lea	rsi, .LC0[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L2:
	mov	eax, DWORD PTR -4180[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -4192[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -4136[rbp], rax
	mov	rax, QWORD PTR -4136[rbp]
	mov	esi, 65536
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4156[rbp], eax
	cmp	DWORD PTR -4156[rbp], -1
	jne	.L3
	lea	rsi, .LC1[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L3:
	mov	rax, QWORD PTR -4136[rbp]
	mov	esi, 2
	mov	rdi, rax
	call	access@PLT
	mov	DWORD PTR -4152[rbp], eax
	cmp	DWORD PTR -4152[rbp], -1
	jne	.L4
	lea	rsi, .LC2[rip]
	mov	edi, 2
	mov	eax, 0
	call	err@PLT
.L4:
	mov	rax, QWORD PTR -4136[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -4148[rbp], eax
	mov	eax, DWORD PTR -4148[rbp]
	cdqe
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -4136[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	je	.L5
	mov	rax, QWORD PTR -4136[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -4136[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 47
	add	DWORD PTR -4148[rbp], 1
.L5:
	mov	rax, QWORD PTR -4136[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -4164[rbp], 1
	jmp	.L6
.L11:
	mov	edi, 255
	call	malloc@PLT
	mov	QWORD PTR -4128[rbp], rax
	mov	DWORD PTR -4160[rbp], 0
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -4160[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -4136[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -4160[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -4128[rbp]
	add	rdx, rcx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -4160[rbp], 1
.L7:
	mov	eax, DWORD PTR -4160[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -4136[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L8
	mov	eax, DWORD PTR -4164[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -4192[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -4128[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	mov	eax, DWORD PTR -4164[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -4192[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4144[rbp], eax
	mov	rax, QWORD PTR -4128[rbp]
	mov	edx, 384
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4140[rbp], eax
	jmp	.L9
.L10:
	mov	rdx, QWORD PTR -4120[rbp]
	lea	rcx, -4112[rbp]
	mov	eax, DWORD PTR -4140[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	cmp	QWORD PTR -4120[rbp], rax
	je	.L9
	mov	eax, DWORD PTR -4156[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -4144[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -4140[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rsi, .LC4[rip]
	mov	edi, 3
	mov	eax, 0
	call	err@PLT
.L9:
	lea	rcx, -4112[rbp]
	mov	eax, DWORD PTR -4144[rbp]
	mov	edx, 4096
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -4120[rbp], rax
	cmp	QWORD PTR -4120[rbp], 0
	jg	.L10
	mov	rax, QWORD PTR -4128[rbp]
	mov	rdi, rax
	call	free@PLT
	add	DWORD PTR -4164[rbp], 1
.L6:
	mov	eax, DWORD PTR -4180[rbp]
	sub	eax, 1
	cmp	DWORD PTR -4164[rbp], eax
	jl	.L11
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.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	"99158.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Arguments expected.\012\000"
	.align	2
.LC1:
	.ascii	"Error with opening directory.\012\000"
	.align	2
.LC2:
	.ascii	"Directory not writable.\012\000"
	.align	2
.LC3:
	.ascii	"/\000"
	.align	2
.LC4:
	.ascii	"%s\000"
	.align	2
.LC5:
	.ascii	"Error while writing to files.\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 4152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #4096
	sub	sp, sp, #60
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r0, [r3, #-52]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r1, [r3, #-56]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-52]
	cmp	r3, #2
	bgt	.L2
	ldr	r1, .L13+4
	mov	r0, #1
	bl	err
.L2:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-52]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-56]
	add	r3, r2, r3
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r3, [r3]
	str	r3, [r2, #-36]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r1, #16384
	ldr	r0, [r3, #-36]
	bl	open
	str	r0, [r4, #-32]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-32]
	cmn	r3, #1
	bne	.L3
	ldr	r1, .L13+8
	mov	r0, #2
	bl	err
.L3:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r1, #2
	ldr	r0, [r3, #-36]
	bl	access
	str	r0, [r4, #-28]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-28]
	cmn	r3, #1
	bne	.L4
	ldr	r1, .L13+12
	mov	r0, #2
	bl	err
.L4:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-36]
	bl	strlen
	mov	r3, r0
	sub	r2, fp, #4096
	sub	r2, r2, #12
	str	r3, [r2, #-24]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-24]
	sub	r3, r3, #1
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-36]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	beq	.L5
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-36]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-36]
	add	r3, r3, r2
	ldr	r2, .L13+16
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-24]
	add	r3, r3, #1
	str	r3, [r2, #-24]
.L5:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r1, [r3, #-36]
	ldr	r0, .L13+20
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #1
	str	r3, [r2, #-44]
	b	.L6
.L11:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	mov	r0, #255
	bl	malloc
	mov	r3, r0
	str	r3, [r4, #-20]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-40]
	b	.L7
.L8:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-40]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-36]
	add	r2, r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-40]
	sub	r1, fp, #4096
	sub	r1, r1, #12
	ldr	r1, [r1, #-20]
	add	r3, r1, r3
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-40]
	add	r3, r3, #1
	str	r3, [r2, #-40]
.L7:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-40]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-36]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L8
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-44]
	lsl	r3, r3, #2
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-56]
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	mov	r1, r3
	ldr	r0, [r2, #-20]
	bl	strcat
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-44]
	lsl	r3, r3, #2
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-56]
	add	r3, r2, r3
	ldr	r3, [r3]
	sub	r2, fp, #4096
	sub	r2, r2, #12
	mov	r4, r2
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [r4, #-16]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, #384
	ldr	r1, .L13+24
	ldr	r0, [r3, #-20]
	bl	open
	str	r0, [r4, #-12]
	b	.L9
.L10:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r3, #-8]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r1, fp, #4096
	sub	r1, r1, #12
	mov	r0, r1
	mov	r1, r3
	ldr	r0, [r0, #-12]
	bl	write
	mov	r2, r0
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmp	r3, r2
	beq	.L9
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-32]
	bl	close
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-16]
	bl	close
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-12]
	bl	close
	ldr	r1, .L13+28
	mov	r0, #3
	bl	err
.L9:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	sub	r2, fp, #4096
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #4096
	mov	r1, r3
	ldr	r0, [r0, #-16]
	bl	read
	str	r0, [r4, #-8]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-8]
	cmp	r3, #0
	bgt	.L10
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-20]
	bl	free
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-44]
	add	r3, r3, #1
	str	r3, [r2, #-44]
.L6:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-52]
	sub	r3, r3, #1
	sub	r2, fp, #4096
	sub	r2, r2, #12
	ldr	r2, [r2, #-44]
	cmp	r2, r3
	blt	.L11
	mov	r0, #0
	bl	exit
.L14:
	.align	2
.L13:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	577
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
