	.file	"340459.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Buy low, sell high."
.LC1:
	.string	"Program error!"
.LC2:
	.string	"Bye."
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	jmp	.L2
.L7:
	cmp	DWORD PTR -4[rbp], 99
	je	.L3
	cmp	DWORD PTR -4[rbp], 99
	jg	.L4
	cmp	DWORD PTR -4[rbp], 97
	je	.L5
	cmp	DWORD PTR -4[rbp], 98
	je	.L6
	jmp	.L4
.L5:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L2
.L6:
	mov	edi, 7
	call	putchar@PLT
	jmp	.L2
.L3:
	call	count
	jmp	.L2
.L4:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	nop
.L2:
	call	get_choice
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 113
	jne	.L7
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.string	"Count how far? Enter an integer:"
.LC4:
	.string	"%d\n"
	.text
	.globl	count
	.type	count, @function
count:
.LFB1:
	.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	rdi, .LC3[rip]
	call	puts@PLT
	call	get_int
	mov	DWORD PTR -4[rbp], eax
	mov	DWORD PTR -8[rbp], 1
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -8[rbp], 1
.L10:
	mov	eax, DWORD PTR -8[rbp]
	cmp	eax, DWORD PTR -4[rbp]
	jle	.L11
	jmp	.L12
.L13:
	nop
.L12:
	call	getchar@PLT
	cmp	eax, 10
	jne	.L13
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	count, .-count
	.section	.rodata
	.align 8
.LC5:
	.string	"Enter the letter of your choice:"
.LC6:
	.string	"a. advice           b. bell"
.LC7:
	.string	"c. count            q. quit"
	.align 8
.LC8:
	.string	"Please respond with a, b, c, or q."
	.text
	.globl	get_choice
	.type	get_choice, @function
get_choice:
.LFB2:
	.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	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	lea	rdi, .LC7[rip]
	call	puts@PLT
	call	get_first
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
	jmp	.L15
.L18:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	call	get_first
	movsx	eax, al
	mov	DWORD PTR -4[rbp], eax
.L15:
	cmp	DWORD PTR -4[rbp], 96
	jle	.L16
	cmp	DWORD PTR -4[rbp], 99
	jle	.L17
.L16:
	cmp	DWORD PTR -4[rbp], 113
	jne	.L18
.L17:
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get_choice, .-get_choice
	.globl	get_first
	.type	get_first, @function
get_first:
.LFB3:
	.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
	call	getchar@PLT
	mov	DWORD PTR -4[rbp], eax
	jmp	.L21
.L22:
	nop
.L21:
	call	getchar@PLT
	cmp	eax, 10
	jne	.L22
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	get_first, .-get_first
	.section	.rodata
	.align 8
.LC9:
	.string	" is not an integer.\nPlease enter an "
	.align 8
.LC10:
	.string	"integer value, such as 25, -178, or 3: "
.LC11:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB4:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	jmp	.L25
.L27:
	movsx	eax, BYTE PTR -13[rbp]
	mov	edi, eax
	call	putchar@PLT
.L26:
	call	getchar@PLT
	mov	BYTE PTR -13[rbp], al
	cmp	BYTE PTR -13[rbp], 10
	jne	.L27
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L25:
	lea	rax, -12[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, 1
	jne	.L26
	mov	eax, DWORD PTR -12[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	get_int, .-get_int
	.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	"340459.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Buy low, sell high.\000"
	.align	2
.LC1:
	.ascii	"Program error!\000"
	.align	2
.LC2:
	.ascii	"Bye.\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	b	.L2
.L7:
	ldr	r3, [fp, #-8]
	cmp	r3, #99
	beq	.L3
	ldr	r3, [fp, #-8]
	cmp	r3, #99
	bgt	.L4
	ldr	r3, [fp, #-8]
	cmp	r3, #97
	beq	.L5
	ldr	r3, [fp, #-8]
	cmp	r3, #98
	beq	.L6
	b	.L4
.L5:
	ldr	r0, .L9
	bl	puts
	b	.L2
.L6:
	mov	r0, #7
	bl	putchar
	b	.L2
.L3:
	bl	count
	b	.L2
.L4:
	ldr	r0, .L9+4
	bl	puts
	nop
.L2:
	bl	get_choice
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #113
	bne	.L7
	ldr	r0, .L9+8
	bl	puts
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Count how far? Enter an integer:\000"
	.align	2
.LC4:
	.ascii	"%d\012\000"
	.text
	.align	2
	.global	count
	.syntax unified
	.arm
	.fpu softvfp
	.type	count, %function
count:
	@ 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	r0, .L16
	bl	puts
	bl	get_int
	str	r0, [fp, #-8]
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L12
.L13:
	ldr	r1, [fp, #-12]
	ldr	r0, .L16+4
	bl	printf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L12:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	ble	.L13
	b	.L14
.L15:
	nop
.L14:
	bl	getchar
	mov	r3, r0
	cmp	r3, #10
	bne	.L15
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC3
	.word	.LC4
	.size	count, .-count
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Enter the letter of your choice:\000"
	.align	2
.LC6:
	.ascii	"a. advice           b. bell\000"
	.align	2
.LC7:
	.ascii	"c. count            q. quit\000"
	.align	2
.LC8:
	.ascii	"Please respond with a, b, c, or q.\000"
	.text
	.align	2
	.global	get_choice
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_choice, %function
get_choice:
	@ 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	r0, .L24
	bl	puts
	ldr	r0, .L24+4
	bl	puts
	ldr	r0, .L24+8
	bl	puts
	bl	get_first
	mov	r3, r0
	str	r3, [fp, #-8]
	b	.L19
.L22:
	ldr	r0, .L24+12
	bl	puts
	bl	get_first
	mov	r3, r0
	str	r3, [fp, #-8]
.L19:
	ldr	r3, [fp, #-8]
	cmp	r3, #96
	ble	.L20
	ldr	r3, [fp, #-8]
	cmp	r3, #99
	ble	.L21
.L20:
	ldr	r3, [fp, #-8]
	cmp	r3, #113
	bne	.L22
.L21:
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.size	get_choice, .-get_choice
	.align	2
	.global	get_first
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_first, %function
get_first:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	getchar
	str	r0, [fp, #-8]
	b	.L27
.L28:
	nop
.L27:
	bl	getchar
	mov	r3, r0
	cmp	r3, #10
	bne	.L28
	ldr	r3, [fp, #-8]
	and	r3, r3, #255
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	get_first, .-get_first
	.section	.rodata
	.align	2
.LC9:
	.ascii	" is not an integer.\012Please enter an \000"
	.align	2
.LC10:
	.ascii	"integer value, such as 25, -178, or 3: \000"
	.align	2
.LC11:
	.ascii	"%d\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	get_int
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_int, %function
get_int:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	b	.L31
.L33:
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	mov	r0, r3
	bl	putchar
.L32:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-13]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L33
	ldr	r0, .L37+4
	bl	printf
	ldr	r0, .L37+8
	bl	printf
.L31:
	sub	r3, fp, #12
	mov	r1, r3
	ldr	r0, .L37+12
	bl	__isoc99_scanf
	mov	r3, r0
	cmp	r3, #1
	bne	.L32
	ldr	r3, [fp, #-12]
	ldr	r2, .L37
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L36
	bl	__stack_chk_fail
.L36:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC12
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	get_int, .-get_int
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
