user: Converte this assembly snippet into its equivalent C code:

```asm
<enginecommand>:
  endbr64
  push   %r13
  push   %r12
  mov    %rsi,%r12
  lea    D12(%rip),%rsi
  push   %rbp
  sub    $0x310,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x308(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x100(%rsp),%r13
  lea    0x200(%rsp),%r8
  mov    %r13,%rcx
  mov    %rbp,%rdx
  call   <sscanf@plt>
  lea    D129(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L99
  lea    D116(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L103
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L4
  lea    D165(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L77
  lea    D31(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L118
  lea    D149(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L118
L77:
  lea    D49(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L118
  lea    D31(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L118
  lea    D149(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L118
  lea    D103(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L13
  lea    D151(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L118
  lea    D115(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    $0x1,%eax
  jmp    L63
  nopl   0x0(%rax)
L103:
  lea    D172(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    $0x1,%eax
L63:
  mov    0x308(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L162
  add    $0x310,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L118:
  lea    D51(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  jmp    L63
  nopl   0x0(%rax,%rax,1)
L99:
  lea    D2(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    $0x1,%eax
  jmp    L63
  xchg   %ax,%ax
L4:
  lea    D34(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    $0x1,%eax
  jmp    L63
  cs nopw 0x0(%rax,%rax,1)
L13:
  lea    D84(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    $0x1,%eax
  jmp    L63
L162:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D12
datatype: string
name: read_data
arguments: data_label: D129
datatype: string
name: read_data
arguments: data_label: D116
datatype: string
name: read_data
arguments: data_label: D1
datatype: string
name: read_data
arguments: data_label: D165
datatype: string
name: read_data
arguments: data_label: D31
datatype: string
name: read_data
arguments: data_label: D149
datatype: string
name: read_data
arguments: data_label: D49
datatype: string
name: read_data
arguments: data_label: D103
datatype: string
name: read_data
arguments: data_label: D151
datatype: string
name: read_data
arguments: data_label: D115
datatype: string
name: read_data
arguments: data_label: D172
datatype: string
name: read_data
arguments: data_label: D51
datatype: string
name: read_data
arguments: data_label: D2
datatype: string
name: read_data
arguments: data_label: D34
datatype: string
name: read_data
arguments: data_label: D84
datatype: string

tool: D12: %s %s %s

tool: D129: name

tool: D116: about

tool: D1: help

tool: D165: set

tool: D31: hashsize

tool: D149: book

tool: D49: get

tool: D103: protocolversion

tool: D151: gametype

tool: D115: 21

tool: D172: Simple Checkers 1.14

2002 by Martin Fierz

tool: D51: ?

tool: D2: Simple Checkers 1.14

tool: D34: simplechhelp.htm

tool: D84: 2

assistant: ```c
int enginecommand(char str[256], char reply[256]) {
  char command[256], param1[256], param2[256];
  sscanf(str, "%s %s %s", command, param1, param2);
  if (strcmp(command, "name") == 0) {
    sprintf(reply, "Simple Checkers 1.14");
    return 1;
  }
  if (strcmp(command, "about") == 0) {
    sprintf(reply, "Simple Checkers 1.14\n\n2002 by Martin Fierz");
    return 1;
  }
  if (strcmp(command, "help") == 0) {
    sprintf(reply, "simplechhelp.htm");
    return 1;
  }
  if (strcmp(command, "set") == 0) {
    if (strcmp(param1, "hashsize") == 0) {
      sprintf(reply, "?");
      return 0;
    }
    if (strcmp(param1, "book") == 0) {
      sprintf(reply, "?");
      return 0;
    }
  }
  if (strcmp(command, "get") == 0) {
    if (strcmp(param1, "hashsize") == 0) {
      sprintf(reply, "?");
      return 0;
    }
    if (strcmp(param1, "book") == 0) {
      sprintf(reply, "?");
      return 0;
    }
    if (strcmp(param1, "protocolversion") == 0) {
      sprintf(reply, "2");
      return 1;
    }
    if (strcmp(param1, "gametype") == 0) {
      sprintf(reply, "21");
      return 1;
    }
  }
  sprintf(reply, "?");
  return 0;
}
```