user: Converte this assembly snippet into its equivalent C code:

```asm
<Call_C_Arg_Foreign_L>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x5,-0x14(%rbp)
  ja     L21
  mov    -0x14(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D175(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D175(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  lea    -0x10(%rbp),%rax
  lea    D164(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L41
  lea    -0x10(%rbp),%rax
  lea    D15(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L41
  lea    -0x10(%rbp),%rax
  lea    D24(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L41
  lea    -0x10(%rbp),%rax
  lea    D205(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L41
  lea    -0x10(%rbp),%rax
  lea    D28(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L41
  lea    -0x10(%rbp),%rax
  lea    D161(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L41
L21:
  lea    -0x10(%rbp),%rax
  lea    D238(%rip),%rdx
  lea    D108(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  nop
L41:
  lea    D0(%rip),%rax
  mov    %rax,%rsi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  cmpl   $0x0,-0x18(%rbp)
  jne    L86
  mov    -0x1c(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  lea    -0x10(%rbp),%rax
  mov    %edx,%ecx
  mov    %rax,%rdx
  lea    D116(%rip),%rax
  mov    %rax,%rsi
  lea    D158(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  jmp    L97
L86:
  mov    -0x1c(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  lea    -0x10(%rbp),%rax
  mov    %edx,%ecx
  mov    %rax,%rdx
  lea    D116(%rip),%rax
  mov    %rax,%rsi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
L97:
  cmpl   $0x5,-0x14(%rbp)
  jle    L0
  mov    -0x14(%rbp),%eax
  sub    $0x6,%eax
  lea    0x0(,%rax,8),%edx
  lea    -0x10(%rbp),%rax
  mov    %edx,%ecx
  mov    %rax,%rdx
  lea    D171(%rip),%rax
  mov    %rax,%rsi
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
L0:
  mov    $0x1,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L26
  call   <__stack_chk_fail@plt>
L26:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D164
data_type: string
name: extract_symbolic_data
arguments: tag: D108
data_type: string
name: extract_symbolic_data
arguments: tag: D15
data_type: string
name: extract_symbolic_data
arguments: tag: D24
data_type: string
name: extract_symbolic_data
arguments: tag: D205
data_type: string
name: extract_symbolic_data
arguments: tag: D28
data_type: string
name: extract_symbolic_data
arguments: tag: D161
data_type: string
name: extract_symbolic_data
arguments: tag: D238
data_type: string
name: extract_symbolic_data
arguments: tag: D0
data_type: string
name: extract_symbolic_data
arguments: tag: D119
data_type: string
name: extract_symbolic_data
arguments: tag: D116
data_type: string
name: extract_symbolic_data
arguments: tag: D158
data_type: string
name: extract_symbolic_data
arguments: tag: D171
data_type: string
name: extract_symbolic_data
arguments: tag: D41
data_type: string

tool: D164: $16

tool: D108: %s

tool: D15: $17

tool: D24: $18

tool: D205: $19

tool: D28: $20

tool: D161: $21

tool: D238: $1

tool: D0: $2,pl_foreign_long

tool: D119: lda

tool: D116: %s,%d($2)

tool: D158: ldq

tool: D171: %s,%d($30)

tool: D41: stq

assistant: ```c
int Call_C_Arg_Foreign_L(int offset, int adr_of, int index) {
  char dest[8];
  switch (offset) {
  case 0:
    sprintf(dest, "%s", "$16");
    break;
  case 1:
    sprintf(dest, "%s", "$17");
    break;
  case 2:
    sprintf(dest, "%s", "$18");
    break;
  case 3:
    sprintf(dest, "%s", "$19");
    break;
  case 4:
    sprintf(dest, "%s", "$20");
    break;
  case 5:
    sprintf(dest, "%s", "$21");
    break;
  default:
    sprintf(dest, "%s", "$1");
    break;
  }
  Inst_Printf("lda", "$2,pl_foreign_long");
  if (!adr_of) {
    Inst_Printf("ldq", "%s,%d($2)", dest, index * 8);
  } else {
    Inst_Printf("lda", "%s,%d($2)", dest, index * 8);
  }
  if (offset > 5) {
    Inst_Printf("stq", "%s,%d($30)", dest, (offset - 6) * 8);
  }
  return 1;
}
```