	.file	"423129.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"Unable to open file!"
	.text
	.globl	read_file
	.type	read_file, @function
read_file:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	edi, 4096
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 1
	call	_exit@PLT
.L2:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4096
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_file, .-read_file
	.section	.rodata
.LC2:
	.string	"/flag.txt"
	.text
	.globl	read_flag
	.type	read_flag, @function
read_flag:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC2[rip]
	call	read_file
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	read_flag, .-read_flag
	.section	.rodata
.LC3:
	.string	"\nToo slow!"
	.text
	.globl	timeout
	.type	timeout, @function
timeout:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	edi, 1
	call	_exit@PLT
	.cfi_endproc
.LFE8:
	.size	timeout, .-timeout
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	directory
	.align 8
	.type	directory, @object
	.size	directory, 8
directory:
	.zero	8
	.globl	directory_entry
	.align 8
	.type	directory_entry, @object
	.size	directory_entry, 8
directory_entry:
	.zero	8
	.section	.rodata
	.align 8
.LC4:
	.string	"Current working directory is: "
.LC5:
	.string	"pwd"
.LC6:
	.string	"ls -1"
	.align 8
.LC7:
	.string	"Enter a filename to print the contents of the file =>"
	.align 8
.LC8:
	.string	"This cat doesn't like the alphabet 'n' :/"
.LC9:
	.string	"."
	.align 8
.LC10:
	.string	"Unable to open current directory to list files!"
.LC11:
	.string	"File contents:"
.LC12:
	.string	"Hint: Flag is at %p\n"
.LC13:
	.string	"%39s"
.LC14:
	.string	"Hint: Input is at %p\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR stdin[rip]
	mov	ecx, 0
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	setvbuf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	ecx, 0
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	setvbuf@PLT
	mov	rax, QWORD PTR stderr[rip]
	mov	ecx, 0
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	setvbuf@PLT
	lea	rsi, timeout[rip]
	mov	edi, 14
	call	signal@PLT
	mov	eax, 0
	call	read_flag
	mov	QWORD PTR -56[rbp], rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC5[rip]
	call	system@PLT
	lea	rdi, .LC6[rip]
	call	system@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	BYTE PTR -48[rbp], 0
	mov	DWORD PTR i[rip], 0
	jmp	.L8
