user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<display_game_menu>:
  endbr64
  push   %r15
  lea    D3(%rip),%r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x38,%rsp
  movzbl 0x78(%rsp),%eax
  mov    %ecx,0x14(%rsp)
  movzbl 0x70(%rsp),%ecx
  mov    %r8d,0x18(%rsp)
  mov    %al,0x13(%rsp)
  mov    0x80(%rsp),%r14
  mov    %cl,0x12(%rsp)
  mov    0x98(%rsp),%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movsbl %r9b,%eax
  movl   $0x0,0x24(%rsp)
  mov    %eax,0xc(%rsp)
  movsbl %cl,%eax
  movb   $0x0,0x23(%rsp)
  mov    %eax,0x1c(%rsp)
  jmp    L17
  nopl   0x0(%rax)
L54:
  cmpl   $0x1,0x88(%rsp)
  je     L79
L96:
  xor    %eax,%eax
  call   <_flushall@plt>
  mov    %r15,%rdi
  call   <system@plt>
  mov    0x90(%rsp),%esi
  mov    0x24(%rsp),%edi
  mov    %ebx,%edx
  call   <is_valid_item@plt>
  test   %eax,%eax
  jne    L42
L17:
  mov    0xc(%rsp),%ecx
  xor    %eax,%eax
  mov    %ebp,%r8d
  mov    %r12d,%edx
  mov    %r13d,%esi
  lea    D58(%rip),%rdi
  call   <printf@plt>
  cmpb   $0x30,0x12(%rsp)
  je     L98
  mov    0x14(%rsp),%edx
  mov    0x1c(%rsp),%esi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L98:
  movzbl 0x13(%rsp),%eax
  cmp    $0x30,%al
  je     L71
  mov    0x18(%rsp),%edx
  movsbl %al,%esi
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L71:
  lea    D60(%rip),%rdi
  call   <puts@plt>
  mov    %r14,%rsi
  lea    D69(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x88(%rsp),%eax
  test   %eax,%eax
  jne    L54
  xor    %eax,%eax
  lea    0x24(%rsp),%rsi
  lea    D75(%rip),%rdi
  call   <scanf@plt>
  test   %eax,%eax
  jne    L96
L108:
  lea    -0x1(%rbx),%eax
  mov    %eax,0x24(%rsp)
  jmp    L96
L79:
  xor    %eax,%eax
  lea    0x23(%rsp),%rsi
  lea    D39(%rip),%rdi
  call   <scanf@plt>
  test   %eax,%eax
  je     L108
  movsbl 0x23(%rsp),%edi
  call   <char_convert@plt>
  mov    %eax,0x24(%rsp)
  jmp    L96
  nopw   0x0(%rax,%rax,1)
L42:
  mov    0x24(%rsp),%eax
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L55
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D3
type: string
name: retrieve_data
arguments: label: D58
type: string
name: retrieve_data
arguments: label: D0
type: string
name: retrieve_data
arguments: label: D60
type: string
name: retrieve_data
arguments: label: D69
type: string
name: retrieve_data
arguments: label: D75
type: string
name: retrieve_data
arguments: label: D39
type: string

tool: D3: cls

tool: D58: Question #%d: %d %c %d

tool: D0:  %c %d

tool: D60:  = ?

tool: D69: %s



tool: D75:  %d

tool: D39:  %c

assistant: ```c
int display_game_menu(int questions, int term1, int term2, int term3, int term4, char operand1, char operand2, char operand3, char menu_items[], int menu_type, int num_items, int min_items) {
  int option = 0, error_check = 0;
  char char_option = '\0';
  do {
    printf("Question #%d: %d %c %d", questions, term1, operand1, term2);
    if (operand2 != '0') {
      printf(" %c %d", operand2, term3);
    }
    if (operand3 != '0') {
      printf(" %c %d", operand3, term4);
    }
    printf(" = ?\n");
    printf("%s\n\n", menu_items);
    if (menu_type == 0) {
      error_check = scanf(" %d", &option);
      if (!error_check) {
        option = min_items - 1;
      }
    } else if (menu_type == 1) {
      error_check = scanf(" %c", &char_option);
      if (!error_check) {
        option = min_items - 1;
      } else {
        option = char_convert(char_option);
      }
    }
    _flushall();
    system("cls");
  } while (!is_valid_item(option, num_items, min_items));
  return option;
}
```