user: 请将以下的汇编代码转换成C语言代码:

```asm
<display_game_menu>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  mov    %r9d,%ecx
  mov    0x10(%rbp),%edx
  mov    0x18(%rbp),%eax
  mov    %cl,-0x38(%rbp)
  mov    %dl,-0x3c(%rbp)
  mov    %al,-0x40(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movb   $0x0,-0x11(%rbp)
L47:
  movsbl -0x38(%rbp),%ecx
  mov    -0x2c(%rbp),%esi
  mov    -0x28(%rbp),%edx
  mov    -0x24(%rbp),%eax
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D67(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpb   $0x30,-0x3c(%rbp)
  je     L96
  movsbl -0x3c(%rbp),%eax
  mov    -0x30(%rbp),%edx
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L96:
  cmpb   $0x30,-0x40(%rbp)
  je     L74
  movsbl -0x40(%rbp),%eax
  mov    -0x34(%rbp),%edx
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L74:
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,0x28(%rbp)
  jne    L43
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L27
  mov    0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L27
L43:
  cmpl   $0x1,0x28(%rbp)
  jne    L27
  lea    -0x11(%rbp),%rax
  mov    %rax,%rsi
  lea    D59(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L25
  mov    0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L27
L25:
  movzbl -0x11(%rbp),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <char_convert@plt>
  mov    %eax,-0x10(%rbp)
L27:
  mov    $0x0,%eax
  call   <_flushall@plt>
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    -0x10(%rbp),%eax
  mov    0x38(%rbp),%edx
  mov    0x30(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <is_valid_item@plt>
  test   %eax,%eax
  je     L47
  mov    -0x10(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L73
  call   <__stack_chk_fail@plt>
L73:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D67
type: string
name: retrieve_data
arguments: data_label: D29
type: string
name: retrieve_data
arguments: data_label: D45
type: string
name: retrieve_data
arguments: data_label: D0
type: string
name: retrieve_data
arguments: data_label: D70
type: string
name: retrieve_data
arguments: data_label: D59
type: string
name: retrieve_data
arguments: data_label: D57
type: string

tool: D67: Question #%d: %d %c %d

tool: D29:  %c %d

tool: D45:  = ?

tool: D0: %s



tool: D70:  %d

tool: D59:  %c

tool: D57: cls

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;
}
```