user: 请将以下的汇编代码转换成C语言代码:

```asm
<build_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L462
  lea    D42(%rip),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L512
L526:
  cmpq   $0x0,-0x20(%rbp)
  je     L529
  cmpq   $0x0,-0x28(%rbp)
  je     L198
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L198
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L198:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x20(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L512
L529:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
L512:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L526
  mov    $0xc,%eax
  jmp    L515
L462:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L232
  mov    $0x0,%eax
  jmp    L515
L232:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L57
  movw   $0x0,-0xa(%rbp)
  jmp    L495
L98:
  cmpq   $0x0,-0x20(%rbp)
  je     L505
  cmpq   $0x0,-0x28(%rbp)
  je     L545
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L545
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L545:
  mov    -0x18(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x20(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L194
L505:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
L194:
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
L495:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L98
  movswl -0xa(%rbp),%eax
  jmp    L515
L57:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %ax,-0xe(%rbp)
  movw   $0x0,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L76
L553:
  movzwl -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xc(%rbp)
  addq   $0x1,-0x8(%rbp)
L76:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L553
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movw   $0x0,-0xa(%rbp)
  movzwl -0xe(%rbp),%eax
  cmp    -0xc(%rbp),%ax
  jle    L454
  cmpl   $0x2,-0x34(%rbp)
  jne    L540
  jmp    L163
L313:
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L231
  cmpq   $0x0,-0x28(%rbp)
  je     L127
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L127
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L127:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x20,(%rax)
  jmp    L336
L231:
  mov    $0x20,%edi
  call   <putchar@plt>
L336:
  movzwl -0xe(%rbp),%eax
  sub    $0x1,%eax
  mov    %ax,-0xe(%rbp)
L163:
  movzwl -0xe(%rbp),%eax
  cmp    -0xc(%rbp),%ax
  jg     L313
  jmp    L91
L32:
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L215
  cmpq   $0x0,-0x28(%rbp)
  je     L59
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L59
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L59:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x20(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L91
L215:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
L91:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L32
  jmp    L559
L378:
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L268
  cmpq   $0x0,-0x28(%rbp)
  je     L562
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L562
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L562:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x20(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L540
L268:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
L540:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L378
  jmp    L188
L73:
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L94
  cmpq   $0x0,-0x28(%rbp)
  je     L320
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L320
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L320:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x20,(%rax)
  jmp    L449
L94:
  mov    $0x20,%edi
  call   <putchar@plt>
L449:
  movzwl -0xe(%rbp),%eax
  sub    $0x1,%eax
  mov    %ax,-0xe(%rbp)
L188:
  movzwl -0xe(%rbp),%eax
  cmp    -0xc(%rbp),%ax
  jg     L73
  jmp    L559
L584:
  movzwl -0xa(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xa(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L470
  cmpq   $0x0,-0x28(%rbp)
  je     L195
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L195
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L515
L195:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x20(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L454
L470:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <putchar@plt>
L454:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L584
L559:
  movswl -0xa(%rbp),%eax
L515:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D42
type_guessed: string
name: parse_data
arguments: data_label: D62
type_guessed: string

tool: D42: NULL_POINTER

tool: D62: s_printf buffer overflow

assistant: ```c
int build_string(char *src, char *dest, char *bufend, char *hdr, int sign) {
  char *cp1;
  short minsize, i, j;
  if (!src) {
    cp1 = "NULL_POINTER";
    while (*cp1) {
      if (dest) {
        if (bufend && (dest >= bufend)) {
          puts("s_printf buffer overflow");
          return (-1);
        }
        *dest++ = *cp1++;
      } else {
        putchar(*cp1++);
      };
    }
    return (12);
  }
  if (!*src) {
    return (0);
  }
  if (!hdr[0]) {
    j = 0;
    while (*src) {
      if (dest) {
        if (bufend && (dest >= bufend)) {
          puts("s_printf buffer overflow");
          return (-1);
        }
        *dest++ = *src++;
      } else {
        putchar(*src++);
      };
      j++;
    }
    return (j);
  }
  minsize = (short)atoi(hdr);
  i = 0;
  cp1 = (char *)src;
  while (*cp1) {
    i++;
    cp1++;
  }
  cp1 = (char *)src;
  j = 0;
  if (minsize > i) {
    if (sign == 2) {
      while (minsize > i) {
        j++;
        if (dest) {
          if (bufend && (dest >= bufend)) {
            puts("s_printf buffer overflow");
            return (-1);
          }
          *dest++ = ' ';
        } else {
          if (' ')
            putchar(' ');
        };
        minsize--;
      }
      while (*cp1) {
        j++;
        if (dest) {
          if (bufend && (dest >= bufend)) {
            puts("s_printf buffer overflow");
            return (-1);
          }
          *dest++ = *cp1++;
        } else {
          putchar(*cp1++);
        };
      }
    } else {
      while (*cp1) {
        j++;
        if (dest) {
          if (bufend && (dest >= bufend)) {
            puts("s_printf buffer overflow");
            return (-1);
          }
          *dest++ = *cp1++;
        } else {
          putchar(*cp1++);
        };
      }
      while (minsize > i) {
        j++;
        if (dest) {
          if (bufend && (dest >= bufend)) {
            puts("s_printf buffer overflow");
            return (-1);
          }
          *dest++ = ' ';
        } else {
          if (' ')
            putchar(' ');
        };
        minsize--;
      }
    }
  } else {
    while (*cp1) {
      j++;
      if (dest) {
        if (bufend && (dest >= bufend)) {
          puts("s_printf buffer overflow");
          return (-1);
        }
        *dest++ = *cp1++;
      } else {
        putchar(*cp1++);
      };
    }
  }
  return (j);
}
```