user: Translate the below assembly code into C programming language:

```asm
<getprefix>:
  endbr64
  push   %r15
  lea    D15(%rip),%rsi
  lea    D54(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x348,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x338(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L26
  lea    0x130(%rsp),%rbx
  mov    %rax,%rdx
  mov    $0x200,%esi
  mov    %rax,%r14
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L100
  lea    0x68(%rsp),%rax
  lea    0x64(%rsp),%rbp
  mov    %rax,0x18(%rsp)
  lea    0x100(%rsp),%rax
  lea    0x60(%rsp),%r13
  mov    %rax,0x10(%rsp)
  lea    0x6c(%rsp),%rax
  lea    0xd0(%rsp),%r12
  mov    %rax,0x8(%rsp)
  lea    D11(%rip),%r15
  jmp    L144
  nopl   0x0(%rax)
L147:
  mov    %r14,%rdx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L100
L144:
  push   0x10(%rsp)
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%r8
  push   0x10(%rsp)
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    0x28(%rsp),%r9
  call   <sscanf@plt>
  pop    %rdx
  pop    %rcx
  cmp    $0x6,%eax
  jne    L147
  mov    0x68(%rsp),%eax
  test   %eax,%eax
  jne    L147
  lea    0xa0(%rsp),%rax
  mov    $0x21,%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  mov    %rax,0x30(%rsp)
  call   <memset@plt>
  mov    0x64(%rsp),%edi
  test   %edi,%edi
  jle    L74
  mov    %edi,%eax
  xor    %ecx,%ecx
  mov    %r14,0x40(%rsp)
  mov    %r12,%r14
  shr    $0x3,%eax
  mov    %rbx,0x48(%rsp)
  mov    %edi,%r12d
  mov    %eax,%esi
  lea    -0x1(%rdi),%eax
  mov    %r13,0x50(%rsp)
  shr    $0x3,%eax
  mov    %rbp,0x58(%rsp)
  mov    %rsi,%r13
  mov    %rcx,%rbp
  add    $0x1,%eax
  mov    %rax,0x38(%rsp)
  lea    0x9d(%rsp),%rax
  mov    %rax,%rbx
  jmp    L137
  nopl   (%rax)
L60:
  mov    0x30(%rsp),%rcx
  mov    %al,(%rcx,%rbp,1)
  add    $0x1,%rbp
  cmp    0x38(%rsp),%rbp
  je     L138
L137:
  lea    0x0(,%rbp,8),%eax
  mov    %r12d,%ecx
  xor    %esi,%esi
  mov    %rbx,%rdi
  sub    %eax,%ecx
  mov    $0x10,%edx
  movabs $0xc000000080,%rax
  mov    %ebp,0x20(%rsp)
  mov    %rax,0x70(%rsp)
  movabs $0xf0000000e0,%rax
  mov    %rax,0x78(%rsp)
  movabs $0xfc000000f8,%rax
  mov    %rax,0x80(%rsp)
  movabs $0xff000000fe,%rax
  mov    %rax,0x88(%rsp)
  movzbl (%r14,%rbp,2),%eax
  mov    %ecx,0x28(%rsp)
  mov    %al,0x9d(%rsp)
  movzbl 0x1(%r14,%rbp,2),%eax
  movb   $0x0,0x9f(%rsp)
  mov    %al,0x9e(%rsp)
  call   <strtol@plt>
  lea    0x1(%rbp),%edx
  cmp    %r13,%rbp
  jne    L60
  movslq 0x28(%rsp),%rcx
  mov    %edx,0x38(%rsp)
  mov    %r14,%r12
  movslq 0x20(%rsp),%rdx
  mov    0x48(%rsp),%rbx
  and    0x70(%rsp,%rcx,4),%al
  mov    0x40(%rsp),%r14
  mov    %al,0xa0(%rsp,%rdx,1)
  mov    0x50(%rsp),%r13
  mov    0x58(%rsp),%rbp
L32:
  lea    D50(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %ecx,%ecx
  mov    %r14,0x20(%rsp)
  movzbl 0xa0(%rsp),%edx
  mov    %rbx,0x28(%rsp)
  mov    0x30(%rsp),%r14
  lea    D57(%rip),%rsi
  mov    %rbp,0x30(%rsp)
  mov    0x38(%rsp),%ebx
  mov    %rcx,%rbp
  jmp    L83
  nopl   (%rax)
L131:
  movzbl (%r14,%rbp,1),%edx
  lea    D29(%rip),%rsi
L83:
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%rbp
  call   <printf@plt>
  cmp    %ebp,%ebx
  jg     L131
  mov    0x20(%rsp),%r14
  mov    0x28(%rsp),%rbx
  mov    0x30(%rsp),%rbp
L67:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L147
  nopl   0x0(%rax,%rax,1)
L100:
  mov    %r14,%rdi
  call   <fclose@plt>
L26:
  mov    0x338(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L92
  add    $0x348,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  lea    D50(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L67
L92:
  call   <__stack_chk_fail@plt>
L138:
  mov    %r14,%r12
  mov    %edx,0x38(%rsp)
  mov    0x48(%rsp),%rbx
  mov    0x40(%rsp),%r14
  mov    0x50(%rsp),%r13
  mov    0x58(%rsp),%rbp
  jmp    L32
```

tool_calls: name: unpack_data
arguments: label: D15
type_guessed: string
name: unpack_data
arguments: label: D54
type_guessed: string
name: unpack_data
arguments: label: D11
type_guessed: string
name: unpack_data
arguments: label: D50
type_guessed: string
name: unpack_data
arguments: label: D57
type_guessed: string
name: unpack_data
arguments: label: D29
type_guessed: string
name: unpack_data
arguments: label: D66
type_guessed: string

tool: D15: r

tool: D54: /proc/net/if_inet6

tool: D11: %32[0-9a-f] %02x %02x %02x %02x %31s

tool: D50: id6: 

tool: 

tool: D29: :

tool: D66: %s%02x

assistant: ```c
void getprefix(void) {
  FILE *ifs = fopen("/proc/net/if_inet6", "r");
  if (ifs) {
    char buffer[512];
    char ip6[40];
    int devnum;
    int preflen;
    int scope;
    int flags;
    char name[40];
    char *l = fgets(buffer, sizeof(buffer), ifs);
    while (l) {
      if (6 == sscanf(buffer, "%32[0-9a-f] %02x %02x %02x %02x %31s", ip6, &devnum, &preflen, &scope, &flags, name)) {
        if (scope == 0x00) {
          unsigned char id6[33];
          int i, j;
          int bits;
          memset(id6, 0, sizeof(id6));
          for (bits = preflen, i = 0; bits > 0; bits -= 8, i++) {
            char buf[3];
            long val;
            int mask;
            int maskit[] = {0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff};
            buf[0] = ip6[i * 2];
            buf[1] = ip6[i * 2 + 1];
            buf[2] = 0;
            val = strtol(buf, NULL, 16);
            mask = (bits >= 8) ? 0xff : maskit[bits];
            id6[i] = (unsigned char)val & mask;
          }
          printf("id6: ");
          for (j = 0; j < i; j++)
            printf("%s%02x", j ? ":" : "", id6[j]);
          printf("\n");
        }
      }
      l = fgets(buffer, sizeof(buffer), ifs);
    }
    fclose(ifs);
  }
}
```