	.file	"802158.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"--help"
	.align 8
.LC1:
	.string	"Usage: %s <filename> [r|R|w!s]\n"
.LC2:
	.string	"Err. open(%s): %s\n"
.LC3:
	.string	"Err. malloc()\n"
.LC4:
	.string	"Err. read()\n"
.LC5:
	.string	"%s: EOF\n"
.LC6:
	.string	"%s: "
.LC7:
	.string	"%02x "
.LC8:
	.string	"Err. write()\n"
.LC9:
	.string	"%s: wrote %ld bytes\n"
.LC10:
	.string	"Err. lseek()\n"
.LC11:
	.string	"%s: seek succeeded\n"
.LC12:
	.string	"aio"
	.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, 80
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	cmp	DWORD PTR -68[rbp], 2
	jle	.L2
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 6
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L3
.L2:
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 438
	mov	esi, 66
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], -1
	jne	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	DWORD PTR -52[rbp], 2
	jmp	.L5
.L23:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	eax, 119
	je	.L6
	cmp	eax, 119
	jg	.L7
	cmp	eax, 115
	je	.L8
	cmp	eax, 115
	jg	.L7
	cmp	eax, 82
	je	.L9
	cmp	eax, 114
	jne	.L7
.L9:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	cdqe
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 14
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	rdx, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 12
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L12
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L13
.L12:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -48[rbp], 0
	jmp	.L14
.L19:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 114
	jne	.L15
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -48[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rcx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 16384
	test	eax, eax
	je	.L16
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	jmp	.L17
.L16:
	mov	eax, 63
.L17:
	mov	edi, eax
	call	putchar@PLT
	jmp	.L18
.L15:
	mov	eax, DWORD PTR -48[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
.L18:
	add	DWORD PTR -48[rbp], 1
.L14:
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	cmp	QWORD PTR -8[rbp], rax
	jg	.L19
	mov	edi, 10
	call	putchar@PLT
.L13:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L20
.L6:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	lea	rcx, 1[rax]
	mov	eax, DWORD PTR -44[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], -1
	jne	.L21
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L21:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L20
.L8:
	mov	rax, QWORD PTR -80[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	cdqe
	mov	QWORD PTR -32[rbp], rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	cmp	rax, -1
	jne	.L22
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 13
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L20
.L7:
	lea	rdi, .LC12[rip]
	call	puts@PLT
.L20:
	add	DWORD PTR -52[rbp], 1
.L5:
	mov	eax, DWORD PTR -52[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jl	.L23
	mov	eax, 0
	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	"802158.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"--help\000"
	.align	2
.LC1:
	.ascii	"Usage: %s <filename> [r|R|w!s]\012\000"
	.align	2
.LC2:
	.ascii	"Err. open(%s): %s\012\000"
	.align	2
.LC3:
	.ascii	"Err. malloc()\012\000"
	.align	2
.LC4:
	.ascii	"Err. read()\012\000"
	.align	2
.LC5:
	.ascii	"%s: EOF\012\000"
	.align	2
.LC6:
	.ascii	"%s: \000"
	.align	2
.LC7:
	.ascii	"%02x \000"
	.align	2
.LC8:
	.ascii	"Err. write()\012\000"
	.align	2
.LC9:
	.ascii	"%s: wrote %ld bytes\012\000"
	.align	2
.LC10:
	.ascii	"Err. lseek()\012\000"
	.align	2
.LC11:
	.ascii	"%s: seek succeeded\012\000"
	.align	2
.LC12:
	.ascii	"aio\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #40
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	ble	.L2
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #6
	ldr	r1, .L25
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L3
.L2:
	ldr	r3, .L25+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-52]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L25+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L3:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r2, .L25+12
	mov	r1, #66
	mov	r0, r3
	bl	open
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmn	r3, #1
	bne	.L4
	ldr	r3, .L25+4
	ldr	r4, [r3]
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L25+16
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L4:
	mov	r3, #2
	str	r3, [fp, #-44]
	b	.L5
.L23:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #119
	beq	.L6
	cmp	r3, #119
	bgt	.L7
	cmp	r3, #115
	beq	.L8
	cmp	r3, #115
	bgt	.L7
	cmp	r3, #82
	beq	.L9
	cmp	r3, #114
	bne	.L7
.L9:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r0, [fp, #-24]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L10
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r2, #14
	mov	r1, #1
	ldr	r0, .L25+20
	bl	fwrite
	mov	r0, #1
	bl	exit
.L10:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-36]
	bl	read
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L11
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r2, #12
	mov	r1, #1
	ldr	r0, .L25+24
	bl	fwrite
	mov	r0, #1
	bl	exit
.L11:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+28
	bl	printf
	b	.L13
.L12:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+32
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L14
.L19:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #114
	bne	.L15
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	ldr	r1, [fp, #-20]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #16384
	cmp	r3, #0
	beq	.L16
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	b	.L17
.L16:
	mov	r3, #63
.L17:
	mov	r0, r3
	bl	putchar
	b	.L18
.L15:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L25+36
	bl	printf
.L18:
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L14:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L19
	mov	r0, #10
	bl	putchar
.L13:
	ldr	r0, [fp, #-20]
	bl	free
	b	.L20
.L6:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r4, r3, #1
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	add	r3, r3, #1
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, [fp, #-36]
	bl	write
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmn	r3, #1
	bne	.L21
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L25+40
	bl	fwrite
	mov	r0, #1
	bl	exit
.L21:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	mov	r1, r3
	ldr	r0, .L25+44
	bl	printf
	b	.L20
.L8:
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-28]
	mov	r2, #0
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-36]
	bl	lseek
	mov	r3, r0
	cmn	r3, #1
	bne	.L22
	ldr	r3, .L25+4
	ldr	r3, [r3]
	mov	r2, #13
	mov	r1, #1
	ldr	r0, .L25+48
	bl	fwrite
	mov	r0, #1
	bl	exit
.L22:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L25+52
	bl	printf
	b	.L20
.L7:
	ldr	r0, .L25+56
	bl	puts
.L20:
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L5:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	blt	.L23
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	438
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
