	.file	"31386825.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Stack Operations :"
.LC1:
	.string	"1. Print Stack"
.LC2:
	.string	"2. Push Stack"
.LC3:
	.string	"3. Pop Stack"
.LC4:
	.string	"9. Exit"
.LC5:
	.string	"Choice : "
.LC6:
	.string	"(empty)"
.LC7:
	.string	"Input : "
.LC8:
	.string	"Successful!"
	.align 8
.LC9:
	.string	"Invalid input(<= 0) or stack has not initialized!"
.LC10:
	.string	"Output : %d\n"
.LC11:
	.string	"Invalid choice! 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, 32
	call	newStack
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -16[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	jmp	.L2
.L13:
	lea	rdi, .LC5[rip]
	call	getInt
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], 9
	je	.L3
	cmp	DWORD PTR -16[rbp], 9
	jg	.L4
	cmp	DWORD PTR -16[rbp], 3
	je	.L5
	cmp	DWORD PTR -16[rbp], 3
	jg	.L4
	cmp	DWORD PTR -16[rbp], 1
	je	.L6
	cmp	DWORD PTR -16[rbp], 2
	je	.L7
	jmp	.L4
.L6:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	print_stack
	test	eax, eax
	jne	.L2
	lea	rdi, .LC6[rip]
	call	puts@PLT
	jmp	.L2
.L7:
	lea	rdi, .LC7[rip]
	call	getInt
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	push
	test	eax, eax
	je	.L9
	lea	rdi, .LC8[rip]
	call	puts@PLT
	jmp	.L2
.L9:
	lea	rdi, .LC9[rip]
	call	puts@PLT
	jmp	.L2
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pop
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], -1
	jne	.L11
	lea	rdi, .LC6[rip]
	call	puts@PLT
	jmp	.L2
.L11:
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L2
.L3:
	mov	DWORD PTR -20[rbp], 1
	jmp	.L2
.L4:
	lea	rdi, .LC11[rip]
	call	puts@PLT
	nop
.L2:
	cmp	DWORD PTR -20[rbp], 0
	je	.L13
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	freeStack
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	newStack
	.type	newStack, @function
newStack:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	esi, 16
	mov	edi, 1
	call	calloc@PLT
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	newStack, .-newStack
	.section	.rodata
.LC12:
	.string	"%d "
	.text
	.globl	print_stack
	.type	print_stack, @function
