user: 请从给定的汇编指令推导出C源代码:

```asm
<Call_C_Arg_Foreign_L>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebx
  mov    %esi,%r12d
  mov    %edx,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x5,%edi
  ja     L111
  mov    %edi,%eax
  lea    D74(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    %rsp,%rdi
  lea    D153(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
L48:
  lea    D126(%rip),%rsi
  lea    D146(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  test   %r12d,%r12d
  jne    L2
  lea    0x0(,%rbp,8),%ecx
  mov    %rsp,%rdx
  lea    D43(%rip),%rsi
  lea    D37(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
L32:
  cmp    $0x5,%ebx
  jg     L13
L91:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  mov    $0x1,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  mov    %rsp,%rdi
  lea    D32(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
  jmp    L48
  mov    %rsp,%rdi
  lea    D213(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
  jmp    L48
  mov    %rsp,%rdi
  lea    D99(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
  jmp    L48
  mov    %rsp,%rdi
  lea    D15(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
  jmp    L48
  mov    %rsp,%rdi
  lea    D150(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
  jmp    L48
L111:
  mov    %rsp,%rdi
  lea    D134(%rip),%rdx
  lea    D7(%rip),%rsi
  call   <sprintf@plt>
  jmp    L48
L2:
  lea    0x0(,%rbp,8),%ecx
  mov    %rsp,%rdx
  lea    D43(%rip),%rsi
  lea    D146(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  jmp    L32
L13:
  lea    -0x30(,%rbx,8),%ecx
  mov    %rsp,%rdx
  lea    D78(%rip),%rsi
  lea    D175(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  jmp    L91
L44:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D153
type: string
name: retrieve_data
arguments: data_tag: D7
type: string
name: retrieve_data
arguments: data_tag: D126
type: string
name: retrieve_data
arguments: data_tag: D146
type: string
name: retrieve_data
arguments: data_tag: D43
type: string
name: retrieve_data
arguments: data_tag: D37
type: string
name: retrieve_data
arguments: data_tag: D32
type: string
name: retrieve_data
arguments: data_tag: D213
type: string
name: retrieve_data
arguments: data_tag: D99
type: string
name: retrieve_data
arguments: data_tag: D15
type: string
name: retrieve_data
arguments: data_tag: D150
type: string
name: retrieve_data
arguments: data_tag: D134
type: string
name: retrieve_data
arguments: data_tag: D78
type: string
name: retrieve_data
arguments: data_tag: D175
type: string

tool: D153: $16

tool: D7: %s

tool: D126: $2,pl_foreign_long

tool: D146: lda

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

tool: D37: ldq

tool: D32: $17

tool: D213: $18

tool: D99: $19

tool: D15: $20

tool: D150: $21

tool: D134: $1

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

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