// File: /workspace/github_cpp_makefile_star2_O3/ATOMIC-LICHESS[P]ATOMKRAFT/main.cpp
// Function: main
int main(int argc, char* argv[]) {
	srand(time(0));
	
	
	setvbuf(stderr, NULL, _IONBF, 0);
	setvbuf(stdin, NULL, _IONBF, 0);
	setvbuf(stdout, NULL, _IONBF, 0);
	cout.rdbuf()->pubsetbuf(NULL, 0);
	cin.rdbuf()->pubsetbuf(NULL, 0);
	
	// Startup initializations
	init_bitboards();
	Position::init_zobrist();
	Position::init_piece_square_tables();
	init_kpk_bitbase();
	init_search();
	Threads.init();
	generate_explosionSquares();
	generate_squaresTouch();
	
	
#ifndef NDEBUG
	cout << "Debug version of atomkraft, define NDEBUG to get the release version." << endl;
#endif
	
	// Print copyright notice
	cout << engine_name() << endl;
	cout << "by " << engine_authors() << endl;
	cout << "built " << __DATE__ << " " << __TIME__ << endl << endl;
	
	if (CpuHasPOPCNT)
		cout << "Good! CPU has hardware POPCNT." << endl;
	
	
#ifdef SWEN_VERSION
	Options["Threads"] = UCIOption(2, 1, MAX_THREADS);
	Options["Hash"] = UCIOption(512, 4, 8192);
	Options["Book File"] = UCIOption("eao.bin");
#endif
	
	
	
	
#if defined ANALYZE_VERSION
    
    main_analyze();

#elif defined BOOK_VERSION
	
	main_book_from_file();
	//main_book_from_thinking();
	
#elif defined FICS_VERSION
	
	main_fics();


#elif defined UCI_VERSION

	main_uci(argc);
	
#else
	
	cout << "no version specified" << endl;
	
#endif
	
	
	
	
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
xorl %edi, %edi
callq 0x5370
movl %eax, %edi
callq 0x53b0
movq 0x26de2(%rip), %rax     # 0x3cfb0
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x26d82(%rip), %rax     # 0x3cf68
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x26d22(%rip), %rax     # 0x3cf20
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x26d8a(%rip), %r14     # 0x3cfa0
movq (%r14), %rax
movq -0x18(%rax), %rax
movq 0xe8(%r14,%rax), %rdi
movq (%rdi), %rax
xorl %esi, %esi
xorl %edx, %edx
callq *0x18(%rax)
movq 0x26d9a(%rip), %rax     # 0x3cfd0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq 0xe8(%rax,%rcx), %rdi
movq (%rdi), %rax
xorl %esi, %esi
xorl %edx, %edx
callq *0x18(%rax)
callq 0x82c7
callq 0x20c52
callq 0x20dcc
callq 0x7d50
callq 0x21ba4
leaq 0x3ab821(%rip), %rdi    # 0x3c1a90
callq 0x293de
callq 0x7b7b
callq 0x758c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x169e4
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x5460
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
leaq 0x18(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x162e0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x26cb9(%rip), %r14     # 0x3cfa0
leaq 0x1c102(%rip), %rsi     # 0x323f0
movl $0x3, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x171ea
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x5460
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x16358
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x1c095(%rip), %rsi     # 0x323f4
movl $0x6, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x1c088(%rip), %rsi     # 0x323fb
movl $0xb, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x1b339(%rip), %rsi     # 0x316c0
movl $0x1, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x1c06c(%rip), %rsi     # 0x32407
movl $0x8, %edx
movq %r14, %rdi
callq 0x5460
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
movl %ebx, %edi
callq 0x16444
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x1642e
jmp 0x1643b
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1643b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
movq %rbx, %rdi
callq 0x5790
nop