print_stack:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	cmp	QWORD PTR -24[rbp], 0
	je	.L18
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L19
.L18:
	mov	eax, 0
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L21
.L22:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC12[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
.L21:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L22
	mov	edi, 10
	call	putchar@PLT
	mov	eax, 1
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	print_stack, .-print_stack
	.globl	push
	.type	push, @function
push:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	cmp	QWORD PTR -24[rbp], 0
	je	.L24
	cmp	DWORD PTR -28[rbp], 0
	jg	.L25
.L24:
	mov	eax, 0
	jmp	.L26
.L25:
	mov	esi, 16
	mov	edi, 1
	call	calloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -28[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, 1
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	push, .-push
	.globl	pop
	.type	pop, @function
pop:
.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	QWORD PTR -24[rbp], rdi
	cmp	QWORD PTR -24[rbp], 0
	je	.L28
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L29
.L28:
	mov	eax, -1
	jmp	.L30
.L29:
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, DWORD PTR -12[rbp]
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pop, .-pop
	.globl	freeStack
	.type	freeStack, @function
freeStack:
.LFB11:
	.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	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	je	.L34
	nop
.L33:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	pop
	cmp	eax, -1
	jne	.L33
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L34:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	freeStack, .-freeStack
	.section	.rodata
.LC13:
	.string	"%s"
.LC14:
	.string	"%d"
	.text
	.globl	getInt
	.type	getInt, @function
getInt:
.LFB12:
	.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	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -12[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	getInt, .-getInt
	.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	"31386825.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Stack Operations :\000"
	.align	2
.LC1:
	.ascii	"1. Print Stack\000"
	.align	2
.LC2:
	.ascii	"2. Push Stack\000"
	.align	2
.LC3:
	.ascii	"3. Pop Stack\000"
	.align	2
.LC4:
	.ascii	"9. Exit\000"
	.align	2
.LC5:
	.ascii	"Choice : \000"
	.align	2
.LC6:
	.ascii	"(empty)\000"
	.align	2
.LC7:
	.ascii	"Input : \000"
	.align	2
.LC8:
	.ascii	"Successful!\000"
	.align	2
.LC9:
	.ascii	"Invalid input(<= 0) or stack has not initialized!\000"
	.align	2
.LC10:
	.ascii	"Output : %d\012\000"
	.align	2
.LC11:
	.ascii	"Invalid choice! Try again!\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
	bl	newStack
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r0, .L16
	bl	puts
	ldr	r0, .L16+4
	bl	puts
	ldr	r0, .L16+8
	bl	puts
	ldr	r0, .L16+12
	bl	puts
	ldr	r0, .L16+16
	bl	puts
	b	.L2
.L14:
	ldr	r0, .L16+20
	bl	getInt
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	cmp	r3, #8
	ldrls	pc, [pc, r3, asl #2]
	b	.L3
.L5:
	.word	.L8
	.word	.L7
	.word	.L6
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L4
.L8:
	ldr	r0, [fp, #-16]
	bl	print_stack
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L16+24
	bl	puts
	b	.L2
.L7:
	ldr	r0, .L16+28
	bl	getInt
	mov	r3, r0
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	push
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L16+32
	bl	puts
	b	.L2
.L10:
	ldr	r0, .L16+36
	bl	puts
	b	.L2
.L6:
	ldr	r0, [fp, #-16]
	bl	pop
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L12
	ldr	r0, .L16+24
	bl	puts
	b	.L2
.L12:
	ldr	r1, [fp, #-8]
	ldr	r0, .L16+40
	bl	printf
	b	.L2
.L4:
	mov	r3, #1
	str	r3, [fp, #-20]
	b	.L2
.L3:
	ldr	r0, .L16+44
	bl	puts
	nop
.L2:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L14
	ldr	r0, [fp, #-16]
	bl	freeStack
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.align	2
	.global	newStack
	.syntax unified
	.arm
	.fpu softvfp
	.type	newStack, %function
newStack:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	mov	r1, #8
	mov	r0, #1
	bl	calloc
	mov	r3, r0
	mov	r0, r3
	pop	{fp, pc}
	.size	newStack, .-newStack
	.section	.rodata
	.align	2
.LC12:
	.ascii	"%d \000"
	.text
	.align	2
	.global	print_stack
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_stack, %function
print_stack:
	@ 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]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L21
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L22
.L21:
	mov	r3, #0
	b	.L23
.L22:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	b	.L24
.L25:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L26
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
.L24:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L25
	mov	r0, #10
	bl	putchar
	mov	r3, #1
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L27:
	.align	2
.L26:
	.word	.LC12
	.size	print_stack, .-print_stack
	.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
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L29
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bgt	.L30
.L29:
	mov	r3, #0
	b	.L31
.L30:
	mov	r1, #8
	mov	r0, #1
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	mov	r3, #1
.L31:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	push, .-push
	.align	2
	.global	pop
	.syntax unified
	.arm
	.fpu softvfp
	.type	pop, %function
pop:
	@ 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]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L33
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L34
.L33:
	mvn	r3, #0
	b	.L35
.L34:
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	ldr	r0, [fp, #-12]
	bl	free
	ldr	r3, [fp, #-8]
.L35:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	pop, .-pop
	.align	2
	.global	freeStack
	.syntax unified
	.arm
	.fpu softvfp
	.type	freeStack, %function
freeStack:
	@ 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
	beq	.L39
	nop
.L38:
	ldr	r0, [fp, #-8]
	bl	pop
	mov	r3, r0
	cmn	r3, #1
	bne	.L38
	ldr	r0, [fp, #-8]
	bl	free
.L39:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	freeStack, .-freeStack
	.section	.rodata
	.align	2
.LC13:
	.ascii	"%s\000"
	.align	2
.LC14:
	.ascii	"%d\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getInt
	.syntax unified
	.arm
	.fpu softvfp
	.type	getInt, %function
getInt:
	@ 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]
	ldr	r3, .L43
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-16]
	ldr	r0, .L43+4
	bl	printf
	sub	r3, fp, #12
	mov	r1, r3
	ldr	r0, .L43+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-12]
	ldr	r2, .L43
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L42
	bl	__stack_chk_fail
.L42:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L44:
	.align	2
.L43:
	.word	.LC15
	.word	.LC13
	.word	.LC14
	.size	getInt, .-getInt
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
