#include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Stack
{
private:
    int Size;
    int* arr;
public:
    Stack();
    ~Stack();
    void Append(int x);
    void Pop();
    void Destroy();
    void Peek();
    void Show();
};
Stack::Stack() : Size(1)
{
    arr = new int[INT_MAX];
}
Stack::~Stack()
{
    arr = nullptr;
}
void Stack::Append(int x)
{
    arr[Size-1] = x;
    Size++;
}
void Stack::Pop()
{
    arr[Size-1] = -1;
    Size--;
}
void Stack::Destroy()
{
    this->~Stack();
}

void Stack::Peek()
{
    cout << this->arr[Size-1] << endl;
}
void Stack::Show()
{
    cout << '[';
    for(int i=Size-2;i>0;i--)
    {
        cout << this->arr[i] << ',';
    }
    cout << this->arr[0] << ']' << endl;
}


	.file	"tmpxft_0035054c_00000000-6_stack.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB10838:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE10838:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.globl	_ZN5StackC2Ev
	.type	_ZN5StackC2Ev, @function
_ZN5StackC2Ev:
.LFB10826:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movl	$1, (%rdi)
	movl	$2147483647, %edi
	salq	$2, %rdi
	call	_Znam@PLT
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE10826:
	.size	_ZN5StackC2Ev, .-_ZN5StackC2Ev
	.globl	_ZN5StackC1Ev
	.set	_ZN5StackC1Ev,_ZN5StackC2Ev
	.align 2
	.globl	_ZN5StackD2Ev
	.type	_ZN5StackD2Ev, @function
_ZN5StackD2Ev:
.LFB10829:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE10829:
	.size	_ZN5StackD2Ev, .-_ZN5StackD2Ev
	.globl	_ZN5StackD1Ev
	.set	_ZN5StackD1Ev,_ZN5StackD2Ev
	.align 2
	.globl	_ZN5Stack6AppendEi
	.type	_ZN5Stack6AppendEi, @function
_ZN5Stack6AppendEi:
.LFB10831:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rdx
	movq	8(%rdi), %rax
	movl	%esi, -4(%rax,%rdx,4)
	incl	(%rdi)
	ret
	.cfi_endproc
.LFE10831:
	.size	_ZN5Stack6AppendEi, .-_ZN5Stack6AppendEi
	.align 2
	.globl	_ZN5Stack3PopEv
	.type	_ZN5Stack3PopEv, @function
_ZN5Stack3PopEv:
.LFB10832:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rdx
	movq	8(%rdi), %rax
	movl	$-1, -4(%rax,%rdx,4)
	decl	(%rdi)
	ret
	.cfi_endproc
.LFE10832:
	.size	_ZN5Stack3PopEv, .-_ZN5Stack3PopEv
	.align 2
	.globl	_ZN5Stack7DestroyEv
	.type	_ZN5Stack7DestroyEv, @function
_ZN5Stack7DestroyEv:
.LFB10833:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE10833:
	.size	_ZN5Stack7DestroyEv, .-_ZN5Stack7DestroyEv
	.align 2
	.globl	_ZN5Stack4PeekEv
	.type	_ZN5Stack4PeekEv, @function
_ZN5Stack4PeekEv:
.LFB10834:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	movslq	(%rdi), %rdx
	movq	8(%rdi), %rax
	leaq	_ZSt4cout(%rip), %rdi
	movl	-4(%rax,%rdx,4), %esi
	call	_ZNSolsEi@PLT
	popq	%rdx
	.cfi_def_cfa_offset 8
	movq	%rax, %rdi
	jmp	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	.cfi_endproc
.LFE10834:
	.size	_ZN5Stack4PeekEv, .-_ZN5Stack4PeekEv
	.align 2
	.globl	_ZN5Stack4ShowEv
	.type	_ZN5Stack4ShowEv, @function
