user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  lea    D111(%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    D23(%rip),%rdi
  mov    %rax,0x8(%rsp)
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <scanf@plt>
  cmpb   $0x0,0x30(%rsp)
  je     L86
  mov    $0x1,%eax
  lea    0x2f(%rsp),%rdx
  nopl   0x0(%rax)
L19:
  mov    %eax,%ebp
  add    $0x1,%rax
  cmpb   $0x0,(%rdx,%rax,1)
  jne    L19
L52:
  xor    %eax,%eax
  mov    %ebp,%esi
  lea    D102(%rip),%rdi
  call   <printf@plt>
  cmpl   $0x5,0x2c(%rsp)
  jne    L157
  lea    0x28(%rsp),%rax
  lea    0xa0(%rsp),%rcx
  mov    %ebp,0x14(%rsp)
  mov    %rax,(%rsp)
  lea    0x2c(%rsp),%rax
  lea    D50(%rip),%r15
  mov    %rcx,0x18(%rsp)
  lea    D77(%rip),%r14
  lea    D20(%rip),%r13
  mov    %rax,%rbp
  lea    D86(%rip),%r12
  lea    D39(%rip),%rbx
  jmp    L155
  xchg   %ax,%ax
L16:
  cmp    $0x2,%eax
  jne    L27
  mov    0x14(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <rev@plt>
L10:
  lea    D122(%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    L157
L155:
  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    D76(%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     L99
  jg     L14
  cmp    $0x1,%eax
  jne    L16
  mov    0x8(%rsp),%rdi
  call   <copy@plt>
  jmp    L10
  nopl   0x0(%rax)
L14:
  cmp    $0x4,%eax
  jne    L27
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  lea    D23(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%edx
  mov    0x18(%rsp),%rsi
  mov    0x8(%rsp),%rdi
  call   <concat@plt>
  jmp    L10
  cs nopw 0x0(%rax,%rax,1)
L99:
  mov    0x14(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <pal@plt>
  jmp    L10
  nopl   0x0(%rax,%rax,1)
L27:
  lea    D74(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L10
  nopl   0x0(%rax,%rax,1)
L157:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L142
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L86:
  xor    %ebp,%ebp
  jmp    L52
L142:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D111
type_guessed: string
name: extract_symbolic_data
arguments: tag: D23
type_guessed: string
name: extract_symbolic_data
arguments: tag: D102
type_guessed: string
name: extract_symbolic_data
arguments: tag: D50
type_guessed: string
name: extract_symbolic_data
arguments: tag: D77
type_guessed: string
name: extract_symbolic_data
arguments: tag: D20
type_guessed: string
name: extract_symbolic_data
arguments: tag: D86
type_guessed: string
name: extract_symbolic_data
arguments: tag: D39
type_guessed: string
name: extract_symbolic_data
arguments: tag: D122
type_guessed: string
name: extract_symbolic_data
arguments: tag: D76
type_guessed: string
name: extract_symbolic_data
arguments: tag: D66
type_guessed: string
name: extract_symbolic_data
arguments: tag: D74
type_guessed: string

tool: D111: 
Enter string s1: 

tool: D23: %s

tool: D102: Length of string: %d


tool: D50: 
1) To copy a string

tool: D77: 
2) To reverse a string

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

tool: D86: 
4) To concatenate two strings

tool: D39: %d

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

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

tool: D66: Enter second string: 

tool: D74: 
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;
}
```