	.file	"35669.c"
	.intel_syntax noprefix
	.text
	.local	output_stream
	.comm	output_stream,8,8
	.globl	menu
	.section	.rodata
.LC0:
	.string	"a - add new record"
.LC1:
	.string	"d - delete record"
.LC2:
	.string	"q - quit"
	.section	.data.rel.local,"aw"
	.align 32
	.type	menu, @object
	.size	menu, 32
menu:
	.quad	.LC0
	.quad	.LC1
	.quad	.LC2
	.quad	0
	.section	.rodata
.LC3:
	.string	"You are not a terminal, OK.\n"
.LC4:
	.string	"r"
.LC5:
	.string	"/dev/tty"
.LC6:
	.string	"w"
.LC7:
	.string	"Unable to open /dev/tty\n"
.LC8:
	.string	"could not set attributes\n"
.LC9:
	.string	"Please select an action"
.LC10:
	.string	"You have chosen: %c\n"
	.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, 176
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -164[rbp], 0
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	edi, eax
	call	isatty@PLT
	test	eax, eax
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 28
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
.L2:
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	fopen@PLT
	mov	QWORD PTR -160[rbp], rax
	lea	rsi, .LC6[rip]
	lea	rdi, .LC5[rip]
	call	fopen@PLT
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -160[rbp], 0
	je	.L3
	cmp	QWORD PTR -152[rbp], 0
	jne	.L4