_ZN5Stack4ShowEv:
.LFB10835:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	_ZSt4cout(%rip), %r13
	movl	$91, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	pushq	%rdx
	.cfi_def_cfa_offset 48
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movl	(%r12), %eax
	leal	-2(%rax), %ebx
	movslq	%ebx, %rbp
	salq	$2, %rbp
.L11:
	movq	8(%r12), %rax
	testl	%ebx, %ebx
	jle	.L15
	movl	(%rax,%rbp), %esi
	movq	%r13, %rdi
	decl	%ebx
	subq	$4, %rbp
	call	_ZNSolsEi@PLT
	movl	$44, %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	jmp	.L11
.L15:
	movl	(%rax), %esi
	movq	%r13, %rdi
	call	_ZNSolsEi@PLT
	movl	$93, %esi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c@PLT
	movq	%rax, %rdi
	popq	%rax
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
	.cfi_endproc
.LFE10835:
	.size	_ZN5Stack4ShowEv, .-_ZN5Stack4ShowEv
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB10861:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE10861:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.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:


#include <hip/hip_runtime.h>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Stack
{
private:
    int Size;
    int* arr;
public:
    Stack();
    ~Stack();
    void Append(int x);
    void Pop();
    void Destroy();
    void Peek();
    void Show();
};
Stack::Stack() : Size(1)
{
    arr = new int[INT_MAX];
}
Stack::~Stack()
{
    arr = nullptr;
}
void Stack::Append(int x)
{
    arr[Size-1] = x;
    Size++;
}
void Stack::Pop()
{
    arr[Size-1] = -1;
    Size--;
}
void Stack::Destroy()
{
    this->~Stack();
}

void Stack::Peek()
{
    cout << this->arr[Size-1] << endl;
}
void Stack::Show()
{
    cout << '[';
    for(int i=Size-2;i>0;i--)
    {
        cout << this->arr[i] << ',';
    }
    cout << this->arr[0] << ']' << endl;
}


	.text
	.file	"stack.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_ZN5StackC2Ev                   # -- Begin function _ZN5StackC2Ev
	.p2align	1, 0x90
	.type	_ZN5StackC2Ev,@function
_ZN5StackC2Ev:                          # @_ZN5StackC2Ev
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	movl	$1, (%rdi)
	movabsq	$8589934588, %rdi               # imm = 0x1FFFFFFFC
	callq	_Znam
	movq	%rax, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end0:
	.size	_ZN5StackC2Ev, .Lfunc_end0-_ZN5StackC2Ev
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5StackD2Ev                   # -- Begin function _ZN5StackD2Ev
	.p2align	1, 0x90
	.type	_ZN5StackD2Ev,@function
_ZN5StackD2Ev:                          # @_ZN5StackD2Ev
	.cfi_startproc
# %bb.0:
	movq	$0, 8(%rdi)
	retq
.Lfunc_end1:
	.size	_ZN5StackD2Ev, .Lfunc_end1-_ZN5StackD2Ev
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5Stack6AppendEi              # -- Begin function _ZN5Stack6AppendEi
	.p2align	1, 0x90
	.type	_ZN5Stack6AppendEi,@function
_ZN5Stack6AppendEi:                     # @_ZN5Stack6AppendEi
	.cfi_startproc
# %bb.0:
	movq	8(%rdi), %rax
	movslq	(%rdi), %rcx
	movl	%esi, -4(%rax,%rcx,4)
	incl	(%rdi)
	retq
.Lfunc_end2:
	.size	_ZN5Stack6AppendEi, .Lfunc_end2-_ZN5Stack6AppendEi
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5Stack3PopEv                 # -- Begin function _ZN5Stack3PopEv
	.p2align	1, 0x90
	.type	_ZN5Stack3PopEv,@function
_ZN5Stack3PopEv:                        # @_ZN5Stack3PopEv
	.cfi_startproc
# %bb.0:
	movq	8(%rdi), %rax
	movslq	(%rdi), %rcx
	movl	$-1, -4(%rax,%rcx,4)
	decl	(%rdi)
	retq
