	.file	"13308.c"
	.intel_syntax noprefix
	.text
	.globl	current_balance
	.data
	.align 4
	.type	current_balance, @object
	.size	current_balance, 4
current_balance:
	.long	10
	.section	.rodata
.LC0:
	.string	"r"
	.align 8
.LC1:
	.string	"/home/tripathy/Documents/CTF_Problems/Binaries/Bank/flag.txt"
	.text
	.globl	set_up_bank
	.type	set_up_bank, @function
set_up_bank:
.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, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -56[rbp], rax
	mov	rdx, QWORD PTR -56[rbp]
	lea	rax, -48[rbp]
	mov	esi, 37
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	puts@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	set_up_bank, .-set_up_bank
	.section	.rodata
	.align 8
.LC2:
	.string	"You cannot withdraw a negative amount of money."
	.align 8
.LC3:
	.string	"You cannot withdraw more money than you have."
	.text
	.globl	withdraw
	.type	withdraw, @function
withdraw:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 0
	jns	.L4
	lea	rdi, .LC2[rip]
	call	puts@PLT
	jmp	.L5
.L4:
	mov	eax, DWORD PTR current_balance[rip]
	sub	eax, DWORD PTR -4[rbp]
	test	eax, eax
	jns	.L5
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L5:
	mov	eax, DWORD PTR current_balance[rip]
	sub	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR current_balance[rip], eax
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	withdraw, .-withdraw
	.section	.rodata
	.align 8
.LC4:
	.string	"You cannot deposit a negative amount of money."
	.text
	.globl	deposit
	.type	deposit, @function
deposit:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 0
	jns	.L7
	lea	rdi, .LC4[rip]
	call	puts@PLT
.L7:
	mov	edx, DWORD PTR current_balance[rip]
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	mov	DWORD PTR current_balance[rip], eax
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	deposit, .-deposit
	.section	.rodata
	.align 8
.LC5:
	.string	"What is your bank account password?"
.LC6:
	.string	"hue_hue_psswd"
	.text
	.globl	validate_password
	.type	validate_password, @function
validate_password:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rax, -80[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	gets@PLT
	lea	rax, -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	call	strcmp@PLT
	test	eax, eax
	sete	al
	movzx	eax, al
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	validate_password, .-validate_password
	.section	.rodata
.LC7:
	.string	"Invalid arguments."
	.align 8
.LC8:
	.string	"./bank (withdraw|deposit) (amount)"
.LC9:
	.string	"Invalid password"
.LC10:
	.string	"withdraw"
.LC11:
	.string	"deposit"
.LC12:
	.string	"%s is not a valid action.\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.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	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	cmp	DWORD PTR -20[rbp], 3
	je	.L12
	lea	rdi, .LC7[rip]
	call	puts@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L13
.L12:
	mov	eax, 0
	call	validate_password
	cmp	eax, 1
	je	.L14
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L13
.L14:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L15
	lea	rax, withdraw[rip]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L16
.L15:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L17
	lea	rax, deposit[rip]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L16
.L17:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -2
	jmp	.L13
.L16:
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	edx, 10
	mov	esi, 0
	mov	rdi, rax
	call	strtol@PLT
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edi, edx
	call	rax
	mov	eax, 0
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	"13308.c"
	.text
	.global	current_balance
	.data
	.align	2
	.type	current_balance, %object
	.size	current_balance, 4
current_balance:
	.word	10
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"/home/tripathy/Documents/CTF_Problems/Binaries/Bank"
	.ascii	"/flag.txt\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	set_up_bank
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_up_bank, %function
set_up_bank:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	ldr	r3, .L3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L3+4
	ldr	r0, .L3+8
	bl	fopen
	str	r0, [fp, #-52]
	sub	r3, fp, #48
	ldr	r2, [fp, #-52]
	mov	r1, #37
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #48
	mov	r0, r3
	bl	puts
	nop
	ldr	r3, .L3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L2
	bl	__stack_chk_fail
.L2:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	set_up_bank, .-set_up_bank
	.section	.rodata
	.align	2
.LC3:
	.ascii	"You cannot withdraw a negative amount of money.\000"
	.align	2
.LC4:
	.ascii	"You cannot withdraw more money than you have.\000"
	.text
	.align	2
	.global	withdraw
	.syntax unified
	.arm
	.fpu softvfp
	.type	withdraw, %function
withdraw:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L8
	bl	puts
	b	.L7
.L6:
	ldr	r3, .L8+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L8+8
	bl	puts
.L7:
	ldr	r3, .L8+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	ldr	r2, .L8+4
	str	r3, [r2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC3
	.word	current_balance
	.word	.LC4
	.size	withdraw, .-withdraw
	.section	.rodata
	.align	2
.LC5:
	.ascii	"You cannot deposit a negative amount of money.\000"
	.text
	.align	2
	.global	deposit
	.syntax unified
	.arm
	.fpu softvfp
	.type	deposit, %function
deposit:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L12
	bl	puts
.L11:
	ldr	r3, .L12+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldr	r2, .L12+4
	str	r3, [r2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC5
	.word	current_balance
	.size	deposit, .-deposit
	.section	.rodata
	.align	2
.LC6:
	.ascii	"What is your bank account password?\000"
	.align	2
.LC7:
	.ascii	"hue_hue_psswd\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	validate_password
	.syntax unified
	.arm
	.fpu softvfp
	.type	validate_password, %function
validate_password:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L17+4
	bl	puts
	sub	r3, fp, #72
	mov	r0, r3
	bl	gets
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, .L17+8
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	ldr	r2, .L17
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC8
	.word	.LC6
	.word	.LC7
	.size	validate_password, .-validate_password
	.section	.rodata
	.align	2
.LC9:
	.ascii	"Invalid arguments.\000"
	.align	2
.LC10:
	.ascii	"./bank (withdraw|deposit) (amount)\000"
	.align	2
.LC11:
	.ascii	"Invalid password\000"
	.align	2
.LC12:
	.ascii	"withdraw\000"
	.align	2
.LC13:
	.ascii	"deposit\000"
	.align	2
.LC14:
	.ascii	"%s is not a valid action.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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	r3, [fp, #-16]
	cmp	r3, #3
	beq	.L20
	ldr	r0, .L26
	bl	puts
	ldr	r0, .L26+4
	bl	puts
	mov	r3, #1
	b	.L21
.L20:
	bl	validate_password
	mov	r3, r0
	cmp	r3, #1
	beq	.L22
	ldr	r0, .L26+8
	bl	puts
	mvn	r3, #0
	b	.L21
.L22:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L26+12
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L23
	ldr	r3, .L26+16
	str	r3, [fp, #-8]
	b	.L24
.L23:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L26+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L25
	ldr	r3, .L26+24
	str	r3, [fp, #-8]
	b	.L24
.L25:
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L26+28
	bl	printf
	mvn	r3, #1
	b	.L21
.L24:
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, #10
	mov	r1, #0
	mov	r0, r3
	bl	strtol
	mov	r2, r0
	ldr	r3, [fp, #-8]
	mov	r0, r2
	blx	r3
	mov	r3, #0
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	withdraw
	.word	.LC13
	.word	deposit
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
