	.file	"98020.c"
	.intel_syntax noprefix
	.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, 1104
	mov	DWORD PTR -1092[rbp], edi
	mov	QWORD PTR -1104[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -1092[rbp], 1
	jle	.L2
	mov	rax, QWORD PTR -1104[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 1
	jbe	.L2
	mov	rax, QWORD PTR -1104[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L2
	mov	rax, QWORD PTR -1104[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 97
	jne	.L2
	mov	eax, 1
	jmp	.L3
.L2:
	mov	eax, 0
.L3:
	mov	DWORD PTR -1060[rbp], eax
	cmp	DWORD PTR -1092[rbp], 1
	sete	al
	movzx	eax, al
	mov	DWORD PTR -1056[rbp], eax
	cmp	DWORD PTR -1056[rbp], 0
	jne	.L4
	mov	eax, DWORD PTR -1092[rbp]
	sub	eax, DWORD PTR -1060[rbp]
	sub	eax, 1
	jmp	.L5
.L4:
	mov	eax, 1
.L5:
	mov	DWORD PTR -1052[rbp], eax
	mov	eax, DWORD PTR -1052[rbp]
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -1048[rbp], rax
	cmp	DWORD PTR -1056[rbp], 0
	je	.L6
	mov	rax, QWORD PTR -1048[rbp]
	mov	DWORD PTR [rax], 1
	jmp	.L7
.L6:
	mov	DWORD PTR -1076[rbp], 0
	jmp	.L8
.L11:
	cmp	DWORD PTR -1060[rbp], 0
	je	.L9
	mov	eax, DWORD PTR -1076[rbp]
	cdqe
	add	rax, 2
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -1104[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 448
	mov	esi, 1089
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	jmp	.L10
.L9:
	mov	eax, DWORD PTR -1076[rbp]
	cdqe
	add	rax, 1
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -1104[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 448
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
.L10:
	mov	edx, DWORD PTR -1076[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	mov	rdx, QWORD PTR -1048[rbp]
	add	rdx, rcx
	mov	DWORD PTR [rdx], eax
	add	DWORD PTR -1076[rbp], 1
.L8:
	mov	eax, DWORD PTR -1092[rbp]
	sub	eax, DWORD PTR -1060[rbp]
	sub	eax, 1
	cmp	DWORD PTR -1076[rbp], eax
	jl	.L11
.L7:
	lea	rax, -1040[rbp]
	mov	edx, 1024
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -1072[rbp], eax
	jmp	.L12
.L15:
	mov	DWORD PTR -1068[rbp], 0
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -1072[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -1068[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	mov	rax, QWORD PTR -1048[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	lea	rcx, -1040[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	add	DWORD PTR -1068[rbp], 1
.L13:
	mov	eax, DWORD PTR -1068[rbp]
	cmp	eax, DWORD PTR -1052[rbp]
	jl	.L14
	lea	rax, -1040[rbp]
	mov	edx, 1024
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	mov	DWORD PTR -1072[rbp], eax
.L12:
	cmp	DWORD PTR -1072[rbp], 0
	jne	.L15
	mov	DWORD PTR -1064[rbp], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR -1064[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -1048[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	close@PLT
	add	DWORD PTR -1064[rbp], 1
.L16:
	mov	eax, DWORD PTR -1092[rbp]
	sub	eax, DWORD PTR -1060[rbp]
	sub	eax, 1
	cmp	DWORD PTR -1064[rbp], eax
	jl	.L17
	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	"98020.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 1072
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1072
	str	r0, [fp, #-1072]
	str	r1, [fp, #-1076]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-1072]
	cmp	r3, #1
	ble	.L2
	ldr	r3, [fp, #-1076]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #1
	bls	.L2
	ldr	r3, [fp, #-1076]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L2
	ldr	r3, [fp, #-1076]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #97
	bne	.L2
	mov	r3, #1
	b	.L3
.L2:
	mov	r3, #0
.L3:
	str	r3, [fp, #-1048]
	ldr	r3, [fp, #-1072]
	cmp	r3, #1
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	bne	.L4
	ldr	r2, [fp, #-1072]
	ldr	r3, [fp, #-1048]
	sub	r3, r2, r3
	sub	r3, r3, #1
	b	.L5
.L4:
	mov	r3, #1
.L5:
	str	r3, [fp, #-1040]
	ldr	r3, [fp, #-1040]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-1036]
	ldr	r3, [fp, #-1044]
	cmp	r3, #0
	beq	.L6
	ldr	r3, [fp, #-1036]
	mov	r2, #1
	str	r2, [r3]
	b	.L7
.L6:
	mov	r3, #0
	str	r3, [fp, #-1064]
	b	.L8
.L11:
	ldr	r3, [fp, #-1048]
	cmp	r3, #0
	beq	.L9
	ldr	r3, [fp, #-1064]
	add	r3, r3, #2
	lsl	r3, r3, #2
	ldr	r2, [fp, #-1076]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #448
	ldr	r1, .L20+4
	mov	r0, r3
	bl	open
	mov	r3, r0
	b	.L10
.L9:
	ldr	r3, [fp, #-1064]
	add	r3, r3, #1
	lsl	r3, r3, #2
	ldr	r2, [fp, #-1076]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #448
	ldr	r1, .L20+8
	mov	r0, r3
	bl	open
	mov	r3, r0
.L10:
	ldr	r2, [fp, #-1064]
	lsl	r2, r2, #2
	ldr	r1, [fp, #-1036]
	add	r2, r1, r2
	str	r3, [r2]
	ldr	r3, [fp, #-1064]
	add	r3, r3, #1
	str	r3, [fp, #-1064]
.L8:
	ldr	r2, [fp, #-1072]
	ldr	r3, [fp, #-1048]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-1064]
	cmp	r2, r3
	blt	.L11
.L7:
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-1060]
	b	.L12
.L15:
	mov	r3, #0
	str	r3, [fp, #-1056]
	b	.L13
.L14:
	ldr	r3, [fp, #-1056]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-1036]
	add	r3, r2, r3
	ldr	r0, [r3]
	ldr	r2, [fp, #-1060]
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	bl	write
	ldr	r3, [fp, #-1056]
	add	r3, r3, #1
	str	r3, [fp, #-1056]
.L13:
	ldr	r2, [fp, #-1056]
	ldr	r3, [fp, #-1040]
	cmp	r2, r3
	blt	.L14
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r2, #1024
	mov	r1, r3
	mov	r0, #0
	bl	read
	str	r0, [fp, #-1060]
.L12:
	ldr	r3, [fp, #-1060]
	cmp	r3, #0
	bne	.L15
	mov	r3, #0
	str	r3, [fp, #-1052]
	b	.L16
.L17:
	ldr	r3, [fp, #-1052]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-1036]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	close
	ldr	r3, [fp, #-1052]
	add	r3, r3, #1
	str	r3, [fp, #-1052]
.L16:
	ldr	r2, [fp, #-1072]
	ldr	r3, [fp, #-1048]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-1052]
	cmp	r2, r3
	blt	.L17
	mov	r3, #0
	ldr	r2, .L20
	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}
.L21:
	.align	2
.L20:
	.word	.LC0
	.word	1089
	.word	577
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