.L3:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -160[rbp]
	mov	rdi, rax
	call	fileno@PLT
	mov	edx, eax
	lea	rax, -144[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	tcgetattr@PLT
	mov	rax, QWORD PTR -144[rbp]
	mov	rdx, QWORD PTR -136[rbp]
	mov	QWORD PTR -80[rbp], rax
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR -128[rbp]
	mov	rdx, QWORD PTR -120[rbp]
	mov	QWORD PTR -64[rbp], rax
	mov	QWORD PTR -56[rbp], rdx
	mov	rax, QWORD PTR -112[rbp]
	mov	rdx, QWORD PTR -104[rbp]
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR -96[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -88[rbp]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -3
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -9
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -2
	mov	DWORD PTR -68[rbp], eax
	mov	BYTE PTR -57[rbp], 1
	mov	BYTE PTR -58[rbp], 0
	mov	rax, QWORD PTR -160[rbp]
	mov	rdi, rax
	call	fileno@PLT
	mov	ecx, eax
	lea	rax, -80[rbp]
	mov	rdx, rax
	mov	esi, 0
	mov	edi, ecx
	call	tcsetattr@PLT
	test	eax, eax
	je	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 25
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
.L6:
	mov	rdx, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR -160[rbp]
	mov	rcx, rdx
	mov	rdx, rax
	lea	rsi, menu[rip]
	lea	rdi, .LC9[rip]
	call	getchoice
	mov	DWORD PTR -164[rbp], eax
	mov	eax, DWORD PTR -164[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -164[rbp], 113
	jne	.L6
	mov	rax, QWORD PTR -160[rbp]
	mov	rdi, rax
	call	fileno@PLT
	mov	ecx, eax
	lea	rax, -144[rbp]
	mov	rdx, rax
	mov	esi, 0
	mov	edi, ecx
	call	tcsetattr@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC11:
	.string	"cup"
.LC12:
	.string	"clear"
.LC13:
	.string	"Choice: %s"
	.align 8
.LC14:
	.string	"Incorrect choice, select again\n"
	.text
	.globl	getchoice
	.type	getchoice, @function
getchoice:
.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, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	QWORD PTR -80[rbp], rcx
	mov	DWORD PTR -40[rbp], 0
	mov	DWORD PTR -32[rbp], 10
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	fileno@PLT
	mov	edx, 0
	mov	esi, eax
	mov	edi, 0
	call	setupterm@PLT
	lea	rdi, .LC11[rip]
	call	tigetstr@PLT
	mov	QWORD PTR -16[rbp], rax
	lea	rdi, .LC12[rip]
	call	tigetstr@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -36[rbp], 4
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, char_to_terminal[rip]
	mov	esi, 1
	mov	rdi, rax
	call	tputs@PLT
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	tparm@PLT
	lea	rdx, char_to_terminal[rip]
	mov	esi, 1
	mov	rdi, rax
	call	tputs@PLT
	mov	rdx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -80[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -36[rbp], 2
	mov	rax, QWORD PTR -64[rbp]
	mov	QWORD PTR -24[rbp], rax
	jmp	.L9
.L10:
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	tparm@PLT
	lea	rdx, char_to_terminal[rip]
	mov	esi, 1
	mov	rdi, rax
	call	tputs@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -80[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fputs@PLT
	add	DWORD PTR -36[rbp], 1
	add	QWORD PTR -24[rbp], 8
.L9:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L10
	mov	rax, QWORD PTR -80[rbp]
	mov	rsi, rax
	mov	edi, 10
	call	fputc@PLT
.L16:
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR -28[rbp], eax
	mov	rax, QWORD PTR -64[rbp]
	mov	QWORD PTR -24[rbp], rax
	jmp	.L11
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	cmp	DWORD PTR -28[rbp], eax
	jne	.L12
	mov	DWORD PTR -40[rbp], 1
	jmp	.L13
.L12:
	add	QWORD PTR -24[rbp], 8
.L11:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L14
.L13:
	cmp	DWORD PTR -40[rbp], 0
	jne	.L15
	mov	edx, DWORD PTR -32[rbp]
	mov	ecx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	tparm@PLT
	lea	rdx, char_to_terminal[rip]
	mov	esi, 1
	mov	rdi, rax
	call	tputs@PLT
	mov	rax, QWORD PTR -80[rbp]
	mov	rcx, rax
	mov	edx, 31
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
.L15:
	cmp	DWORD PTR -40[rbp], 0
	je	.L16
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, char_to_terminal[rip]
	mov	esi, 1
	mov	rdi, rax
	call	tputs@PLT
	mov	eax, DWORD PTR -28[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	getchoice, .-getchoice
	.globl	char_to_terminal
	.type	char_to_terminal, @function
char_to_terminal:
.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
	mov	rax, QWORD PTR output_stream[rip]
	test	rax, rax
	je	.L19
	mov	rdx, QWORD PTR output_stream[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
.L19:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	char_to_terminal, .-char_to_terminal
	.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	"35669.c"
	.text
	.local	output_stream
	.comm	output_stream,4,4
	.global	menu
	.section	.rodata
	.align	2
.LC0:
	.ascii	"a - add new record\000"
	.align	2
.LC1:
	.ascii	"d - delete record\000"
	.align	2
.LC2:
	.ascii	"q - quit\000"
	.data
	.align	2
	.type	menu, %object
	.size	menu, 16
menu:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	0
	.section	.rodata
	.align	2
.LC3:
	.ascii	"You are not a terminal, OK.\012\000"
	.align	2
.LC4:
	.ascii	"r\000"
	.align	2
.LC5:
	.ascii	"/dev/tty\000"
	.align	2
.LC6:
	.ascii	"w\000"
	.align	2
.LC7:
	.ascii	"Unable to open /dev/tty\012\000"
	.align	2
.LC8:
	.ascii	"could not set attributes\012\000"
	.align	2
.LC9:
	.ascii	"Please select an action\000"
	.align	2
.LC10:
	.ascii	"You have chosen: %c\012\000"
	.align	2
.LC11:
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-140]
	ldr	r3, .L8+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	mov	r3, r0
	mov	r0, r3
	bl	isatty
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L8+8
	ldr	r3, [r3]
	mov	r2, #28
	mov	r1, #1
	ldr	r0, .L8+12
	bl	fwrite
.L2:
	ldr	r1, .L8+16
	ldr	r0, .L8+20
	bl	fopen
	str	r0, [fp, #-136]
	ldr	r1, .L8+24
	ldr	r0, .L8+20
	bl	fopen
	str	r0, [fp, #-132]
	ldr	r3, [fp, #-136]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-132]
	cmp	r3, #0
	bne	.L4
.L3:
	ldr	r3, .L8+8
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L8+28
	bl	fwrite
	mov	r0, #1
	bl	exit
.L4:
	ldr	r0, [fp, #-136]
	bl	fileno
	mov	r2, r0
	sub	r3, fp, #128
	mov	r1, r3
	mov	r0, r2
	bl	tcgetattr
	sub	ip, fp, #68
	sub	lr, fp, #128
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2}
	stm	ip, {r0, r1, r2}
	ldr	r3, [fp, #-56]
	bic	r3, r3, #2
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	bic	r3, r3, #8
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	bic	r3, r3, #1
	str	r3, [fp, #-56]
	mov	r3, #1
	strb	r3, [fp, #-45]
	mov	r3, #0
	strb	r3, [fp, #-46]
	ldr	r0, [fp, #-136]
	bl	fileno
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #0
	bl	tcsetattr
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L8+8
	ldr	r3, [r3]
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L8+32
	bl	fwrite
.L6:
	ldr	r3, [fp, #-132]
	ldr	r2, [fp, #-136]
	ldr	r1, .L8+36
	ldr	r0, .L8+40
	bl	getchoice
	str	r0, [fp, #-140]
	ldr	r1, [fp, #-140]
	ldr	r0, .L8+44
	bl	printf
	ldr	r3, [fp, #-140]
	cmp	r3, #113
	bne	.L6
	ldr	r0, [fp, #-136]
	bl	fileno
	sub	r3, fp, #128
	mov	r2, r3
	mov	r1, #0
	bl	tcsetattr
	mov	r0, #0
	bl	exit
.L9:
	.align	2
.L8:
	.word	.LC11
	.word	stdout
	.word	stderr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	menu
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.section	.rodata
	.align	2
.LC12:
	.ascii	"cup\000"
	.align	2
.LC13:
	.ascii	"clear\000"
	.align	2
.LC14:
	.ascii	"Choice: %s\000"
	.align	2
.LC15:
	.ascii	"Incorrect choice, select again\012\000"
	.text
	.align	2
	.global	getchoice
	.syntax unified
	.arm
	.fpu softvfp
	.type	getchoice, %function
getchoice:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-32]
	mov	r3, #10
	str	r3, [fp, #-20]
	ldr	r0, [fp, #-52]
	bl	fileno
	mov	r3, r0
	mov	r2, #0
	mov	r1, r3
	mov	r0, #0
	bl	setupterm
	ldr	r0, .L20
	bl	tigetstr
	str	r0, [fp, #-16]
	ldr	r0, .L20+4
	bl	tigetstr
	str	r0, [fp, #-12]
	mov	r3, #4
	str	r3, [fp, #-28]
	ldr	r2, .L20+8
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	tputs
	ldr	r2, [fp, #-20]
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-16]
	bl	tparm
	mov	r3, r0
	ldr	r2, .L20+8
	mov	r1, #1
	mov	r0, r3
	bl	tputs
	ldr	r2, [fp, #-40]
	ldr	r1, .L20+12
	ldr	r0, [fp, #-52]
	bl	fprintf
	ldr	r3, [fp, #-28]
	add	r3, r3, #2
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-44]
	str	r3, [fp, #-24]
	b	.L11
.L12:
	ldr	r2, [fp, #-20]
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-16]
	bl	tparm
	mov	r3, r0
	ldr	r2, .L20+8
	mov	r1, #1
	mov	r0, r3
	bl	tputs
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldr	r1, [fp, #-52]
	mov	r0, r3
	bl	fputs
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	str	r3, [fp, #-24]
.L11:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L12
	ldr	r1, [fp, #-52]
	mov	r0, #10
	bl	fputc
.L18:
	ldr	r0, [fp, #-52]
	bl	fflush
	ldr	r0, [fp, #-48]
	bl	fgetc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-44]
	str	r3, [fp, #-24]
	b	.L13
.L16:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-8]
	cmp	r3, r2
	bne	.L14
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L15
.L14:
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	str	r3, [fp, #-24]
.L13:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L16
.L15:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L17
	ldr	r2, [fp, #-20]
	ldr	r1, [fp, #-28]
	ldr	r0, [fp, #-16]
	bl	tparm
	mov	r3, r0
	ldr	r2, .L20+8
	mov	r1, #1
	mov	r0, r3
	bl	tputs
	ldr	r3, [fp, #-52]
	mov	r2, #31
	mov	r1, #1
	ldr	r0, .L20+16
	bl	fwrite
.L17:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L18
	ldr	r2, .L20+8
	mov	r1, #1
	ldr	r0, [fp, #-12]
	bl	tputs
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC12
	.word	.LC13
	.word	char_to_terminal
	.word	.LC14
	.word	.LC15
	.size	getchoice, .-getchoice
	.align	2
	.global	char_to_terminal
	.syntax unified
	.arm
	.fpu softvfp
	.type	char_to_terminal, %function
char_to_terminal:
	@ 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, .L25
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L23
	ldr	r3, .L25
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	putc
.L23:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	output_stream
	.size	char_to_terminal, .-char_to_terminal
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
