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

```asm
<main>:
  endbr64
  push   %r15
  lea    D31(%rip),%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x2c(%rsp),%rax
  lea    0x30(%rsp),%rbp
  mov    %rax,0x8(%rsp)
  lea    0x28(%rsp),%rax
  lea    0x50(%rsp),%rbx
  mov    %rax,0x18(%rsp)
  lea    0x70(%rsp),%rax
  lea    0x6f(%rsp),%r14
  mov    %rax,0x10(%rsp)
  lea    0x4f(%rsp),%r13
  lea    0x2f(%rsp),%r12
  cs nopw 0x0(%rax,%rax,1)
L37:
  lea    D41(%rip),%rdi
  call   <printf@plt>
  lea    D26(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  mov    0x2c(%rsp),%eax
  cmp    $0x2,%eax
  je     L68
  cmp    $0x3,%eax
  je     L70
  cmp    $0x1,%eax
  je     L26
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L37
  nopl   0x0(%rax)
L68:
  lea    D27(%rip),%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    %r15,%rdi
  call   <scanf@plt>
  movzbl 0x30(%rsp),%eax
  test   %al,%al
  je     L24
  movzbl 0x28(%rsp),%esi
  xor    %edx,%edx
  nopl   0x0(%rax)
L41:
  add    %esi,%eax
  mov    %al,(%rbx,%rdx,1)
  add    $0x1,%rdx
  movzbl 0x0(%rbp,%rdx,1),%eax
  test   %al,%al
  jne    L41
L24:
  lea    D43(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <puts@plt>
  jmp    L37
  nopl   0x0(%rax,%rax,1)
L26:
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <gets@plt>
  jmp    L37
  nopl   0x0(%rax)
L70:
  xor    %edx,%edx
  cmpb   $0x0,0x30(%rsp)
  movzbl 0x28(%rsp),%esi
  mov    $0x1,%eax
  je     L64
  nopl   0x0(%rax,%rax,1)
L27:
  movzbl 0x0(%r13,%rax,1),%edx
  sub    %esi,%edx
  mov    %dl,(%r14,%rax,1)
  movslq %eax,%rdx
  add    $0x1,%rax
  cmpb   $0x0,(%r12,%rax,1)
  jne    L27
L64:
  lea    D1(%rip),%rdi
  movb   $0x0,0x70(%rsp,%rdx,1)
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <puts@plt>
  jmp    L37
```

tool_calls: name: retrieve_data
arguments: tag: D31
type_infered: string
name: retrieve_data
arguments: tag: D41
type_infered: string
name: retrieve_data
arguments: tag: D26
type_infered: string
name: retrieve_data
arguments: tag: D27
type_infered: string
name: retrieve_data
arguments: tag: D43
type_infered: string
name: retrieve_data
arguments: tag: D5
type_infered: string
name: retrieve_data
arguments: tag: D1
type_infered: string

tool: D31: %d

tool: D41: 
MENU
=====
1.Input
2.Encode
3.Decode
4.Exit

tool: D26: 
Enter your choice


tool: D27: 
Enter a key


tool: D43: 
Encoded String :


tool: D5: 
Enter a str


tool: D1: 
Decoded String :


assistant: ```c
int main(void) {
  char Str[30], encStr[30], decStr[30];
  int i, iKey, iChoice;
  while (1) {
    printf("\nMENU\n=====\n1.Input\n2.Encode\n3.Decode\n4.Exit");
    printf("\nEnter your choice\n");
    scanf("%d", &iChoice);
    getchar();
    switch (iChoice) {
    case 1:
      printf("\nEnter a str\n");
      gets(Str);
      break;
    case 2:
      printf("\nEnter a key\n");
      scanf("%d", &iKey);
      for (i = 0; Str[i] != '\0'; i++) {
        encStr[i] = Str[i] + iKey;
      }
      printf("\nEncoded String :\n");
      puts(encStr);
      break;
    case 3:
      for (i = 0; Str[i] != '\0'; i++) {
        decStr[i] = encStr[i] - iKey;
      }
      decStr[i] = '\0';
      printf("\nDecoded String :\n");
      puts(decStr);
      break;
    default:
      exit(0);
    }
  }
  return 0;
}
```