.L11:
	mov	eax, DWORD PTR i[rip]
	cdqe
	movzx	eax, BYTE PTR -48[rbp+rax]
	cmp	al, 110
	jne	.L9
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L15
.L9:
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L8:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 39
	jle	.L11
	lea	rdi, .LC9[rip]
	call	opendir@PLT
	mov	QWORD PTR directory[rip], rax
	mov	rax, QWORD PTR directory[rip]
	test	rax, rax
	jne	.L13
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L15
.L14:
	mov	rax, QWORD PTR directory_entry[rip]
	lea	rdx, 19[rax]
	lea	rax, -48[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L13
	lea	rdi, .LC11[rip]
	call	puts@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	read_file
	mov	rdi, rax
	call	puts@PLT
	mov	eax, 0
	jmp	.L15
.L13:
	mov	rax, QWORD PTR directory[rip]
	mov	rdi, rax
	call	readdir@PLT
	mov	QWORD PTR directory_entry[rip], rax
	mov	rax, QWORD PTR directory_entry[rip]
	test	rax, rax
	jne	.L14
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	lea	rax, -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
.L15:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	"423129.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"Unable to open file!\000"
	.text
	.align	2
	.global	read_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_file, %function
read_file:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	mov	r0, #4096
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r1, .L4
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L4+4
	bl	puts
	mov	r0, #1
	bl	_exit
.L2:
	ldr	r3, [fp, #-8]
	mov	r2, #1
	mov	r1, #4096
	ldr	r0, [fp, #-12]
	bl	fread
	ldr	r0, [fp, #-8]
	bl	fclose
	ldr	r3, [fp, #-12]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.word	.LC1
	.size	read_file, .-read_file
	.section	.rodata
	.align	2
.LC2:
	.ascii	"/flag.txt\000"
	.text
	.align	2
	.global	read_flag
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_flag, %function
read_flag:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L8
	bl	read_file
	mov	r3, r0
	mov	r0, r3
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC2
	.size	read_flag, .-read_flag
	.section	.rodata
	.align	2
.LC3:
	.ascii	"\012Too slow!\000"
	.text
	.align	2
	.global	timeout
	.syntax unified
	.arm
	.fpu softvfp
	.type	timeout, %function
timeout:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L11
	bl	puts
	mov	r0, #1
	bl	_exit
.L12:
	.align	2
.L11:
	.word	.LC3
	.size	timeout, .-timeout
	.comm	i,4,4
	.comm	directory,4,4
	.comm	directory_entry,4,4
	.section	.rodata
	.align	2
.LC4:
	.ascii	"Current working directory is: \000"
	.align	2
.LC5:
	.ascii	"pwd\000"
	.align	2
.LC6:
	.ascii	"ls -1\000"
	.align	2
.LC7:
	.ascii	"Enter a filename to print the contents of the file "
	.ascii	"=>\000"
	.align	2
.LC8:
	.ascii	"This cat doesn't like the alphabet 'n' :/\000"
	.align	2
.LC9:
	.ascii	".\000"
	.align	2
.LC10:
	.ascii	"Unable to open current directory to list files!\000"
	.align	2
.LC11:
	.ascii	"File contents:\000"
	.align	2
.LC12:
	.ascii	"Hint: Flag is at %p\012\000"
	.align	2
.LC13:
	.ascii	"%39s\000"
	.align	2
.LC14:
	.ascii	"Hint: Input is at %p\012\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L23+4
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	ldr	r3, .L23+8
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	ldr	r3, .L23+12
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	ldr	r1, .L23+16
	mov	r0, #14
	bl	signal
	bl	read_flag
	str	r0, [fp, #-52]
	ldr	r0, .L23+20
	bl	printf
	ldr	r0, .L23+24
	bl	system
	ldr	r0, .L23+28
	bl	system
	ldr	r0, .L23+32
	bl	puts
	mov	r3, #0
	strb	r3, [fp, #-48]
	ldr	r3, .L23+36
	mov	r2, #0
	str	r2, [r3]
	b	.L14
.L17:
	ldr	r3, .L23+36
	ldr	r3, [r3]
	sub	r2, fp, #4
	add	r3, r2, r3
	ldrb	r3, [r3, #-44]	@ zero_extendqisi2
	cmp	r3, #110
	bne	.L15
	ldr	r0, .L23+40
	bl	puts
	mov	r3, #1
	b	.L21
.L15:
	ldr	r3, .L23+36
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L23+36
	str	r3, [r2]
.L14:
	ldr	r3, .L23+36
	ldr	r3, [r3]
	cmp	r3, #39
	ble	.L17
	ldr	r0, .L23+44
	bl	opendir
	mov	r3, r0
	ldr	r2, .L23+48
	str	r3, [r2]
	ldr	r3, .L23+48
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L19
	ldr	r0, .L23+52
	bl	puts
	mov	r3, #1
	b	.L21
.L20:
	ldr	r3, .L23+56
	ldr	r3, [r3]
	add	r2, r3, #11
	sub	r3, fp, #48
	mov	r1, r2
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L19
	ldr	r0, .L23+60
	bl	puts
	sub	r3, fp, #48
	mov	r0, r3
	bl	read_file
	mov	r3, r0
	mov	r0, r3
	bl	puts
	mov	r3, #0
	b	.L21
.L19:
	ldr	r3, .L23+48
	ldr	r3, [r3]
	mov	r0, r3
	bl	readdir
	mov	r3, r0
	ldr	r2, .L23+56
	str	r3, [r2]
	ldr	r3, .L23+56
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L20
	ldr	r1, [fp, #-52]
	ldr	r0, .L23+64
	bl	printf
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L23+68
	bl	__isoc99_scanf
	sub	r3, fp, #48
	mov	r0, r3
	bl	printf
	mov	r0, #10
	bl	putchar
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L23+72
	bl	printf
	ldr	r1, [fp, #-52]
	ldr	r0, .L23+64
	bl	printf
	mov	r3, #1
.L21:
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC15
	.word	stdin
	.word	stdout
	.word	stderr
	.word	timeout
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	i
	.word	.LC8
	.word	.LC9
	.word	directory
	.word	.LC10
	.word	directory_entry
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
