user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r15
  lea    D11(%rip),%r15
  push   %r14
  lea    D47(%rip),%r14
  push   %r13
  lea    D59(%rip),%r13
  push   %r12
  push   %rbp
  lea    D12(%rip),%rbp
  push   %rbx
  lea    D57(%rip),%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  nopl   0x0(%rax,%rax,1)
L77:
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    (%rsp),%eax
  cmp    $0x8,%eax
  je     L92
  cmp    $0x7,%eax
  ja     L77
  movslq (%rbx,%rax,4),%rax
  add    %rbx,%rax
  notrack jmp *%rax
  xor    %eax,%eax
  call   <display@plt>
  jmp    L77
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <reverse@plt>
  xor    %eax,%eax
  call   <display@plt>
  jmp    L77
  mov    %r14,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <search@plt>
  cmp    $0x1,%eax
  je     L38
  mov    %r15,%rdi
  call   <puts@plt>
  jmp    L77
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <count@plt>
  lea    D15(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L77
  nopl   0x0(%rax)
  lea    D96(%rip),%rdi
  call   <puts@plt>
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <deleteele@plt>
  xor    %eax,%eax
  call   <display@plt>
  jmp    L77
  cs nopw 0x0(%rax,%rax,1)
  lea    D81(%rip),%rdi
  call   <puts@plt>
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <insertend@plt>
  xor    %eax,%eax
  call   <display@plt>
  jmp    L77
  xchg   %ax,%ax
  lea    D81(%rip),%rdi
  call   <puts@plt>
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <insertbeg@plt>
  xor    %eax,%eax
  call   <display@plt>
  jmp    L77
  xchg   %ax,%ax
L38:
  lea    D75(%rip),%rdi
  call   <puts@plt>
  jmp    L77
  nopl   0x0(%rax)
L92:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D11
type_guessed: string
name: read_data
arguments: data_label: D47
type_guessed: string
name: read_data
arguments: data_label: D59
type_guessed: string
name: read_data
arguments: data_label: D12
type_guessed: string
name: read_data
arguments: data_label: D15
type_guessed: string
name: read_data
arguments: data_label: D96
type_guessed: string
name: read_data
arguments: data_label: D81
type_guessed: string
name: read_data
arguments: data_label: D75
type_guessed: string

tool: D11: Element not found

tool: D47: Enter element to be searched

tool: D59: Enter choice: 1. Insertbeg 2. Insertend 3. Delete ele 4. Count 5. Search 6. Reverse 7. Display 8. Exit - 

tool: D12: %d

tool: D15: Count = %d

tool: D96: Enter element to be deleted

tool: D81: Enter element to be inserted

tool: D75: Element found

assistant: ```c
void main() {
  int ch, ele, z;
  while (1) {
    printf("Enter choice: 1. Insertbeg 2. Insertend 3. Delete ele 4. Count 5. Search 6. Reverse 7. Display 8. Exit - ");
    scanf("%d", &ch);
    if (ch == 8)
      break;
    switch (ch) {
    case 1:
      printf("Enter element to be inserted\n");
      scanf("%d", &ele);
      insertbeg(ele);
      display();
      break;
    case 2:
      printf("Enter element to be inserted\n");
      scanf("%d", &ele);
      insertend(ele);
      display();
      break;
    case 3:
      printf("Enter element to be deleted\n");
      scanf("%d", &ele);
      deleteele(ele);
      display();
      break;
    case 4:
      z = count();
      printf("Count = %d", z);
      break;
    case 5:
      printf("Enter element to be searched\n");
      scanf("%d", &ele);
      z = search(ele);
      if (z == 1)
        printf("Element found\n");
      else
        printf("Element not found\n");
      break;
    case 6:
      reverse();
      display();
      break;
    case 7:
      display();
      break;
    }
  }
}
```