// File: jeffchan[P]blockchain-parser/BitcoinScript.cpp
// Function: BitcoinScriptImpl::Stack::push(unsigned char, unsigned char const*&)
void push(uint8_t size,const uint8_t *&script)
		{
			mStackElements[mStackIndex] = mStackPtr8;
			mStackSize[mStackIndex] = size;
			mStackIndex++;
			assert( mStackIndex < MAX_STACK_ELEMENTS );
			switch ( size )
			{
				case 0:
					// it is considered valid to push zero bytes onto the stack; essentially just increments the stack pointer
					break;
				case 1:
					*mStackPtr8++ = *script;	// copy one byte
					break;
				case 2:
					*mStackPtr16++ = *script; // copy two bytes
					break;
				case 4:
					*mStackPtr32++ = *script;	// copy 4 bytes
					break;
				case 8:
					*mStackPtr64++ = *script;	// copy 8 bytes
					break;
				default:
					memcpy(mStackPtr8,script,size);
					mStackPtr8+=size;
					break;
			}
			script+=size;	// advance the script intput instruction pointer.
			assert(mStackPtr8 < &mStack[MAX_STACK_SIZE]);	// assert that we have not had a stack overflow
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq (%rax), %rdx
movl 0x808(%rax), %ecx
movq %rdx, 0x810(%rax,%rcx,8)
movb -0x9(%rbp), %dl
movl 0x808(%rax), %ecx
movb %dl, 0xa10(%rax,%rcx)
movl 0x808(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x808(%rax)
cmpl $0x40, 0x808(%rax)
jae 0xe919
jmp 0xe938
leaq 0x21fab(%rip), %rdi     # 0x308cb
leaq 0x21ed1(%rip), %rsi     # 0x307f8
movl $0x97, %edx
leaq 0x21fb9(%rip), %rcx     # 0x308ec
callq 0x20c0
movzbl -0x9(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0x8, %rax
ja 0xe9e8
movq -0x28(%rbp), %rax
leaq 0x21e5b(%rip), %rcx     # 0x307b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xea15
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movb (%rax), %cl
movq (%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
movb %cl, (%rax)
jmp 0xea15
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movw %ax, %cx
movq (%rdx), %rax
movq %rax, %rsi
addq $0x2, %rsi
movq %rsi, (%rdx)
movw %cx, (%rax)
jmp 0xea15
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %ecx
movq (%rdx), %rax
movq %rax, %rsi
addq $0x4, %rsi
movq %rsi, (%rdx)
movl %ecx, (%rax)
jmp 0xea15
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
movq (%rdx), %rax
movq %rax, %rsi
addq $0x8, %rsi
movq %rsi, (%rdx)
movq %rcx, (%rax)
jmp 0xea15
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movzbl -0x9(%rbp), %eax
movl %eax, %edx
callq 0x20f0
movq -0x20(%rbp), %rax
movzbl -0x9(%rbp), %edx
movq (%rax), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movzbl -0x9(%rbp), %esi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movslq %esi, %rsi
addq %rsi, %rdx
movq %rdx, (%rax)
movq (%rcx), %rax
addq $0x8, %rcx
addq $0x800, %rcx            # imm = 0x800
cmpq %rcx, %rax
jae 0xea42
jmp 0xea61
leaq 0x21ee2(%rip), %rdi     # 0x3092b
leaq 0x21da8(%rip), %rsi     # 0x307f8
movl $0xaf, %edx
leaq 0x21e90(%rip), %rcx     # 0x308ec
callq 0x20c0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)