// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rsi, %r14
cmpl $0x4, %edx
ja 0x1f94f
movl $0x19, %eax
btl %edx, %eax
jae 0x1f94f
movb $0x1, (%rdi)
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl %edx, %esi
callq 0x1f898
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x79644(%rip), %rdi     # 0x98fb0
callq 0xa320
leaq 0x18(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x1f984
callq 0xa2b0
cmpq $0x0, (%r15)
je 0x1f9c3
movq 0x7961f(%rip), %rdi     # 0x98fb0
leaq 0x57755(%rip), %rsi     # 0x770ed
movl $0x5, %edx
callq 0xa320
movq (%r15), %rcx
movq 0x20(%rcx), %rax
movq 0x28(%rcx), %rbp
testq %rbp, %rbp
je 0x1fa20
movq 0x795ef(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x1fa1c
incl 0x8(%rbp)
jmp 0x1fa20
movq 0x795e6(%rip), %rbx     # 0x98fb0
leaq 0x5c313(%rip), %rsi     # 0x7bce4
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 0x1ff10
lock
incl 0x8(%rbp)
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0xdde2
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x79568(%rip), %rdi     # 0x98fb0
callq 0xa320
movq %rax, %r12
leaq 0x5769c(%rip), %rsi     # 0x770f3
movl $0x10, %edx
movq %rax, %rdi
callq 0xa320
movq (%r15), %rax
movl 0x30(%rax), %esi
movq %r12, %rdi
callq 0xa500
movq %rax, %r12
leaq 0x5a0a8(%rip), %rsi     # 0x79b24
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 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fac0
callq 0xa2b0
testq %rbp, %rbp
je 0x1facd
movq %rbp, %rdi
callq 0xdcba
leaq 0xf8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x56fb8(%rip), %rsi     # 0x76a99
leaq 0x56fb5(%rip), %rdx     # 0x76a9d
leaq 0xe8(%rsp), %rdi
callq 0xdf6a
leaq 0x8(%rsp), %rdi
leaq 0xe8(%rsp), %rdx
movq %r14, %rsi
movl $0x1, %ecx
callq 0x5a113
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x79490(%rip), %rdi     # 0x98fb0
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 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fb5e
callq 0xa2b0
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1fb70
callq 0xa2b0
movq (%r15), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %r14
testq %r14, %r14
je 0x1fb97
movq 0x79421(%rip), %rax     # 0x98fa8
cmpb $0x0, (%rax)
je 0x1fb92
incl 0x8(%r14)
jmp 0x1fb97
lock
incl 0x8(%r14)
movq (%r15), %rax
movl 0x30(%rax), %edx
leaq 0x8(%rsp), %rdi
callq 0x524a6
testq %r14, %r14
je 0x1fbb4
movq %r14, %rdi
callq 0xdcba
movq 0x10(%rsp), %rbx
testl %ebx, %ebx
jle 0x1fbf0
movq 0x8(%rsp), %rax
movl %ebx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
movabsq $0x100000600, %rsi      # imm = 0x100000600
movzbl (%rax,%rdx), %edi
cmpq $0x20, %rdi
ja 0x1fbf4
btq %rdi, %rsi
jae 0x1fbf4
incq %rdx
cmpq %rdx, %rcx
jne 0x1fbd6
jmp 0x1fbf6
xorl %ebx, %ebx
jmp 0x1fbf6
movl %edx, %ebx
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x56e49(%rip), %rdx     # 0x76a4f
leaq 0x48(%rsp), %rdi
movq %rdx, %rsi
callq 0xdf6a
movq (%r15), %rax
movq %rbx, %r14
movl %ebx, %ecx
subl 0x34(%rax), %ecx
cmpl $-0x2, %ecx
jg 0x1fc52
movl %r14d, %ebp
notl %ebp
xorl %r12d, %r12d
leaq 0x56e6a(%rip), %r13     # 0x76a9c
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa560
incl %r12d
movq (%r15), %rax
movl 0x34(%rax), %eax
addl %ebp, %eax
cmpl %eax, %r12d
jl 0x1fc37
xorl %r13d, %r13d
leaq 0x28(%rsp), %r12
movq %r15, %rbx
movq (%r15), %rax
leaq 0x38(%rsp), %rbp
movq %rbp, 0x28(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xdde2
movl 0x30(%rsp), %r15d
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1fc90
callq 0xa2b0
cmpl %r15d, %r13d
jge 0x1fcae
leaq 0x48(%rsp), %rdi
leaq 0x57463(%rip), %rsi     # 0x77104
callq 0xa560
incl %r13d
movq %rbx, %r15
jmp 0x1fc5a
movq %r14, %rax
movl %eax, %edx
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq $-0x1, %rcx
callq 0xa2f0
leaq 0x56d7c(%rip), %rcx     # 0x76a4f
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 0x1fd17
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x1fd1e
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 0x571e4(%rip), %rsi     # 0x76f28
callq 0xa560
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1fd79
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x1fd80
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 0x1fdd6
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x1fdde
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 0x56c90(%rip), %rsi     # 0x76a99
leaq 0x56c8d(%rip), %rdx     # 0x76a9d
leaq 0xc8(%rsp), %rdi
callq 0xdf6a
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
movl $0x1, %ecx
callq 0x5a113
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x79166(%rip), %rdi     # 0x98fb0
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
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1fe8d
callq 0xa2b0
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1fe9f
callq 0xa2b0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
leaq 0x18(%rsp), %rbx
leaq 0x58(%rsp), %r12
je 0x1feb8
callq 0xa2b0
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1feca
callq 0xa2b0
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x1fedc
callq 0xa2b0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1fef2
callq 0xa2b0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1ff01
callq 0xa2b0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1ff10
callq 0xa2b0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1ffab
movq %rax, %rbx
jmp 0x1ffbd
movq %rax, %rbx
jmp 0x1ffcc
movq %rax, %rbx
jmp 0x1ffde
movq %rax, %rbx
jmp 0x1fff0
jmp 0x2004e
movq %rax, %rbx
jmp 0x20065
movq %rax, %rbx
testq %r14, %r14
je 0x20079
movq %r14, %rdi
jmp 0x20043
movq %rax, %rbx
jmp 0x2001a
movq %rax, %rbx
jmp 0x20079
movq %rax, %rbx
jmp 0x2003b
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x2006f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1ffab
callq 0xa2b0
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1ffbd
callq 0xa2b0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1ffcc
callq 0xa2b0
movq 0xa8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1ffde
callq 0xa2b0
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x1fff0
callq 0xa2b0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20051
callq 0xa2b0
jmp 0x20051
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2001a
callq 0xa2b0
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x20074
jmp 0x20079
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2003b
callq 0xa2b0
testq %rbp, %rbp
je 0x20079
movq %rbp, %rdi
callq 0xdcba
jmp 0x20079
jmp 0x2004e
jmp 0x2004e
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x20065
callq 0xa2b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x20079
callq 0xa2b0
movq %rbx, %rdi
callq 0xa510
nop