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

```asm
<ifconfig6>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  mov    $0x400,%edx
  sub    $0x638,%rsp
  mov    %ecx,0x8(%rsp)
  lea    0x20(%rsp),%r13
  lea    0x1c(%rsp),%r14
  mov    %esi,0xc(%rsp)
  lea    0x220(%rsp),%rbp
  xor    %esi,%esi
  lea    0x120(%rsp),%r15
  mov    %rbp,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x628(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x100,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x100,%edx
  mov    %r15,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x4,%edx
  mov    %r14,%rdi
  call   <memset@plt>
  mov    0xc(%rsp),%ecx
  mov    %r12,%rdx
  mov    %r13,%rdi
  mov    $0x100,%esi
  call   <ifconfigCheckCopyInput@plt>
  mov    0x8(%rsp),%r9d
  test   %eax,%eax
  jne    L17
L49:
  xor    %eax,%eax
L72:
  mov    0x628(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L34
  add    $0x638,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L17:
  sub    $0x8,%rsp
  mov    $0x4,%ecx
  mov    %r14,%rdx
  mov    %rbx,%r8
  push   $0x2f
  mov    $0x100,%esi
  mov    %r15,%rdi
  call   <ifconfigSplit@plt>
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  je     L49
  cmpb   $0x0,0x1c(%rsp)
  je     L77
L42:
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D34(%rip),%rsi
  mov    %r13,%rdx
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <ifconfigExec@plt>
  test   %eax,%eax
  jne    L49
  mov    %rbp,%rdi
  mov    %r13,%rdx
  lea    D31(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <ifconfigExec@plt>
  test   %eax,%eax
  jne    L49
  mov    %r14,%r8
  mov    %r15,%rcx
  mov    %r13,%rdx
  mov    %rbp,%rdi
  lea    D26(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <ifconfigExec@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  jmp    L72
  nopw   0x0(%rax,%rax,1)
L77:
  mov    $0x2,%edx
  lea    D30(%rip),%rsi
  mov    %r14,%rdi
  call   <memcpy@plt>
  jmp    L42
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D34
type_infered: string
name: parse_data
arguments: data_tag: D31
type_infered: string
name: parse_data
arguments: data_tag: D26
type_infered: string
name: parse_data
arguments: data_tag: D30
type_infered: string

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

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

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

tool: D30: 128

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;
}
```