// File: /workspace/github_cpp_makefile_star2_O1/Silica[P]PSL/./PSL/environment.h
// Function: PSL::variable::Variable::Code::optimize(PSL::variable::Variable::OpCode*)
bool optimize(OpCode *c)
	{
		size_t s = code.size();
		OpCode::MNEMONIC::mnemonic cn = c->get();
		if (cn == OpCode::MNEMONIC::PLUS)
		{
			delete c;
			return false;
		}
		if (s < 1)
			return true;
		if (cn == OpCode::MNEMONIC::POP)
		{
			OpCode::MNEMONIC::mnemonic n = code[s-1]->get();
			#ifdef PSL_OPTIMIZE_IMMEDIATELY_POP
			if (n == OpCode::MNEMONIC::CONSTANT || n == OpCode::MNEMONIC::VARIABLE)
			{
				if (s < 2 || code[s-2]->get() != OpCode::MNEMONIC::JR)
				{
					delete c;
					delete code[--s];
					code.resize(s);
					return false;
				}
			}
			#endif
			#ifdef PSL_OPTIMIZE_SUFFIX_INCREMENT
			if (n == OpCode::MNEMONIC::INC)
			{
				delete code[--s];
				code[s] = new PINC();
				return true;
			}
			if (n == OpCode::MNEMONIC::DEC)
			{
				delete code[--s];
				code[s] = new PDEC();
				return true;
			}
			#endif
		}
		#ifdef PSL_OPTIMIZE_CONSTANT_CALCULATION
		if (cn == OpCode::MNEMONIC::UNARY || cn == OpCode::MNEMONIC::INC || cn == OpCode::MNEMONIC::DEC)
		{
			if (code[s-1]->get() == OpCode::MNEMONIC::CONSTANT)
			{
				if (s < 2 || code[s-2]->get() != OpCode::MNEMONIC::JR)
				{
					PSL_TEMPORARY_ENV0(optimizer);
					code[s-1]->Execute(optimizer);
					variable v = optimizer.pop();
					optimizer.push(v);
					c->Execute(optimizer);
					delete c;
					variable a = optimizer.pop();
					v = a;
					return false;
				}
			}
		}
		if (cn == OpCode::MNEMONIC::BINARY && s >= 2)
		{
			if ((code[s-1]->get() == OpCode::MNEMONIC::CONSTANT) && (code[s-2]->get() == OpCode::MNEMONIC::CONSTANT))
			{
				if (s < 3 || code[s-3]->get() != OpCode::MNEMONIC::JR)
				{
					PSL_TEMPORARY_ENV0(optimizer);
					code[s-2]->Execute(optimizer);
					code[--s]->Execute(optimizer);
					variable r = optimizer.pop();
					variable l = optimizer.pop();
					optimizer.push(l);
					optimizer.push(r);
					c->Execute(optimizer);
					delete c;
					variable a = optimizer.pop();
					l = a;
					delete code[s];
					code.resize(s);
					return false;
				}
			}
		}
		#endif
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r15
movq (%rsi), %rax
movq %rsi, %rdi
callq *0x28(%rax)
cmpl $0x22, %eax
jne 0x15632
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
jmp 0x158b5
testq %r15, %r15
je 0x158b3
movl %eax, %ebp
cmpl $0x9, %eax
jne 0x156aa
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x29, %eax
je 0x1566d
movb $0x1, %cl
cmpl $0x28, %eax
jne 0x156a0
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
leaq 0x27165(%rip), %r12     # 0x3c7d0
jmp 0x1567c
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
leaq 0x271cc(%rip), %r12     # 0x3c848
testq %rdi, %rdi
je 0x15687
movq (%rdi), %rax
callq *0x8(%rax)
leaq -0x1(%r15), %r13
callq 0xf762
movq %r12, (%rax)
movq (%r14), %rcx
movq %rax, -0x8(%rcx,%r15,8)
xorl %ecx, %ecx
movq %r13, %r15
movb $0x1, %al
testb %cl, %cl
je 0x158b5
cmpl $0x29, %ebp
ja 0x156f5
movl %ebp, %eax
movabsq $0x30200000000, %rcx    # imm = 0x30200000000
btq %rax, %rcx
jae 0x156f5
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x1, %eax
jne 0x156f5
cmpq $0x2, %r15
jb 0x158c4
movq (%r14), %rax
movq -0x10(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x4d, %eax
jne 0x158c4
cmpl $0x2d, %ebp
setne %al
cmpq $0x2, %r15
setb %cl
orb %al, %cl
jne 0x158b3
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x1, %eax
jne 0x158b3
movq (%r14), %rax
movq -0x10(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x1, %eax
jne 0x158b3
cmpq $0x3, %r15
jb 0x15759
movq (%r14), %rax
movq -0x18(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movl %eax, %ecx
movb $0x1, %al
cmpl $0x4d, %ecx
je 0x158b5
callq 0xd8a6
movq (%rax), %rax
incl 0x8(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movq (%r14), %rax
movq -0x10(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rsi
callq *0x10(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xf800
movq 0x8(%rsp), %r12
incl 0x8(%r12)
movq %r12, %rdi
callq 0xfc04
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xf800
movq 0x8(%rsp), %r13
incl 0x8(%r13)
movq %r13, %rdi
callq 0xfc04
incl 0x8(%r13)
leaq 0x18(%rsp), %rbp
leaq 0x8(%rsp), %rsi
movq %r13, (%rsi)
movq %rbp, %rdi
callq 0xfc38
movq 0x8(%rsp), %rdi
callq 0xfc04
incl 0x8(%r12)
leaq 0x8(%rsp), %rsi
movq %r12, (%rsi)
movq %rbp, %rdi
callq 0xfc38
movq 0x8(%rsp), %rdi
callq 0xfc04
movq (%rbx), %rax
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xf800
movq 0x8(%rsp), %rbp
incl 0x8(%rbp)
movq %rbp, %rdi
callq 0xfc04
movq (%r13), %rdi
movq (%rdi), %rax
movq %rbp, %rsi
callq *0x38(%rax)
movq %rax, (%r13)
movq (%rax), %rcx
movq %rax, %rdi
movq %r13, %rsi
callq *0x158(%rcx)
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
decq %r15
testq %rdi, %rdi
je 0x15887
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x13ee0
movq %r15, 0x10(%r14)
movq %rbp, %rdi
callq 0xfc04
movq %r13, %rdi
callq 0xfc04
movq %r12, %rdi
callq 0xfc04
jmp 0x15995
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xd8a6
movq (%rax), %rax
incl 0x8(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movq (%r14), %rax
movq -0x8(%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xf800
movq 0x8(%rsp), %r14
incl 0x8(%r14)
movq %r14, %rdi
callq 0xfc04
incl 0x8(%r14)
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
callq 0xfc38
movq 0x8(%rsp), %rdi
callq 0xfc04
movq (%rbx), %rax
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq *0x10(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xf800
movq 0x8(%rsp), %r15
incl 0x8(%r15)
movq %r15, %rdi
callq 0xfc04
movq (%r14), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x38(%rax)
movq %rax, (%r14)
movq (%rax), %rcx
movq %rax, %rdi
movq %r14, %rsi
callq *0x158(%rcx)
movq %r15, %rdi
callq 0xfc04
movq %r14, %rdi
callq 0xfc04
leaq 0x10(%rsp), %rdi
callq 0x12de0
jmp 0x1562b
jmp 0x15a71
jmp 0x15a71
jmp 0x15a71
jmp 0x15a71
jmp 0x159ba
movq %rax, %rbx
jmp 0x15a09
jmp 0x15a71
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xfc04
jmp 0x15a09
jmp 0x15a71
jmp 0x15a71
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xfc04
jmp 0x15a09
jmp 0x15a71
jmp 0x15a71
movq %rax, %rbx
jmp 0x15a11
jmp 0x15a71
jmp 0x15a45
jmp 0x15a45
movq %rax, %rbx
movq %rbp, %rdi
callq 0xfc04
movq %r13, %rdi
callq 0xfc04
movq %r12, %rdi
callq 0xfc04
jmp 0x15a5d
jmp 0x15a71
jmp 0x15a71
jmp 0x15a71
jmp 0x15a71
jmp 0x15a71
jmp 0x15a71
jmp 0x15a29
movq %rax, %rbx
jmp 0x15a55
jmp 0x15a71
movq %rax, %rbx
movq 0x8(%rsp), %rdi
callq 0xfc04
jmp 0x15a55
jmp 0x15a71
jmp 0x15a71
jmp 0x15a45
movq %rax, %rbx
jmp 0x15a5d
movq %rax, %rbx
movq %r15, %rdi
callq 0xfc04
movq %r14, %rdi
callq 0xfc04
leaq 0x10(%rsp), %rdi
callq 0x12de0
movq %rbx, %rdi
callq 0xc290
jmp 0x15a71
movq %rax, %rdi
callq 0xde83
nop