	.file	"198580273.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"read()"
.LC1:
	.string	"fcntl()"
.LC2:
	.string	"written %d bytes, errno = %d\n"
	.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
	lea	r11, -999424[rsp]
.LPSRL0:
	sub	rsp, 4096
	or	DWORD PTR [rsp], 0
	cmp	rsp, r11
	jne	.LPSRL0
	sub	rsp, 640
	mov	DWORD PTR -1000052[rbp], edi
	mov	QWORD PTR -1000064[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -1000016[rbp]
	mov	edx, 1000000
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -1000036[rbp], eax
	cmp	DWORD PTR -1000036[rbp], 0
	jns	.L2
	lea	rdi, .LC0[rip]
	call	error
.L2:
	mov	edx, 0
	mov	esi, 3
	mov	edi, 1
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -1000032[rbp], eax
	cmp	DWORD PTR -1000032[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	error
.L3:
	or	DWORD PTR -1000032[rbp], 2048
	mov	eax, DWORD PTR -1000032[rbp]
	mov	edx, eax
	mov	esi, 4
	mov	edi, 1
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -1000032[rbp], eax
	cmp	DWORD PTR -1000032[rbp], 0
	jns	.L4
	lea	rdi, .LC1[rip]
	call	error
.L4:
	lea	rax, -1000016[rbp]
	mov	QWORD PTR -1000024[rbp], rax
	jmp	.L5
.L6:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 0
	mov	eax, DWORD PTR -1000036[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -1000024[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	mov	DWORD PTR -1000028[rbp], eax
	call	__errno_location@PLT
	mov	ecx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -1000028[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	cmp	DWORD PTR -1000028[rbp], 0
	jle	.L5
	mov	eax, DWORD PTR -1000028[rbp]
	cdqe
	add	QWORD PTR -1000024[rbp], rax
	mov	eax, DWORD PTR -1000028[rbp]
	sub	DWORD PTR -1000036[rbp], eax
.L5:
	cmp	DWORD PTR -1000036[rbp], 0
	jg	.L6
	and	DWORD PTR -1000032[rbp], -2049
	mov	eax, DWORD PTR -1000032[rbp]
	mov	edx, eax
	mov	esi, 4
	mov	edi, 1
	mov	eax, 0
	call	fcntl@PLT
	mov	DWORD PTR -1000032[rbp], eax
	cmp	DWORD PTR -1000032[rbp], 0
	jns	.L7
	lea	rdi, .LC1[rip]
	call	error
.L7:
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	.cfi_endproc
.LFE7:
	.size	error, .-error
	.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	"198580273.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"read()\000"
	.align	2
.LC1:
	.ascii	"fcntl()\000"
	.align	2
.LC2:
	.ascii	"written %d bytes, errno = %d\012\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1000032
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #999424
	sub	sp, sp, #612
	sub	r3, fp, #999424
	sub	r3, r3, #12
	str	r0, [r3, #-604]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	str	r1, [r3, #-608]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	sub	r3, r3, #580
	ldr	r2, .L9+4
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [r4, #-592]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-592]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L9+8
	bl	error
.L2:
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r4, r3
	mov	r2, #0
	mov	r1, #3
	mov	r0, #1
	bl	fcntl
	str	r0, [r4, #-588]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-588]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L9+12
	bl	error
.L3:
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-588]
	orr	r3, r3, #2048
	str	r3, [r2, #-588]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r2, [r3, #-588]
	mov	r1, #4
	mov	r0, #1
	bl	fcntl
	str	r0, [r4, #-588]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-588]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L9+12
	bl	error
.L4:
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	sub	r3, r3, #580
	str	r3, [r2, #-596]
	b	.L5
.L6:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #0
	str	r2, [r3]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-592]
	sub	r2, fp, #999424
	sub	r2, r2, #12
	mov	r4, r2
	sub	r2, fp, #999424
	sub	r2, r2, #12
	mov	r1, r2
	mov	r2, r3
	ldr	r1, [r1, #-596]
	mov	r0, #1
	bl	write
	str	r0, [r4, #-584]
	ldr	r3, .L9+16
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	sub	r2, fp, #999424
	sub	r2, r2, #12
	ldr	r2, [r2, #-584]
	ldr	r1, .L9+20
	mov	r0, r4
	bl	fprintf
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-596]
	str	r3, [r2, #-596]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-592]
	str	r3, [r2, #-592]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-584]
	cmp	r3, #0
	ble	.L5
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-584]
	sub	r2, fp, #999424
	sub	r2, r2, #12
	mov	r1, r2
	sub	r2, fp, #999424
	sub	r2, r2, #12
	ldr	r2, [r2, #-596]
	add	r3, r2, r3
	str	r3, [r1, #-596]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r2, [r2, #-592]
	ldr	r3, [r3, #-584]
	sub	r3, r2, r3
	str	r3, [r1, #-592]
.L5:
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-592]
	cmp	r3, #0
	bgt	.L6
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-588]
	bic	r3, r3, #2048
	str	r3, [r2, #-588]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r2, [r3, #-588]
	mov	r1, #4
	mov	r0, #1
	bl	fcntl
	str	r0, [r4, #-588]
	sub	r3, fp, #999424
	sub	r3, r3, #12
	ldr	r3, [r3, #-588]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L9+12
	bl	error
.L7:
	mov	r0, #0
	bl	exit
.L10:
	.align	2
.L9:
	.word	.LC3
	.word	1000000
	.word	.LC0
	.word	.LC1
	.word	stderr
	.word	.LC2
	.size	main, .-main
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ 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	r0, [fp, #-8]
	bl	perror
	mov	r0, #1
	bl	exit
	.size	error, .-error
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
