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

```asm
<ifconfig6>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x620,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %rdx,%r12
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x618(%rsp)
  xor    %eax,%eax
  lea    0x210(%rsp),%rdi
  mov    $0x400,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  lea    0x10(%rsp),%r14
  mov    $0x100,%edx
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  lea    0x110(%rsp),%rdi
  mov    $0x100,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  lea    0xc(%rsp),%rdi
  mov    $0x4,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    %ebp,%ecx
  mov    %rbx,%rdx
  mov    $0x100,%esi
  mov    %r14,%rdi
  call   <ifconfigCheckCopyInput@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jne    L36
L88:
  mov    0x618(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  mov    %ebx,%eax
  add    $0x620,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L36:
  lea    0xc(%rsp),%rdx
  lea    0x110(%rsp),%rdi
  sub    $0x8,%rsp
  push   $0x2f
  mov    %r13d,%r9d
  mov    %r12,%r8
  mov    $0x4,%ecx
  mov    $0x100,%esi
  call   <ifconfigSplit@plt>
  mov    %eax,%ebx
  add    $0x10,%rsp
  test   %eax,%eax
  je     L88
  cmpb   $0x0,0xc(%rsp)
  je     L84
L5:
  lea    0x10(%rsp),%rdx
  lea    0x210(%rsp),%rbx
  lea    D24(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <ifconfigExec@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L34
  mov    $0x0,%ebx
  jmp    L88
L84:
  lea    0xc(%rsp),%rdi
  mov    $0x2,%edx
  lea    D2(%rip),%rsi
  call   <memcpy@plt>
  jmp    L5
L34:
  lea    0x10(%rsp),%rdx
  lea    0x210(%rsp),%rbp
  lea    D12(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <ifconfigExec@plt>
  test   %eax,%eax
  jne    L88
  lea    0x110(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  lea    0xc(%rsp),%r8
  lea    D39(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <ifconfigExec@plt>
  test   %eax,%eax
  sete   %bl
  movzbl %bl,%ebx
  jmp    L88
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D24
data_type: string
name: parse_data
arguments: label: D2
data_type: string
name: parse_data
arguments: label: D12
data_type: string
name: parse_data
arguments: label: D39
data_type: string

tool: D24: ip link set dev "%s" up

tool: D2: 128

tool: D12: ip -6 addr flush dev "%s" scope global

tool: D39: ip -6 addr add dev "%s" "%s/%s" scope global

assistant: ```c
int ifconfig6(const char *ifname, const int ifname_len, const char *addr, const int addr_len) {
  char cmd[1024];
  memset(cmd, 0, 1024);
  char ifname_s[256];
  memset(ifname_s, 0, 256);
  char ip_s[256];
  memset(ip_s, 0, 256);
  char prefixlen_s[4];
  memset(prefixlen_s, 0, 4);
  int ret;
  if (!ifconfigCheckCopyInput(ifname_s, 256, ifname, ifname_len))
    return 0;
  if (!ifconfigSplit(ip_s, 256, prefixlen_s, 4, addr, addr_len, '/'))
    return 0;
  if (strlen(prefixlen_s) == 0)
    memcpy(prefixlen_s, "128", 2);
  sprintf(cmd, "ip link set dev \"%s\" up", ifname_s);
  ret = ifconfigExec(cmd);
  if (ret == 0) {
    sprintf(cmd, "ip -6 addr flush dev \"%s\" scope global", ifname_s);
    ret = ifconfigExec(cmd);
    if (ret != 0) {
      return 0;
    }
    sprintf(cmd, "ip -6 addr add dev \"%s\" \"%s/%s\" scope global", ifname_s, ip_s, prefixlen_s);
    ret = ifconfigExec(cmd);
    if (ret != 0) {
      return 0;
    }
    return 1;
  }
  return 0;
}
```