user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<revparseip>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  xor    %esi,%esi
  push   %r13
  push   %r12
  lea    D46(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,(%rsp)
  lea    0x20(%rsp),%rbp
  mov    %rdx,0x8(%rsp)
  mov    %rbp,%rdi
  mov    $0x1e,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  movsbl 0x3(%r14),%ecx
  movsbl (%r14),%esi
  xor    %eax,%eax
  movsbl 0x2(%r14),%edx
  lea    D1(%rip),%rdi
  call   <printf@plt>
  movsbl 0x3(%r14),%ecx
  movsbl (%r14),%esi
  xor    %eax,%eax
  movsbl 0x2(%r14),%edx
  lea    D26(%rip),%rdi
  call   <printf@plt>
  movsbl (%r14),%r9d
  test   %r9b,%r9b
  je     L32
  xor    %ebx,%ebx
  lea    D41(%rip),%r13
  jmp    L143
  nopl   0x0(%rax)
L35:
  test   $0x4,%dl
  jne    L45
  test   %edx,%edx
  je     L79
  movzbl (%rsi),%ecx
  mov    %cl,(%rax)
  test   $0x2,%dl
  jne    L57
L79:
  lea    (%r14,%rdx,1),%r15
  add    %r9d,%ebx
L58:
  lea    0x1(%r15),%r14
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  mov    %r14,%rsi
  call   <printf@plt>
  movsbl 0x1(%r15),%eax
  and    $0xc0,%eax
  cmp    $0xc0,%eax
  je     L139
L127:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsbl (%r14),%r9d
  test   %r9b,%r9b
  je     L32
L143:
  movslq %ebx,%rax
  movb   $0x2e,0x20(%rsp,%rax,1)
  test   %r9b,%r9b
  jle    L103
  movsbq %r9b,%rdx
  lea    0x1(%rbp,%rax,1),%rax
  lea    0x1(%r14),%rsi
  cmp    $0x8,%edx
  jb     L35
  mov    0x1(%r14),%rcx
  mov    %rcx,(%rax)
  mov    %edx,%ecx
  mov    -0x8(%rsi,%rcx,1),%rdi
  mov    %rdi,-0x8(%rax,%rcx,1)
  lea    0x8(%rax),%rdi
  and    $0xfffffffffffffff8,%rdi
  sub    %rdi,%rax
  sub    %rax,%rsi
  add    %edx,%eax
  shr    $0x3,%eax
  mov    %eax,%ecx
  rep movsq %ds:(%rsi),%es:(%rdi)
  jmp    L79
  nopl   0x0(%rax,%rax,1)
L139:
  lea    D9(%rip),%rdi
  call   <puts@plt>
  mov    %r14,%rsi
  lea    0x1e(%rsp),%rdi
  mov    $0x2,%edx
  call   <memcpy@plt>
  movswl 0x1e(%rsp),%edi
  call   <htons@plt>
  mov    (%rsp),%rcx
  xor    $0xc000,%ax
  mov    %ax,0x1e(%rsp)
  movswq %ax,%rax
  lea    (%rcx,%rax,1),%r14
  jmp    L127
  nopw   0x0(%rax,%rax,1)
L32:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    0x8(%rsp),%rdi
  mov    %rbp,%rsi
  mov    %eax,%edx
  call   <memcpy@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L103:
  mov    %r14,%r15
  jmp    L58
L45:
  mov    (%rsi),%ecx
  mov    %ecx,(%rax)
  mov    %edx,%ecx
  mov    -0x4(%rsi,%rcx,1),%esi
  mov    %esi,-0x4(%rax,%rcx,1)
  jmp    L79
L57:
  mov    %edx,%ecx
  movzwl -0x2(%rsi,%rcx,1),%esi
  mov    %si,-0x2(%rax,%rcx,1)
  jmp    L79
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D46
data_type: string
name: unpack_data
arguments: data_label: D1
data_type: string
name: unpack_data
arguments: data_label: D26
data_type: string
name: unpack_data
arguments: data_label: D41
data_type: string
name: unpack_data
arguments: data_label: D9
data_type: string

tool: D46: Str = %s


tool: D1: Reversep tmpptr = %x,%x,%x


tool: D26: Reversep ipptr = %x,%x,%x


tool: D41: Reversep tmpptr = %s


tool: D9: Pointer Found!

assistant: ```c
int revparseip(struct nserver *ns, char *ipstr, char *outip) {
  char tmp[30];
  char *tmpptr;
  int j, i = 0;
  short tmpsh;
  int lastcount;
  memset(tmp, 0x00, sizeof(tmp));
  tmpptr = ipstr;
  printf("Reversep tmpptr = %x,%x,%x\n", tmpptr[0], tmpptr[2], tmpptr[3]);
  printf("Reversep ipptr = %x,%x,%x\n", ipstr[0], ipstr[2], ipstr[3]);
  while (tmpptr[0] != 0x00) {
    lastcount = tmpptr[0];
    tmp[i] = '.';
    for (j = 0; j < lastcount; j++) {
      i++;
      tmpptr++;
      tmp[i] = tmpptr[0];
    }
    tmpptr++;
    i++;
    printf("Reversep tmpptr = %s\n", tmpptr);
    if ((tmpptr[0] & 0xc0) == 0xc0) {
      printf("Pointer Found!\n");
      memcpy((char *)&tmpsh, tmpptr, sizeof(tmpsh));
      tmpsh = (htons(tmpsh) ^ 0xc000);
      tmpptr = &((char *)ns)[tmpsh];
    }
    printf("Str = %s\n", tmp);
  }
  printf("Str = %s\n", tmp);
  memcpy(outip, tmp, strlen(tmp));
}
```