	.file	"50136902.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"mytail: missing operand(s)"
	.align 8
.LC1:
	.string	"mytail: invalid number of lines -- '%s'\n"
.LC2:
	.string	"mytail: missing filepath"
.LC3:
	.string	"open"
.LC4:
	.string	"stat"
.LC5:
	.string	"lseek"
.LC6:
	.string	"read"
.LC7:
	.string	"\n"
.LC8:
	.string	"write"
	.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, 1248
	mov	DWORD PTR -1236[rbp], edi
	mov	QWORD PTR -1248[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1236[rbp], 1
	jg	.L2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -1248[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L3
	mov	rax, QWORD PTR -1248[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -1224[rbp], eax
	cmp	DWORD PTR -1224[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR -1248[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	cmp	DWORD PTR -1236[rbp], 2
	jne	.L5
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	rax, QWORD PTR -1248[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1040[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	jmp	.L6
.L3:
	mov	DWORD PTR -1224[rbp], 10
	mov	rax, QWORD PTR -1248[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	lea	rax, -1040[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
.L6:
	lea	rax, -1040[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -1212[rbp], eax
	cmp	DWORD PTR -1212[rbp], -1
	jne	.L7
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L7:
	lea	rdx, -1200[rbp]
	lea	rax, -1040[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	jne	.L8
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	rax, QWORD PTR -1152[rbp]
	mov	QWORD PTR -1208[rbp], rax
	mov	DWORD PTR -1220[rbp], 0
	mov	DWORD PTR -1216[rbp], 0
	jmp	.L9
.L15:
	sub	QWORD PTR -1208[rbp], 1
	mov	rcx, QWORD PTR -1208[rbp]
	mov	eax, DWORD PTR -1212[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	cmp	rax, -1
	jne	.L10
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	lea	rcx, -1042[rbp]
	mov	eax, DWORD PTR -1212[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, -1
	jne	.L11
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L11:
	lea	rax, -1042[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L12
	add	DWORD PTR -1220[rbp], 1
.L12:
	add	DWORD PTR -1216[rbp], 1
	mov	rax, QWORD PTR -1152[rbp]
	cmp	DWORD PTR -1216[rbp], eax
	jne	.L9
	mov	eax, DWORD PTR -1212[rbp]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	lseek@PLT
	cmp	rax, -1
	jne	.L20
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -1220[rbp]
	cmp	eax, DWORD PTR -1224[rbp]
	jle	.L15
	jmp	.L16
.L20:
	nop
	jmp	.L16
.L17:
	lea	rax, -1042[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 1
	call	write@PLT
	cmp	rax, -1
	jne	.L16
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L16:
	lea	rcx, -1042[rbp]
	mov	eax, DWORD PTR -1212[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jne	.L17
	mov	eax, DWORD PTR -1212[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	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	"50136902.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"mytail: missing operand(s)\000"
	.align	2
.LC1:
	.ascii	"mytail: invalid number of lines -- '%s'\012\000"
	.align	2
.LC2:
	.ascii	"mytail: missing filepath\000"
	.align	2
.LC3:
	.ascii	"open\000"
	.align	2
.LC4:
	.ascii	"stat\000"
	.align	2
.LC5:
	.ascii	"lseek\000"
	.align	2
.LC6:
	.ascii	"read\000"
	.align	2
.LC7:
	.ascii	"\012\000"
	.align	2
.LC8:
	.ascii	"write\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1152
	str	r0, [fp, #-1152]
	str	r1, [fp, #-1156]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1152]
	cmp	r3, #1
	bgt	.L2
	ldr	r0, .L21+4
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-1156]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L3
	ldr	r3, [fp, #-1156]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-1144]
	ldr	r3, [fp, #-1144]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-1156]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L21+8
	bl	printf
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-1152]
	cmp	r3, #2
	bne	.L5
	ldr	r0, .L21+12
	bl	puts
	mov	r0, #1
	bl	exit
.L5:
	ldr	r3, [fp, #-1156]
	add	r3, r3, #8
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	b	.L6
.L3:
	mov	r3, #10
	str	r3, [fp, #-1144]
	ldr	r3, [fp, #-1156]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
.L6:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-1128]
	ldr	r3, [fp, #-1128]
	cmn	r3, #1
	bne	.L7
	ldr	r0, .L21+16
	bl	perror
	mov	r0, #1
	bl	exit
.L7:
	sub	r2, fp, #1120
	sub	r2, r2, #4
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r2
	mov	r0, r3
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r0, .L21+20
	bl	perror
	mov	r0, #1
	bl	exit
.L8:
	ldr	r3, [fp, #-1080]
	str	r3, [fp, #-1132]
	mov	r3, #0
	str	r3, [fp, #-1140]
	mov	r3, #0
	str	r3, [fp, #-1136]
	b	.L9
.L15:
	ldr	r3, [fp, #-1132]
	sub	r3, r3, #1
	str	r3, [fp, #-1132]
	mov	r2, #0
	ldr	r1, [fp, #-1132]
	ldr	r0, [fp, #-1128]
	bl	lseek
	mov	r3, r0
	cmn	r3, #1
	bne	.L10
	ldr	r0, .L21+24
	bl	perror
	mov	r0, #1
	bl	exit
.L10:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-1128]
	bl	read
	mov	r3, r0
	cmn	r3, #1
	bne	.L11
	ldr	r0, .L21+28
	bl	perror
	mov	r0, #1
	bl	exit
.L11:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	ldr	r1, .L21+32
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-1140]
	add	r3, r3, #1
	str	r3, [fp, #-1140]
.L12:
	ldr	r3, [fp, #-1136]
	add	r3, r3, #1
	str	r3, [fp, #-1136]
	ldr	r3, [fp, #-1080]
	ldr	r2, [fp, #-1136]
	cmp	r2, r3
	bne	.L9
	mov	r2, #0
	mov	r1, #0
	ldr	r0, [fp, #-1128]
	bl	lseek
	mov	r3, r0
	cmn	r3, #1
	bne	.L20
	ldr	r0, .L21+24
	bl	perror
	mov	r0, #1
	bl	exit
.L9:
	ldr	r2, [fp, #-1140]
	ldr	r3, [fp, #-1144]
	cmp	r2, r3
	ble	.L15
	b	.L16
.L20:
	nop
	b	.L16
.L17:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #1
	mov	r1, r3
	mov	r0, #1
	bl	write
	mov	r3, r0
	cmn	r3, #1
	bne	.L16
	ldr	r0, .L21+36
	bl	perror
	mov	r0, #1
	bl	exit
.L16:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #8
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-1128]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bne	.L17
	ldr	r0, [fp, #-1128]
	bl	close
	mov	r3, #0
	ldr	r2, .L21
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC9
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
