	.file	"1162121.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Program expects 4 parameters"
	.align 8
.LC1:
	.string	"Index file is not aligned properly"
	.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, 224
	mov	DWORD PTR -212[rbp], edi
	mov	QWORD PTR -224[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -212[rbp], 5
	je	.L2
	lea	rsi, .LC0[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L2:
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -192[rbp], eax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -188[rbp], eax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 24
	mov	rax, QWORD PTR [rax]
	mov	edx, 384
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -184[rbp], eax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 32
	mov	rax, QWORD PTR [rax]
	mov	edx, 384
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -180[rbp], eax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rdx, -160[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	rax, QWORD PTR -112[rbp]
	and	eax, 3
	test	rax, rax
	je	.L3
	lea	rsi, .LC1[rip]
	mov	edi, 2
	mov	eax, 0
	call	errx@PLT
.L3:
	mov	WORD PTR -194[rbp], 0
	jmp	.L4
.L9:
	movzx	eax, WORD PTR -176[rbp]
	movzx	ecx, ax
	mov	eax, DWORD PTR -192[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	edi, eax
	call	lseek@PLT
	lea	rcx, -195[rbp]
	mov	eax, DWORD PTR -192[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	movzx	eax, BYTE PTR -195[rbp]
	cmp	al, 65
	jle	.L4
	movzx	eax, BYTE PTR -195[rbp]
	cmp	al, 89
	jle	.L6
	jmp	.L4
.L6:
	lea	rcx, -195[rbp]
	mov	eax, DWORD PTR -184[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -168[rbp], 1
	jmp	.L7
.L8:
	lea	rcx, -195[rbp]
	mov	eax, DWORD PTR -192[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	add	QWORD PTR -168[rbp], rax
	lea	rcx, -195[rbp]
	mov	eax, DWORD PTR -184[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
.L7:
	movzx	eax, BYTE PTR -174[rbp]
	movzx	eax, al
	cmp	QWORD PTR -168[rbp], rax
	jl	.L8
	movzx	eax, WORD PTR -194[rbp]
	mov	WORD PTR -172[rbp], ax
	movzx	eax, BYTE PTR -174[rbp]
	mov	BYTE PTR -170[rbp], al
	mov	BYTE PTR -169[rbp], 0
	lea	rcx, -172[rbp]
	mov	eax, DWORD PTR -180[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	movzx	eax, BYTE PTR -174[rbp]
	movzx	eax, al
	add	WORD PTR -194[rbp], ax
.L4:
	lea	rcx, -176[rbp]
	mov	eax, DWORD PTR -188[rbp]
	mov	edx, 4
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	test	rax, rax
	jg	.L9
	mov	eax, DWORD PTR -192[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -188[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -184[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -180[rbp]
	mov	edi, eax
	call	close@PLT
	mov	edi, 0
	call	exit@PLT
	.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	"1162121.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Program expects 4 parameters\000"
	.align	2
.LC1:
	.ascii	"Index file is not aligned properly\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 = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	str	r0, [fp, #-136]
	str	r1, [fp, #-140]
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-136]
	cmp	r3, #5
	beq	.L2
	ldr	r1, .L11+4
	mov	r0, #1
	bl	errx
.L2:
	ldr	r3, [fp, #-140]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-116]
	ldr	r3, [fp, #-140]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	open
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-140]
	add	r3, r3, #12
	ldr	r3, [r3]
	mov	r2, #384
	ldr	r1, .L11+8
	mov	r0, r3
	bl	open
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-140]
	add	r3, r3, #16
	ldr	r3, [r3]
	mov	r2, #384
	ldr	r1, .L11+8
	mov	r0, r3
	bl	open
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-140]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r2, fp, #100
	mov	r1, r2
	mov	r0, r3
	bl	stat
	ldr	r3, [fp, #-56]
	and	r3, r3, #3
	cmp	r3, #0
	beq	.L3
	ldr	r1, .L11+12
	mov	r0, #2
	bl	errx
.L3:
	mov	r3, #0
	strh	r3, [fp, #-130]	@ movhi
	b	.L4
.L9:
	ldrh	r3, [fp, #-128]
	mov	r2, #0
	mov	r1, r3
	ldr	r0, [fp, #-116]
	bl	lseek
	sub	r3, fp, #131
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-116]
	bl	read
	ldrb	r3, [fp, #-131]	@ zero_extendqisi2
	cmp	r3, #65
	bls	.L4
	ldrb	r3, [fp, #-131]	@ zero_extendqisi2
	cmp	r3, #89
	bls	.L6
	b	.L4
.L6:
	sub	r3, fp, #131
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-108]
	bl	write
	mov	r3, #1
	str	r3, [fp, #-120]
	b	.L7
.L8:
	sub	r3, fp, #131
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-116]
	bl	read
	mov	r2, r0
	ldr	r3, [fp, #-120]
	add	r3, r3, r2
	str	r3, [fp, #-120]
	sub	r3, fp, #131
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-108]
	bl	write
.L7:
	ldrb	r3, [fp, #-126]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-120]
	cmp	r3, r2
	blt	.L8
	ldrh	r3, [fp, #-130]	@ movhi
	strh	r3, [fp, #-124]	@ movhi
	ldrb	r3, [fp, #-126]	@ zero_extendqisi2
	strb	r3, [fp, #-122]
	mov	r3, #0
	strb	r3, [fp, #-121]
	sub	r3, fp, #124
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-104]
	bl	write
	ldrb	r3, [fp, #-126]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldrh	r3, [fp, #-130]	@ movhi
	add	r3, r2, r3
	strh	r3, [fp, #-130]	@ movhi
.L4:
	sub	r3, fp, #128
	mov	r2, #4
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bgt	.L9
	ldr	r0, [fp, #-116]
	bl	close
	ldr	r0, [fp, #-112]
	bl	close
	ldr	r0, [fp, #-108]
	bl	close
	ldr	r0, [fp, #-104]
	bl	close
	mov	r0, #0
	bl	exit
.L12:
	.align	2
.L11:
	.word	.LC2
	.word	.LC0
	.word	577
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
