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

```asm
<main>:
  endbr64
  push   %r15
  lea    D105(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  movl   $0x5,0x2c(%rsp)
  call   <printf@plt>
  lea    0x30(%rsp),%rax
  lea    D27(%rip),%rdi
  mov    %rax,0x8(%rsp)
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <scanf@plt>
  cmpb   $0x0,0x30(%rsp)
  je     L113
  mov    $0x1,%eax
  lea    0x2f(%rsp),%rdx
  nopl   0x0(%rax)
L120:
  mov    %eax,%ebp
  add    $0x1,%rax
  cmpb   $0x0,(%rdx,%rax,1)
  jne    L120
L129:
  xor    %eax,%eax
  mov    %ebp,%esi
  lea    D123(%rip),%rdi
  call   <printf@plt>
  cmpl   $0x5,0x2c(%rsp)
  jne    L55
  lea    0x28(%rsp),%rax
  lea    0xa0(%rsp),%rcx
  mov    %ebp,0x14(%rsp)
  mov    %rax,(%rsp)
  lea    0x2c(%rsp),%rax
  lea    D74(%rip),%r15
  mov    %rcx,0x18(%rsp)
  lea    D86(%rip),%r14
  lea    D103(%rip),%r13
  mov    %rax,%rbp
  lea    D19(%rip),%r12
  lea    D72(%rip),%rbx
  jmp    L41
  xchg   %ax,%ax
L101:
  cmp    $0x2,%eax
  jne    L7
  mov    0x14(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <rev@plt>
L61:
  lea    D71(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  cmpl   $0x5,0x2c(%rsp)
  jne    L55
L41:
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%rsp),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x28(%rsp),%eax
  cmp    $0x3,%eax
  je     L158
  jg     L11
  cmp    $0x1,%eax
  jne    L101
  mov    0x8(%rsp),%rdi
  call   <copy@plt>
  jmp    L61
  nopl   0x0(%rax)
L11:
  cmp    $0x4,%eax
  jne    L7
  lea    D124(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  lea    D27(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%edx
  mov    0x18(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <concat@plt>
  jmp    L61
  cs nopw 0x0(%rax,%rax,1)
L158:
  mov    0x14(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <pal@plt>
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L7:
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L55:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L113:
  xor    %ebp,%ebp
  jmp    L129
L25:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D105
type: string
name: unpack_data
arguments: data_tag: D27
type: string
name: unpack_data
arguments: data_tag: D123
type: string
name: unpack_data
arguments: data_tag: D74
type: string
name: unpack_data
arguments: data_tag: D86
type: string
name: unpack_data
arguments: data_tag: D103
type: string
name: unpack_data
arguments: data_tag: D19
type: string
name: unpack_data
arguments: data_tag: D72
type: string
name: unpack_data
arguments: data_tag: D71
type: string
name: unpack_data
arguments: data_tag: D24
type: string
name: unpack_data
arguments: data_tag: D124
type: string
name: unpack_data
arguments: data_tag: D42
type: string

tool: D105: 
Enter string s1: 

tool: D27: %s

tool: D123: Length of string: %d


tool: D74: 
1) To copy a string

tool: D86: 
2) To reverse a string

tool: D103: 
3) To find whether it is palindrome or not

tool: D19: 
4) To concatenate two strings

tool: D72: %d

tool: D71: 
Enter 5 to continue, else exit: 

tool: D24: 
Enter 1,2,3 or 4: 

tool: D124: Enter second string: 

tool: D42: 
Invalid Choice

assistant: ```c
int main() {
  char s1[100], s2[100];
  int choice, len, ans = 5;
  printf("\nEnter string s1: ");
  scanf("%s", s1);
  for (len = 0; s1[len] != '\0'; ++len)
    ;
  printf("Length of string: %d\n", len);
  while (ans == 5) {
    printf("\n1) To copy a string");
    printf("\n2) To reverse a string");
    printf("\n3) To find whether it is palindrome or not");
    printf("\n4) To concatenate two strings");
    printf("\nEnter 1,2,3 or 4: ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      copy(s1);
      break;
    case 2:
      rev(s1, len);
      break;
    case 3:
      pal(s1, len);
      break;
    case 4:
      printf("Enter second string: ");
      scanf("%s", s2);
      concat(s1, s2, len);
      break;
    default:
      printf("\nInvalid Choice");
    }
    printf("\nEnter 5 to continue, else exit: ");
    scanf("%d", &ans);
  }
  return 0;
}
```