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

```asm
<ifconf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <ssystem@plt>
  mov    -0x80(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <ssystem@plt>
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  movl   $0x0,-0x68(%rbp)
  jmp    L46
L143:
  mov    -0x68(%rbp),%eax
  cltq
  movl   $0x0,-0x50(%rbp,%rax,4)
  addl   $0x1,-0x68(%rbp)
L46:
  cmpl   $0x7,-0x68(%rbp)
  jle    L143
  movl   $0x0,-0x68(%rbp)
  movl   $0x0,-0x60(%rbp)
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  jmp    L66
L141:
  cmpb   $0x2f,-0x6d(%rbp)
  je     L100
  cmpb   $0x3a,-0x6d(%rbp)
  jne    L53
  cmpl   $0x0,-0x64(%rbp)
  je     L131
  mov    -0x68(%rbp),%eax
  mov    %eax,-0x60(%rbp)
L131:
  movl   $0x1,-0x64(%rbp)
  addl   $0x1,-0x68(%rbp)
  cmpl   $0x7,-0x68(%rbp)
  jle    L66
  jmp    L140
L53:
  movl   $0x0,-0x64(%rbp)
  movsbl -0x6d(%rbp),%eax
  sub    $0x30,%eax
  mov    %eax,-0x6c(%rbp)
  cmpl   $0x9,-0x6c(%rbp)
  jle    L4
  movsbl -0x6d(%rbp),%eax
  and    $0xdf,%eax
  sub    $0x37,%eax
  mov    %eax,-0x6c(%rbp)
L4:
  mov    -0x68(%rbp),%eax
  cltq
  mov    -0x50(%rbp,%rax,4),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x6c(%rbp),%eax
  add    %eax,%edx
  mov    -0x68(%rbp),%eax
  cltq
  mov    %edx,-0x50(%rbp,%rax,4)
L66:
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movzbl (%rax),%eax
  mov    %al,-0x6d(%rbp)
  cmpb   $0x0,-0x6d(%rbp)
  jne    L141
  jmp    L140
L100:
  nop
L140:
  mov    $0x8,%eax
  sub    -0x68(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L18
L136:
  mov    $0x8,%eax
  sub    -0x5c(%rbp),%eax
  sub    -0x64(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jl     L117
  mov    $0x7,%eax
  sub    -0x5c(%rbp),%eax
  cltq
  movl   $0x0,-0x50(%rbp,%rax,4)
  jmp    L55
L117:
  mov    $0x8,%eax
  sub    -0x5c(%rbp),%eax
  sub    -0x64(%rbp),%eax
  mov    $0x7,%edx
  mov    %edx,%ecx
  sub    -0x5c(%rbp),%ecx
  cltq
  mov    -0x50(%rbp,%rax,4),%edx
  movslq %ecx,%rax
  mov    %edx,-0x50(%rbp,%rax,4)
  mov    $0x8,%eax
  sub    -0x5c(%rbp),%eax
  sub    -0x64(%rbp),%eax
  cltq
  movl   $0x0,-0x50(%rbp,%rax,4)
L55:
  addl   $0x1,-0x5c(%rbp)
L18:
  mov    -0x5c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L136
  mov    -0x34(%rbp),%edi
  mov    -0x44(%rbp),%ecx
  mov    -0x48(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  and    $0xfefd,%eax
  mov    %eax,%esi
  lea    -0x30(%rbp),%rax
  mov    %edi,%r9d
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %esi,%edx
  lea    D9(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x30(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <ssystem@plt>
  mov    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <ssystem@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L132
  call   <__stack_chk_fail@plt>
L132:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D47
data_type: string
name: disassemble_data
arguments: data_label: D45
data_type: string
name: disassemble_data
arguments: data_label: D9
data_type: string
name: disassemble_data
arguments: data_label: D40
data_type: string
name: disassemble_data
arguments: data_label: D26
data_type: string

tool: D47: ifconfig %s inet `hostname` up

tool: D45: ifconfig %s add %s

tool: D9: fe80::%x:%x:%x:%x

tool: D40: ifconfig %s add %s/64

tool: D26: ifconfig %s


assistant: ```c
void ifconf(char *tundev, char *ipaddr) {
  ssystem("ifconfig %s inet `hostname` up", tundev);
  ssystem("ifconfig %s add %s", tundev, ipaddr);
  {
    char lladdr[40];
    char c, *ptr = (char *)ipaddr;
    uint16_t digit, ai, a[8], cc, scc, i;
    for (ai = 0; ai < 8; ai++) {
      a[ai] = 0;
    }
    ai = 0;
    cc = scc = 0;
    while (c = *ptr++) {
      if (c == '/')
        break;
      if (c == ':') {
        if (cc)
          scc = ai;
        cc = 1;
        if (++ai > 7)
          break;
      } else {
        cc = 0;
        digit = c - '0';
        if (digit > 9)
          digit = 10 + (c & 0xdf) - 'A';
        a[ai] = (a[ai] << 4) + digit;
      }
    }
    cc = 8 - ai;
    for (i = 0; i < cc; i++) {
      if ((8 - i - cc) <= scc) {
        a[7 - i] = 0;
      } else {
        a[7 - i] = a[8 - i - cc];
        a[8 - i - cc] = 0;
      }
    }
    sprintf(lladdr, "fe80::%x:%x:%x:%x", a[1] & 0xfefd, a[2], a[3], a[7]);
    ssystem("ifconfig %s add %s/64", tundev, lladdr);
  }
  ssystem("ifconfig %s\n", tundev);
}
```