// File: /workspace/github_cpp_makefile_star2_O3/menhits[P]phplus/src/ErrorHandler.cpp
// Function: ErrorHandler::log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ErrorPriority, std::shared_ptr<TokenData>)
void ErrorHandler::log(string msg, ErrorPriority priority, Token token)
{
	if (priority==SOURCE_ERROR || priority==INTERNAL_ERROR || priority==RUNTIME_ERROR)
		errorHasBeenLogged=true;
	
	// gcc style
	//if (token)
	//	cout << token->getFile() << ":" << token->getLine() << ":" << token->getCharPos() << ": ";
	
	//cout << priorityToStr(priority) << ": " << msg << endl;
	
	// Phplus style
	
	cout << priorityToStr(priority);
	
	if (token)
	{
		cout << " di '" << token->getFile()->getFilename() << "' pada baris ke " << token->getLine() << ":" << endl;
		cout << indentString(msg, "    ") << endl;
		
		string line=token->getFile()->getLine(token->getLine());
		
		int wspace=0;
		for (; wspace<int(line.size()) && (line[wspace]==' ' || line[wspace]=='\t' || line[wspace]=='\n'); wspace++) {}
		
		string arrows="";
		for (int i=0; i<token->getCharPos()-1-wspace; i++)
			arrows+=" ";
		for (int i=0; i<int(token->getText().size()); i++)
			arrows+="^";
		
		cout << indentString(""+line.substr(wspace, string::npos)+"\n"+arrows, "    ") << endl;
	}
	else
	{
		cout << ": " << msg << endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rcx, %rbx
movq %rsi, %r14
cmpl $0x4, %edx
ja 0x1fc6f
movl $0x19, %eax
btl %edx, %eax
jae 0x1fc6f
movb $0x1, (%rdi)
movq %rsp, %r15
movq %r15, %rdi
movl %edx, %esi
callq 0x1fbb8
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x7a326(%rip), %rdi     # 0x99fb0
callq 0xa320
leaq 0x10(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x1fca2
callq 0xa2b0
cmpq $0x0, (%rbx)
je 0x1fce2
movq 0x7a301(%rip), %rdi     # 0x99fb0
leaq 0x58437(%rip), %rsi     # 0x780ed
movl $0x5, %edx
callq 0xa320
movq (%rbx), %rcx
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %r15
testq %r15, %r15
je 0x1fd40
movq 0x7a2d1(%rip), %rcx     # 0x99fa8
cmpb $0x0, (%rcx)
je 0x1fd3b
incl 0x8(%r15)
jmp 0x1fd40
movq 0x7a2c7(%rip), %rbx     # 0x99fb0
leaq 0x5cfb4(%rip), %rsi     # 0x7cca4
movl $0x2, %edx
movq %rbx, %rdi
callq 0xa320
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0xa320
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xa030
movq %rax, %rdi
callq 0xa200
jmp 0x2022b
lock
incl 0x8(%r15)
movq %rsp, %rdi
movq %r13, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0xde0c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x7a24b(%rip), %rdi     # 0x99fb0
callq 0xa320
movq %rax, %r12
leaq 0x5837f(%rip), %rsi     # 0x780f3
movl $0x10, %edx
movq %rax, %rdi
callq 0xa320
movq (%rbx), %rax
movl 0x30(%rax), %esi
movq %r12, %rdi
callq 0xa500
movq %rax, %r12
leaq 0x5ad4b(%rip), %rsi     # 0x7aae4
movl $0x1, %edx
movq %rax, %rdi
callq 0xa320
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq %r12, %rdi
callq 0xa030
movq %rax, %rdi
callq 0xa200
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1fddc
callq 0xa2b0
testq %r15, %r15
je 0x1fde9
movq %r15, %rdi
callq 0xdce4
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x57c9d(%rip), %rsi     # 0x77a99
leaq 0x57c9a(%rip), %rdx     # 0x77a9d
leaq 0xe8(%rsp), %rdi
callq 0xdfa8
movq %rsp, %rdi
leaq 0xe8(%rsp), %rdx
movq %r14, %rsi
movl $0x1, %ecx
callq 0x5ae1f
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x7a178(%rip), %rdi     # 0x99fb0
callq 0xa320
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq %r14, %rdi
callq 0xa030
movq %rax, %rdi
callq 0xa200
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x1fe75
callq 0xa2b0
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1fe87
callq 0xa2b0
movq (%rbx), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %r14
testq %r14, %r14
je 0x1feb1
movq 0x7a10a(%rip), %rcx     # 0x99fa8
cmpb $0x0, (%rcx)
je 0x1fea9
incl 0x8(%r14)
jmp 0x1feb1
lock
incl 0x8(%r14)
movq (%rbx), %rax
movl 0x30(%rax), %edx
movq %rsp, %rdi
callq 0x53266
testq %r14, %r14
je 0x1fec9
movq %r14, %rdi
callq 0xdce4
movq 0x8(%rsp), %r14
testl %r14d, %r14d
jle 0x1ff06
movq (%rsp), %rax
movl %r14d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
movabsq $0x100000600, %rsi      # imm = 0x100000600
movzbl (%rax,%rdx), %edi
cmpq $0x20, %rdi
ja 0x1ff0b
btq %rdi, %rsi
jae 0x1ff0b
incq %rdx
cmpq %rdx, %rcx
jne 0x1feec
jmp 0x1ff0e
xorl %r14d, %r14d
jmp 0x1ff0e
movl %edx, %r14d
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x57b31(%rip), %rdx     # 0x77a4f
leaq 0x48(%rsp), %rdi
movq %rdx, %rsi
callq 0xdfa8
movq (%rbx), %rax
movq %r14, 0x20(%rsp)
movl %r14d, %ecx
subl 0x34(%rax), %ecx
cmpl $-0x2, %ecx
jg 0x1ff71
movq 0x20(%rsp), %rax
movl %eax, %ebp
notl %ebp
xorl %r12d, %r12d
leaq 0x57b4b(%rip), %r14     # 0x77a9c
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa560
incl %r12d
movq (%rbx), %rax
movl 0x34(%rax), %ecx
addl %ebp, %ecx
cmpl %ecx, %r12d
jl 0x1ff56
xorl %r13d, %r13d
leaq 0x38(%rsp), %r15
leaq 0x28(%rsp), %r14
leaq 0x48(%rsp), %r12
movq %r15, 0x28(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xde0c
movq %r15, %rax
movl 0x30(%rsp), %ebp
movq 0x28(%rsp), %rdi
movq %rax, %r15
cmpq %rax, %rdi
je 0x1ffb3
callq 0xa2b0
cmpl %ebp, %r13d
jge 0x1ffcf
movq %r12, %rdi
leaq 0x58142(%rip), %rsi     # 0x78104
callq 0xa560
incl %r13d
movq (%rbx), %rax
jmp 0x1ff83
movl 0x20(%rsp), %edx
leaq 0x108(%rsp), %rdi
movq %rsp, %rsi
movq $-0x1, %rcx
callq 0xa2f0
movq %r15, %rbp
leaq 0x57a5b(%rip), %rcx     # 0x77a4f
leaq 0x108(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0xa310
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20038
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x2003f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x57ec3(%rip), %rsi     # 0x77f28
callq 0xa560
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2009a
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x200a1
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xa8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0xa110
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x200f7
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x200ff
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd8(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x5796f(%rip), %rsi     # 0x77a99
leaq 0x5796c(%rip), %rdx     # 0x77a9d
leaq 0xc8(%rsp), %rdi
callq 0xdfa8
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
movl $0x1, %ecx
callq 0x5ae1f
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x79e45(%rip), %rdi     # 0x99fb0
callq 0xa320
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xa030
movq %rax, %rdi
callq 0xa200
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x201a9
callq 0xa2b0
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x201bb
callq 0xa2b0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
leaq 0x10(%rsp), %rbx
leaq 0x58(%rsp), %r12
je 0x201d4
callq 0xa2b0
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x201e6
callq 0xa2b0
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x201f8
callq 0xa2b0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2020e
callq 0xa2b0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2021d
callq 0xa2b0
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x2022b
callq 0xa2b0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x202be
movq %rax, %rbx
jmp 0x202d0
movq %rax, %rbx
jmp 0x202df
movq %rax, %rbx
jmp 0x202f1
movq %rax, %rbx
jmp 0x20303
jmp 0x2035f
movq %rax, %rbx
jmp 0x20376
movq %rax, %rbx
testq %r14, %r14
je 0x20389
movq %r14, %rdi
jmp 0x20354
movq %rax, %rbx
jmp 0x2032c
movq %rax, %rbx
jmp 0x20389
movq %rax, %rbx
jmp 0x2034c
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x2037f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x202be
callq 0xa2b0
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x202d0
callq 0xa2b0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x202df
callq 0xa2b0
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x202f1
callq 0xa2b0
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x20303
callq 0xa2b0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20362
callq 0xa2b0
jmp 0x20362
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2032c
callq 0xa2b0
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x20384
jmp 0x20389
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2034c
callq 0xa2b0
testq %r15, %r15
je 0x20389
movq %r15, %rdi
callq 0xdce4
jmp 0x20389
jmp 0x2035f
jmp 0x2035f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x20376
callq 0xa2b0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x20389
callq 0xa2b0
movq %rbx, %rdi
callq 0xa510
nop