	.file	"167455.c"
	.intel_syntax noprefix
	.text
	.globl	top
	.bss
	.align 8
	.type	top, @object
	.size	top, 8
top:
	.zero	8
	.globl	size
	.align 4
	.type	size, @object
	.size	size, 4
size:
	.zero	4
	.section	.rodata
.LC0:
	.string	"    STACK IMPLEMENTATION    "
.LC1:
	.string	"1. Push"
.LC2:
	.string	"2. Pop"
.LC3:
	.string	"3. Size"
.LC4:
	.string	"4. Exit"
.LC5:
	.string	"Enter your choice: "
.LC6:
	.string	"%d"
	.align 8
.LC7:
	.string	"Enter data to push into stack: "
.LC8:
	.string	"Data => %d\n"
.LC9:
	.string	"Stack size: %d\n"
.LC10:
	.string	"Exiting from app."
	.align 8
.LC11:
	.string	"Invalid choice, please try again."
.LC12:
	.string	"\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, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
.L9:
	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
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -16[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:
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -12[rbp]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	push
	jmp	.L7
.L6:
	mov	eax, 0
	call	pop
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, -2147483648
	je	.L11
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L11
.L4:
	mov	eax, DWORD PTR size[rip]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L7
.L2:
	lea	rdi, .LC10[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L3:
	lea	rdi, .LC11[rip]
	call	puts@PLT
	jmp	.L7
.L11:
	nop
.L7:
	lea	rdi, .LC12[rip]
	call	puts@PLT
	jmp	.L9
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC13:
	.string	"Stack Overflow, can't add more element to stack."
.LC14:
	.string	"Data pushed to 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	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR size[rip]
	cmp	eax, 999
	jle	.L13
	lea	rdi, .LC13[rip]
	call	puts@PLT
	jmp	.L12
.L13:
	mov	edi, 16
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	rdx, QWORD PTR top[rip]
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR top[rip], rax
	mov	eax, DWORD PTR size[rip]
	add	eax, 1
	mov	DWORD PTR size[rip], eax
	lea	rdi, .LC14[rip]
	call	puts@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	push, .-push
	.section	.rodata
.LC15:
	.string	"Stack is empty."
	.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	DWORD PTR -12[rbp], 0
	mov	eax, DWORD PTR size[rip]
	test	eax, eax
	jle	.L16
	mov	rax, QWORD PTR top[rip]
	test	rax, rax
	jne	.L17
.L16:
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	eax, -2147483648
	jmp	.L18
.L17:
	mov	rax, QWORD PTR top[rip]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR top[rip]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR top[rip]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR top[rip], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, DWORD PTR size[rip]
	sub	eax, 1
	mov	DWORD PTR size[rip], eax
	mov	eax, DWORD PTR -12[rbp]
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	pop, .-pop
	.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	"167455.c"
	.text
	.comm	top,4,4
	.global	size
	.bss
	.align	2
	.type	size, %object
	.size	size, 4
size:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"    STACK IMPLEMENTATION    \000"
	.align	2
.LC1:
	.ascii	"1. Push\000"
	.align	2
.LC2:
	.ascii	"2. Pop\000"
	.align	2
.LC3:
	.ascii	"3. Size\000"
	.align	2
.LC4:
	.ascii	"4. Exit\000"
	.align	2
.LC5:
	.ascii	"Enter your choice: \000"
	.align	2
.LC6:
	.ascii	"%d\000"
	.align	2
.LC7:
	.ascii	"Enter data to push into stack: \000"
	.align	2
.LC8:
	.ascii	"Data => %d\012\000"
	.align	2
.LC9:
	.ascii	"Stack size: %d\012\000"
	.align	2
.LC10:
	.ascii	"Exiting from app.\000"
	.align	2
.LC11:
	.ascii	"Invalid choice, please try again.\000"
	.align	2
.LC12:
	.ascii	"\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.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
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
.L10:
	ldr	r0, .L13+4
	bl	puts
	ldr	r0, .L13+8
	bl	puts
	ldr	r0, .L13+12
	bl	puts
	ldr	r0, .L13+16
	bl	puts
	ldr	r0, .L13+20
	bl	puts
	ldr	r0, .L13+24
	bl	printf
	sub	r3, fp, #16
	mov	r1, r3
	ldr	r0, .L13+28
	bl	__isoc99_scanf
	ldr	r3, [fp, #-16]
	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:
	ldr	r0, .L13+32
	bl	printf
	sub	r3, fp, #12
	mov	r1, r3
	ldr	r0, .L13+28
	bl	__isoc99_scanf
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	push
	b	.L8
.L6:
	bl	pop
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #-2147483648
	beq	.L12
	ldr	r3, [fp, #-12]
	mov	r1, r3
	ldr	r0, .L13+36
	bl	printf
	b	.L12
.L5:
	ldr	r3, .L13+40
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L13+44
	bl	printf
	b	.L8
.L3:
	ldr	r0, .L13+48
	bl	puts
	mov	r0, #0
	bl	exit
.L2:
	ldr	r0, .L13+52
	bl	puts
	b	.L8
.L12:
	nop
.L8:
	ldr	r0, .L13+56
	bl	puts
	b	.L10
.L14:
	.align	2
.L13:
	.word	.LC13
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	size
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.section	.rodata
	.align	2
.LC14:
	.ascii	"Stack Overflow, can't add more element to stack.\000"
	.align	2
.LC15:
	.ascii	"Data pushed to stack.\000"
	.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
	str	r0, [fp, #-16]
	ldr	r3, .L18
	ldr	r3, [r3]
	cmp	r3, #1000
	blt	.L16
	ldr	r0, .L18+4
	bl	puts
	b	.L15
.L16:
	mov	r0, #8
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, .L18+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r2, .L18+8
	ldr	r3, [fp, #-8]
	str	r3, [r2]
	ldr	r3, .L18
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L18
	str	r3, [r2]
	ldr	r0, .L18+12
	bl	puts
.L15:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	size
	.word	.LC14
	.word	top
	.word	.LC15
	.size	push, .-push
	.section	.rodata
	.align	2
.LC16:
	.ascii	"Stack is empty.\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
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, .L24
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L21
	ldr	r3, .L24+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L22
.L21:
	ldr	r0, .L24+8
	bl	puts
	mov	r3, #-2147483648
	b	.L23
.L22:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, .L24+4
	str	r3, [r2]
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r3, .L24
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L24
	str	r3, [r2]
	ldr	r3, [fp, #-12]
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	size
	.word	top
	.word	.LC16
	.size	pop, .-pop
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
