	.file	"887923.c"
	.intel_syntax noprefix
	.text
	.globl	clean_stdin
	.type	clean_stdin, @function
clean_stdin:
.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, 16
.L3:
	call	getchar@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 10
	je	.L4
	cmp	DWORD PTR -4[rbp], -1
	jne	.L3
.L4:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	clean_stdin, .-clean_stdin
	.section	.rodata
.LC0:
	.string	"Podaj nazwy plikow:"
.LC1:
	.string	"Couldn't open file"
	.align 8
.LC2:
	.string	"Podaj tekst do dopisania do pliku:"
.LC3:
	.string	"Files saved"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 2128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -2120[rbp], 0
	lea	rdi, .LC0[rip]
	call	puts@PLT
.L9:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -2016[rbp]
	mov	esi, 1000
	mov	rdi, rax
	call	fgets@PLT
	movzx	eax, BYTE PTR -2016[rbp]
	cmp	al, 10
	je	.L20
	lea	rax, -2016[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -2112[rbp], eax
	mov	eax, DWORD PTR -2112[rbp]
	cdqe
	lea	rdx, -1[rax]
	lea	rax, -2016[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -2120[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, -2096[rbp]
	add	rdx, rax
	lea	rax, -2016[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	open_file
	mov	DWORD PTR -2108[rbp], eax
	cmp	DWORD PTR -2108[rbp], 0
	jne	.L8
	add	DWORD PTR -2120[rbp], 1
.L8:
	cmp	DWORD PTR -2120[rbp], 5
	jle	.L9
	jmp	.L7
.L20:
	nop
.L7:
	cmp	DWORD PTR -2120[rbp], 0
	jne	.L10
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 4
	jmp	.L17
.L10:
	lea	rdi, .LC2[rip]
	call	puts@PLT
.L14:
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -1008[rbp]
	mov	esi, 1000
	mov	rdi, rax
	call	fgets@PLT
	movzx	eax, BYTE PTR -1008[rbp]
	cmp	al, 10
	je	.L21
	mov	edx, DWORD PTR -2120[rbp]
	lea	rax, -2096[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	find_min
	mov	QWORD PTR -2104[rbp], rax
	mov	rax, QWORD PTR -2104[rbp]
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1008[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fputs@PLT
	mov	rax, QWORD PTR -2104[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	ftell@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -2104[rbp]
	mov	DWORD PTR 8[rax], edx
	jmp	.L14
.L21:
	nop
	mov	DWORD PTR -2116[rbp], 0
	jmp	.L15
.L16:
	mov	eax, DWORD PTR -2116[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, -2096[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	close_file
	add	DWORD PTR -2116[rbp], 1
.L15:
	mov	eax, DWORD PTR -2116[rbp]
	cmp	eax, DWORD PTR -2120[rbp]
	jl	.L16
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 0
.L17:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
.LC4:
	.string	"a"
	.text
	.globl	open_file
	.type	open_file, @function
open_file:
.LFB2:
	.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	QWORD PTR -32[rbp], rsi
	cmp	QWORD PTR -24[rbp], 0
	je	.L23
	cmp	QWORD PTR -32[rbp], 0
	jne	.L24
.L23:
	mov	eax, 1
	jmp	.L25
.L24:
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L26
	mov	eax, 2
	jmp	.L25
.L26:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 8[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L27
	mov	eax, 2
	jmp	.L25
.L27:
	mov	eax, 0
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	open_file, .-open_file
	.globl	find_min
	.type	find_min, @function
find_min:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	cmp	QWORD PTR -24[rbp], 0
	je	.L29
	cmp	DWORD PTR -28[rbp], 0
	jg	.L30
.L29:
	mov	eax, 0
	jmp	.L31
.L30:
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR -12[rbp], eax
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L32
.L34:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L33
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR -12[rbp], eax
.L33:
	add	DWORD PTR -4[rbp], 1
.L32:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jl	.L34
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
.L31:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	find_min, .-find_min
	.globl	close_file
	.type	close_file, @function
close_file:
.LFB4:
	.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	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	je	.L39
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L39
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L35
.L39:
	nop
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	close_file, .-close_file
	.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	"887923.c"
	.text
	.align	2
	.global	clean_stdin
	.syntax unified
	.arm
	.fpu softvfp
	.type	clean_stdin, %function
clean_stdin:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
.L3:
	bl	getchar
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	beq	.L4
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L3
.L4:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	clean_stdin, .-clean_stdin
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Podaj nazwy plikow:\000"
	.align	2
.LC1:
	.ascii	"Couldn't open file\000"
	.align	2
.LC2:
	.ascii	"Podaj tekst do dopisania do pliku:\000"
	.align	2
.LC3:
	.ascii	"Files saved\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 = 2064
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #2064
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-2068]
	ldr	r0, .L22+4
	bl	puts
.L9:
	ldr	r3, .L22+8
	ldr	r2, [r3]
	sub	r3, fp, #2000
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #1000
	mov	r0, r3
	bl	fgets
	ldrb	r3, [fp, #-2008]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L20
	sub	r3, fp, #2000
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-2060]
	ldr	r3, [fp, #-2060]
	sub	r2, r3, #1
	sub	r3, fp, #2000
	sub	r3, r3, #4
	sub	r3, r3, #4
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-2068]
	lsl	r2, r3, #3
	sub	r3, fp, #2032
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r2, r3, r2
	sub	r3, fp, #2000
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	open_file
	str	r0, [fp, #-2056]
	ldr	r3, [fp, #-2056]
	cmp	r3, #0
	bne	.L8
	ldr	r3, [fp, #-2068]
	add	r3, r3, #1
	str	r3, [fp, #-2068]
.L8:
	ldr	r3, [fp, #-2068]
	cmp	r3, #5
	ble	.L9
	b	.L7
.L20:
	nop
.L7:
	ldr	r3, [fp, #-2068]
	cmp	r3, #0
	bne	.L10
	ldr	r0, .L22+12
	bl	puts
	mov	r3, #4
	b	.L17
.L10:
	ldr	r0, .L22+16
	bl	puts
.L14:
	ldr	r3, .L22+8
	ldr	r2, [r3]
	sub	r3, fp, #1008
	mov	r1, #1000
	mov	r0, r3
	bl	fgets
	ldrb	r3, [fp, #-1008]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L21
	sub	r3, fp, #2032
	sub	r3, r3, #4
	sub	r3, r3, #12
	ldr	r1, [fp, #-2068]
	mov	r0, r3
	bl	find_min
	str	r0, [fp, #-2052]
	ldr	r3, [fp, #-2052]
	ldr	r2, [r3]
	sub	r3, fp, #1008
	mov	r1, r2
	mov	r0, r3
	bl	fputs
	ldr	r3, [fp, #-2052]
	ldr	r3, [r3]
	mov	r0, r3
	bl	ftell
	mov	r2, r0
	ldr	r3, [fp, #-2052]
	str	r2, [r3, #4]
	b	.L14
.L21:
	nop
	mov	r3, #0
	str	r3, [fp, #-2064]
	b	.L15
.L16:
	ldr	r3, [fp, #-2064]
	lsl	r2, r3, #3
	sub	r3, fp, #2032
	sub	r3, r3, #4
	sub	r3, r3, #12
	add	r3, r3, r2
	mov	r0, r3
	bl	close_file
	ldr	r3, [fp, #-2064]
	add	r3, r3, #1
	str	r3, [fp, #-2064]
.L15:
	ldr	r2, [fp, #-2064]
	ldr	r3, [fp, #-2068]
	cmp	r2, r3
	blt	.L16
	ldr	r0, .L22+20
	bl	puts
	mov	r3, #0
.L17:
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC4
	.word	.LC0
	.word	stdin
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.section	.rodata
	.align	2
.LC5:
	.ascii	"a\000"
	.text
	.align	2
	.global	open_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	open_file, %function
open_file:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L25
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L26
.L25:
	mov	r3, #1
	b	.L27
.L26:
	ldr	r1, .L30
	ldr	r0, [fp, #-20]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L28
	mov	r3, #2
	b	.L27
.L28:
	ldr	r0, [fp, #-8]
	bl	ftell
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r0, [fp, #-8]
	bl	fclose
	ldr	r1, .L30
	ldr	r0, [fp, #-20]
	bl	fopen
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L29
	mov	r3, #2
	b	.L27
.L29:
	mov	r3, #0
.L27:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	.LC5
	.size	open_file, .-open_file
	.align	2
	.global	find_min
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_min, %function
find_min:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L33
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bgt	.L34
.L33:
	mov	r3, #0
	b	.L35
.L34:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L36
.L38:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L37
	ldr	r3, [fp, #-8]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	str	r3, [fp, #-16]
.L37:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L36:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	blt	.L38
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
.L35:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	find_min, .-find_min
	.align	2
	.global	close_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	close_file, %function
close_file:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L43
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L43
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	b	.L39
.L43:
	nop
.L39:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	close_file, .-close_file
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
