user: What would the C source look like for the assembly code provided here:

```asm
<Call_C_Arg_Foreign_L>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebp
  mov    %esi,%r12d
  mov    %edx,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x7,%edi
  jg     L41
  lea    0x3(%rdi),%edx
  lea    0x4(%rsp),%rdi
  lea    D25(%rip),%rsi
  call   <sprintf@plt>
L19:
  shl    $0x2,%ebx
  lea    0x4(%rsp),%rdx
  mov    %ebx,%ecx
  lea    D5(%rip),%rsi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  test   %r12d,%r12d
  je     L61
  lea    0x4(%rsp),%rdx
  mov    %ebx,%r8d
  mov    %rdx,%rcx
  lea    D9(%rip),%rsi
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
L22:
  cmp    $0x7,%ebp
  jg     L31
L50:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L64
  mov    $0x1,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L41:
  lea    0x4(%rsp),%rdi
  lea    D13(%rip),%rsi
  call   <strcpy@plt>
  jmp    L19
L61:
  lea    0x4(%rsp),%rdx
  mov    %rdx,%r8
  mov    %ebx,%ecx
  lea    D42(%rip),%rsi
  lea    D50(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  jmp    L22
L31:
  lea    0x18(,%rbp,4),%ecx
  lea    0x4(%rsp),%rdx
  lea    D40(%rip),%rsi
  lea    D35(%rip),%rdi
  mov    $0x0,%eax
  call   <Inst_Printf@plt>
  jmp    L50
L64:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D25
type: string
name: unpack_data
arguments: tag: D5
type: string
name: unpack_data
arguments: tag: D11
type: string
name: unpack_data
arguments: tag: D9
type: string
name: unpack_data
arguments: tag: D19
type: string
name: unpack_data
arguments: tag: D13
type: string
name: unpack_data
arguments: tag: D42
type: string
name: unpack_data
arguments: tag: D50
type: string
name: unpack_data
arguments: tag: D40
type: string
name: unpack_data
arguments: tag: D35
type: string

tool: D25: r%d

tool: D5: %s,0,ha16(_pl_foreign_long+%d)

tool: D11: addis

tool: D9: %s,%s,lo16(_pl_foreign_long+%d)

tool: D19: addi

tool: D13: r11

tool: D42: %s,lo16(_pl_foreign_long+%d)(%s)

tool: D50: lwz

tool: D40: %s,%d(r1)

tool: D35: stw

assistant: ```c
int Call_C_Arg_Foreign_L(int offset, int adr_of, int index) {
  {
    char r[4];
    if (offset < 8)
      sprintf(r,
              "r"
              "%d",
              offset + 3);
    else
      strcpy(r, "r"
                "11");
    ;
    Inst_Printf("addis",
                "%s,0,"
                "ha16("
                "_"
                "pl_foreign_long+%d"
                ")",
                r, index * 4);
    if (adr_of)
      Inst_Printf("addi",
                  "%s,%s,"
                  "lo16("
                  "_"
                  "pl_foreign_long+%d"
                  ")",
                  r, r, index * 4);
    else
      Inst_Printf("lwz",
                  "%s,"
                  "lo16("
                  "_"
                  "pl_foreign_long+%d"
                  ")"
                  "(%s)",
                  r, index * 4, r);
    if (offset >= 8)
      Inst_Printf("stw",
                  "%s,%d("
                  "r"
                  "1"
                  ")",
                  r, offset * 4 + 24);
  };
  return 1;
}
```