// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/Parser.cpp
// Function: parseTokenList(std::vector<std::shared_ptr<TokenData>, std::allocator<std::shared_ptr<TokenData>>> const&, int, int, std::vector<std::unique_ptr<AstNodeBase, std::default_delete<AstNodeBase>>, std::allocator<std::unique_ptr<AstNodeBase, std::default_delete<AstNodeBase>>>>&)
void parseTokenList(const vector<Token>& tokens, int left, int right, vector<AstNode>& nodes)
{
	int start=left;
	
	for (int i=left; i<=right; i++)
	{
		if (tokens[i]->getOp()==ops->import)
		{
			if (i==right || tokens[i+1]->getType()!=TokenData::STRING_LITERAL)
			{
				throw PhplusError("'"+ops->import->getText()+"' must be followed by a string literal", SOURCE_ERROR, tokens[i]);
			}
			
			string path=tokens[i+1]->getText();
			
			//this nonesens is required because my lexer is shit and includes the first quote but not the last one
			//instead of hardcoding that in, I figured I'd make it flexable so I don't break everthing when I fix the lexer
			
			while (path.size()>0 && path[0]=='"')
				path=path.substr(1, string::npos);
			
			while (path.size()>0 && path[path.size()-1]=='"')
				path=path.substr(0, path.size()-1);
			
			path=tokens[i]->getFile()->getDirPath()+"/"+path;
			
			try
			{
				importFile(nodes, path);
			}
			catch (PhplusError err)
			{
				err.log();
			}
			
			
			i+=2;
			start=i;
		}
		else
		{
			if (ops->isOpenBrac(tokens[i]->getOp()))
			{
				i=skipBrace(tokens, i);
			}
			
			bool tokenTakesRightInput=(tokens[i]->getOp() && tokens[i]->getOp()->takesRightInput());
			int next=i+1;
			bool nextTokenTakesLeftInput=(next<=right && tokens[next]->getOp() && tokens[next]->getOp()->takesLeftInput());
			
			if (i==right || (!tokenTakesRightInput && !nextTokenTakesLeftInput))
			{
				try
				{
					AstNode node=parseExpression(tokens, start, i);
					nodes.push_back(move(node));
				}
				catch (PhplusError err)
				{
					err.log();
				}
				
				start=next;
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rcx, 0x38(%rsp)
movl %edx, %ebp
movq %rdi, %rbx
leaq 0x40(%rsp), %r13
movq %rsi, %rax
movq %rsi, 0x8(%rsp)
movl %eax, (%rsp)
movl %edx, 0x14(%rsp)
movq 0x8(%rsp), %rax
cmpl %ebp, %eax
jg 0x1f0f3
movslq %eax, %r14
movq (%rbx), %rax
movq %r14, %r12
shlq $0x4, %r12
movq (%rax,%r12), %rsi
addq $0x40, %rsi
movq %r13, %rdi
callq 0xc950
movq %rbx, %r13
leaq 0x5b5e7(%rip), %rbx     # 0x7a2f0
movq (%rbx), %rax
movq 0x40(%rsp), %r15
movq 0x180(%rax), %rbp
leaq 0x48(%rsp), %rdi
callq 0xc984
cmpq %rbp, %r15
je 0x1eea4
movq (%rbx), %r15
movq (%r13), %rax
movq (%rax,%r12), %rsi
addq $0x40, %rsi
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0xc950
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc7ec
movl 0x14(%rsp), %ebp
movl %eax, %r12d
movq %r13, %rbx
leaq 0x90(%rsp), %rdi
callq 0xc984
testb %r12b, %r12b
leaq 0x40(%rsp), %r13
je 0x1ed8b
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x1f29d
movl %eax, %r12d
movslq %eax, %r14
jmp 0x1ed90
movq 0x8(%rsp), %r12
movq (%rbx), %rax
shlq $0x4, %r14
movq (%rax,%r14), %rsi
addq $0x40, %rsi
movq %r13, %rdi
callq 0xc950
cmpq $0x0, 0x40(%rsp)
je 0x1ede1
movq (%rbx), %rax
movq (%rax,%r14), %rsi
addq $0x40, %rsi
leaq 0x18(%rsp), %rdi
callq 0xc950
movq 0x18(%rsp), %rax
movl 0x28(%rax), %eax
decl %eax
cmpl $0x2, %eax
setb %r15b
leaq 0x20(%rsp), %rdi
callq 0xc984
jmp 0x1ede4
xorl %r15d, %r15d
leaq 0x48(%rsp), %rdi
callq 0xc984
leal 0x1(%r12), %eax
cmpl %ebp, %r12d
movq %rax, 0x8(%rsp)
jge 0x1ee50
movslq %eax, %r14
movq (%rbx), %rax
shlq $0x4, %r14
movq (%rax,%r14), %rsi
addq $0x40, %rsi
movq %r13, %rdi
callq 0xc950
cmpq $0x0, 0x40(%rsp)
je 0x1ee55
movq (%rbx), %rax
movq (%rax,%r14), %rsi
addq $0x40, %rsi
leaq 0x18(%rsp), %rdi
callq 0xc950
movq 0x18(%rsp), %rax
testl $0xfffffffd, 0x28(%rax) # imm = 0xFFFFFFFD
sete %r14b
leaq 0x20(%rsp), %rdi
callq 0xc984
jmp 0x1ee58
xorl %r14d, %r14d
jmp 0x1ee62
xorl %r14d, %r14d
leaq 0x48(%rsp), %rdi
callq 0xc984
cmpl %ebp, %r12d
je 0x1ee70
orb %r14b, %r15b
jne 0x1ecd5
movq %r13, %rdi
movq %rbx, %rsi
movl (%rsp), %edx
movl %r12d, %ecx
callq 0x1f970
movq 0x38(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %r14
callq 0x12fa6
movq %r13, %rdi
callq 0x11c58
movl %r14d, (%rsp)
jmp 0x1ecd5
movl 0x14(%rsp), %ebp
cmpl %ebp, 0x8(%rsp)
movq %r13, %rbx
je 0x1f105
movq (%rbx), %rax
movq 0x10(%rax,%r12), %rsi
cmpl $0x4, 0x38(%rsi)
jne 0x1f105
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0xa3b0
leaq 0x40(%rsp), %r13
leaq 0xc8(%rsp), %r15
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
je 0x1ef43
movq 0x18(%rsp), %rax
cmpb $0x22, (%rax)
jne 0x1ef43
movq %r13, %rdi
movq %r14, %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0xa2d0
movq %r14, %rdi
movq %r13, %rsi
callq 0xa350
movq %r13, %rdi
callq 0xa558
jmp 0x1eee1
decq %rcx
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xa2d0
movq %r14, %rdi
movq %r13, %rsi
callq 0xa350
movq %r13, %rdi
callq 0xa558
movq 0x20(%rsp), %rcx
testq %rcx, %rcx
je 0x1ef54
movq 0x18(%rsp), %rax
cmpb $0x22, -0x1(%rax,%rcx)
je 0x1ef1b
movq (%rbx), %rax
movq (%rax,%r12), %rsi
addq $0x20, %rsi
leaq 0x78(%rsp), %rdi
callq 0x19fe6
movq 0x78(%rsp), %rsi
movq %r15, %rdi
callq 0x3c624
leaq 0xe8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
leaq 0x398d7(%rip), %rdx     # 0x58862
callq 0xc882
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x184b5
movq %r14, %rdi
movq %r13, %rsi
callq 0xa350
movq %r13, %rdi
callq 0xa558
movq %r12, %rdi
callq 0xa558
movq %r15, %rdi
callq 0xa558
leaq 0x80(%rsp), %rdi
callq 0xc984
leaq 0x108(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa3b0
movq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x21a03
movq %r15, %rdi
callq 0xa558
movq 0x8(%rsp), %r15
leal 0x2(%r15), %eax
movl %eax, (%rsp)
movq %r14, %rdi
callq 0xa558
addl $0x3, %r15d
movq %r15, 0x8(%rsp)
jmp 0x1ecd5
movq %rdx, %r12
movq %rax, (%rsp)
movq %r13, %rdi
callq 0x11c58
jmp 0x1f030
movq %rdx, %r12
movq %rax, (%rsp)
cmpl $0x1, %r12d
jne 0x1f294
movq (%rsp), %rdi
callq 0xa360
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x119b8
movq (%rsp), %rdi
callq 0xa160
leaq 0x40(%rsp), %rdi
callq 0x19f60
leaq 0x40(%rsp), %r13
movq %r13, %rdi
callq 0x11692
callq 0xa4b0
movq 0x8(%rsp), %rax
movl %eax, (%rsp)
movl 0x14(%rsp), %ebp
jmp 0x1ecd5
movq %rdx, %r12
movq %rax, (%rsp)
movq %r15, %rdi
callq 0xa558
jmp 0x1f09e
movq %rdx, %r12
movq %rax, (%rsp)
cmpl $0x1, %r12d
jne 0x1f277
movq (%rsp), %rdi
callq 0xa360
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x119b8
movq (%rsp), %rdi
callq 0xa160
leaq 0x40(%rsp), %rdi
callq 0x19f60
leaq 0x40(%rsp), %rdi
callq 0x11692
callq 0xa4b0
movl 0x14(%rsp), %ebp
leaq 0x40(%rsp), %r13
leaq 0x18(%rsp), %r14
jmp 0x1eff6
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x38
popq %rdi
callq 0xa1b0
movq %rax, %r14
leaq 0x5b1d9(%rip), %rax     # 0x7a2f0
movq (%rax), %rax
movq 0x180(%rax), %rsi
leaq 0x18(%rsp), %rdi
callq 0xa3b0
leaq 0x3a120(%rip), %rsi     # 0x59252
leaq 0x40(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x11ff8
leaq 0x364d6(%rip), %rdx     # 0x5561e
leaq 0xa8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xc882
addq (%rbx), %r12
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12e2e
movb $0x1, %bpl
leaq 0xa8(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x19f06
xorl %ebp, %ebp
leaq 0x58407(%rip), %rsi     # 0x77598
leaq -0xdb06(%rip), %rdx     # 0x11692
movq %r14, %rdi
callq 0xa4e0
jmp 0x1f273
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0x11692
callq 0xa4b0
jmp 0x1f277
jmp 0x1f1d7
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0x11692
callq 0xa4b0
jmp 0x1f294
movq %rax, %rdi
callq 0xc944
movq %rax, (%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xc984
leaq 0xa8(%rsp), %rdi
callq 0xa558
jmp 0x1f206
movq %rax, (%rsp)
movb $0x1, %bpl
leaq 0x40(%rsp), %rdi
callq 0xa558
jmp 0x1f219
movq %rax, (%rsp)
movb $0x1, %bpl
leaq 0x18(%rsp), %rdi
callq 0xa558
testb %bpl, %bpl
jne 0x1f22e
jmp 0x1f294
movq %rax, (%rsp)
movq %r14, %rdi
callq 0xa230
jmp 0x1f294
movq %rax, (%rsp)
leaq 0xe8(%rsp), %rdi
callq 0xa558
jmp 0x1f24f
movq %rax, (%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xa558
jmp 0x1f262
movq %rax, (%rsp)
leaq 0x80(%rsp), %rdi
callq 0xc984
jmp 0x1f277
jmp 0x1f273
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
callq 0xa558
jmp 0x1f294
movq %rax, (%rsp)
leaq 0x90(%rsp), %rdi
callq 0xc984
movq (%rsp), %rdi
callq 0xa500