// File: /workspace/github_cpp_makefile_star2_O2/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 $0x628, %rsp            # imm = 0x628
movq %rdi, %rbx
movb 0x3a2ed6(%rip), %al     # 0x3c6068
testb %al, %al
je 0x23b6f
leaq 0xa0(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5730
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x54e0
leaq 0x70e9(%rip), %rsi      # 0x2a2be
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x231ea
xorl %ebx, %ebx
jmp 0x2394e
leaq 0x7bbd(%rip), %rsi      # 0x2adae
leaq 0x50(%rsp), %rdi
callq 0x11daf
leaq 0x10(%rsp), %r14
testb %al, %al
je 0x233da
movq %rsp, %rbx
movq %r14, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
xorpd %xmm0, %xmm0
leaq 0x2c(%rsp), %rax
movupd %xmm0, (%rax)
leaq 0x7c(%rsp), %rcx
andq $0x0, -0x4(%rcx)
leaq 0x74(%rsp), %rcx
andq $0x0, -0x4(%rcx)
movapd %xmm0, -0xc(%rax)
leaq 0x220(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0xa0(%rsp), %r14
leaq 0x7b28(%rip), %r15      # 0x2ad81
leaq 0x7b2a(%rip), %r12      # 0x2ad8a
leaq 0x7b2a(%rip), %r13      # 0x2ad91
leaq 0x78(%rsp), %rbp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x54e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2340b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x11daf
testb %al, %al
je 0x2329f
movb $0x1, 0x38(%rsp)
jmp 0x2326c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11daf
testb %al, %al
je 0x232b5
movb $0x1, 0x39(%rsp)
jmp 0x2326c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x11daf
movq %rbp, %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7ac2(%rip), %rsi      # 0x2ad97
callq 0x11daf
leaq 0x7c(%rsp), %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7aac(%rip), %rsi      # 0x2ad9d
callq 0x11daf
leaq 0x70(%rsp), %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7a99(%rip), %rsi      # 0x2ada2
callq 0x11daf
leaq 0x74(%rsp), %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7a86(%rip), %rsi      # 0x2ada7
callq 0x11daf
leaq 0x28(%rsp), %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7a78(%rip), %rsi      # 0x2adb1
callq 0x11daf
leaq 0x30(%rsp), %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7a66(%rip), %rsi      # 0x2adb7
callq 0x11daf
leaq 0x34(%rsp), %rsi
testb %al, %al
jne 0x23377
movq %rbx, %rdi
leaq 0x7a54(%rip), %rsi      # 0x2adbd
callq 0x11daf
leaq 0x2c(%rsp), %rsi
testb %al, %al
je 0x23384
movq %r14, %rdi
callq 0x5220
jmp 0x2326c
movq %rbx, %rdi
leaq 0x7a38(%rip), %rsi      # 0x2adc6
callq 0x11daf
testb %al, %al
je 0x2326c
jmp 0x233bc
leaq 0x3a1384(%rip), %rdi    # 0x3c4728
movq %rbx, %rsi
callq 0x13659
movq 0x48(%rsp), %rcx
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x48(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x54e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x2339d
jmp 0x2326c
leaq 0x78df(%rip), %rsi      # 0x2acc0
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x2345e
movb $0x1, %bl
leaq 0x3a1330(%rip), %rdi    # 0x3c4728
leaq 0x3a1309(%rip), %rsi    # 0x3c4708
xorl %edx, %edx
callq 0x1740c
jmp 0x2394e
movq 0x48(%rsp), %rax
andl $0x0, (%rax)
movl 0x3a239f(%rip), %eax    # 0x3c57b8
leaq 0x3a1308(%rip), %rdi    # 0x3c4728
movl 0x78(%rsp,%rax,4), %ecx
leaq 0x20(%rsp), %rsi
movl %ecx, (%rsi)
movl 0x70(%rsp,%rax,4), %eax
movl %eax, 0x4(%rsi)
leaq 0x220(%rsp), %rdx
leaq 0x9c(%rsp), %rcx
leaq 0x98(%rsp), %r8
callq 0x1b60e
movl %eax, %ebx
movq %rsp, %rdi
callq 0x5858
jmp 0x2394e
leaq 0x7866(%rip), %rsi      # 0x2accb
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23495
movq 0x11b26(%rip), %rdi     # 0x34fa0
leaq 0x7852(%rip), %rsi      # 0x2acd3
callq 0x53b0
movb $0x1, %bl
movq %rax, %rdi
callq 0x51d0
jmp 0x2394e
leaq 0x783f(%rip), %rsi      # 0x2acdb
leaq 0x50(%rsp), %rdi
callq 0x11daf
leaq 0x230(%rsp), %r15
testb %al, %al
je 0x2352d
leaq 0x220(%rsp), %rsi
movq %r15, (%rsi)
andq $0x0, 0x8(%rsi)
xorl %eax, %eax
movb %al, 0x10(%rsi)
movq %r14, (%rsp)
andq $0x0, 0x8(%rsp)
movb %al, 0x10(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x54e0
leaq 0x7867(%rip), %rsi      # 0x2ad50
leaq 0x220(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23703
leaq 0x3a1223(%rip), %rdi    # 0x3c4728
leaq 0x3a11fc(%rip), %rsi    # 0x3c4708
xorl %edx, %edx
callq 0x1740c
leaq 0xa0(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x54e0
jmp 0x238c0
leaq 0x77b0(%rip), %rsi      # 0x2ace4
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23622
movq %r15, 0x220(%rsp)
andq $0x0, 0x228(%rsp)
xorl %eax, %eax
movb %al, 0x230(%rsp)
movq %r14, (%rsp)
andq $0x0, 0x8(%rsp)
movb %al, 0x10(%rsp)
leaq 0x5b32(%rip), %rsi      # 0x290a7
leaq 0x20(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x9c42
leaq 0xa0(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x54e0
leaq 0xa0(%rsp), %rdi
movq %rsp, %rsi
callq 0x54e0
leaq 0xa0(%rsp), %rbx
leaq 0x220(%rsp), %r14
leaq 0x77aa(%rip), %r15      # 0x2ad6a
leaq 0x4f99(%rip), %r12      # 0x28560
leaq 0x78(%rsp), %r13
movq %rsp, %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x23798
movq %r14, %rdi
movq %r15, %rsi
callq 0x21889
testb %al, %al
je 0x23798
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1ab28
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5830
movq %r13, %rdi
callq 0x5858
jmp 0x235cf
leaq 0x76c5(%rip), %rsi      # 0x2acee
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23847
leaq 0xa0(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x5220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2394c
callq 0x130ea
movq %rax, %r15
movl 0x220(%rsp), %esi
addl %esi, %esi
leaq 0x3a10ae(%rip), %rdi    # 0x3c4728
callq 0x1b54c
movq %rax, %rbx
callq 0x130ea
movq %rax, %r14
movq 0x1190f(%rip), %rdi     # 0x34fa0
leaq 0x773a(%rip), %rsi      # 0x2add2
callq 0x53b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5380
leaq 0x772b(%rip), %rsi      # 0x2adda
movq %rax, %rdi
callq 0x53b0
subl %r15d, %r14d
movq %rax, %rdi
movl %r14d, %esi
callq 0x5760
leaq 0x771a(%rip), %rsi      # 0x2ade6
movq %rax, %rdi
callq 0x53b0
cvtsi2sd %rbx, %xmm0
cvtsi2sd %r14d, %xmm1
divsd 0x75d2(%rip), %xmm1     # 0x2acb8
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
movq %rax, %rdi
callq 0x5760
movq %rax, %rdi
callq 0x51d0
jmp 0x2394c
leaq 0x764f(%rip), %rsi      # 0x2ad59
leaq 0x220(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23937
leaq 0xa0(%rsp), %rbx
leaq 0x220(%rsp), %r14
leaq 0x7696(%rip), %r15      # 0x2adcc
leaq 0x4e23(%rip), %r12      # 0x28560
leaq 0x20(%rsp), %r13
movq %rsp, %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x23875
movq %r14, %rdi
movq %r15, %rsi
callq 0x21889
testb %al, %al
je 0x23875
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1320e
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5830
movq %r13, %rdi
callq 0x5858
jmp 0x23745
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x54e0
leaq 0xa0(%rsp), %rbx
leaq 0x220(%rsp), %r14
leaq 0x4d9f(%rip), %r15      # 0x28560
leaq 0x78(%rsp), %r12
leaq 0x20(%rsp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x23807
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1ab28
movq %r13, %rdi
movq %r12, %rsi
callq 0x5830
movq %r12, %rdi
callq 0x5858
jmp 0x237cb
leaq 0x3a286a(%rip), %rbx    # 0x3c6078
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x23c52
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x23907
leaq 0x3a284b(%rip), %rdi    # 0x3c6078
movq %rsp, %rsi
callq 0x11dbc
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x24f66
jmp 0x2392d
leaq 0x4dd6(%rip), %rsi      # 0x28624
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23979
movb $0x1, %bl
leaq 0x3a0ebf(%rip), %rdi    # 0x3c4728
xorl %esi, %esi
callq 0x18308
jmp 0x2394e
leaq 0x74e1(%rip), %rsi      # 0x2ad5d
leaq 0x20(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x9c42
leaq 0x3a27e6(%rip), %rdi    # 0x3c6078
leaq 0x20(%rsp), %rsi
callq 0x11d0c
movq %rax, %rdi
callq 0x11d78
movzbl %al, %edx
leaq 0x3a0e7a(%rip), %rdi    # 0x3c4728
movq %rsp, %rsi
callq 0x1740c
leaq 0x20(%rsp), %rdi
callq 0x5858
leaq 0xa0(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x54e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x23937
leaq 0x3a0e3e(%rip), %rdi    # 0x3c4728
leaq 0x220(%rsp), %rsi
callq 0x13659
leaq 0x3a0e2a(%rip), %rdi    # 0x3c4728
movl %eax, %esi
callq 0x190b8
jmp 0x238c0
movq 0x11692(%rip), %rdi     # 0x34fa0
leaq 0x745b(%rip), %rsi      # 0x2ad70
callq 0x53b0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x5340
movq %rax, %rdi
callq 0x51d0
leaq 0x20(%rsp), %rdi
callq 0x5858
movq %rsp, %rdi
callq 0x5858
leaq 0x220(%rsp), %rdi
callq 0x5858
movb $0x1, %bl
leaq 0x50(%rsp), %rdi
callq 0x5858
leaq 0xa0(%rsp), %rdi
callq 0x51a0
movl %ebx, %eax
addq $0x628, %rsp            # imm = 0x628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7374(%rip), %rsi      # 0x2acf4
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x2399e
movb $0x1, %bl
leaq 0x3a0d91(%rip), %rdi    # 0x3c4728
callq 0x1a84c
jmp 0x2394e
leaq 0x7354(%rip), %rsi      # 0x2acf9
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x239f3
movl 0x3a1dff(%rip), %edi    # 0x3c57b8
callq 0xec74
leaq 0x3a0d63(%rip), %rsi    # 0x3c4728
leaq 0x220(%rsp), %rdi
callq 0xf006
movq 0x115c7(%rip), %rdi     # 0x34fa0
leaq 0x220(%rsp), %rsi
callq 0x5340
movq %rax, %rdi
callq 0x51d0
jmp 0x2393f
leaq 0x7304(%rip), %rsi      # 0x2acfe
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23a8f
movq 0x1158d(%rip), %rdi     # 0x34fa0
leaq 0x72f2(%rip), %rsi      # 0x2ad0c
callq 0x53b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq 0x3a2625(%rip), %rcx    # 0x3c6060
movq 0x38(%rcx), %rsi
movq %rax, %rdi
callq 0x5260
leaq 0x72b4(%rip), %rsi      # 0x2ad02
movq %rax, %rdi
callq 0x53b0
movq 0x3a2603(%rip), %rcx    # 0x3c6060
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x5260
leaq 0x72a2(%rip), %rsi      # 0x2ad12
movq %rax, %rdi
callq 0x53b0
movq 0x3a25e1(%rip), %rcx    # 0x3c6060
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x5260
jmp 0x23486
leaq 0x7288(%rip), %rsi      # 0x2ad1e
leaq 0x50(%rsp), %rdi
callq 0x11daf
testb %al, %al
je 0x23b4c
movq 0x114f1(%rip), %rdi     # 0x34fa0
leaq 0x726c(%rip), %rsi      # 0x2ad22
callq 0x53b0
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x12b6c
leaq 0x220(%rsp), %rsi
movq %rbx, %rdi
callq 0x5340
leaq 0x7249(%rip), %rsi      # 0x2ad2b
movq %rax, %rdi
callq 0x53b0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x12f59
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x5340
leaq 0x5f96(%rip), %rsi      # 0x29a9d
movq %rax, %rdi
callq 0x53b0
movq %rax, %rbx
leaq 0x3a255f(%rip), %rsi    # 0x3c6078
leaq 0x20(%rsp), %rdi
callq 0x24bd0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x5340
leaq 0x7200(%rip), %rsi      # 0x2ad37
movq %rax, %rdi
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
jmp 0x2392d
movq 0x1144d(%rip), %rdi     # 0x34fa0
leaq 0x71e4(%rip), %rsi      # 0x2ad3e
callq 0x53b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5340
jmp 0x23486
leaq 0x3a24f2(%rip), %rdi    # 0x3c6068
callq 0x57b0
testl %eax, %eax
je 0x2319a
leaq 0x3a0b9e(%rip), %rdi    # 0x3c4728
leaq 0x3a0b77(%rip), %rsi    # 0x3c4708
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x173dc
leaq 0x3a24c7(%rip), %rdi    # 0x3c6068
callq 0x5240
jmp 0x2319a
movq %rax, %rbx
leaq 0x3a24b3(%rip), %rdi    # 0x3c6068
callq 0x5230
jmp 0x23c4a
jmp 0x23c13
jmp 0x23bcd
jmp 0x23c0e
jmp 0x23c13
jmp 0x23bcd
jmp 0x23bff
jmp 0x23c0e
movq %rax, %rbx
jmp 0x23c1e
jmp 0x23c13
jmp 0x23c28
jmp 0x23bff
jmp 0x23c13
jmp 0x23bff
jmp 0x23c13
jmp 0x23bff
jmp 0x23bff
jmp 0x23c13
jmp 0x23bec
jmp 0x23bff
jmp 0x23c13
jmp 0x23c28
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x5858
jmp 0x23c02
jmp 0x23bff
jmp 0x23bff
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5858
jmp 0x23c16
movq %rax, %rbx
jmp 0x23c33
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5858
leaq 0x220(%rsp), %rdi
jmp 0x23c2e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5858
leaq 0x50(%rsp), %rdi
callq 0x5858
leaq 0xa0(%rsp), %rdi
callq 0x51a0
movq %rbx, %rdi
callq 0x5780