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

```asm
<dogetdeps>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x6e8,%rsp
  mov    %edx,0xc(%rsp)
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x16d8(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x12f0(%rsp)
  movb   $0x0,0xf00(%rsp)
  movb   $0x0,0xb10(%rsp)
  movb   $0x0,0x720(%rsp)
  test   %edx,%edx
  jle    L62
  movslq 0xc(%rsp),%rdx
  lea    0x10(%rsp),%r13
  mov    %r13,%rdi
  shl    $0x3,%rdx
  call   <memcpy@plt>
L62:
  lea    D29(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L17
L112:
  movl   $0xffffffff,0x8(%rsp)
  mov    $0x1,%ebp
  lea    0x330(%rsp),%rbx
  nopl   (%rax)
L201:
  mov    %r15,%rdx
  mov    $0x3e8,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L196
  cmpb   $0x0,0x330(%rsp)
  jne    L291
L230:
  mov    $0x8,%edx
  lea    D8(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncasecmp@plt>
  test   %rax,%rax
  je     L229
  test   %ebp,%ebp
  jne    L201
  mov    $0x8,%edx
  lea    D21(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncasecmp@plt>
  test   %rax,%rax
  je     L260
  mov    $0xc,%edx
  lea    D12(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncasecmp@plt>
  test   %rax,%rax
  jne    L201
  lea    0xf00(%rsp),%rdi
  mov    %rbx,%rsi
  call   <fieldcpy@plt>
  jmp    L201
  nopw   0x0(%rax,%rax,1)
L291:
  mov    %rbx,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x330(%rsp,%rax,1)
  jne    L230
  mov    %rbx,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cltq
  movb   $0x0,0x330(%rsp,%rax,1)
  jmp    L230
  nopl   (%rax)
L229:
  lea    0x720(%rsp),%r14
  mov    %rbx,%rsi
  lea    0x12f0(%rsp),%rbp
  mov    %r14,%rdi
  call   <fieldcpy@plt>
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L99
  mov    0x8(%rsp),%eax
  cmp    $0xffffffff,%eax
  je     L135
  movslq %eax,%r12
  movq   $0x0,0x10(%rsp,%r12,8)
L135:
  cmpb   $0x0,0xb10(%rsp)
  jne    L16
L15:
  cmpb   $0x0,0xf00(%rsp)
  jne    L245
L49:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
L99:
  movslq 0xc(%rsp),%rax
  movb   $0x0,0xf00(%rsp)
  movb   $0x0,0xb10(%rsp)
  test   %eax,%eax
  jle    L293
  mov    %rax,(%rsp)
  xor    %r12d,%r12d
  xor    %ebp,%ebp
  lea    0x10(%rsp),%r13
  nopw   0x0(%rax,%rax,1)
L24:
  mov    0x0(%r13,%r12,8),%rsi
  mov    %r12d,0x8(%rsp)
  test   %rsi,%rsi
  je     L285
  mov    %r14,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L178
  mov    $0x1,%ebp
L285:
  add    $0x1,%r12
  cmp    %r12,(%rsp)
  jne    L24
  test   %ebp,%ebp
  je     L196
  movl   $0xffffffff,0x8(%rsp)
  jmp    L201
L260:
  lea    0xb10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <fieldcpy@plt>
  jmp    L201
  nopl   (%rax)
L196:
  cmpb   $0x0,0xb10(%rsp)
  je     L275
  lea    0xb10(%rsp),%rdi
  call   <outputdeps@plt>
L275:
  movzbl 0xf00(%rsp),%eax
  test   %al,%al
  jne    L83
L293:
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    0x16d8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L203
  add    $0x16e8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L178:
  xor    %ebp,%ebp
  jmp    L201
  nopw   0x0(%rax,%rax,1)
L83:
  lea    0xf00(%rsp),%rdi
  call   <outputdeps@plt>
  jmp    L293
  nop
L245:
  lea    0xf00(%rsp),%rdi
  call   <outputdeps@plt>
  jmp    L49
  nopw   0x0(%rax,%rax,1)
L16:
  lea    0xb10(%rsp),%rdi
  call   <outputdeps@plt>
  jmp    L15
L17:
  mov    %rbp,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L112
L203:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D29
type_guessed: string
name: unpack_data
arguments: label: D8
type_guessed: string
name: unpack_data
arguments: label: D21
type_guessed: string
name: unpack_data
arguments: label: D12
type_guessed: string

tool: D29: r

tool: D8: Package:

tool: D21: Depends:

tool: D12: Pre-Depends:

assistant: ```c
void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) {
  char buf[1000];
  char cur_pkg[1000];
  char cur_deps[1000];
  char cur_predeps[1000];
  char prev_pkg[1000];
  char *pkgs[100];
  int i;
  int skip;
  FILE *f;
  int output_pkg = -1;
  cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0';
  for (i = 0; i < pkgc; i++)
    pkgs[i] = in_pkgs[i];
  f = fopen(pkgsfile, "r");
  if (f == NULL) {
    perror(pkgsfile);
    exit(1);
  }
  skip = 1;
  while (fgets(buf, sizeof(buf), f)) {
    if (*buf && buf[strlen(buf) - 1] == '\n')
      buf[strlen(buf) - 1] = '\0';
    if (strncasecmp(buf, "Package:", 8) == 0) {
      int any = 0;
      skip = 1;
      fieldcpy(cur_pkg, buf);
      if (strcmp(cur_pkg, prev_pkg) != 0) {
        if (output_pkg != -1)
          pkgs[output_pkg] = NULL;
        if (cur_deps[0])
          outputdeps(cur_deps);
        if (cur_predeps[0])
          outputdeps(cur_predeps);
        strcpy(prev_pkg, cur_pkg);
      }
      cur_deps[0] = cur_predeps[0] = '\0';
      output_pkg = -1;
      for (i = 0; i < pkgc; i++) {
        if (!pkgs[i])
          continue;
        any = 1;
        if (strcmp(cur_pkg, pkgs[i]) == 0) {
          skip = 0;
          output_pkg = i;
          break;
        }
      }
      if (!any)
        break;
    } else if (!skip && strncasecmp(buf, "Depends:", 8) == 0)
      fieldcpy(cur_deps, buf);
    else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0)
      fieldcpy(cur_predeps, buf);
  }
  if (cur_deps[0])
    outputdeps(cur_deps);
  if (cur_predeps[0])
    outputdeps(cur_predeps);
  fclose(f);
}
```