user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<res_search>:
  endbr64
  push   %r15
  mov    %r8d,%r9d
  mov    %rdi,%r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    D17(%rip),%rax
  mov    D47(%rip),%rdx
  mov    (%rax),%eax
  and    (%rdx),%eax
  je     L167
L3:
  mov    D298(%rip),%rax
  movq   $0x0,(%rax)
  mov    D240(%rip),%rax
  movl   $0x82,(%rax)
  movzbl (%r15),%edx
  test   %dl,%dl
  je     L271
  mov    %r15,%rax
  xor    %ebx,%ebx
  nopl   (%rax)
L369:
  cmp    $0x2e,%dl
  sete   %dl
  add    $0x1,%rax
  movzbl %dl,%edx
  add    %rdx,%rbx
  movzbl (%rax),%edx
  test   %dl,%dl
  jne    L369
  movl   $0x0,0x8(%rsp)
  cmp    %rax,%r15
  jae    L47
  cmpb   $0x2e,-0x1(%rax)
  sete   %al
  movzbl %al,%eax
  mov    %eax,0x8(%rsp)
L47:
  test   %rbx,%rbx
  je     L271
  mov    D17(%rip),%rax
  cmp    0x8(%rax),%rbx
  jge    L392
  cmpl   $0x1,0x8(%rsp)
  je     L74
  mov    %rax,%rcx
  mov    D245(%rip),%rax
  mov    (%rax),%eax
  and    (%rcx),%eax
  mov    %eax,0xc(%rsp)
  je     L6
  mov    0x10(%rcx),%rbp
  mov    0x0(%rbp),%rsi
  test   %rsi,%rsi
  je     L68
  movl   $0xffffffff,0x18(%rsp)
L360:
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0xc(%rsp)
  mov    %rbx,0x10(%rsp)
  mov    %r9d,%ebx
  nopl   0x0(%rax,%rax,1)
L341:
  mov    %ebx,%r9d
  mov    %r12,%r8
  mov    %r13d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rdi
  call   <res_querydomain@plt>
  test   %eax,%eax
  jg     L80
  mov    D65(%rip),%rax
  mov    D298(%rip),%rcx
  mov    (%rax),%rax
  cmp    %rax,(%rcx)
  je     L101
  mov    D240(%rip),%rax
  mov    (%rax),%eax
  cmp    $0x81,%eax
  je     L297
  cmp    $0x82,%eax
  je     L270
  cmp    $0x80,%eax
  je     L41
L78:
  mov    D17(%rip),%rax
  mov    %ebx,%r9d
  mov    0x10(%rsp),%rbx
  mov    (%rax),%eax
L261:
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  jne    L300
  test   %rbx,%rbx
  jne    L239
L169:
  mov    D5(%rip),%rdx
  and    (%rdx),%eax
  je     L239
L300:
  cmpl   $0xffffffff,0x18(%rsp)
  jne    L463
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jne    L216
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  je     L196
L101:
  mov    D240(%rip),%rax
  movl   $0x80,(%rax)
  add    $0x28,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L392:
  xor    %esi,%esi
  mov    %r12,%r8
  mov    %r13d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rdi
  mov    %r9d,0xc(%rsp)
  call   <res_querydomain@plt>
  mov    0xc(%rsp),%r9d
  test   %eax,%eax
  jle    L61
L80:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L167:
  mov    %r8d,0x8(%rsp)
  call   <res_init@plt>
  mov    0x8(%rsp),%r9d
  cmp    $0xffffffff,%eax
  jne    L3
  mov    D180(%rip),%rdx
  mov    (%rdx),%ecx
  mov    D240(%rip),%rdx
  mov    %ecx,(%rdx)
  jmp    L80
  nopl   0x0(%rax)
L271:
  mov    %r15,%rdi
  mov    %r9d,0x8(%rsp)
  call   <hostalias@plt>
  mov    0x8(%rsp),%r9d
  test   %rax,%rax
  jne    L428
  mov    D17(%rip),%rax
  cmpq   $0x0,0x8(%rax)
  jle    L204
  mov    (%rax),%eax
  mov    D300(%rip),%rdx
  mov    %eax,%edi
  and    (%rdx),%edi
  jne    L404
  mov    D5(%rip),%rdx
  movl   $0x0,0x1c(%rsp)
  movl   $0xffffffff,0x18(%rsp)
  and    (%rdx),%eax
  mov    %eax,0xc(%rsp)
  jne    L196
L239:
  xor    %esi,%esi
  mov    %r12,%r8
  mov    %r13d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rdi
  call   <res_querydomain@plt>
  test   %eax,%eax
  jle    L300
  jmp    L80
  nop
L404:
  mov    D17(%rip),%rdi
  movl   $0x0,0x8(%rsp)
  xor    %ebx,%ebx
  movl   $0xffffffff,0x18(%rsp)
  mov    0x10(%rdi),%rbp
  mov    0x0(%rbp),%rsi
  test   %rsi,%rsi
  jne    L360
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0xc(%rsp)
  jmp    L169
  nop
L297:
  addl   $0x1,0xc(%rsp)
L270:
  mov    D17(%rip),%rax
  mov    D245(%rip),%rdx
  mov    (%rax),%eax
  mov    %eax,%edi
  and    (%rdx),%edi
  je     L464
  mov    0x8(%rbp),%rsi
  add    $0x8,%rbp
  test   %rsi,%rsi
  jne    L341
  nopl   0x0(%rax)
