// File: /workspace/github_cpp_makefile_star2_O1/ATOMIC-LICHESS[P]ATOMKRAFT/uci.cpp
// Function: execute_uci_command(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool execute_uci_command(const string& cmd) {

  static Position pos(StartPositionFEN, false, 0); // The root position

  UCIParser up(cmd);
  string token;

  up >> token; // operator>>() skips any whitespace

  if (token == "quit")
      return false;

  if (token == "go")
      return go(pos, up);

  if (token == "ucinewgame")
      pos.from_fen(StartPositionFEN, false);

  else if (token == "isready")
      cout << "readyok" << endl;

  else if (token == "position")
      set_position(pos, up);

  else if (token == "setoption")
      set_option(up);

  else if (token == "perft")
      perft(pos, up);

  else if (token == "d")
      pos.print();

  else if (token == "flip")
      pos.flip();

  else if (token == "eval")
  {
      read_evaluation_uci_options(pos.side_to_move());
      cout << trace_evaluate(pos) << endl;
  }

  else if (token == "key")
      cout << "key: " << hex     << pos.get_key()
           << "\nmaterial key: " << pos.get_material_key()
           << "\npawn key: "     << pos.get_pawn_key() << endl;

  else if (token == "uci")
      cout << "id name "     << engine_name()
           << "\nid author " << engine_authors()
           << "\n"           << Options.print_all()
           << "\nuciok"      << endl;
  else
      cout << "Unknown command: " << cmd << endl;

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x608, %rsp            # imm = 0x608
movq %rdi, %rbx
movb 0x3a278e(%rip), %al     # 0x3cd068
testb %al, %al
je 0x2b227
leaq 0x488(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x5720
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x5510
leaq 0x7b13(%rip), %rsi      # 0x32436
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2aa78
leaq 0x85f2(%rip), %rsi      # 0x32f2e
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2aa7f
leaq 0x84eb(%rip), %rsi      # 0x32e40
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2acd1
leaq 0x84dd(%rip), %rsi      # 0x32e4b
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2aced
leaq 0x84d4(%rip), %rsi      # 0x32e5b
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2ad3a
leaq 0x84c4(%rip), %rsi      # 0x32e64
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2ade2
leaq 0x84b5(%rip), %rsi      # 0x32e6e
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2adf6
leaq 0x5d32(%rip), %rsi      # 0x30704
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2ae39
leaq 0x8489(%rip), %rsi      # 0x32e74
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2afc2
leaq 0x8475(%rip), %rsi      # 0x32e79
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2afd5
leaq 0x8461(%rip), %rsi      # 0x32e7e
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2b032
leaq 0x8468(%rip), %rsi      # 0x32e9e
leaq 0x40(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2b11e
movq 0x11551(%rip), %rdi     # 0x3bfa0
leaq 0x8468(%rip), %rsi      # 0x32ebe
movl $0x11, %edx
callq 0x5460
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x11532(%rip), %rdi     # 0x3bfa0
callq 0x5460
jmp 0x2b0c8
xorl %ebx, %ebx
jmp 0x2b0d2
leaq 0x30(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
xorps %xmm0, %xmm0
leaq 0xc(%rsp), %rcx
movups %xmm0, (%rcx)
movaps %xmm0, -0xc(%rcx)
leaq 0x74(%rsp), %rcx
movq %rax, -0x4(%rcx)
leaq 0x6c(%rsp), %rcx
movq %rax, -0x4(%rcx)
leaq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x488(%rsp), %rbx
leaq 0x20(%rsp), %r14
leaq 0x842e(%rip), %r15      # 0x32f01
leaq 0x8430(%rip), %r12      # 0x32f0a
leaq 0x8430(%rip), %r13      # 0x32f11
leaq 0x70(%rsp), %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5510
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2ac66
movq %r14, %rdi
movq %r15, %rsi
callq 0x5120
testl %eax, %eax
je 0x2ac15
movq %r14, %rdi
movq %r12, %rsi
callq 0x5120
testl %eax, %eax
je 0x2ac1f
movq %r14, %rdi
movq %r13, %rsi
callq 0x5120
movq %rbp, %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x83ce(%rip), %rsi      # 0x32f17
callq 0x5120
leaq 0x74(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x83b8(%rip), %rsi      # 0x32f1d
callq 0x5120
leaq 0x68(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x83a1(%rip), %rsi      # 0x32f22
callq 0x5120
leaq 0x6c(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x838e(%rip), %rsi      # 0x32f27
callq 0x5120
leaq 0x8(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x8380(%rip), %rsi      # 0x32f31
callq 0x5120
leaq 0x10(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x836e(%rip), %rsi      # 0x32f37
callq 0x5120
leaq 0x14(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x835c(%rip), %rsi      # 0x32f3d
callq 0x5120
leaq 0xc(%rsp), %rsi
testl %eax, %eax
je 0x2ac08
movq %r14, %rdi
leaq 0x834d(%rip), %rsi      # 0x32f46
callq 0x5120
testl %eax, %eax
jne 0x2aae6
jmp 0x2ac48
movq %rbx, %rdi
callq 0x5220
jmp 0x2aae6
movb $0x1, 0x18(%rsp)
jmp 0x2aae6
movb $0x1, 0x19(%rsp)
jmp 0x2aae6
leaq 0x3a0af8(%rip), %rdi    # 0x3cb728
movq %r14, %rsi
callq 0x177e6
movq 0x60(%rsp), %rcx
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x60(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5510
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x2ac29
jmp 0x2aae6
movq 0x60(%rsp), %rax
movl $0x0, (%rax)
movl 0x3a1b41(%rip), %eax    # 0x3cc7b8
leaq 0x3a0aaa(%rip), %rdi    # 0x3cb728
movl 0x70(%rsp,%rax,4), %ecx
movq %rsp, %rsi
movl %ecx, (%rsi)
movl 0x68(%rsp,%rax,4), %eax
movl %eax, 0x4(%rsi)
leaq 0x80(%rsp), %rdx
leaq 0x7c(%rsp), %rcx
leaq 0x78(%rsp), %r8
callq 0x219de
movl %eax, %ebx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
leaq 0x50(%rsp), %r15
je 0x2b0d2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x2b0d2
movb $0x1, %bl
leaq 0x3a0a4e(%rip), %rdi    # 0x3cb728
leaq 0x3a0a27(%rip), %rsi    # 0x3cb708
xorl %edx, %edx
callq 0x1c7f2
jmp 0x2b0d2
movq 0x112ac(%rip), %rbx     # 0x3bfa0
leaq 0x8158(%rip), %rsi      # 0x32e53
movl $0x7, %edx
movq %rbx, %rdi
callq 0x5460
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq 0x1127a(%rip), %rdi     # 0x3bfa0
callq 0x5050
movb $0x1, %bl
movq %rax, %rdi
callq 0x5270
jmp 0x2b0d2
leaq 0x90(%rsp), %rbx
movq %rbx, -0x10(%rbx)
xorl %eax, %eax
movq %rax, -0x8(%rbx)
movb %al, (%rbx)
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x488(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5510
leaq 0x8156(%rip), %rsi      # 0x32ed0
leaq 0x80(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2ae0a
leaq 0x8147(%rip), %rsi      # 0x32ed9
leaq 0x80(%rsp), %rdi
callq 0x5120
testl %eax, %eax
je 0x2ae4e
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2adbe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x80(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2addb
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5400
movb $0x1, %bl
jmp 0x2b0d2
movb $0x1, %bl
leaq 0x488(%rsp), %rdi
callq 0x2b3a2
jmp 0x2b0d2
movb $0x1, %bl
leaq 0x488(%rsp), %rdi
callq 0x2b68d
jmp 0x2b0d2
leaq 0x3a0917(%rip), %rdi    # 0x3cb728
leaq 0x3a08f0(%rip), %rsi    # 0x3cb708
xorl %edx, %edx
callq 0x1c7f2
leaq 0x488(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5510
jmp 0x2af77
movb $0x1, %bl
leaq 0x3a08e6(%rip), %rdi    # 0x3cb728
xorl %esi, %esi
callq 0x1dad4
jmp 0x2b0d2
leaq 0x10(%rsp), %r13
leaq 0x488(%rsp), %rbx
leaq 0x80(%rsp), %r14
leaq 0x80e2(%rip), %r15      # 0x32f4c
movq %rsp, %r12
leaq 0x20(%rsp), %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5510
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2aef1
movq %r14, %rdi
movq %r15, %rsi
callq 0x5120
testl %eax, %eax
je 0x2aef1
movq %r13, (%rsp)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x1591c
movq %r12, %rdi
leaq 0x577d(%rip), %rsi      # 0x30640
callq 0x5820
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x5130
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2ae72
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x2ae72
movq %rsp, %rsi
movq %r13, (%rsi)
movabsq $0x736568435f494355, %rax # imm = 0x736568435F494355
movq %rax, 0x10(%rsi)
movl $0x30363973, 0x18(%rsi) # imm = 0x30363973
movq $0xc, 0x8(%rsi)
movb $0x0, 0x1c(%rsi)
leaq 0x3a2159(%rip), %rdi    # 0x3cd078
callq 0x15516
addq $0x20, %rax
leaq 0x6268(%rip), %rsi      # 0x31197
movq %rax, %rdi
callq 0x5120
xorl %edx, %edx
testl %eax, %eax
sete %dl
leaq 0x3a07e3(%rip), %rdi    # 0x3cb728
leaq 0x20(%rsp), %rsi
callq 0x1c7f2
movq (%rsp), %rdi
cmpq %r13, %rdi
leaq 0x50(%rsp), %r15
leaq 0x90(%rsp), %rbx
leaq 0x30(%rsp), %r14
je 0x2af77
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x488(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5510
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2ada7
leaq 0x3a0783(%rip), %rdi    # 0x3cb728
leaq 0x80(%rsp), %rsi
callq 0x177e6
leaq 0x3a076f(%rip), %rdi    # 0x3cb728
movl %eax, %esi
callq 0x1eeae
jmp 0x2af77
movb $0x1, %bl
leaq 0x3a075d(%rip), %rdi    # 0x3cb728
callq 0x209ac
jmp 0x2b0d2
movl 0x3a17dd(%rip), %edi    # 0x3cc7b8
callq 0x10d5a
leaq 0x3a0741(%rip), %rsi    # 0x3cb728
leaq 0x80(%rsp), %rdi
callq 0x112bb
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x10f95(%rip), %rdi     # 0x3bfa0
callq 0x5460
movq %rax, %rdi
callq 0x51c0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2adcb
jmp 0x2addb
movq 0x10f67(%rip), %rbx     # 0x3bfa0
leaq 0x7e4c(%rip), %rsi      # 0x32e8c
movl $0x5, %edx
movq %rbx, %rdi
callq 0x5460
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
movq 0x3a1ff7(%rip), %rax    # 0x3cd060
movq 0x38(%rax), %rsi
movq %rbx, %rdi
callq 0x5260
movq %rax, %rbx
leaq 0x7e03(%rip), %rsi      # 0x32e82
movl $0xf, %edx
movq %rax, %rdi
callq 0x5460
movq 0x3a1fcd(%rip), %rax    # 0x3cd060
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x5260
movq %rax, %rbx
leaq 0x7de9(%rip), %rsi      # 0x32e92
movl $0xb, %edx
movq %rax, %rdi
callq 0x5460
movq 0x3a1fa3(%rip), %rax    # 0x3cd060
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x5260
movb $0x1, %bl
movq %rax, %rdi
callq 0x51c0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b0e9
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x10e90(%rip), %rsi     # 0x3bf80
leaq 0x488(%rsp), %rdi
callq 0x55b0
leaq 0x500(%rsp), %rdi
callq 0x5140
movl %ebx, %eax
addq $0x608, %rsp            # imm = 0x608
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10e7b(%rip), %rdi     # 0x3bfa0
leaq 0x7d76(%rip), %rsi      # 0x32ea2
movl $0x8, %edx
callq 0x5460
leaq 0x80(%rsp), %rdi
callq 0x1646c
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x10e46(%rip), %rdi     # 0x3bfa0
callq 0x5460
movq %rax, %rbx
leaq 0x7d42(%rip), %rsi      # 0x32eab
movl $0xb, %edx
movq %rax, %rdi
callq 0x5460
leaq 0x20(%rsp), %rdi
callq 0x16c7a
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x5460
movq %rax, %rbx
leaq 0x69f1(%rip), %rsi      # 0x31b8d
movl $0x1, %edx
movq %rax, %rdi
callq 0x5460
leaq 0x3a1ec8(%rip), %rsi    # 0x3cd078
movq %rsp, %rdi
callq 0x2d7ac
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5460
movq %rax, %rbx
leaq 0x7ce4(%rip), %rsi      # 0x32eb7
movl $0x6, %edx
movq %rax, %rdi
callq 0x5460
movq %rbx, %rdi
callq 0x51c0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b203
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b018
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x2b018
leaq 0x3a1e3a(%rip), %rdi    # 0x3cd068
callq 0x57c0
testl %eax, %eax
je 0x2a8e2
leaq 0x3a04e6(%rip), %rdi    # 0x3cb728
leaq 0x3a04bf(%rip), %rsi    # 0x3cb708
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1c7c2
leaq 0x3a1e0f(%rip), %rdi    # 0x3cd068
callq 0x5240
jmp 0x2a8e2
movq %rax, %rbx
leaq 0x3a1dfb(%rip), %rdi    # 0x3cd068
callq 0x5230
jmp 0x2b39a
jmp 0x2b27d
jmp 0x2b2c1
jmp 0x2b2fb
movq %rax, %rbx
jmp 0x2b2a4
jmp 0x2b2c1
jmp 0x2b2fb
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b2a4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b2c4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x2b2c4
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x2b32f
jmp 0x2b2dc
jmp 0x2b300
jmp 0x2b33e
jmp 0x2b2dc
jmp 0x2b300
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2b303
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x2b303
jmp 0x2b300
jmp 0x2b33e
movq %rax, %rbx
jmp 0x2b35d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2b31f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x2b35d
movq 0x90(%rsp), %rsi
jmp 0x2b355
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2b35d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x2b379
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x10c00(%rip), %rsi     # 0x3bf80
leaq 0x488(%rsp), %rdi
callq 0x55b0
leaq 0x500(%rsp), %rdi
callq 0x5140
movq %rbx, %rdi
callq 0x5790