	.file	"23814.c"
	.intel_syntax noprefix
	.text
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 404
S:
	.zero	404
	.text
	.globl	IntialiseStack
	.type	IntialiseStack, @function
IntialiseStack:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR S[rip+400], -1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	IntialiseStack, .-IntialiseStack
	.globl	IsEmpty
	.type	IsEmpty, @function
IsEmpty:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR S[rip+400]
	cmp	eax, -1
	jne	.L3
	mov	eax, 1
	jmp	.L4
.L3:
	mov	eax, 0
.L4:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	IsEmpty, .-IsEmpty
	.section	.rodata
.LC0:
	.string	"stack overflow"
	.text
	.globl	Push
	.type	Push, @function
Push:
.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	eax, DWORD PTR S[rip+400]
	cmp	eax, 99
	jne	.L6
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	eax, DWORD PTR S[rip+400]
	add	eax, 1
	mov	DWORD PTR S[rip+400], eax
	mov	eax, DWORD PTR S[rip+400]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, S[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Push, .-Push
	.section	.rodata
.LC1:
	.string	"\nstack underflow"
	.text
	.globl	Pop
	.type	Pop, @function
Pop:
.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
	call	IsEmpty
	test	eax, eax
	je	.L8
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L8:
	mov	eax, DWORD PTR S[rip+400]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, S[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR S[rip+400]
	sub	eax, 1
	mov	DWORD PTR S[rip+400], eax
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	Pop, .-Pop
	.globl	StackTop
	.type	StackTop, @function
StackTop:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR S[rip+400]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, S[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	StackTop, .-StackTop
	.section	.rodata
.LC2:
	.string	"enter a number"
.LC3:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	call	IntialiseStack
	lea	rdi, .LC2[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
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -20[rbp]
	cdq
	shr	edx, 31
	add	eax, edx
	and	eax, 1
	sub	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	Push
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	DWORD PTR -20[rbp], eax
.L13:
	mov	eax, DWORD PTR -20[rbp]
	test	eax, eax
	jne	.L14
	jmp	.L15
.L16:
	call	Pop
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L15:
	call	IsEmpty
	test	eax, eax
	je	.L16
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.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	"23814.c"
	.text
	.comm	S,404,4
	.align	2
	.global	IntialiseStack
	.syntax unified
	.arm
	.fpu softvfp
	.type	IntialiseStack, %function
IntialiseStack:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	ldr	r3, .L2
	mvn	r2, #0
	str	r2, [r3, #400]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L3:
	.align	2
.L2:
	.word	S
	.size	IntialiseStack, .-IntialiseStack
	.align	2
	.global	IsEmpty
	.syntax unified
	.arm
	.fpu softvfp
	.type	IsEmpty, %function
IsEmpty:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	ldr	r3, .L7
	ldr	r3, [r3, #400]
	cmn	r3, #1
	bne	.L5
	mov	r3, #1
	b	.L6
.L5:
	mov	r3, #0
.L6:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L8:
	.align	2
.L7:
	.word	S
	.size	IsEmpty, .-IsEmpty
	.section	.rodata
	.align	2
.LC0:
	.ascii	"stack overflow\000"
	.text
	.align	2
	.global	Push
	.syntax unified
	.arm
	.fpu softvfp
	.type	Push, %function
Push:
	@ 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, .L11
	ldr	r3, [r3, #400]
	cmp	r3, #99
	bne	.L10
	ldr	r0, .L11+4
	bl	printf
	mov	r0, #1
	bl	exit
.L10:
	ldr	r3, .L11
	ldr	r3, [r3, #400]
	add	r3, r3, #1
	ldr	r2, .L11
	str	r3, [r2, #400]
	ldr	r3, .L11
	ldr	r3, [r3, #400]
	ldr	r1, .L11
	ldr	r2, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	S
	.word	.LC0
	.size	Push, .-Push
	.section	.rodata
	.align	2
.LC1:
	.ascii	"\012stack underflow\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
	bl	IsEmpty
	mov	r3, r0
	cmp	r3, #0
	beq	.L14
	ldr	r0, .L16
	bl	printf
	mov	r0, #1
	bl	exit
.L14:
	ldr	r3, .L16+4
	ldr	r3, [r3, #400]
	ldr	r2, .L16+4
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-8]
	ldr	r3, .L16+4
	ldr	r3, [r3, #400]
	sub	r3, r3, #1
	ldr	r2, .L16+4
	str	r3, [r2, #400]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC1
	.word	S
	.size	Pop, .-Pop
	.align	2
	.global	StackTop
	.syntax unified
	.arm
	.fpu softvfp
	.type	StackTop, %function
StackTop:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	ldr	r3, .L20
	ldr	r3, [r3, #400]
	ldr	r2, .L20
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L21:
	.align	2
.L20:
	.word	S
	.size	StackTop, .-StackTop
	.section	.rodata
	.align	2
.LC2:
	.ascii	"enter a number\000"
	.align	2
.LC3:
	.ascii	"%d\000"
	.align	2
.LC4:
	.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, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	bl	IntialiseStack
	ldr	r0, .L29+4
	bl	printf
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, .L29+8
	bl	__isoc99_scanf
	b	.L23
.L24:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	str	r3, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	Push
	ldr	r3, [fp, #-20]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	str	r3, [fp, #-20]
.L23:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L24
	b	.L25
.L26:
	bl	Pop
	str	r0, [fp, #-16]
	ldr	r1, [fp, #-16]
	ldr	r0, .L29+8
	bl	printf
.L25:
	bl	IsEmpty
	mov	r3, r0
	cmp	r3, #0
	beq	.L26
	mov	r3, #0
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC4
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