L464:
  mov    %ebx,%r9d
  mov    0x10(%rsp),%rbx
  jmp    L261
  nopl   (%rax)
L41:
  mov    D23(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,(%r12)
  jne    L78
  addl   $0x1,0x1c(%rsp)
  jmp    L270
L204:
  xor    %esi,%esi
  mov    %r12,%r8
  mov    %r13d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rdi
  mov    %r9d,0x8(%rsp)
  call   <res_querydomain@plt>
  test   %eax,%eax
  jg     L80
  mov    D240(%rip),%rax
  mov    D300(%rip),%rdx
  mov    0x8(%rsp),%r9d
  mov    (%rax),%eax
  mov    %eax,0x18(%rsp)
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  and    (%rdx),%eax
  je     L170
  mov    D17(%rip),%rax
  movl   $0x1,0x8(%rsp)
  xor    %ebx,%ebx
  mov    0x10(%rax),%rbp
  mov    0x0(%rbp),%rsi
  test   %rsi,%rsi
  jne    L360
L170:
  cmpl   $0xffffffff,0x18(%rsp)
  jne    L463
L196:
  add    $0x28,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L428:
  add    $0x28,%rsp
  mov    %r12,%rcx
  mov    %r13d,%edx
  mov    %r14d,%esi
  pop    %rbx
  mov    %r9d,%r8d
  pop    %rbp
  mov    %rax,%rdi
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <res_query@plt>
  nopw   0x0(%rax,%rax,1)
L74:
  movl   $0xffffffff,0x18(%rsp)
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0xc(%rsp)
  jmp    L239
L6:
  movl   $0x0,0x1c(%rsp)
  movl   $0xffffffff,0x18(%rsp)
  jmp    L239
L68:
  mov    0x8(%rsp),%eax
  movl   $0xffffffff,0x18(%rsp)
  mov    %eax,0x1c(%rsp)
  mov    %eax,0xc(%rsp)
  jmp    L239
L463:
  mov    D240(%rip),%rax
  mov    0x18(%rsp),%edi
  mov    %edi,(%rax)
  mov    $0xffffffff,%eax
  jmp    L80
L216:
  mov    D240(%rip),%rax
  movl   $0x81,(%rax)
  mov    $0xffffffff,%eax
  jmp    L80
L61:
  mov    D240(%rip),%rax
  cmpl   $0x1,0x8(%rsp)
  mov    (%rax),%eax
  mov    %eax,0x18(%rsp)
  je     L170
  mov    D245(%rip),%rax
  mov    D17(%rip),%rcx
  mov    (%rax),%eax
  and    (%rcx),%eax
  je     L170
  mov    D17(%rip),%rax
  movl   $0x1,0x8(%rsp)
  mov    0x10(%rax),%rbp
  mov    0x0(%rbp),%rsi
  test   %rsi,%rsi
  jne    L360
  jmp    L170
```

assistant: ```c
int res_search(const char *name, int class, int type, u_char *answer, int anslen) {
  const char *cp, *const *domain;
  HEADER *hp = (HEADER *)answer;
  u_int dots;
  int trailing_dot, ret, saved_herrno;
  int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
  if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
    h_errno = NETDB_INTERNAL;
    return (-1);
  }
  errno = 0;
  h_errno = HOST_NOT_FOUND;
  dots = 0;
  for (cp = name; *cp; cp++)
    dots += (*cp == '.');
  trailing_dot = 0;
  if (cp > name && *--cp == '.')
    trailing_dot++;
  if (!dots && (cp = hostalias(name)) != NULL)
    return (res_query(cp, class, type, answer, anslen));
  saved_herrno = -1;
  if (dots >= _res.ndots) {
    ret = res_querydomain(name, NULL, class, type, answer, anslen);
    if (ret > 0)
      return (ret);
    saved_herrno = h_errno;
    tried_as_is++;
  }
  if ((!dots && (_res.options & RES_DEFNAMES)) || (dots && !trailing_dot && (_res.options & RES_DNSRCH))) {
    int done = 0;
    for (domain = (const char *const *)_res.dnsrch; *domain && !done; domain++) {
      ret = res_querydomain(name, *domain, class, type, answer, anslen);
      if (ret > 0)
        return (ret);
      if (errno == ECONNREFUSED) {
        h_errno = TRY_AGAIN;
        return (-1);
      }
      switch (h_errno) {
      case NO_DATA:
        got_nodata++;
      case HOST_NOT_FOUND:
        break;
      case TRY_AGAIN:
        if (hp->rcode == SERVFAIL) {
          got_servfail++;
          break;
        }
      default:
        done++;
      }
      if (!(_res.options & RES_DNSRCH))
        done++;
    }
  }
  if (!tried_as_is && (dots || !(_res.options & RES_NOTLDQUERY))) {
    ret = res_querydomain(name, NULL, class, type, answer, anslen);
    if (ret > 0)
      return (ret);
  }
  if (saved_herrno != -1)
    h_errno = saved_herrno;
  else if (got_nodata)
    h_errno = NO_DATA;
  else if (got_servfail)
    h_errno = TRY_AGAIN;
  return (-1);
}
```