user: 请从给定的汇编指令推导出C源代码：

```asm
<getprefix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x308,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2f8(%rsp)
  xor    %eax,%eax
  lea    D69(%rip),%rsi
  lea    D35(%rip),%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L4
  mov    %rax,%rbp
  lea    0xf0(%rsp),%rdi
  mov    %rax,%rdx
  mov    $0x200,%esi
  call   <fgets@plt>
  test   %rax,%rax
  je     L93
  lea    0xf0(%rsp),%r12
  lea    D67(%rip),%r14
  jmp    L115
L43:
  mov    %al,0x60(%rsp,%rbx,1)
  lea    0x1(%rbx),%r13d
  add    $0x1,%rbx
  cmp    0x18(%rsp),%rbx
  je     L3
L17:
  lea    0x0(,%rbx,8),%eax
  mov    %r15d,%r13d
  sub    %eax,%r13d
  mov    %ebx,(%rsp)
  movl   $0x80,0x30(%rsp)
  movl   $0xc0,0x34(%rsp)
  movl   $0xe0,0x38(%rsp)
  movl   $0xf0,0x3c(%rsp)
  movl   $0xf8,0x40(%rsp)
  movl   $0xfc,0x44(%rsp)
  movl   $0xfe,0x48(%rsp)
  movl   $0xff,0x4c(%rsp)
  movzbl 0x90(%rsp,%rbx,2),%eax
  mov    %al,0x5d(%rsp)
  movzbl 0x91(%rsp,%rbx,2),%eax
  mov    %al,0x5e(%rsp)
  movb   $0x0,0x5f(%rsp)
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    0x10(%rsp),%rdi
  call   <strtol@plt>
  cmp    0x8(%rsp),%rbx
  jne    L43
  mov    (%rsp),%ecx
  movslq %ecx,%rdx
  movslq %r13d,%r13
  and    0x30(%rsp,%r13,4),%al
  mov    %al,0x60(%rsp,%rdx,1)
  lea    0x1(%rcx),%r13d
L3:
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %r13d,%r13d
  jle    L31
  mov    %r13d,%eax
  mov    %rax,(%rsp)
  mov    $0x0,%ebx
  lea    0x60(%rsp),%r13
  lea    D0(%rip),%r15
L134:
  movzbl (%rbx,%r13,1),%edx
  test   %ebx,%ebx
  lea    D54(%rip),%rsi
  cmove  %r15,%rsi
  lea    D38(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    (%rsp),%rbx
  jne    L134
L31:
  mov    $0xa,%edi
  call   <putchar@plt>
L70:
  mov    %rbp,%rdx
  mov    $0x200,%esi
  mov    %r12,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L93
L115:
  lea    0x20(%rsp),%rcx
  lea    0x90(%rsp),%rdx
  lea    0xc0(%rsp),%rax
  push   %rax
  lea    0x34(%rsp),%rax
  push   %rax
  lea    0x38(%rsp),%r9
  lea    0x34(%rsp),%r8
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x6,%eax
  jne    L70
  cmpl   $0x0,0x28(%rsp)
  jne    L70
  lea    0x60(%rsp),%rdi
  mov    $0x21,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    0x24(%rsp),%r15d
  test   %r15d,%r15d
  jle    L75
  mov    %r15d,%eax
  shr    $0x3,%eax
  mov    %eax,%eax
  mov    %rax,0x8(%rsp)
  lea    -0x1(%r15),%eax
  shr    $0x3,%eax
  add    $0x1,%eax
  mov    %eax,%eax
  mov    %rax,0x18(%rsp)
  mov    $0x0,%ebx
  lea    0x5d(%rsp),%rax
  mov    %rax,0x10(%rsp)
  jmp    L17
L93:
  mov    %rbp,%rdi
  call   <fclose@plt>
L4:
  mov    0x2f8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  add    $0x308,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L75:
  lea    D47(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L31
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D69
type_guessed: string
name: disassemble_data
arguments: label: D35
type_guessed: string
name: disassemble_data
arguments: label: D67
type_guessed: string
name: disassemble_data
arguments: label: D47
type_guessed: string
name: disassemble_data
arguments: label: D0
type_guessed: string
name: disassemble_data
arguments: label: D54
type_guessed: string
name: disassemble_data
arguments: label: D38
type_guessed: string

tool: D69: r

tool: D35: /proc/net/if_inet6

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

tool: D47: id6: 

tool: 

tool: D54: :

tool: D38: %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);
  }
}
```