	.file	"449948.c"
	.intel_syntax noprefix
	.text
	.globl	flag
	.bss
	.align 32
	.type	flag, @object
	.size	flag, 64
flag:
	.zero	64
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"flag.txt"
	.text
	.globl	setup
	.type	setup, @function
setup:
.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, 16
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, rax
	mov	esi, 64
	lea	rdi, flag[rip]
	call	fgets@PLT
	mov	eax, 0
	call	getegid@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	edx, DWORD PTR -12[rbp]
	mov	ecx, DWORD PTR -12[rbp]
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, ecx
	mov	edi, eax
	mov	eax, 0
	call	setresgid@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	setup, .-setup
	.section	.rodata
.LC2:
	.string	"Authenticate Me 2.0"
	.align 8
.LC3:
	.string	"--------------------------------"
.LC4:
	.string	"Enter your username: "
.LC5:
	.string	"admin"
.LC6:
	.string	"Don't pretent you're admin =("
.LC7:
	.string	"Enter your password: "
	.align 8
.LC8:
	.string	"Welcome admin! Here is your flag: %s"
.LC9:
	.string	"user"
	.align 8
.LC10:
	.string	"Welcome %s! You're authenticated!\n"
	.align 8
.LC11:
	.string	"Invalid Username %s or Password %s\n"
	.align 8
.LC12:
	.string	"Hint: Distance between user and pass is %i\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, 0
	call	setup
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -24[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	lea	rax, -24[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L3
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L8
.L3:
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -16[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	lea	rax, -24[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L5
	lea	rax, -16[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L5
	lea	rsi, flag[rip]
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L5:
	lea	rax, -24[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L7
	lea	rax, -16[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L7
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L6
.L7:
	lea	rdx, -16[rbp]
	lea	rax, -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -24[rbp]
	lea	rdx, -16[rbp]
	sub	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
.L6:
	mov	eax, 0
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"449948.c"
	.text
	.comm	flag,64,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"flag.txt\000"
	.text
	.align	2
	.global	setup
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup, %function
setup:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r1, .L2
	ldr	r0, .L2+4
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r2, [fp, #-12]
	mov	r1, #64
	ldr	r0, .L2+8
	bl	fgets
	bl	getegid
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	setresgid
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L3:
	.align	2
.L2:
	.word	.LC0
	.word	.LC1
	.word	flag
	.size	setup, .-setup
	.section	.rodata
	.align	2
.LC2:
	.ascii	"Authenticate Me 2.0\000"
	.align	2
.LC3:
	.ascii	"--------------------------------\000"
	.align	2
.LC4:
	.ascii	"Enter your username: \000"
	.align	2
.LC5:
	.ascii	"admin\000"
	.align	2
.LC6:
	.ascii	"Don't pretent you're admin =(\000"
	.align	2
.LC7:
	.ascii	"Enter your password: \000"
	.align	2
.LC8:
	.ascii	"Welcome admin! Here is your flag: %s\000"
	.align	2
.LC9:
	.ascii	"user\000"
	.align	2
.LC10:
	.ascii	"Welcome %s! You're authenticated!\012\000"
	.align	2
.LC11:
	.ascii	"Invalid Username %s or Password %s\012\000"
	.align	2
.LC12:
	.ascii	"Hint: Distance between user and pass is %i\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	setup
	ldr	r0, .L12+4
	bl	puts
	ldr	r0, .L12+8
	bl	puts
	ldr	r0, .L12+12
	bl	printf
	sub	r3, fp, #24
	mov	r0, r3
	bl	gets
	sub	r3, fp, #24
	ldr	r1, .L12+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L12+20
	bl	puts
	mov	r3, #0
	b	.L10
.L5:
	ldr	r0, .L12+24
	bl	printf
	sub	r3, fp, #16
	mov	r0, r3
	bl	gets
	sub	r3, fp, #24
	ldr	r1, .L12+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	sub	r3, fp, #16
	ldr	r1, .L12+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	ldr	r1, .L12+28
	ldr	r0, .L12+32
	bl	printf
	b	.L8
.L7:
	sub	r3, fp, #24
	ldr	r1, .L12+36
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	sub	r3, fp, #16
	ldr	r1, .L12+36
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L9
	ldr	r0, .L12+40
	bl	printf
	b	.L8
.L9:
	sub	r2, fp, #16
	sub	r3, fp, #24
	mov	r1, r3
	ldr	r0, .L12+44
	bl	printf
	sub	r3, fp, #24
	sub	r2, fp, #16
	sub	r3, r3, r2
	mov	r1, r3
	ldr	r0, .L12+48
	bl	printf
.L8:
	mov	r3, #0
.L10:
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC13
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	flag
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
