// File: /workspace/github_cpp_makefile_star2_O1/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 0x26372(%rip), %rax     # 0x3bfb0
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x26312(%rip), %rax     # 0x3bf68
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x262b2(%rip), %rax     # 0x3bf20
movq (%rax), %rdi
xorl %esi, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x5040
movq 0x2631a(%rip), %r14     # 0x3bfa0
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 0x2632a(%rip), %rax     # 0x3bfd0
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 0x7d83
callq 0x20796
callq 0x2090a
callq 0x77a8
callq 0x216dc
leaq 0x3aadb1(%rip), %rdi    # 0x3c0a90
callq 0x2909a
callq 0x75c0
callq 0x752c
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x1646c
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 0x15d50
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x26249(%rip), %r14     # 0x3bfa0
leaq 0x1b612(%rip), %rsi     # 0x31370
movl $0x3, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x16c7a
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 0x15dc8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x1b5a5(%rip), %rsi     # 0x31374
movl $0x6, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x1b598(%rip), %rsi     # 0x3137b
movl $0xb, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x1a849(%rip), %rsi     # 0x30640
movl $0x1, %edx
movq %r14, %rdi
callq 0x5460
leaq 0x1b57c(%rip), %rsi     # 0x31387
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 0x15eb4
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 0x15e9e
jmp 0x15eab
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15eab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5400
movq %rbx, %rdi
callq 0x5790
nop