	.file	"331921.c"
	.intel_syntax noprefix
	.text
	.globl	password
	.bss
	.align 8
	.type	password, @object
	.size	password, 8
password:
	.zero	8
	.globl	flag
	.align 8
	.type	flag, @object
	.size	flag, 8
flag:
	.zero	8
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"fopen"
.LC2:
	.string	"ftell"
.LC3:
	.string	"calloc"
.LC4:
	.string	"fread"
	.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	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L2
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	ftell@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L3
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	rewind@PLT
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	esi, 1
	mov	rdi, rax
	call	calloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR [rax], rdx
	cmp	QWORD PTR -32[rbp], 0
	jne	.L4
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	QWORD PTR -8[rbp], rax
	je	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	read_file, .-read_file
	.section	.rodata
.LC5:
	.string	"password.txt"
.LC6:
	.string	"flag.txt"
	.text
	.globl	setup
	.type	setup, @function
setup:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rsi, password[rip]
	lea	rdi, .LC5[rip]
	call	read_file
	lea	rsi, flag[rip]
	lea	rdi, .LC6[rip]
	call	read_file
	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
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	setup, .-setup
	.section	.rodata
.LC7:
	.string	"Password: "
.LC8:
	.string	"Flag: %s\n"
.LC9:
	.string	"Access denied."
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 144
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	setup
	mov	BYTE PTR -16[rbp], 0
	lea	rax, -144[rbp]
	mov	edx, 128
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -144[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	mov	rax, QWORD PTR password[rip]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR password[rip]
	lea	rax, -144[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L9
	mov	BYTE PTR -16[rbp], 1
.L9:
	movzx	eax, BYTE PTR -16[rbp]
	test	al, al
	je	.L10
	mov	rax, QWORD PTR flag[rip]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L10:
	lea	rdi, .LC9[rip]
	call	puts@PLT
.L11:
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"331921.c"
	.text
	.comm	password,4,4
	.comm	flag,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"fopen\000"
	.align	2
.LC2:
	.ascii	"ftell\000"
	.align	2
.LC3:
	.ascii	"calloc\000"
	.align	2
.LC4:
	.ascii	"fread\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]
	str	r1, [fp, #-20]
	ldr	r1, .L7
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L7+4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	mov	r2, #2
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	fseek
	ldr	r0, [fp, #-12]
	bl	ftell
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L3
	ldr	r0, .L7+8
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	ldr	r0, [fp, #-12]
	bl	rewind
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	mov	r1, #1
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L7+12
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-20]
	ldr	r0, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	mov	r1, #1
	bl	fread
	mov	r2, r0
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	beq	.L6
	ldr	r0, .L7+16
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	read_file, .-read_file
	.section	.rodata
	.align	2
.LC5:
	.ascii	"password.txt\000"
	.align	2
.LC6:
	.ascii	"flag.txt\000"
	.text
	.align	2
	.global	setup
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup, %function
setup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r1, .L10
	ldr	r0, .L10+4
	bl	read_file
	ldr	r1, .L10+8
	ldr	r0, .L10+12
	bl	read_file
	ldr	r3, .L10+16
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	ldr	r3, .L10+20
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	ldr	r3, .L10+24
	ldr	r0, [r3]
	mov	r3, #0
	mov	r2, #2
	mov	r1, #0
	bl	setvbuf
	nop
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	password
	.word	.LC5
	.word	flag
	.word	.LC6
	.word	stdin
	.word	stdout
	.word	stderr
	.size	setup, .-setup
	.section	.rodata
	.align	2
.LC7:
	.ascii	"Password: \000"
	.align	2
.LC8:
	.ascii	"Flag: %s\012\000"
	.align	2
.LC9:
	.ascii	"Access denied.\000"
	.align	2
.LC10:
	.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	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #140
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	bl	setup
	mov	r3, #0
	strb	r3, [fp, #-20]
	sub	r3, fp, #148
	mov	r2, #128
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r0, .L18+4
	bl	printf
	sub	r3, fp, #148
	mov	r0, r3
	bl	gets
	ldr	r3, .L18+8
	ldr	r4, [r3]
	ldr	r3, .L18+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	sub	r3, fp, #148
	mov	r1, r4
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L13
	mov	r3, #1
	strb	r3, [fp, #-20]
.L13:
	ldrb	r3, [fp, #-20]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L14
	ldr	r3, .L18+12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L18+16
	bl	printf
	b	.L15
.L14:
	ldr	r0, .L18+20
	bl	puts
.L15:
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC10
	.word	.LC7
	.word	password
	.word	flag
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
