	.file	"247018082.c"
	.intel_syntax noprefix
	.text
	.globl	tempNode
	.bss
	.align 8
	.type	tempNode, @object
	.size	tempNode, 8
tempNode:
	.zero	8
	.section	.rodata
	.align 8
.LC0:
	.string	"Stack simulation using a linked list\n\r"
	.align 8
.LC1:
	.string	"1 - Push onto stack\n2 - Pop off of stack\n3 - Display stack\n4 - Exit"
.LC2:
	.string	"Enter option: "
.LC3:
	.string	"%d"
	.align 8
.LC4:
	.string	"Choice invalid, please try again."
	.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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
.L8:
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -12[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 4
	je	.L2
	cmp	eax, 4
	jg	.L3
	cmp	eax, 3
	je	.L4
	cmp	eax, 3
	jg	.L3
	cmp	eax, 1
	je	.L5
	cmp	eax, 2
	je	.L6
	jmp	.L3
.L5:
	mov	eax, 0
	call	push
	jmp	.L7
.L6:
	mov	eax, 0
	call	pop
	jmp	.L7
.L4:
	mov	eax, 0
	call	display
	jmp	.L7
.L2:
	mov	edi, 0
	call	exit@PLT
.L3:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	nop
.L7:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, 4
	jne	.L8
	mov	eax, 0
	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
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC5:
	.string	"Stack overflow (stack is full)"
	.align 8
.LC6:
	.string	"Enter a value to push onto the stack: "
	.text
	.globl	push
	.type	push, @function
push:
.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 16
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L12
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L16
.L12:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -20[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR tempNode[rip]
	test	rax, rax
	jne	.L14
	mov	edx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR tempNode[rip], rax
	jmp	.L16
.L14:
	mov	edx, DWORD PTR -20[rbp]
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], edx
	mov	rdx, QWORD PTR tempNode[rip]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR tempNode[rip], rax
.L16:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	push, .-push
	.section	.rodata
	.align 8
.LC7:
	.string	"Stack underflow (stack is empty)"
	.align 8
.LC8:
	.string	"%d has been popped from the stack\n"
	.text
	.globl	pop
	.type	pop, @function
pop:
.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	rax, QWORD PTR tempNode[rip]
	test	rax, rax
	jne	.L18
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L20
.L18:
	mov	rax, QWORD PTR tempNode[rip]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR tempNode[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR tempNode[rip]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR tempNode[rip], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
.L20:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pop, .-pop
	.section	.rodata
	.align 8
.LC9:
	.string	"The following values are contained within the stack:"
.LC10:
	.string	"%d\n"
	.text
	.globl	display
	.type	display, @function
display:
.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, 16
	mov	rax, QWORD PTR tempNode[rip]
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L22
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L26
.L22:
	lea	rdi, .LC9[rip]
	call	puts@PLT
	jmp	.L24
.L25:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
.L24:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L25
.L26:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	display, .-display
	.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	"247018082.c"
	.text
	.comm	tempNode,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Stack simulation using a linked list\012\015\000"
	.align	2
.LC1:
	.ascii	"1 - Push onto stack\0122 - Pop off of stack\0123 - "
	.ascii	"Display stack\0124 - Exit\000"
	.align	2
.LC2:
	.ascii	"Enter option: \000"
	.align	2
.LC3:
	.ascii	"%d\000"
	.align	2
.LC4:
	.ascii	"Choice invalid, please try again.\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.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
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L12+4
	bl	printf
.L9:
	ldr	r0, .L12+8
	bl	puts
	ldr	r0, .L12+12
	bl	printf
	sub	r3, fp, #12
	mov	r1, r3
	ldr	r0, .L12+16
	bl	__isoc99_scanf
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L2
.L4:
	.word	.L7
	.word	.L6
	.word	.L5
	.word	.L3
.L7:
	bl	push
	b	.L8
.L6:
	bl	pop
	b	.L8
.L5:
	bl	display
	b	.L8
.L3:
	mov	r0, #0
	bl	exit
.L2:
	ldr	r0, .L12+20
	bl	puts
	nop
.L8:
	ldr	r3, [fp, #-12]
	cmp	r3, #4
	bne	.L9
	mov	r3, #0
	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	.LC5
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Stack overflow (stack is full)\000"
	.align	2
.LC7:
	.ascii	"Enter a value to push onto the stack: \000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	push
	.syntax unified
	.arm
	.fpu softvfp
	.type	push, %function
push:
	@ 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, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L15
	ldr	r0, .L20+4
	bl	printf
	b	.L19
.L15:
	ldr	r0, .L20+8
	bl	printf
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L20+12
	bl	__isoc99_scanf
	ldr	r3, .L20+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L17
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r2, .L20+16
	ldr	r3, [fp, #-12]
	str	r3, [r2]
	b	.L19
.L17:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	str	r2, [r3]
	ldr	r3, .L20+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	str	r2, [r3, #4]
	ldr	r2, .L20+16
	ldr	r3, [fp, #-12]
	str	r3, [r2]
.L19:
	nop
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L18
	bl	__stack_chk_fail
.L18:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC8
	.word	.LC6
	.word	.LC7
	.word	.LC3
	.word	tempNode
	.size	push, .-push
	.section	.rodata
	.align	2
.LC9:
	.ascii	"Stack underflow (stack is empty)\000"
	.align	2
.LC10:
	.ascii	"%d has been popped from the stack\012\000"
	.text
	.align	2
	.global	pop
	.syntax unified
	.arm
	.fpu softvfp
	.type	pop, %function
pop:
	@ 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	r3, .L26
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L23
	ldr	r0, .L26+4
	bl	puts
	b	.L25
.L23:
	ldr	r3, .L26
	ldr	r3, [r3]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, .L26
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, .L26
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, .L26
	str	r3, [r2]
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r1, [fp, #-12]
	ldr	r0, .L26+8
	bl	printf
.L25:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	tempNode
	.word	.LC9
	.word	.LC10
	.size	pop, .-pop
	.section	.rodata
	.align	2
.LC11:
	.ascii	"The following values are contained within the stack"
	.ascii	":\000"
	.align	2
.LC12:
	.ascii	"%d\012\000"
	.text
	.align	2
	.global	display
	.syntax unified
	.arm
	.fpu softvfp
	.type	display, %function
display:
	@ 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	r3, .L34
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L29
	ldr	r0, .L34+4
	bl	puts
	b	.L33
.L29:
	ldr	r0, .L34+8
	bl	puts
	b	.L31
.L32:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L34+12
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
.L31:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L32
.L33:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L35:
	.align	2
.L34:
	.word	tempNode
	.word	.LC9
	.word	.LC11
	.word	.LC12
	.size	display, .-display
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
