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

```asm
<main>:
  endbr64
  push   %r15
  lea    D77(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D72(%rip),%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    0x4(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  lea    D51(%rip),%rdi
  mov    %rax,%r13
  call   <puts@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L128
  mov    %r13,%r12
  xor    %ebp,%ebp
L284:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <scanf@plt>
  add    $0x4,%r12
  cmp    %ebp,0x4(%rsp)
  jg     L284
L128:
  xor    %eax,%eax
  lea    0x8(%rsp),%r12
  call   <mainchoices@plt>
  mov    %r12,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  cmp    $0xffffffff,%eax
  je     L9
  lea    D58(%rip),%r15
  lea    D12(%rip),%rbp
  lea    D112(%rip),%r14
  nopl   0x0(%rax)
L203:
  cmp    $0x5,%eax
  ja     L242
  movslq 0x0(%rbp,%rax,4),%rax
  add    %rbp,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
  mov    0x4(%rsp),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xchg   %ax,%ax
L197:
  xor    %eax,%eax
  call   <mainchoices@plt>
  mov    %r12,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  cmp    $0xffffffff,%eax
  jne    L203
L9:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L252
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
  mov    0x4(%rsp),%esi
  mov    %r13,%rdi
  call   <printfun@plt>
  jmp    L197
  cs nopw 0x0(%rax,%rax,1)
  lea    D50(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x4(%rsp),%edx
  mov    0x14(%rsp),%esi
  mov    %r13,%rdi
  call   <search@plt>
  mov    0x14(%rsp),%esi
  mov    %eax,%edx
  cmp    %eax,0x4(%rsp)
  jle    L135
  lea    D131(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L197
  xchg   %ax,%ax
  xor    %eax,%eax
  call   <deletechoices@plt>
  lea    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x10(%rsp),%eax
  cmp    $0x1,%eax
  je     L183
  cmp    $0x2,%eax
  jne    L197
  lea    D214(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x4(%rsp),%edx
  mov    0x14(%rsp),%esi
  mov    %r13,%rdi
  call   <search@plt>
  mov    0x4(%rsp),%edx
  mov    %eax,%esi
  cmp    %eax,%edx
  jle    L103
  mov    %r13,%rdi
  call   <deleteindex@plt>
  mov    0x14(%rsp),%esi
  lea    D238(%rip),%rdi
  mov    %eax,0x4(%rsp)
  mov    %eax,%edx
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L197
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <changechoices@plt>
  lea    0xc(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  cmp    $0x1,%eax
  je     L193
  cmp    $0x2,%eax
  je     L211
  lea    D177(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <mainchoices@plt>
  jmp    L197
L242:
  mov    %r15,%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <mainchoices@plt>
  jmp    L197
  nopl   0x0(%rax)
L135:
  lea    D170(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L197
L211:
  lea    D13(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  xor    %eax,%eax
  lea    D1(%rip),%rdi
  call   <scanf@plt>
  mov    0x10(%rsp),%esi
  mov    0x4(%rsp),%edx
  mov    %r13,%rdi
  call   <search@plt>
  mov    %eax,%esi
  movslq 0x4(%rsp),%rax
  cmp    %esi,%eax
  jle    L188
  mov    0x14(%rsp),%edx
  lea    D27(%rip),%rdi
  mov    %edx,0x0(%r13,%rax,4)
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L197
L193:
  lea    D207(%rip),%rdi
  call   <puts@plt>
  lea    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x10(%rsp),%eax
  mov    0x4(%rsp),%esi
  test   %eax,%eax
  js     L22
  cmp    %esi,%eax
  jl     L142
L22:
  sub    $0x1,%esi
  lea    D179(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <mainchoices@plt>
  jmp    L197
L183:
  lea    D160(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%esi
  mov    0x4(%rsp),%edx
  cmp    %edx,%esi
  jge    L279
  mov    %r13,%rdi
  call   <deleteindex@plt>
  mov    0x14(%rsp),%esi
  lea    D219(%rip),%rdi
  mov    %eax,0x4(%rsp)
  mov    %eax,%edx
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L197
L188:
  lea    D126(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <mainchoices@plt>
  jmp    L197
L279:
  lea    D198(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <mainchoices@plt>
  jmp    L197
L103:
  mov    0x14(%rsp),%esi
  lea    D92(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L197
L142:
  lea    D136(%rip),%rdi
  call   <puts@plt>
  lea    0x14(%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    %r13,%rdi
  call   <updateByIndex@plt>
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  xor    %eax,%eax
  lea    D221(%rip),%rdi
  call   <printf@plt>
  jmp    L197
L252:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D77
data_type: string
name: extract_symbolic_data
arguments: tag: D72
data_type: string
name: extract_symbolic_data
arguments: tag: D51
data_type: string
name: extract_symbolic_data
arguments: tag: D58
data_type: string
name: extract_symbolic_data
arguments: tag: D112
data_type: string
name: extract_symbolic_data
arguments: tag: D50
data_type: string
name: extract_symbolic_data
arguments: tag: D131
data_type: string
name: extract_symbolic_data
arguments: tag: D214
data_type: string
name: extract_symbolic_data
arguments: tag: D238
data_type: string
name: extract_symbolic_data
arguments: tag: D177
data_type: string
name: extract_symbolic_data
arguments: tag: D170
data_type: string
name: extract_symbolic_data
arguments: tag: D13
data_type: string
name: extract_symbolic_data
arguments: tag: D1
data_type: string
name: extract_symbolic_data
arguments: tag: D27
data_type: string
name: extract_symbolic_data
arguments: tag: D207
data_type: string
name: extract_symbolic_data
arguments: tag: D179
data_type: string
name: extract_symbolic_data
arguments: tag: D160
data_type: string
name: extract_symbolic_data
arguments: tag: D219
data_type: string
name: extract_symbolic_data
arguments: tag: D126
data_type: string
name: extract_symbolic_data
arguments: tag: D198
data_type: string
name: extract_symbolic_data
arguments: tag: D92
data_type: string
name: extract_symbolic_data
arguments: tag: D136
data_type: string
name: extract_symbolic_data
arguments: tag: D221
data_type: string

tool: D77: Enter the total no. of elements in the array.

tool: D72: %d

tool: D51: Enter the elements of the array.

tool: D58: None of the choices you eneterd matches the given choices.

tool: D112: size of the array is %d


tool: D50: Enter the value of the elem] to be searched in the array.

tool: D131: %d is present at the index %d.


tool: D214: Enter the element value to be deleted.

tool: D238: 
Deleted element %d. New size of the array is %d


tool: D177: 
Your choice doesn't match any of the available options

tool: D170: %d is not present in the array


tool: D13: 
Enter the old value followed by the new value.


tool: D1: %d%d

tool: D27: Updated value at the ind no. %d to %d.


tool: D207: 
Enter the index no. Remember that indexing starts from 0 in the array.


tool: D179: This index does not exist. Please choose an index between 0 to %d both inclusive.


tool: D160: 
Enter the index to be deleted.Remember that indexing starts from 0.

tool: D219: 

Deleted index no %d. New size of the array is %d


tool: D126: This value is not present in the array.

tool: D198: 
%d index is out of the array size.


tool: D92: 
%d is not present in the array, hence can't be deleted.


tool: D136: 
Enter the new value.

tool: D221: Updated the value of index no %d to %d


assistant: ```c
int main() {
  int n;
  printf("Enter the total no. of elements in the array.\n");
  scanf("%d", &n);
  int *a = (int *)malloc(sizeof(int) * n);
  printf("Enter the elements of the array.\n");
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  mainchoices();
  int ch;
  scanf("%d", &ch);
  while (ch != -1) {
    if (ch == 1) {
      changechoices();
      int chch;
      scanf("%d", &chch);
      if (chch == 1) {
        printf("\nEnter the index no. Remember that indexing starts from 0 in the array.\n\n");
        int ind, value;
        scanf("%d", &ind);
        if (ind < n && ind >= 0) {
          printf("\nEnter the new value.\n");
          scanf("%d", &value);
          updateByIndex(a, ind, value);
          printf("Updated the value of index no %d to %d\n", ind, value);
        } else {
          printf("This index does not exist. Please choose an index between 0 to %d both inclusive.\n", n - 1);
          mainchoices();
        }
      } else if (chch == 2) {
        printf("\nEnter the old value followed by the new value.\n\n");
        int oldv, newv;
        scanf("%d%d", &oldv, &newv);
        int in = search(a, oldv, n);
        if (in < n) {
          a[n] = newv;
          printf("Updated value at the ind no. %d to %d.\n", in, newv);
        } else {
          printf("This value is not present in the array.\n");
          mainchoices();
        }
      } else {
        printf("\nYour choice doesn't match any of the available options\n");
        mainchoices();
      }
    } else if (ch == 2) {
      deletechoices();
      int chdel;
      scanf("%d", &chdel);
      if (chdel == 1) {
        int ind;
        printf("\nEnter the index to be deleted.Remember that indexing starts from 0.\n");
        scanf("%d", &ind);
        if (ind < n) {
          n = deleteindex(a, ind, n);
          printf("\n\nDeleted index no %d. New size of the array is %d\n", ind, n);
        } else {
          printf("\n%d index is out of the array size.\n", ind);
          mainchoices();
        }
      } else if (chdel == 2) {
        printf("Enter the element value to be deleted.\n");
        int del;
        scanf("%d", &del);
        int ind = search(a, del, n);
        if (ind < n) {
          n = deleteindex(a, ind, n);
          printf("\nDeleted element %d. New size of the array is %d\n", del, n);
        } else {
          printf("\n%d is not present in the array, hence can't be deleted.\n", del);
        }
      }
    } else if (ch == 3) {
      printf("Enter the value of the elem] to be searched in the array.\n");
      int val;
      scanf("%d", &val);
      int fo = search(a, val, n);
      if (fo < n) {
        printf("%d is present at the index %d.\n", val, fo);
      } else {
        printf("%d is not present in the array\n", val);
      }
    } else if (ch == 4) {
      printfun(a, n);
    } else if (ch == 5) {
      printf("size of the array is %d\n", n);
    } else {
      printf("None of the choices you eneterd matches the given choices.\n");
      mainchoices();
    }
    mainchoices();
    scanf("%d", &ch);
  }
}
```