.Lfunc_end3:
	.size	_ZN5Stack3PopEv, .Lfunc_end3-_ZN5Stack3PopEv
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5Stack7DestroyEv             # -- Begin function _ZN5Stack7DestroyEv
	.p2align	1, 0x90
	.type	_ZN5Stack7DestroyEv,@function
_ZN5Stack7DestroyEv:                    # @_ZN5Stack7DestroyEv
	.cfi_startproc
# %bb.0:
	movq	$0, 8(%rdi)
	retq
.Lfunc_end4:
	.size	_ZN5Stack7DestroyEv, .Lfunc_end4-_ZN5Stack7DestroyEv
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5Stack4PeekEv                # -- Begin function _ZN5Stack4PeekEv
	.p2align	1, 0x90
	.type	_ZN5Stack4PeekEv,@function
_ZN5Stack4PeekEv:                       # @_ZN5Stack4PeekEv
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	8(%rdi), %rax
	movslq	(%rdi), %rcx
	movl	-4(%rax,%rcx,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZNSo5flushEv                   # TAILCALL
.Lfunc_end5:
	.size	_ZN5Stack4PeekEv, .Lfunc_end5-_ZN5Stack4PeekEv
	.cfi_endproc
                                        # -- End function
	.globl	_ZN5Stack4ShowEv                # -- Begin function _ZN5Stack4ShowEv
	.p2align	1, 0x90
	.type	_ZN5Stack4ShowEv,@function
_ZN5Stack4ShowEv:                       # @_ZN5Stack4ShowEv
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rdi, %rbx
	movb	$91, 13(%rsp)
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rax
	cmpq	$0, _ZSt4cout+16(%rax)
	je	.LBB6_2
# %bb.1:
	leaq	13(%rsp), %rsi
	movl	$_ZSt4cout, %edi
	movl	$1, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB6_3
.LBB6_2:
	movl	$_ZSt4cout, %edi
	movl	$91, %esi
	callq	_ZNSo3putEc
.LBB6_3:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit
	movl	(%rbx), %r15d
	cmpl	$3, %r15d
	jl	.LBB6_7
# %bb.4:                                # %.lr.ph
	addl	$-2, %r15d
	incq	%r15
	leaq	15(%rsp), %r14
.LBB6_5:                                # =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movl	-4(%rax,%r15,4), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movb	$44, 15(%rsp)
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	cmpq	$0, 16(%rax,%rcx)
	je	.LBB6_11
# %bb.6:                                #   in Loop: Header=BB6_5 Depth=1
	movl	$1, %edx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	jmp	.LBB6_12
.LBB6_11:                               #   in Loop: Header=BB6_5 Depth=1
	movq	%rax, %rdi
	movl	$44, %esi
	callq	_ZNSo3putEc
.LBB6_12:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit8
                                        #   in Loop: Header=BB6_5 Depth=1
	decq	%r15
	cmpq	$1, %r15
	jg	.LBB6_5
.LBB6_7:                                # %._crit_edge
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSolsEi
	movq	%rax, %rbx
	movb	$93, 14(%rsp)
	movq	(%rax), %rax
	movq	-24(%rax), %rax
	cmpq	$0, 16(%rbx,%rax)
	je	.LBB6_9
# %bb.8:
	leaq	14(%rsp), %rsi
	movl	$1, %edx
	movq	%rbx, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	%rax, %rbx
	jmp	.LBB6_10
.LBB6_9:
	movq	%rbx, %rdi
	movl	$93, %esi
	callq	_ZNSo3putEc
.LBB6_10:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c.exit5
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end6:
	.size	_ZN5Stack4ShowEv, .Lfunc_end6-_ZN5Stack4ShowEv
	.cfi_endproc
                                        # -- End function
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.globl	_ZN5StackC1Ev
	.type	_ZN5StackC1Ev,@function
.set _ZN5StackC1Ev, _ZN5StackC2Ev
	.globl	_ZN5StackD1Ev
	.type	_ZN5StackD1Ev,@function
.set _ZN5StackD1Ev, _ZN5StackD2Ev
	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
