// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
xorl %edi, %edi
callq 0x5360
movl %eax, %edi
callq 0x53a0
movq 0x22aef(%rip), %rax     # 0x34fb0
movq (%rax), %rdi
pushq $0x2
popq %rbp
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x22a9f(%rip), %rax     # 0x34f78
movq (%rax), %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x22a4a(%rip), %rax     # 0x34f38
movq (%rax), %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x22a9d(%rip), %r14     # 0x34fa0
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 0x22aad(%rip), %rax     # 0x34fd0
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 0x7bae
callq 0x1a6c2
callq 0x1a7a6
callq 0x765e
callq 0x1b37f
leaq 0x3a7534(%rip), %rdi    # 0x3b9a90
callq 0x21d84
callq 0x746d
callq 0x73fc
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x12b6c
movq %r14, %rdi
movq %r15, %rsi
callq 0x5340
movq %rax, %rdi
callq 0x51d0
leaq 0x8(%rsp), %rdi
callq 0x5858
movq 0x22a04(%rip), %rdi     # 0x34fa0
leaq 0x16cdd(%rip), %rsi     # 0x29280
callq 0x53b0
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x12f59
movq %r14, %rdi
movq %r15, %rsi
callq 0x5340
movq %rax, %rdi
callq 0x51d0
leaq 0x8(%rsp), %rdi
callq 0x5858
movq 0x229c4(%rip), %rdi     # 0x34fa0
leaq 0x16ca1(%rip), %rsi     # 0x29284
callq 0x53b0
leaq 0x16c9c(%rip), %rsi     # 0x2928b
movq %rax, %rdi
callq 0x53b0
leaq 0x15f62(%rip), %rsi     # 0x28560
movq %rax, %rdi
callq 0x53b0
leaq 0x16c8a(%rip), %rsi     # 0x29297
movq %rax, %rdi
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
movq %rax, %rdi
callq 0x51d0
movl %ebx, %edi
callq 0x12650
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1263b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5858
movq %rbx, %rdi
callq 0x5780