// File: menhits[P]phplus/src/Parser.cpp
// Function: skipBrace(std::vector<std::shared_ptr<TokenData>, std::allocator<std::shared_ptr<TokenData>>> const&, int)
int skipBrace(const vector<Token>& tokens, int start)
{
	Operator open, close;
	int step;
	
	Operator op=tokens[start]->getOp();
	
	if (tokens[start]->getOp()==ops->openPeren)
	{
		open=ops->openPeren;
		close=ops->closePeren;
		step=1;
	}
	else if (tokens[start]->getOp()==ops->closePeren)
	{
		open=ops->closePeren;
		close=ops->openPeren;
		step=-1;
	}
	else if (tokens[start]->getOp()==ops->openSqBrac)
	{
		open=ops->openSqBrac;
		close=ops->closeSqBrac;
		step=1;
	}
	else if (tokens[start]->getOp()==ops->closeSqBrac)
	{
		open=ops->closeSqBrac;
		close=ops->openSqBrac;
		step=-1;
	}
	else if (tokens[start]->getOp()==ops->openCrBrac)
	{
		open=ops->openCrBrac;
		close=ops->closeCrBrac;
		step=1;
	}
	else if (tokens[start]->getOp()==ops->closeCrBrac)
	{
		open=ops->closeCrBrac;
		close=ops->openCrBrac;
		step=-1;
	}
	else
	{
		throw PhplusError(FUNC + " called with index that is not a valid brace", INTERNAL_ERROR, tokens[start]);
	}
	
	int c=1;
	int i=start;
	
	while(true)
	{
		i+=step;
		
		if (i>=int(tokens.size()))
		{
			throw PhplusError("no matching brace", SOURCE_ERROR, tokens[start]);
		}
		
		if (tokens[i]->getOp()==open)
		{
			c++;
		}
		else if (tokens[i]->getOp()==close)
		{
			c--;
			
			if (c<=0)
			{
				return i;
			}
		}
	}
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x1c0(%rsp)
movl %esi, 0x1bc(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x117e0
leaq 0x198(%rsp), %rdi
callq 0x117e0
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x180(%rsp), %rdi
callq 0x1bc10
jmp 0x4366f
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x160(%rsp), %rdi
callq 0x1bc10
jmp 0x4369e
leaq 0xd4d13(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x190, %rsi            # imm = 0x190
leaq 0x160(%rsp), %rdi
callq 0xfd20
movb %al, 0x47(%rsp)
leaq 0x160(%rsp), %rdi
callq 0xf9a0
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x436d7
jmp 0x43755
leaq 0xd4cda(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x190, %rsi            # imm = 0x190
leaq 0x1a8(%rsp), %rdi
callq 0xfa30
leaq 0xd4cbc(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
leaq 0x198(%rsp), %rdi
callq 0xfa30
movl $0x1, 0x194(%rsp)
jmp 0x43c41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x43ed2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x43ec5
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x150(%rsp), %rdi
callq 0x1bc10
jmp 0x43784
leaq 0xd4c2d(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
leaq 0x150(%rsp), %rdi
callq 0xfd20
movb %al, 0x46(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xf9a0
movb 0x46(%rsp), %al
testb $0x1, %al
jne 0x437bd
jmp 0x43809
leaq 0xd4bf4(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
leaq 0x1a8(%rsp), %rdi
callq 0xfa30
leaq 0xd4bd6(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x190, %rsi            # imm = 0x190
leaq 0x198(%rsp), %rdi
callq 0xfa30
movl $0xffffffff, 0x194(%rsp) # imm = 0xFFFFFFFF
jmp 0x43c3f
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x140(%rsp), %rdi
callq 0x1bc10
jmp 0x43838
leaq 0xd4b79(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1b0, %rsi            # imm = 0x1B0
leaq 0x140(%rsp), %rdi
callq 0xfd20
movb %al, 0x45(%rsp)
leaq 0x140(%rsp), %rdi
callq 0xf9a0
movb 0x45(%rsp), %al
testb $0x1, %al
jne 0x43871
jmp 0x438bd
leaq 0xd4b40(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1b0, %rsi            # imm = 0x1B0
leaq 0x1a8(%rsp), %rdi
callq 0xfa30
leaq 0xd4b22(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
leaq 0x198(%rsp), %rdi
callq 0xfa30
movl $0x1, 0x194(%rsp)
jmp 0x43c3d
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x130(%rsp), %rdi
callq 0x1bc10
jmp 0x438ec
leaq 0xd4ac5(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
leaq 0x130(%rsp), %rdi
callq 0xfd20
movb %al, 0x44(%rsp)
leaq 0x130(%rsp), %rdi
callq 0xf9a0
movb 0x44(%rsp), %al
testb $0x1, %al
jne 0x43925
jmp 0x43971
leaq 0xd4a8c(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
leaq 0x1a8(%rsp), %rdi
callq 0xfa30
leaq 0xd4a6e(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1b0, %rsi            # imm = 0x1B0
leaq 0x198(%rsp), %rdi
callq 0xfa30
movl $0xffffffff, 0x194(%rsp) # imm = 0xFFFFFFFF
jmp 0x43c3b
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x120(%rsp), %rdi
callq 0x1bc10
jmp 0x439a0
leaq 0xd4a11(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1d0, %rsi            # imm = 0x1D0
leaq 0x120(%rsp), %rdi
callq 0xfd20
movb %al, 0x43(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xf9a0
movb 0x43(%rsp), %al
testb $0x1, %al
jne 0x439d9
jmp 0x43a25
leaq 0xd49d8(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1d0, %rsi            # imm = 0x1D0
leaq 0x1a8(%rsp), %rdi
callq 0xfa30
leaq 0xd49ba(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1e0, %rsi            # imm = 0x1E0
leaq 0x198(%rsp), %rdi
callq 0xfa30
movl $0x1, 0x194(%rsp)
jmp 0x43c39
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x110(%rsp), %rdi
callq 0x1bc10
jmp 0x43a54
leaq 0xd495d(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1e0, %rsi            # imm = 0x1E0
leaq 0x110(%rsp), %rdi
callq 0xfd20
movb %al, 0x42(%rsp)
leaq 0x110(%rsp), %rdi
callq 0xf9a0
movb 0x42(%rsp), %al
testb $0x1, %al
jne 0x43a8d
jmp 0x43ad9
leaq 0xd4924(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1e0, %rsi            # imm = 0x1E0
leaq 0x1a8(%rsp), %rdi
callq 0xfa30
leaq 0xd4906(%rip), %rax     # 0x1183b8
movq (%rax), %rsi
addq $0x1d0, %rsi            # imm = 0x1D0
leaq 0x198(%rsp), %rdi
callq 0xfa30
movl $0xffffffff, 0x194(%rsp) # imm = 0xFFFFFFFF
jmp 0x43c37
movb $0x1, 0xb7(%rsp)
movl $0x38, %edi
callq 0xb1f0
movq %rax, 0x30(%rsp)
leaq 0xcf(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xb690
movq 0x38(%rsp), %rdx
leaq 0x8e9bb(%rip), %rsi     # 0xd24c9
leaq 0xd0(%rsp), %rdi
callq 0xb4c0
jmp 0x43b1d
leaq 0x8e9af(%rip), %rdx     # 0xd24d3
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xfa60
jmp 0x43b3b
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rsi
leaq 0xb8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x1bc90
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rcx
leaq 0xf0(%rsp), %rsi
movl $0x3, %edx
callq 0x35600
jmp 0x43b83
movq 0x30(%rsp), %rdi
movb $0x0, 0xb7(%rsp)
leaq 0xd1a31(%rip), %rsi     # 0x1155c8
leaq -0x2952e(%rip), %rdx    # 0x1a670
callq 0xb640
jmp 0x43ef9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x43c0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x43c02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xfc00
leaq 0xf0(%rsp), %rdi
callq 0xb6e8
leaq 0xd0(%rsp), %rdi
callq 0xb6e8
leaq 0xcf(%rsp), %rdi
callq 0xb3f0
testb $0x1, 0xb7(%rsp)
jne 0x43c28
jmp 0x43c32
movq 0x30(%rsp), %rdi
callq 0xb2d0
jmp 0x43ec5
jmp 0x43c39
jmp 0x43c3b
jmp 0x43c3d
jmp 0x43c3f
jmp 0x43c41
movl $0x1, 0xb0(%rsp)
movl 0x1bc(%rsp), %eax
movl %eax, 0xac(%rsp)
jmp 0x43c5c
movl 0x194(%rsp), %eax
addl 0xac(%rsp), %eax
movl %eax, 0xac(%rsp)
movl 0xac(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x1c0(%rsp), %rdi
callq 0x393f0
movq %rax, %rcx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jl 0x43da3
movb $0x1, 0x6f(%rsp)
movl $0x38, %edi
callq 0xb1f0
movq %rax, 0x10(%rsp)
leaq 0x87(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xb690
movq 0x18(%rsp), %rdx
leaq 0x8e836(%rip), %rsi     # 0xd2500
leaq 0x88(%rsp), %rdi
callq 0xb4c0
jmp 0x43cd9
movq 0x1c0(%rsp), %rdi
movslq 0x1bc(%rsp), %rsi
callq 0x48650
movq %rax, %rsi
leaq 0x70(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1bc90
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rcx
leaq 0x88(%rsp), %rsi
xorl %edx, %edx
callq 0x35600
jmp 0x43d1b
movq 0x10(%rsp), %rdi
movb $0x0, 0x6f(%rsp)
leaq 0xd189c(%rip), %rsi     # 0x1155c8
leaq -0x296c3(%rip), %rdx    # 0x1a670
callq 0xb640
jmp 0x43ef9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
jmp 0x43d7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x178(%rsp)
movl %eax, 0x174(%rsp)
leaq 0x70(%rsp), %rdi
callq 0xfc00
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0x87(%rsp), %rdi
callq 0xb3f0
testb $0x1, 0x6f(%rsp)
jne 0x43d94
jmp 0x43d9e
movq 0x10(%rsp), %rdi
callq 0xb2d0
jmp 0x43ec5
movq 0x1c0(%rsp), %rdi
movslq 0xac(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x58(%rsp), %rdi
callq 0x1bc10
jmp 0x43dcf
leaq 0x58(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0xfd20
movb %al, 0x7(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xf9a0
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x43df9
jmp 0x43e0f
movl 0xb0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rsp)
jmp 0x43ec0
movq 0x1c0(%rsp), %rdi
movslq 0xac(%rsp), %rsi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x48(%rsp), %rdi
callq 0x1bc10
jmp 0x43e3b
leaq 0x48(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0xfd20
movb %al, 0x6(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xf9a0
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x43e65
jmp 0x43ebe
movl 0xb0(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xb0(%rsp)
cmpl $0x0, 0xb0(%rsp)
jg 0x43ebc
movl 0xac(%rsp), %eax
movl %eax, (%rsp)
leaq 0x180(%rsp), %rdi
callq 0xf9a0
leaq 0x198(%rsp), %rdi
callq 0xf9a0
leaq 0x1a8(%rsp), %rdi
callq 0xf9a0
movl (%rsp), %eax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
jmp 0x43ebe
jmp 0x43ec0
jmp 0x43c5a
leaq 0x180(%rsp), %rdi
callq 0xf9a0
leaq 0x198(%rsp), %rdi
callq 0xf9a0
leaq 0x1a8(%rsp), %rdi
callq 0xf9a0
movq 0x178(%rsp), %rdi
callq 0xb680
nopl (%rax)