	.file	"17670.c"
	.intel_syntax noprefix
	.text
	.globl	read_all
	.type	read_all, @function
read_all:
.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, 80
	mov	QWORD PTR -72[rbp], rdi
	mov	DWORD PTR -52[rbp], -1
	mov	QWORD PTR -48[rbp], -1
	mov	rax, QWORD PTR -72[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], -1
	je	.L2
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], -1
	je	.L2
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	cmp	rax, -1
	je	.L2
	mov	eax, 1
	jmp	.L3
.L2:
	mov	eax, 0
.L3:
	mov	DWORD PTR -56[rbp], eax
	mov	QWORD PTR -16[rbp], 0
	mov	QWORD PTR -8[rbp], -1
	cmp	DWORD PTR -56[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	test	rax, rax
	setne	al
	movzx	eax, al
	and	DWORD PTR -56[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR -8[rbp], rax
.L4:
	cmp	DWORD PTR -56[rbp], 0
	je	.L5
	mov	QWORD PTR -40[rbp], 0
	jmp	.L6
.L11:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -40[rbp]
	lea	rcx, [rdx+rax]
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -52[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], -1
	jne	.L7
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 4
	jne	.L8
	jmp	.L6
.L8:
	mov	DWORD PTR -56[rbp], 0
	jmp	.L6
.L7:
	cmp	QWORD PTR -24[rbp], 0
	jne	.L9
	mov	DWORD PTR -56[rbp], 0
	jmp	.L6
.L9:
	mov	rax, QWORD PTR -24[rbp]
	add	QWORD PTR -40[rbp], rax
.L6:
	cmp	DWORD PTR -56[rbp], 0
	je	.L10
	mov	rax, QWORD PTR -8[rbp]
	cmp	QWORD PTR -40[rbp], rax
	jb	.L11
.L10:
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
.L5:
	cmp	DWORD PTR -56[rbp], 0
	jne	.L12
	mov	rax, QWORD PTR -16[rbp]
	test	rax, rax
	je	.L13
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
.L13:
	mov	QWORD PTR -16[rbp], 0
	mov	QWORD PTR -8[rbp], -1
.L12:
	cmp	DWORD PTR -52[rbp], -1
	je	.L14
	mov	eax, DWORD PTR -52[rbp]
	mov	edi, eax
	call	close@PLT
.L14:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_all, .-read_all
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"Read error: %s\n"
	.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
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	read_all
	mov	QWORD PTR -16[rbp], rax
	mov	QWORD PTR -8[rbp], rdx
	mov	rax, QWORD PTR -16[rbp]
	test	rax, rax
	je	.L17
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L20
.L17:
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
.L20:
	leave
	.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	"17670.c"
	.text
	.align	2
	.global	read_all
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_all, %function
read_all:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	mvn	r3, #0
	str	r3, [fp, #-24]
	mvn	r3, #0
	str	r3, [fp, #-36]
	mov	r1, #0
	ldr	r0, [fp, #-44]
	bl	open
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	beq	.L2
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	lseek
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmn	r3, #1
	beq	.L2
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	lseek
	mov	r3, r0
	cmn	r3, #1
	beq	.L2
	mov	r3, #1
	b	.L3
.L2:
	mov	r3, #0
.L3:
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-12]
	mvn	r3, #0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	ldr	r3, [fp, #-32]
	and	r3, r3, r2
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-8]
.L4:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L5
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L6
.L11:
	ldr	r3, [fp, #-8]
	mov	r2, r3
	ldr	r3, [fp, #-28]
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-28]
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	read
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L7
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #4
	bne	.L8
	b	.L6
.L8:
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L6
.L7:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L9
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L6
.L9:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	str	r3, [fp, #-28]
.L6:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L10
	ldr	r3, [fp, #-8]
	mov	r2, r3
	ldr	r3, [fp, #-28]
	cmp	r3, r2
	bcc	.L11
.L10:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
.L5:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L13
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	free
.L13:
	mov	r3, #0
	str	r3, [fp, #-12]
	mvn	r3, #0
	str	r3, [fp, #-8]
.L12:
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	beq	.L14
	ldr	r0, [fp, #-24]
	bl	close
.L14:
	ldr	r3, [fp, #-40]
	mov	r2, r3
	sub	r3, fp, #12
	ldm	r3, {r0, r1}
	stm	r2, {r0, r1}
	ldr	r0, [fp, #-40]
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	read_all, .-read_all
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s\000"
	.align	2
.LC1:
	.ascii	"Read error: %s\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L22
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-28]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #16
	mov	r1, r2
	mov	r0, r3
	bl	read_all
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L17
	ldr	r3, [fp, #-16]
	mov	r1, r3
	ldr	r0, .L22+4
	bl	printf
	mov	r3, #0
	b	.L20
.L17:
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L22+8
	bl	printf
	mvn	r3, #0
.L20:
	ldr	r2, .L22
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
